aboutsummaryrefslogtreecommitdiff
path: root/target/linux/bcm27xx/patches-6.1/950-0459-overlays-i2c-sensor-Add-the-jc42-class-of-sensor.patch
blob: 543b1e165488571732e416b0ab221741feae360a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 2ed7fb7bf15420d80c3b272a3a887e142046b7b2 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 7 Nov 2022 15:31:43 +0000
Subject: [PATCH] overlays: i2c-sensor: Add the jc42 class of sensor

This is a second attempt to solve issue 5234, since it turns out that
the mcp980x driver only supports MCP9800-MCP9803. MCP9804, MCP9805 and
MCP9808 require the jc42 driver.

See: https://github.com/raspberrypi/linux/issues/5234

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 arch/arm/boot/dts/overlays/README              | 13 ++++++++++++-
 .../boot/dts/overlays/i2c-sensor-common.dtsi   | 18 +++++++++++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1970,6 +1970,15 @@ Params: addr                    Set the
         int_pin                 Set the GPIO to use for interrupts (max30102
                                 only)
 
+        jc42                    Select any of the many JEDEC JC42.4-compliant
+                                temperature sensors, including:
+                                  ADT7408, AT30TS00, CAT34TS02, CAT6095,
+                                  MAX6604, MCP9804, MCP9805, MCP9808,
+                                  MCP98242, MCP98243, MCP98244, MCP9843,
+                                  SE97, SE98, STTS424(E), STTS2002, STTS3000,
+                                  TSE2002, TSE2004, TS3000, and TS3001.
+                                The default address is 0x18.
+
         lm75                    Select the Maxim LM75 temperature sensor
                                 Valid addresses 0x48-0x4f, default 0x4f
 
@@ -1982,7 +1991,9 @@ Params: addr                    Set the
                                 and blood-oxygen sensor
 
         mcp980x                 Select the Maxim MCP980x range of temperature
-                                sensors (e.g. MCP9808).
+                                sensors (i.e. MCP9800, MCP9801, MCP9802 and
+                                MCP9803). N.B. For MCP9804, MCP9805 and MCP9808,
+                                use the "jc42" option.
                                 Valid addresses are 0x18-0x1f (default 0x18)
 
         sht3x                   Select the Sensiron SHT3x temperature and
--- a/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
+++ b/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
@@ -337,6 +337,21 @@
 		};
 	};
 
+	fragment@22 {
+		target = <&i2cbus>;
+		__dormant__ {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "okay";
+
+			jc42: jc42@18 {
+				compatible = "jedec,jc-42.4-temp";
+				reg = <0x18>;
+				smbus-timeout-disable;
+			};
+		};
+	};
+
 	__overrides__ {
 		bme280 = <0>,"+0";
 		bmp085 = <0>,"+1";
@@ -361,11 +376,12 @@
 		max30102 = <0>,"+19";
 		aht10 = <0>,"+20";
 		mcp980x = <0>,"+21";
+		jc42 = <0>,"+22";
 
 		addr =  <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
 			<&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0",
 			<&ds1621>,"reg:0", <&bme680>,"reg:0", <&ccs811>,"reg:0",
-			<&bh1750>,"reg:0", <&mcp980x>,"reg:0";
+			<&bh1750>,"reg:0", <&mcp980x>,"reg:0", <&jc42>,"reg:0";
 		int_pin = <&max30102>, "interrupts:0";
 	};
 };