Skip to content

Commit 9a70549

Browse files
authored
hwmon-lm75: backport support for PCT2075 thermal sensor (#165)
New platform HW may use the NXP-PCT2075 thermal sensor which is compatible with the lm75 sensor. These patches backport support for that sensor from 5.x kernels. upstream kernel commit id: 557c7ffa2f28 hwmon: (lm75) add support for PCT2075 (5.4-rc1) 985e225142cf dt-bindings: hwmon: Add missing documentation for lm75 (5.1-rc1) be889be7785d dt-bindings: hwmon: Add tmp75b to lm75.txt (5.2-rc1) 5ac6badc5aa0 device-tree: bindinds: add NXP PCT2075 as compatible device to LM75 (5.4-rc1) all the commits can be remove once upgrade to 5.10
1 parent dcf469b commit 9a70549

5 files changed

Lines changed: 243 additions & 2 deletions
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
From 90b3a0b833131831bf259e3506aaf9f29317aae9 Mon Sep 17 00:00:00 2001
2+
From: Daniel Mack <daniel@zonque.org>
3+
Date: Thu, 11 Jul 2019 14:45:04 +0200
4+
Subject: [PATCH 1/6] hwmon: (lm75) add support for PCT2075
5+
6+
The NXP PCT2075 is largely compatible with other chips already supported
7+
by the LM75 driver. It uses an 11-bit resolution and defaults to 100 ms
8+
sampling period. The datasheet is here:
9+
10+
https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
11+
12+
Signed-off-by: Daniel Mack <daniel@zonque.org>
13+
Link: https://lore.kernel.org/r/20190711124504.7580-2-daniel@zonque.org
14+
[groeck: Documentation update]
15+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
16+
---
17+
Documentation/hwmon/lm75 | 35 +++++++++++++++++++++++++----------
18+
drivers/hwmon/lm75.c | 10 ++++++++++
19+
2 files changed, 35 insertions(+), 10 deletions(-)
20+
21+
diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75
22+
index ac95edfcd907..ef7c2afa604e 100644
23+
--- a/Documentation/hwmon/lm75
24+
+++ b/Documentation/hwmon/lm75
25+
@@ -46,20 +46,35 @@ Supported chips:
26+
Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp112', 'tmp175', 'tmp75', 'tmp75c', 'tmp275'
27+
Addresses scanned: none
28+
Datasheet: Publicly available at the Texas Instruments website
29+
- http://www.ti.com/product/tmp100
30+
- http://www.ti.com/product/tmp101
31+
- http://www.ti.com/product/tmp105
32+
- http://www.ti.com/product/tmp112
33+
- http://www.ti.com/product/tmp75
34+
- http://www.ti.com/product/tmp75c
35+
- http://www.ti.com/product/tmp175
36+
- http://www.ti.com/product/tmp275
37+
- * NXP LM75B
38+
- Prefix: 'lm75b'
39+
+
40+
+ http://www.ti.com/product/tmp100
41+
+
42+
+ http://www.ti.com/product/tmp101
43+
+
44+
+ http://www.ti.com/product/tmp105
45+
+
46+
+ http://www.ti.com/product/tmp112
47+
+
48+
+ http://www.ti.com/product/tmp75
49+
+
50+
+ http://www.ti.com/product/tmp75b
51+
+
52+
+ http://www.ti.com/product/tmp75c
53+
+
54+
+ http://www.ti.com/product/tmp175
55+
+
56+
+ http://www.ti.com/product/tmp275
57+
+
58+
+ * NXP LM75B, PCT2075
59+
+
60+
+ Prefix: 'lm75b', 'pct2075'
61+
+
62+
Addresses scanned: none
63+
Datasheet: Publicly available at the NXP website
64+
http://www.nxp.com/documents/data_sheet/LM75B.pdf
65+
66+
+ http://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
67+
+
68+
Author: Frodo Looijaard <frodol@dds.nl>
69+
70+
Description
71+
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
72+
index 7f28912c9abc..9a04af3d7449 100644
73+
--- a/drivers/hwmon/lm75.c
74+
+++ b/drivers/hwmon/lm75.c
75+
@@ -48,6 +48,7 @@ enum lm75_type { /* keep sorted in alphabetical order */
76+
max6625,
77+
max6626,
78+
mcp980x,
79+
+ pct2075,
80+
stds75,
81+
tcn75,
82+
tmp100,
83+
@@ -343,6 +344,10 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
84+
data->resolution = 9;
85+
data->sample_time = MSEC_PER_SEC / 8;
86+
break;
87+
+ case pct2075:
88+
+ data->resolution = 11;
89+
+ data->sample_time = MSEC_PER_SEC / 10;
90+
+ break;
91+
case mcp980x:
92+
data->resolution_limits = 9;
93+
/* fall through */
94+
@@ -416,6 +421,7 @@ static const struct i2c_device_id lm75_ids[] = {
95+
{ "max6625", max6625, },
96+
{ "max6626", max6626, },
97+
{ "mcp980x", mcp980x, },
98+
+ { "pct2075", pct2075, },
99+
{ "stds75", stds75, },
100+
{ "tcn75", tcn75, },
101+
{ "tmp100", tmp100, },
102+
@@ -475,6 +481,10 @@ static const struct of_device_id lm75_of_match[] = {
103+
.compatible = "maxim,mcp980x",
104+
.data = (void *)mcp980x
105+
},
106+
+ {
107+
+ .compatible = "nxp,pct2075",
108+
+ .data = (void *)pct2075
109+
+ },
110+
{
111+
.compatible = "st,stds75",
112+
.data = (void *)stds75
113+
--
114+
2.17.1
115+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From c3eab8b7b730548ade06b71fad6b1d12fd53f28a Mon Sep 17 00:00:00 2001
2+
From: Jagan Teki <jagan@amarulasolutions.com>
3+
Date: Tue, 12 Feb 2019 17:08:08 +0530
4+
Subject: [PATCH 4/6] dt-bindings: hwmon: Add missing documentation for lm75
5+
6+
Add missing dt-binding documentation for lm75 hwmon sensor.
7+
8+
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
9+
Acked-by: Rob Herring <robh@kernel.org>
10+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11+
---
12+
.../devicetree/bindings/hwmon/lm75.txt | 37 +++++++++++++++++++
13+
1 file changed, 37 insertions(+)
14+
create mode 100644 Documentation/devicetree/bindings/hwmon/lm75.txt
15+
16+
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
17+
new file mode 100644
18+
index 000000000000..12d8cf7cf592
19+
--- /dev/null
20+
+++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
21+
@@ -0,0 +1,37 @@
22+
+*LM75 hwmon sensor.
23+
+
24+
+Required properties:
25+
+- compatible: manufacturer and chip name, one of
26+
+ "adi,adt75",
27+
+ "dallas,ds1775",
28+
+ "dallas,ds75",
29+
+ "dallas,ds7505",
30+
+ "gmt,g751",
31+
+ "national,lm75",
32+
+ "national,lm75a",
33+
+ "national,lm75b",
34+
+ "maxim,max6625",
35+
+ "maxim,max6626",
36+
+ "maxim,max31725",
37+
+ "maxim,max31726",
38+
+ "maxim,mcp980x",
39+
+ "st,stds75",
40+
+ "st,stlm75",
41+
+ "microchip,tcn75",
42+
+ "ti,tmp100",
43+
+ "ti,tmp101",
44+
+ "ti,tmp105",
45+
+ "ti,tmp112",
46+
+ "ti,tmp175",
47+
+ "ti,tmp275",
48+
+ "ti,tmp75",
49+
+ "ti,tmp75c",
50+
+
51+
+- reg: I2C bus address of the device
52+
+
53+
+Example:
54+
+
55+
+sensor@48 {
56+
+ compatible = "st,stlm75";
57+
+ reg = <0x48>;
58+
+};
59+
--
60+
2.17.1
61+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From de27b34d7fc91ed109c78ed89442f42427ac0c5c Mon Sep 17 00:00:00 2001
2+
From: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
3+
Date: Fri, 3 May 2019 17:15:01 +0100
4+
Subject: [PATCH 5/6] dt-bindings: hwmon: Add tmp75b to lm75.txt
5+
6+
Update the LM75's devicetree definition to allow Texas Instruments
7+
TMP75B be probed.
8+
9+
Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
10+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11+
---
12+
Documentation/devicetree/bindings/hwmon/lm75.txt | 1 +
13+
1 file changed, 1 insertion(+)
14+
15+
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
16+
index 12d8cf7cf592..586b5ed70be7 100644
17+
--- a/Documentation/devicetree/bindings/hwmon/lm75.txt
18+
+++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
19+
@@ -25,6 +25,7 @@ Required properties:
20+
"ti,tmp175",
21+
"ti,tmp275",
22+
"ti,tmp75",
23+
+ "ti,tmp75b",
24+
"ti,tmp75c",
25+
26+
- reg: I2C bus address of the device
27+
--
28+
2.17.1
29+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 248bae1d862533e1e1b6a1a0ba32f8b73bbfe57e Mon Sep 17 00:00:00 2001
2+
From: Daniel Mack <daniel@zonque.org>
3+
Date: Thu, 11 Jul 2019 14:45:03 +0200
4+
Subject: [PATCH 6/6] device-tree: bindinds: add NXP PCT2075 as compatible
5+
device to LM75
6+
7+
The PCT2075 is compatible to other chips that are already handled by
8+
the LM75 driver.
9+
10+
Signed-off-by: Daniel Mack <daniel@zonque.org>
11+
Link: https://lore.kernel.org/r/20190711124504.7580-1-daniel@zonque.org
12+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13+
---
14+
Documentation/devicetree/bindings/hwmon/lm75.txt | 1 +
15+
1 file changed, 1 insertion(+)
16+
17+
diff --git a/Documentation/devicetree/bindings/hwmon/lm75.txt b/Documentation/devicetree/bindings/hwmon/lm75.txt
18+
index 586b5ed70be7..273616702c51 100644
19+
--- a/Documentation/devicetree/bindings/hwmon/lm75.txt
20+
+++ b/Documentation/devicetree/bindings/hwmon/lm75.txt
21+
@@ -15,6 +15,7 @@ Required properties:
22+
"maxim,max31725",
23+
"maxim,max31726",
24+
"maxim,mcp980x",
25+
+ "nxp,pct2075",
26+
"st,stds75",
27+
"st,stlm75",
28+
"microchip,tcn75",
29+
--
30+
2.17.1
31+

patch/series

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This series applies on GIT commit 18c5597832fcf6988111b05a9a1607ae148723c
2-
# (marvel)
2+
# (Marvell)
33
# 0001-armhf-default-config-for-the-sonic-patches.patch
44
# 0001-arm64-default-config-for-sonic-patches.patch
55

@@ -32,7 +32,12 @@ driver-support-optoe-chunk-offset-fix.patch
3232
driver-support-optoe-QSFP_DD.patch
3333
driver-net-tg3-add-param-short-preamble-and-reset.patch
3434
e1000-Do-not-perform-reset-in-reset_task-if-we-are-a.patch
35-
# (Marvel)
35+
0001-hwmon-lm75-add-support-for-PCT2075.patch
36+
0004-dt-bindings-hwmon-Add-missing-documentation-for-lm75.patch
37+
0005-dt-bindings-hwmon-Add-tmp75b-to-lm75.txt.patch
38+
0006-device-tree-bindinds-add-NXP-PCT2075-as-compatible-d.patch
39+
#
40+
# (Marvell)
3641
# 0042-Marvell-a385-Micron-4G-flash-support.patch
3742
# 0042-armhf-additional-configs.patch
3843
# 0042-armhf-proc-dma-kconfig.patch

0 commit comments

Comments
 (0)