1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-13 11:51:54 +00:00
openmptcprouter/6.1/target/linux/bcm27xx/patches-6.1/0474-overlays-i2c-sensor-Add-the-jc42-class-of-sensor.patch

91 lines
3.6 KiB
Diff

From d74bac6d7d54bab21b1f434a4697285dd5cfe058 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 7 Nov 2022 15:31:43 +0000
Subject: [PATCH 474/726] 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(-)
diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README
index 87f6f8f0f7b0..a4fe2bb80e1b 100644
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1970,6 +1970,15 @@ Params: addr Set the address for the BH1750, BME280, BME680,
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 address for the BH1750, BME280, BME680,
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
diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi b/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
index 77babe855da9..baac806e93bf 100755
--- a/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
+++ b/arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
@@ -337,6 +337,21 @@ mcp980x: mcp980x@18 {
};
};
+ 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 @@ __overrides__ {
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";
};
};
--
2.33.1