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

Sudeep Holla
2020-11-19T11:42:48Z

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@arm.com>
> ---
> 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 ?

--
Regards,
Sudeep