linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCPI (pre-v1.0): fix reading sensor value
@ 2016-11-24  0:18 Martin Blumenstingl
  2016-11-24  0:18 ` [PATCH] firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI firmwares Martin Blumenstingl
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Martin Blumenstingl @ 2016-11-24  0:18 UTC (permalink / raw)
  To: linus-amlogic

I observed the following "strange" value when trying to read the SCPI
temperature sensor on my Amlogic GXM S912 device:
$ cat /sys/class/hwmon/hwmon0/temp1_input
6875990994467160116

The value reported by the original kernel (Amlogic vendor kernel, after
a reboot obviously) was 53C.
The Amlogic SCPI driver only uses a single 32bit value to read the
sensor value, instead of two. After stripping the upper 32bits from
above value gives "52" as result, which is basically identical to
what the vendor kernel reports.
I also compared this with the value shown by u-boot (since there's
less delay between "reboot to u-boot" compared to "reboot from mainline
kernel to vendor kernel") and the temperature reported by u-boot always
matches the lower 32bits of the value from scpi-hwmon temp1_input.

This patch introduces a separate function for reading the sensor value
on pre-v1.0 SCPI firmwares. I also tried initializing the "buf"
variable in scpi_sensor_get_value() but this didn't work (because we
request a 64bit payload from the SCPI firmware, but the firmware only
replies with a 32bit payload).

Martin Blumenstingl (1):
  firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI
    firmwares

 drivers/firmware/arm_scpi.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.10.2

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-12-13 14:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24  0:18 [PATCH] SCPI (pre-v1.0): fix reading sensor value Martin Blumenstingl
2016-11-24  0:18 ` [PATCH] firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI firmwares Martin Blumenstingl
2016-12-07 18:44   ` Sudeep Holla
2016-12-11 21:16     ` Martin Blumenstingl
2016-11-24 10:47 ` [PATCH] SCPI (pre-v1.0): fix reading sensor value Sudeep Holla
2016-11-24 11:15   ` Martin Blumenstingl
2016-11-25  0:56     ` Martin Blumenstingl
2016-12-02 22:54       ` Martin Blumenstingl
2016-12-06 11:38         ` Sudeep Holla
2016-11-25  0:54 ` [PATCH v2 0/2] " Martin Blumenstingl
2016-11-25  0:54   ` [PATCH v2 1/2] firmware: arm_scpi: zero RX buffer before requesting data from the mbox Martin Blumenstingl
2016-12-07 18:17     ` Sudeep Holla
2016-12-09 20:23       ` Martin Blumenstingl
2016-12-09 10:16     ` Jon Medhurst (Tixy)
2016-11-25  0:54   ` [PATCH v2 2/2] firmware: arm_scpi: check the payload length in scpi_send_message Martin Blumenstingl
2016-12-09  9:57     ` Jon Medhurst (Tixy)
2016-12-11 21:14   ` [PATCH v3] SCPI (pre-v1.0): fix reading sensor value Martin Blumenstingl
2016-12-11 21:14     ` [PATCH v3] firmware: arm_scpi: fix reading sensor values on pre-1.0 SCPI firmwares Martin Blumenstingl
2016-12-13 14:09       ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).