diff options
author | Dong Aisheng <aisheng.dong@nxp.com> | 2017-09-13 22:23:21 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2017-09-15 16:08:49 +0800 |
commit | 495204bd6fa75e611b57ece8b4838d2364f691f2 (patch) | |
tree | ad3725adf10605bb5e016928bc0a82f29d7bad6f /drivers/thermal | |
parent | f2ed3bfca174b3e370fc37cd5f75a67334822093 (diff) |
MLK-16470 thermal: imx_thermal: fix wrong thermal grade register read for MX7D
From MX7D Fuse Map v2.9, the thermal grade register is 0x440[7:6],
not 0x480[7:6] as before.
Fixes: 2045abb4391a ("MLK-11518-01 thermal: imx: add thermal support for imx7")
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit add734018577b490840e1d19c2640bcad0e4bda9)
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/imx_thermal.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 4b6ba999e983..586b3f16023e 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -84,7 +84,7 @@ #define IMX6_OCOTP_ANA1 0x04e0 #define IMX7_OCOTP_ANA1 0x04f0 - +#define IMX7_OCOTP_TESTER3 0x0440 /* The driver supports 1 passive trip point and 1 critical trip point */ enum imx_thermal_trip { @@ -625,7 +625,11 @@ static int imx_get_sensor_data(struct platform_device *pdev) imx6_calibrate_data(data, val); /* use OTP for thermal grade */ - ret = regmap_read(map, OCOTP_MEM0, &val); + if (data->socdata->version == TEMPMON_IMX7) + ret = regmap_read(map, IMX7_OCOTP_TESTER3, &val); + else + ret = regmap_read(map, OCOTP_MEM0, &val); + if (ret) { dev_err(&pdev->dev, "failed to read temp grade: %d\n", ret); return ret; |