firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI firmwares
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 11 Dec 2016 21:14:32 +0000 (22:14 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Fri, 30 Dec 2016 14:53:36 +0000 (14:53 +0000)
commita766347b15c01507db9bf01f9b7021be5a776691
tree25e72d837ba668ff633d855af5e2e944ac548c7a
parent7ce7d89f48834cefece7804d38fc5d85382edf77
firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI firmwares

The pre-1.0 SCPI firmwares are using single __le32 as sensor value,
while the SCPI v1.0 protocol uses two __le32 as sensor values(64bit)
split into 32bit upper and 32bit lower value.

Using an "struct sensor_value" to read the sensor value on a pre-1.0
SCPI firmware gives garbage in the "hi_val" field.

This patch fixes the issue by reading only the lower 32-bit value for
all pre-1.0 SCPI versions.

Suggested-by: Sudeep Holla <Sudeep.Holla@arm.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
[sudeep.holla@arm.com: updated the commit log to reflect the implementation]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scpi.c