Re: [PATCH v3 4/6] firmware: arm_scmi: add SCMIv3.0 Sensors timestamped reads

From: Cristian Marussi
Date: Thu Nov 19 2020 - 07:24:27 EST


On Thu, Nov 19, 2020 at 11:42:16AM +0000, Sudeep Holla wrote:
> On Wed, Nov 18, 2020 at 04:29:03PM +0000, Cristian Marussi wrote:
> > Add new .reading_get_timestamped() method to sensor_ops to support SCMIv3.0
> > timestamped reads.
> >
> > Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
> > ---
> > V2 --> v3
> > - setting rx_size to 0 in sensor_reading_get to allow fw to send
> > both v2 and v3 replies...even if sensor_reading_get() only handles
> > v2 spec and returns one single value
> > - using get_unaligned_le64 in lieu of le64_to_cpu
> > - removed refs to v2.1
> > ---
> > drivers/firmware/arm_scmi/sensors.c | 137 ++++++++++++++++++++++++++--
> > include/linux/scmi_protocol.h | 22 +++++
> > 2 files changed, 152 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
> > index 1c83aaae0012..0adc545116a4 100644
> > --- a/drivers/firmware/arm_scmi/sensors.c
> > +++ b/drivers/firmware/arm_scmi/sensors.c
> > @@ -156,6 +156,27 @@ struct scmi_msg_sensor_reading_get {
> > #define SENSOR_READ_ASYNC BIT(0)
> > };
> >
> > +struct scmi_resp_sensor_reading_get {
> > + __le64 readings;
>
> Generally I have avoided such single element structures so far. Any
> particular reasons for having it ?
>
Just because there are a few of them so I found it easy and preferable
to have some typing to distinguish them, but I can drop it.

Cristian

> --
> Regards,
> Sudeep