lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 422/639] firmware: arm_scmi: fix bitfield definitions for SENSOR_DESC attributes
    Date
    From: Sudeep Holla <sudeep.holla@arm.com>

    [ Upstream commit 430daaf96ad133be5ce7c3a5c60e94247f7c6f71 ]

    As per the SCMI specification the bitfields for SENSOR_DESC attributes
    are as follows:
    attributes_low [7:0] Number of trip points supported
    attributes_high [15:11] The power-of-10 multiplier in 2's-complement
    format that is applied to the sensor units

    Looks like the code developed during the draft versions of the
    specification slipped through and are wrong with respect to final
    released version. Fix them by adjusting the bitfields appropriately.

    Fixes: 5179c523c1ea ("firmware: arm_scmi: add initial support for sensor protocol")
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/firmware/arm_scmi/sensors.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
    index b53d5cc9c9f6c..c00287b5f2c23 100644
    --- a/drivers/firmware/arm_scmi/sensors.c
    +++ b/drivers/firmware/arm_scmi/sensors.c
    @@ -30,10 +30,10 @@ struct scmi_msg_resp_sensor_description {
    __le32 id;
    __le32 attributes_low;
    #define SUPPORTS_ASYNC_READ(x) ((x) & BIT(31))
    -#define NUM_TRIP_POINTS(x) (((x) >> 4) & 0xff)
    +#define NUM_TRIP_POINTS(x) ((x) & 0xff)
    __le32 attributes_high;
    #define SENSOR_TYPE(x) ((x) & 0xff)
    -#define SENSOR_SCALE(x) (((x) >> 11) & 0x3f)
    +#define SENSOR_SCALE(x) (((x) >> 11) & 0x1f)
    #define SENSOR_UPDATE_SCALE(x) (((x) >> 22) & 0x1f)
    #define SENSOR_UPDATE_BASE(x) (((x) >> 27) & 0x1f)
    u8 name[SCMI_MAX_STR_SIZE];
    --
    2.20.1


    \
     
     \ /
      Last update: 2020-01-24 12:40    [W:4.017 / U:23.712 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site