CIP-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support
@ 2026-07-17 13:12 Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 01/23] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
                   ` (23 more replies)
  0 siblings, 24 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

Dear All,

This series adds p3t1085 and p3t1755 i3c sensors support into linux-6.1.y-cip
kernel.

Kind Regards,
Tommaso

Abdel Alkuor (3):
  dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  hwmon: (lm75) Add AMS AS6200 temperature sensor
  hwmon: (lm75) Fix tmp112 default config

Andrew Davis (1):
  hwmon: (lm75) Remove use of i2c_match_id()

Frank Li (4):
  dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
  hwmon: (tmp108) Add NXP p3t1085 support
  hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare
    I3C support
  hwmon: (tmp108) Add support for I3C device

Guenter Roeck (1):
  hwmon: (lm75) Hide register size differences in regmap access
    functions

Jarkko Nikula (2):
  hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module
  hwmon: (lm75) Fix I3C transfer buffer pointer for incoming data

Krzysztof Kozlowski (1):
  hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning

Luca Ceresoli (1):
  hwmon: (lm75) remove now-unused include

Stanislav Jakubek (2):
  dt-bindings: hwmon: ti,tmp108: document V+ supply, add short
    description
  hwmon: (tmp108) Add basic regulator support

Théo Lebrun (1):
  dt-bindings: hwmon: lm75: use common hwmon schema

Wolfram Sang (7):
  dt-bindings: hwmon: lm75: Add NXP P3T1755
  hwmon: (lm75) Add NXP P3T1755 support
  hwmon: (lm75) simplify lm75_write_config()
  hwmon: (lm75) simplify regulator handling
  hwmon: (lm75) Remove superfluous 'client' member from private struct
  hwmon: (lm75) separate probe into common and I2C parts
  hwmon: (lm75) add I3C support for P3T1755

 .../devicetree/bindings/hwmon/lm75.yaml       |  37 +-
 .../devicetree/bindings/hwmon/ti,tmp108.yaml  |  18 +-
 Documentation/hwmon/lm75.rst                  |  16 +-
 Documentation/hwmon/tmp108.rst                |   8 +
 drivers/hwmon/Kconfig                         |   5 +-
 drivers/hwmon/lm75.c                          | 399 +++++++++++++-----
 drivers/hwmon/tmp108.c                        |  73 +++-
 7 files changed, 419 insertions(+), 137 deletions(-)

-- 
2.54.0



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

* [PATCH 6.1.y-cip 01/23] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Stanislav Jakubek <stano.jakubek@gmail.com>

commit 699383466851e3fb8284e1eefeed78ec30989b3b upstream.

TMP108 is powered by its V+ supply, document it. The property is called
"vcc-supply" since the plus sign (+) is not an expected character.
While at it, add a short description with a link to its datasheets.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/ZnBmDXfnDQXNXz3k@standask-GA-A55M-S2HP
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 .../devicetree/bindings/hwmon/ti,tmp108.yaml         | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
index dcbc6fbc3b48..5bbb7aedda3a 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
@@ -9,6 +9,14 @@ title: TMP108 temperature sensor
 maintainers:
   - Krzysztof Kozlowski <krzk@kernel.org>
 
+description: |
+  The TMP108 is a digital-output temperature sensor with a
+  dynamically-programmable limit window, and under- and overtemperature
+  alert functions.
+
+  Datasheets:
+    https://www.ti.com/product/TMP108
+
 properties:
   compatible:
     enum:
@@ -24,6 +32,9 @@ properties:
   "#thermal-sensor-cells":
     const: 0
 
+  vcc-supply:
+    description: phandle to the regulator that provides the V+ supply
+
 required:
   - compatible
   - reg
@@ -45,6 +56,7 @@ examples:
             interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
             pinctrl-names = "default";
             pinctrl-0 = <&tmp_alrt>;
+            vcc-supply = <&supply>;
             #thermal-sensor-cells = <0>;
         };
     };
-- 
2.54.0



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

* [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 01/23] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-20 20:15   ` Pavel Machek
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 03/23] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
                   ` (21 subsequent siblings)
  23 siblings, 1 reply; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Frank Li <Frank.Li@nxp.com>

commit 4585580781d69d8627e15f027873e46282ea3787 upstream.

The register layout of P3T1085 is the same as ti,tmp108. Add compatible
string nxp,p3t1085 for it. The difference of P3T1085 is support I3C.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241111-p3t1085-v3-1-bff511550aad@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
index 5bbb7aedda3a..1f8af3a0048b 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
@@ -4,22 +4,26 @@
 $id: http://devicetree.org/schemas/hwmon/ti,tmp108.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: TMP108 temperature sensor
+title: TMP108/P3T1085(NXP) temperature sensor
 
 maintainers:
   - Krzysztof Kozlowski <krzk@kernel.org>
 
 description: |
-  The TMP108 is a digital-output temperature sensor with a
+  The TMP108/P3T1085(NXP) is a digital-output temperature sensor with a
   dynamically-programmable limit window, and under- and overtemperature
   alert functions.
 
+  P3T1085(NXP) support I3C.
+
   Datasheets:
     https://www.ti.com/product/TMP108
+    https://www.nxp.com/docs/en/data-sheet/P3T1085UK.pdf
 
 properties:
   compatible:
     enum:
+      - nxp,p3t1085
       - ti,tmp108
 
   interrupts:
-- 
2.54.0



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

* [PATCH 6.1.y-cip 03/23] hwmon: (tmp108) Add NXP p3t1085 support
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 01/23] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 04/23] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Frank Li <Frank.Li@nxp.com>

commit 11d35624d7696a64724160199fc94587010d7cb2 upstream.

Add compatible string 'nxp,p3t1085' since p3t1085's register layout is the
same as tmp108.

The p3t1085 supports I3C interface.

Update document tmp108.rst and Kconfig's help context.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241111-p3t1085-v3-2-bff511550aad@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/hwmon/tmp108.rst | 8 ++++++++
 drivers/hwmon/Kconfig          | 2 +-
 drivers/hwmon/tmp108.c         | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/hwmon/tmp108.rst b/Documentation/hwmon/tmp108.rst
index 6df7cf1b42f4..bc4941d98268 100644
--- a/Documentation/hwmon/tmp108.rst
+++ b/Documentation/hwmon/tmp108.rst
@@ -3,6 +3,14 @@ Kernel driver tmp108
 
 Supported chips:
 
+  * NXP P3T1085
+
+    Prefix: 'p3t1085'
+
+    Addresses scanned: none
+
+    Datasheet: https://www.nxp.com/docs/en/data-sheet/P3T1085UK.pdf
+
   * Texas Instruments TMP108
 
     Prefix: 'tmp108'
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 7884fcb95c3e..df7a0d3b59ce 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -2063,7 +2063,7 @@ config SENSORS_TMP108
 	select REGMAP_I2C
 	help
 	  If you say yes here you get support for Texas Instruments TMP108
-	  sensor chips.
+	  sensor chips and NXP P3T1085.
 
 	  This driver can also be built as a module. If so, the module
 	  will be called tmp108.
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index acb4ba750b09..a8d9a4e00eb0 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -420,6 +420,7 @@ MODULE_DEVICE_TABLE(i2c, tmp108_i2c_ids);
 
 #ifdef CONFIG_OF
 static const struct of_device_id tmp108_of_ids[] = {
+	{ .compatible = "nxp,p3t1085", },
 	{ .compatible = "ti,tmp108", },
 	{}
 };
-- 
2.54.0



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

* [PATCH 6.1.y-cip 04/23] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (2 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 03/23] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 05/23] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Frank Li <Frank.Li@nxp.com>

commit 700f3250198d51093884254220a96777a922dd47 upstream.

Add help function tmp108_common_probe() to pave road to support i3c for
P3T1085(NXP) chip.

Use dev_err_probe() to simplify the code.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241112-p3t1085-v4-1-a1334314b1e6@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/tmp108.c | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index a8d9a4e00eb0..63c2eaa59d21 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -323,33 +323,19 @@ static const struct regmap_config tmp108_regmap_config = {
 	.use_single_write = true,
 };
 
-static int tmp108_probe(struct i2c_client *client)
+static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *name)
 {
-	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct tmp108 *tmp108;
-	int err;
 	u32 config;
-
-	if (!i2c_check_functionality(client->adapter,
-				     I2C_FUNC_SMBUS_WORD_DATA)) {
-		dev_err(dev,
-			"adapter doesn't support SMBus word transactions\n");
-		return -ENODEV;
-	}
+	int err;
 
 	tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
 	if (!tmp108)
 		return -ENOMEM;
 
 	dev_set_drvdata(dev, tmp108);
-
-	tmp108->regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
-	if (IS_ERR(tmp108->regmap)) {
-		err = PTR_ERR(tmp108->regmap);
-		dev_err(dev, "regmap init failed: %d", err);
-		return err;
-	}
+	tmp108->regmap = regmap;
 
 	err = regmap_read(tmp108->regmap, TMP108_REG_CONF, &config);
 	if (err < 0) {
@@ -383,13 +369,30 @@ static int tmp108_probe(struct i2c_client *client)
 		return err;
 	}
 
-	hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
+	hwmon_dev = devm_hwmon_device_register_with_info(dev, name,
 							 tmp108,
 							 &tmp108_chip_info,
 							 NULL);
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
+static int tmp108_probe(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+	struct regmap *regmap;
+
+	if (!i2c_check_functionality(client->adapter,
+				     I2C_FUNC_SMBUS_WORD_DATA))
+		return dev_err_probe(dev, -ENODEV,
+				     "adapter doesn't support SMBus word transactions\n");
+
+	regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed");
+
+	return tmp108_common_probe(dev, regmap, client->name);
+}
+
 static int tmp108_suspend(struct device *dev)
 {
 	struct tmp108 *tmp108 = dev_get_drvdata(dev);
-- 
2.54.0



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

* [PATCH 6.1.y-cip 05/23] hwmon: (tmp108) Add support for I3C device
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (3 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 04/23] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 06/23] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Frank Li <Frank.Li@nxp.com>

commit c40655e3310649866c4ebf7a10f0d53802ebdfa9 upstream.

Add support for I3C device in the tmp108 driver to handle the P3T1085
sensor. Register the I3C device driver to enable I3C functionality for the
sensor.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241112-p3t1085-v4-2-a1334314b1e6@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/Kconfig  |  1 +
 drivers/hwmon/tmp108.c | 35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index df7a0d3b59ce..da55b19f244f 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -2061,6 +2061,7 @@ config SENSORS_TMP108
 	tristate "Texas Instruments TMP108"
 	depends on I2C
 	select REGMAP_I2C
+	select REGMAP_I3C if I3C
 	help
 	  If you say yes here you get support for Texas Instruments TMP108
 	  sensor chips and NXP P3T1085.
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 63c2eaa59d21..55277ec7c54b 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -13,6 +13,7 @@
 #include <linux/mutex.h>
 #include <linux/of.h>
 #include <linux/i2c.h>
+#include <linux/i3c/device.h>
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/regmap.h>
@@ -440,7 +441,39 @@ static struct i2c_driver tmp108_driver = {
 	.id_table	= tmp108_i2c_ids,
 };
 
-module_i2c_driver(tmp108_driver);
+static const struct i3c_device_id p3t1085_i3c_ids[] = {
+	I3C_DEVICE(0x011b, 0x1529, NULL),
+	{}
+};
+MODULE_DEVICE_TABLE(i3c, p3t1085_i3c_ids);
+
+static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
+{
+	struct device *dev = i3cdev_to_dev(i3cdev);
+	struct regmap *regmap;
+
+#ifdef CONFIG_REGMAP_I3C
+	regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
+#else
+	regmap = ERR_PTR(-ENODEV);
+#endif
+
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap),
+				     "Failed to register i3c regmap\n");
+
+	return tmp108_common_probe(dev, regmap, "p3t1085_i3c");
+}
+
+static struct i3c_driver p3t1085_driver = {
+	.driver = {
+		.name = "p3t1085_i3c",
+	},
+	.probe = p3t1085_i3c_probe,
+	.id_table = p3t1085_i3c_ids,
+};
+
+module_i3c_i2c_driver(p3t1085_driver, &tmp108_driver)
 
 MODULE_AUTHOR("John Muir <john@jmuir.com>");
 MODULE_DESCRIPTION("Texas Instruments TMP108 temperature sensor driver");
-- 
2.54.0



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

* [PATCH 6.1.y-cip 06/23] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (4 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 05/23] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 07/23] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Jarkko Nikula <jarkko.nikula@linux.intel.com>

commit 8281d627905dc72241ca3969ee18f3e029e96d00 upstream.

I3C device probe fails when CONFIG_REGMAP_I3C=m:

	p3t1085_i3c 0-23615290090: error -ENODEV: Failed to register i3c regmap

Fix this by using the IS_ENABLED(CONFIG_REGMAP_I3C) macro in the code.

Fixes: c40655e33106 ("hwmon: (tmp108) Add support for I3C device")
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Message-ID: <20241121121819.393104-1-jarkko.nikula@linux.intel.com>
[groeck: Remove #ifdef entirely; it is not needed due to dead code elimination]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/tmp108.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 55277ec7c54b..955e6cd378dd 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -452,12 +452,7 @@ static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
 	struct device *dev = i3cdev_to_dev(i3cdev);
 	struct regmap *regmap;
 
-#ifdef CONFIG_REGMAP_I3C
 	regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
-#else
-	regmap = ERR_PTR(-ENODEV);
-#endif
-
 	if (IS_ERR(regmap))
 		return dev_err_probe(dev, PTR_ERR(regmap),
 				     "Failed to register i3c regmap\n");
-- 
2.54.0



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

* [PATCH 6.1.y-cip 07/23] hwmon: (tmp108) Add basic regulator support
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (5 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 06/23] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 08/23] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Stanislav Jakubek <stano.jakubek@gmail.com>

commit bddbb9cff4ab97ad367692201a0abe680a59d44d upstream.

TMP108/P3T1085 are powered by the V+/VCC regulator, add support for it.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/tmp108.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 955e6cd378dd..d389b698d3bc 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 
 #define	DRIVER_NAME "tmp108"
@@ -331,6 +332,10 @@ static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *
 	u32 config;
 	int err;
 
+	err = devm_regulator_get_enable(dev, "vcc");
+	if (err)
+		return dev_err_probe(dev, err, "Failed to enable regulator\n");
+
 	tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
 	if (!tmp108)
 		return -ENOMEM;
-- 
2.54.0



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

* [PATCH 6.1.y-cip 08/23] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (6 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 07/23] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 09/23] dt-bindings: hwmon: lm75: use common hwmon schema Tommaso Merciai
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Abdel Alkuor <alkuor@gmail.com>

commit de9c6033fb4de6013c5a4f6cc23b3b40c618cad2 upstream.

as6200 is a temperature sensor with a range between -40°C to
125°C degrees and an accuracy of ±0.4°C degree between 0
and 65°C and ±1°C for the other ranges.

Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/17ba2dfdb3d25bf1b5b4ed9f858b6e28902bedbe.1703127334.git.alkuor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 .../devicetree/bindings/hwmon/lm75.yaml       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index 8226e3b5d028..a7af231c52d3 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -14,6 +14,7 @@ properties:
   compatible:
     enum:
       - adi,adt75
+      - ams,as6200
       - atmel,at30ts74
       - dallas,ds1775
       - dallas,ds75
@@ -48,10 +49,28 @@ properties:
   vs-supply:
     description: phandle to the regulator that provides the +VS supply
 
+  interrupts:
+    maxItems: 1
+
 required:
   - compatible
   - reg
 
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - ams,as6200
+                - ti,tmp100
+                - ti,tmp101
+                - ti,tmp112
+    then:
+      properties:
+        interrupts: false
+
 additionalProperties: false
 
 examples:
@@ -66,3 +85,17 @@ examples:
         vs-supply = <&vs>;
       };
     };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      temperature-sensor@48 {
+        compatible = "ams,as6200";
+        reg = <0x48>;
+        vs-supply = <&vs>;
+        interrupt-parent = <&gpio1>;
+        interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
+      };
+    };
-- 
2.54.0



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

* [PATCH 6.1.y-cip 09/23] dt-bindings: hwmon: lm75: use common hwmon schema
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (7 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 08/23] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 10/23] dt-bindings: hwmon: lm75: Add NXP P3T1755 Tommaso Merciai
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Théo Lebrun <theo.lebrun@bootlin.com>

commit 78cc80d834ed3b792605bc9c2215ed9e63825459 upstream.

Reference common hwmon schema which has the generic "label" property,
parsed by Linux hwmon subsystem.

To: Jean Delvare <jdelvare@suse.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240229-mbly-i2c-v2-2-b32ed18c098c@bootlin.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/devicetree/bindings/hwmon/lm75.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index a7af231c52d3..5aefcf8e5ca1 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -57,6 +57,7 @@ required:
   - reg
 
 allOf:
+  - $ref: hwmon-common.yaml#
   - if:
       not:
         properties:
@@ -71,7 +72,7 @@ allOf:
       properties:
         interrupts: false
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.54.0



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

* [PATCH 6.1.y-cip 10/23] dt-bindings: hwmon: lm75: Add NXP P3T1755
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (8 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 09/23] dt-bindings: hwmon: lm75: use common hwmon schema Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 11/23] hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning Tommaso Merciai
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 844029c59d44c590871b93fdc9720245a71f63c4 upstream.

Add this LM75 compatible sensor which needs a separate entry because of
its default sampling time and SMBusAlert handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241218074131.4351-6-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/devicetree/bindings/hwmon/lm75.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/hwmon/lm75.yaml b/Documentation/devicetree/bindings/hwmon/lm75.yaml
index 5aefcf8e5ca1..b82ff62e9495 100644
--- a/Documentation/devicetree/bindings/hwmon/lm75.yaml
+++ b/Documentation/devicetree/bindings/hwmon/lm75.yaml
@@ -28,6 +28,7 @@ properties:
       - maxim,max31725
       - maxim,max31726
       - maxim,mcp980x
+      - nxp,p3t1755
       - nxp,pct2075
       - st,stds75
       - st,stlm75
-- 
2.54.0



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

* [PATCH 6.1.y-cip 11/23] hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (9 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 10/23] dt-bindings: hwmon: lm75: Add NXP P3T1755 Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 12/23] hwmon: (lm75) remove now-unused include Tommaso Merciai
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

commit c7e07faa48512f4beafef54b144a1e6df25c727f upstream.

'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  lm75.c:581:10: error: cast to smaller integer type 'enum lm75_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810093157.94244-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index bcc3adcb3af1..10784d496278 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -579,7 +579,7 @@ static int lm75_probe(struct i2c_client *client)
 	enum lm75_type kind;
 
 	if (client->dev.of_node)
-		kind = (enum lm75_type)of_device_get_match_data(&client->dev);
+		kind = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		kind = i2c_match_id(lm75_ids, client)->driver_data;
 
-- 
2.54.0



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

* [PATCH 6.1.y-cip 12/23] hwmon: (lm75) remove now-unused include
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (10 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 11/23] hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 13/23] hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Luca Ceresoli <luca.ceresoli@bootlin.com>

commit cfe09564467b8217b992aa329430897d0983e7db upstream.

Including hwmon-sysfs.h is not needed since sysfs code got removed from
this file in commit 08b024338166 ("hwmon: (lm75) Convert to use new hwmon
registration API").

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20231228-hwmon-cleanup-include-v1-1-e36f65aee1f0@bootlin.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 10784d496278..58f8be462816 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -11,7 +11,6 @@
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/hwmon.h>
-#include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/of_device.h>
 #include <linux/of.h>
-- 
2.54.0



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

* [PATCH 6.1.y-cip 13/23] hwmon: (lm75) Add AMS AS6200 temperature sensor
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (11 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 12/23] hwmon: (lm75) remove now-unused include Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config Tommaso Merciai
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Abdel Alkuor <alkuor@gmail.com>

commit 4b6358e1fe4668e88cd654b345a2a62da9d373f7 upstream.

as6200 is a temperature sensor with 0.0625°C resolution and a
range between -40°C to 125°C.

By default, the driver configures as6200 as following:
- Converstion rate: 8 Hz
- Conversion mode: continuous
- Consecutive fault counts: 4 samples
- Alert state: high polarity
- Alert mode: comparator mode

Interrupt is supported for the alert pin.

Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
Link: https://lore.kernel.org/r/d1686678991bf8ee0d00cb08ca046798f37ca4b3.1703127334.git.alkuor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/hwmon/lm75.rst |  10 ++++
 drivers/hwmon/lm75.c         | 108 ++++++++++++++++++++++++++++++-----
 2 files changed, 104 insertions(+), 14 deletions(-)

diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
index 8d0ab4ad5fb5..6adab608dd05 100644
--- a/Documentation/hwmon/lm75.rst
+++ b/Documentation/hwmon/lm75.rst
@@ -133,6 +133,16 @@ Supported chips:
 
                https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
 
+  * AMS OSRAM AS6200
+
+    Prefix: 'as6200'
+
+    Addresses scanned: none
+
+    Datasheet: Publicly available at the AMS website
+
+               https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
+
 Author: Frodo Looijaard <frodol@dds.nl>
 
 Description
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 58f8be462816..f6e16dfa11c5 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -7,6 +7,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
@@ -25,6 +26,7 @@
 
 enum lm75_type {		/* keep sorted in alphabetical order */
 	adt75,
+	as6200,
 	at30ts74,
 	ds1775,
 	ds75,
@@ -55,6 +57,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
 
 /**
  * struct lm75_params - lm75 configuration parameters.
+ * @config_reg_16bits:	Configure register size is 2 bytes.
  * @set_mask:		Bits to set in configuration register when configuring
  *			the chip.
  * @clr_mask:		Bits to clear in configuration register when configuring
@@ -75,17 +78,20 @@ enum lm75_type {		/* keep sorted in alphabetical order */
  * @sample_times:	All the possible sample times to be set. Mandatory if
  *			num_sample_times is larger than 1. If set, number of
  *			entries must match num_sample_times.
+ * @alarm:		Alarm bit is supported.
  */
 
 struct lm75_params {
-	u8			set_mask;
-	u8			clr_mask;
+	bool			config_reg_16bits;
+	u16			set_mask;
+	u16			clr_mask;
 	u8			default_resolution;
 	u8			resolution_limits;
 	const u8		*resolutions;
 	unsigned int		default_sample_time;
 	u8			num_sample_times;
 	const unsigned int	*sample_times;
+	bool			alarm;
 };
 
 /* Addresses scanned */
@@ -104,8 +110,8 @@ struct lm75_data {
 	struct i2c_client		*client;
 	struct regmap			*regmap;
 	struct regulator		*vs;
-	u8				orig_conf;
-	u8				current_conf;
+	u16				orig_conf;
+	u16				current_conf;
 	u8				resolution;	/* In bits, 9 to 16 */
 	unsigned int			sample_time;	/* In ms */
 	enum lm75_type			kind;
@@ -128,6 +134,15 @@ static const struct lm75_params device_params[] = {
 		.default_resolution = 12,
 		.default_sample_time = MSEC_PER_SEC / 10,
 	},
+	[as6200] = {
+		.config_reg_16bits = true,
+		.set_mask = 0x94C0,	/* 8 sample/s, 4 CF, positive polarity */
+		.default_resolution = 12,
+		.default_sample_time = 125,
+		.num_sample_times = 4,
+		.sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
+		.alarm = true,
+	},
 	[at30ts74] = {
 		.set_mask = 3 << 5,	/* 12-bit mode*/
 		.default_resolution = 12,
@@ -317,20 +332,23 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
 	return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8);
 }
 
-static int lm75_write_config(struct lm75_data *data, u8 set_mask,
-			     u8 clr_mask)
+static int lm75_write_config(struct lm75_data *data, u16 set_mask,
+			     u16 clr_mask)
 {
-	u8 value;
+	unsigned int value;
 
-	clr_mask |= LM75_SHUTDOWN;
+	clr_mask |= LM75_SHUTDOWN << (8 * data->params->config_reg_16bits);
 	value = data->current_conf & ~clr_mask;
 	value |= set_mask;
 
 	if (data->current_conf != value) {
 		s32 err;
-
-		err = i2c_smbus_write_byte_data(data->client, LM75_REG_CONF,
-						value);
+		if (data->params->config_reg_16bits)
+			err = regmap_write(data->regmap, LM75_REG_CONF, value);
+		else
+			err = i2c_smbus_write_byte_data(data->client,
+							LM75_REG_CONF,
+							value);
 		if (err)
 			return err;
 		data->current_conf = value;
@@ -338,6 +356,27 @@ static int lm75_write_config(struct lm75_data *data, u8 set_mask,
 	return 0;
 }
 
+static int lm75_read_config(struct lm75_data *data)
+{
+	int ret;
+	unsigned int status;
+
+	if (data->params->config_reg_16bits) {
+		ret = regmap_read(data->regmap, LM75_REG_CONF, &status);
+		return ret ? ret : status;
+	}
+
+	return i2c_smbus_read_byte_data(data->client, LM75_REG_CONF);
+}
+
+static irqreturn_t lm75_alarm_handler(int irq, void *private)
+{
+	struct device *hwmon_dev = private;
+
+	hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_alarm, 0);
+	return IRQ_HANDLED;
+}
+
 static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		     u32 attr, int channel, long *val)
 {
@@ -366,6 +405,9 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		case hwmon_temp_max_hyst:
 			reg = LM75_REG_HYST;
 			break;
+		case hwmon_temp_alarm:
+			reg = LM75_REG_CONF;
+			break;
 		default:
 			return -EINVAL;
 		}
@@ -373,7 +415,17 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		if (err < 0)
 			return err;
 
-		*val = lm75_reg_to_mc(regval, data->resolution);
+		if (attr == hwmon_temp_alarm) {
+			switch (data->kind) {
+			case as6200:
+				*val = (regval >> 5) & 0x1;
+				break;
+			default:
+				return -EINVAL;
+			}
+		} else {
+			*val = lm75_reg_to_mc(regval, data->resolution);
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -436,6 +488,7 @@ static int lm75_update_interval(struct device *dev, long val)
 			data->resolution = data->params->resolutions[index];
 		break;
 	case tmp112:
+	case as6200:
 		err = regmap_read(data->regmap, LM75_REG_CONF, &reg);
 		if (err < 0)
 			return err;
@@ -503,6 +556,10 @@ static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
 		case hwmon_temp_max:
 		case hwmon_temp_max_hyst:
 			return 0644;
+		case hwmon_temp_alarm:
+			if (config_data->params->alarm)
+				return 0444;
+			break;
 		}
 		break;
 	default:
@@ -515,7 +572,8 @@ static const struct hwmon_channel_info *lm75_info[] = {
 	HWMON_CHANNEL_INFO(chip,
 			   HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
 	HWMON_CHANNEL_INFO(temp,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
+			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST |
+			   HWMON_T_ALARM),
 	NULL
 };
 
@@ -623,7 +681,7 @@ static int lm75_probe(struct i2c_client *client)
 		return err;
 
 	/* Cache original configuration */
-	status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
+	status = lm75_read_config(data);
 	if (status < 0) {
 		dev_dbg(dev, "Can't read config? %d\n", status);
 		return status;
@@ -646,6 +704,23 @@ static int lm75_probe(struct i2c_client *client)
 	if (IS_ERR(hwmon_dev))
 		return PTR_ERR(hwmon_dev);
 
+	if (client->irq) {
+		if (data->params->alarm) {
+			err = devm_request_threaded_irq(dev,
+							client->irq,
+							NULL,
+							&lm75_alarm_handler,
+							IRQF_ONESHOT,
+							client->name,
+							hwmon_dev);
+			if (err)
+				return err;
+		} else {
+			 /* alarm is only supported for chips with alarm bit */
+			dev_err(dev, "alarm interrupt is not supported\n");
+		}
+	}
+
 	dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), client->name);
 
 	return 0;
@@ -653,6 +728,7 @@ static int lm75_probe(struct i2c_client *client)
 
 static const struct i2c_device_id lm75_ids[] = {
 	{ "adt75", adt75, },
+	{ "as6200", as6200, },
 	{ "at30ts74", at30ts74, },
 	{ "ds1775", ds1775, },
 	{ "ds75", ds75, },
@@ -689,6 +765,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
 		.compatible = "adi,adt75",
 		.data = (void *)adt75
 	},
+	{
+		.compatible = "ams,as6200",
+		.data = (void *)as6200
+	},
 	{
 		.compatible = "atmel,at30ts74",
 		.data = (void *)at30ts74
-- 
2.54.0



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

* [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (12 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 13/23] hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-20 20:14   ` Pavel Machek
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 15/23] hwmon: (lm75) Remove use of i2c_match_id() Tommaso Merciai
                   ` (9 subsequent siblings)
  23 siblings, 1 reply; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Abdel Alkuor <alkuor@gmail.com>

commit 8249a0e25dd2972e919a2552425bf4faa2581d24 upstream.

Set tmp112 conversion rate to 8 HZ and 12-bit mode.

Fixes: 35cd18048542 ("hwmon: (lm75) Aproximate sample times to data-sheet values")
Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
Link: https://lore.kernel.org/r/20240106030254.384963-1-alkuor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index f6e16dfa11c5..5eba180b66a0 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -270,8 +270,9 @@ static const struct lm75_params device_params[] = {
 		.resolutions = (u8 []) {9, 10, 11, 12 },
 	},
 	[tmp112] = {
-		.set_mask = 3 << 5,	/* 8 samples / second */
-		.clr_mask = 1 << 7,	/* no one-shot mode*/
+		.config_reg_16bits = true,
+		.set_mask = 0x60C0,	/* 12-bit mode, 8 samples / second */
+		.clr_mask = 1 << 15,	/* no one-shot mode*/
 		.default_resolution = 12,
 		.default_sample_time = 125,
 		.num_sample_times = 4,
-- 
2.54.0



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

* [PATCH 6.1.y-cip 15/23] hwmon: (lm75) Remove use of i2c_match_id()
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (13 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 16/23] hwmon: (lm75) Add NXP P3T1755 support Tommaso Merciai
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Andrew Davis <afd@ti.com>

commit 5178911d5c13308a0c2e80e0055c04f36a515bbf upstream.

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-14-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 5eba180b66a0..4f54a50f2c12 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -626,20 +626,12 @@ static void lm75_remove(void *data)
 	i2c_smbus_write_byte_data(client, LM75_REG_CONF, lm75->orig_conf);
 }
 
-static const struct i2c_device_id lm75_ids[];
-
 static int lm75_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct lm75_data *data;
 	int status, err;
-	enum lm75_type kind;
-
-	if (client->dev.of_node)
-		kind = (uintptr_t)of_device_get_match_data(&client->dev);
-	else
-		kind = i2c_match_id(lm75_ids, client)->driver_data;
 
 	if (!i2c_check_functionality(client->adapter,
 			I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
@@ -650,7 +642,7 @@ static int lm75_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	data->client = client;
-	data->kind = kind;
+	data->kind = (uintptr_t)i2c_get_match_data(client);
 
 	data->vs = devm_regulator_get(dev, "vs");
 	if (IS_ERR(data->vs))
-- 
2.54.0



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

* [PATCH 6.1.y-cip 16/23] hwmon: (lm75) Add NXP P3T1755 support
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (14 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 15/23] hwmon: (lm75) Remove use of i2c_match_id() Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 17/23] hwmon: (lm75) Hide register size differences in regmap access functions Tommaso Merciai
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit d3506653d01c0df1f1c86cd49fe70c98f00f1aef upstream.

Add this LM75 compatible sensor which needs a separate entry because of
its default sampling time and SMBusAlert handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241218074131.4351-7-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 Documentation/hwmon/lm75.rst |  6 ++++--
 drivers/hwmon/lm75.c         | 13 +++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/Documentation/hwmon/lm75.rst b/Documentation/hwmon/lm75.rst
index 6adab608dd05..9877ddbbf7c8 100644
--- a/Documentation/hwmon/lm75.rst
+++ b/Documentation/hwmon/lm75.rst
@@ -121,9 +121,9 @@ Supported chips:
 
          https://www.ti.com/product/TMP1075
 
-  * NXP LM75B, PCT2075
+  * NXP LM75B, P3T1755, PCT2075
 
-    Prefix: 'lm75b', 'pct2075'
+    Prefix: 'lm75b', 'p3t1755', 'pct2075'
 
     Addresses scanned: none
 
@@ -131,6 +131,8 @@ Supported chips:
 
 	       https://www.nxp.com/documents/data_sheet/LM75B.pdf
 
+               https://www.nxp.com/docs/en/data-sheet/P3T1755.pdf
+
                https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf
 
   * AMS OSRAM AS6200
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 4f54a50f2c12..1d0040e3276f 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -39,6 +39,7 @@ enum lm75_type {		/* keep sorted in alphabetical order */
 	max6626,
 	max31725,
 	mcp980x,
+	p3t1755,
 	pct2075,
 	stds75,
 	stlm75,
@@ -223,6 +224,13 @@ static const struct lm75_params device_params[] = {
 		.default_resolution = 9,
 		.default_sample_time = MSEC_PER_SEC / 18,
 	},
+	[p3t1755] = {
+		.clr_mask = 1 << 1 | 1 << 7,	/* disable SMBAlert and one-shot */
+		.default_resolution = 12,
+		.default_sample_time = 55,
+		.num_sample_times = 4,
+		.sample_times = (unsigned int []){ 28, 55, 110, 220 },
+	},
 	[pct2075] = {
 		.default_resolution = 11,
 		.default_sample_time = MSEC_PER_SEC / 10,
@@ -735,6 +743,7 @@ static const struct i2c_device_id lm75_ids[] = {
 	{ "max31725", max31725, },
 	{ "max31726", max31725, },
 	{ "mcp980x", mcp980x, },
+	{ "p3t1755", p3t1755, },
 	{ "pct2075", pct2075, },
 	{ "stds75", stds75, },
 	{ "stlm75", stlm75, },
@@ -814,6 +823,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = {
 		.compatible = "maxim,mcp980x",
 		.data = (void *)mcp980x
 	},
+	{
+		.compatible = "nxp,p3t1755",
+		.data = (void *)p3t1755
+	},
 	{
 		.compatible = "nxp,pct2075",
 		.data = (void *)pct2075
-- 
2.54.0



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

* [PATCH 6.1.y-cip 17/23] hwmon: (lm75) Hide register size differences in regmap access functions
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (15 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 16/23] hwmon: (lm75) Add NXP P3T1755 support Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 18/23] hwmon: (lm75) simplify lm75_write_config() Tommaso Merciai
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Guenter Roeck <linux@roeck-us.net>

commit 6da24a25f766e02fbfc07570b5560154818ba59d upstream.

Hide register size differences in regmap access functions to simplify
runtime code and to simplify adding support for I3C devices. Also
use regmap API functions for bit operations where possible.

For this to work, the 16-bit and 8-bit configuration register has to be
mapped to a 16-bit value. Unlike other registers, this register is a
low-byte-first register, presumably for compatibility with chips with
8-bit wide configuration registers. Hide the differences in the regmap
access code.

While at it, enable alarm attribute support for TMP112.

Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 131 ++++++++++++++++++++-----------------------
 1 file changed, 62 insertions(+), 69 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 1d0040e3276f..4bb3d2959593 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -112,7 +112,6 @@ struct lm75_data {
 	struct regmap			*regmap;
 	struct regulator		*vs;
 	u16				orig_conf;
-	u16				current_conf;
 	u8				resolution;	/* In bits, 9 to 16 */
 	unsigned int			sample_time;	/* In ms */
 	enum lm75_type			kind;
@@ -285,6 +284,7 @@ static const struct lm75_params device_params[] = {
 		.default_sample_time = 125,
 		.num_sample_times = 4,
 		.sample_times = (unsigned int []){ 125, 250, 1000, 4000 },
+		.alarm = true,
 	},
 	[tmp175] = {
 		.set_mask = 3 << 5,	/* 12-bit mode */
@@ -344,40 +344,16 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
 static int lm75_write_config(struct lm75_data *data, u16 set_mask,
 			     u16 clr_mask)
 {
-	unsigned int value;
+	int err;
 
-	clr_mask |= LM75_SHUTDOWN << (8 * data->params->config_reg_16bits);
-	value = data->current_conf & ~clr_mask;
-	value |= set_mask;
+	err = regmap_update_bits(data->regmap, LM75_REG_CONF,
+				 clr_mask | LM75_SHUTDOWN, set_mask);
+	if (err)
+		return err;
 
-	if (data->current_conf != value) {
-		s32 err;
-		if (data->params->config_reg_16bits)
-			err = regmap_write(data->regmap, LM75_REG_CONF, value);
-		else
-			err = i2c_smbus_write_byte_data(data->client,
-							LM75_REG_CONF,
-							value);
-		if (err)
-			return err;
-		data->current_conf = value;
-	}
 	return 0;
 }
 
-static int lm75_read_config(struct lm75_data *data)
-{
-	int ret;
-	unsigned int status;
-
-	if (data->params->config_reg_16bits) {
-		ret = regmap_read(data->regmap, LM75_REG_CONF, &status);
-		return ret ? ret : status;
-	}
-
-	return i2c_smbus_read_byte_data(data->client, LM75_REG_CONF);
-}
-
 static irqreturn_t lm75_alarm_handler(int irq, void *private)
 {
 	struct device *hwmon_dev = private;
@@ -427,7 +403,8 @@ static int lm75_read(struct device *dev, enum hwmon_sensor_types type,
 		if (attr == hwmon_temp_alarm) {
 			switch (data->kind) {
 			case as6200:
-				*val = (regval >> 5) & 0x1;
+			case tmp112:
+				*val = (regval >> 13) & 0x1;
 				break;
 			default:
 				return -EINVAL;
@@ -478,7 +455,6 @@ static int lm75_write_temp(struct device *dev, u32 attr, long temp)
 static int lm75_update_interval(struct device *dev, long val)
 {
 	struct lm75_data *data = dev_get_drvdata(dev);
-	unsigned int reg;
 	u8 index;
 	s32 err;
 
@@ -498,19 +474,14 @@ static int lm75_update_interval(struct device *dev, long val)
 		break;
 	case tmp112:
 	case as6200:
-		err = regmap_read(data->regmap, LM75_REG_CONF, &reg);
-		if (err < 0)
-			return err;
-		reg &= ~0x00c0;
-		reg |= (3 - index) << 6;
-		err = regmap_write(data->regmap, LM75_REG_CONF, reg);
+		err = regmap_update_bits(data->regmap, LM75_REG_CONF,
+					 0xc000, (3 - index) << 14);
 		if (err < 0)
 			return err;
 		data->sample_time = data->params->sample_times[index];
 		break;
 	case pct2075:
-		err = i2c_smbus_write_byte_data(data->client, PCT2075_REG_IDLE,
-						index + 1);
+		err = regmap_write(data->regmap, PCT2075_REG_IDLE, index + 1);
 		if (err)
 			return err;
 		data->sample_time = data->params->sample_times[index];
@@ -607,6 +578,39 @@ static bool lm75_is_volatile_reg(struct device *dev, unsigned int reg)
 	return reg == LM75_REG_TEMP || reg == LM75_REG_CONF;
 }
 
+static int lm75_i2c_reg_read(void *context, unsigned int reg, unsigned int *val)
+{
+	struct lm75_data *data = context;
+	struct i2c_client *client = data->client;
+	int ret;
+
+	if (reg == LM75_REG_CONF) {
+		if (!data->params->config_reg_16bits)
+			ret = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
+		else
+			ret = i2c_smbus_read_word_data(client, LM75_REG_CONF);
+	} else {
+		ret = i2c_smbus_read_word_swapped(client, reg);
+	}
+	if (ret < 0)
+		return ret;
+	*val = ret;
+	return 0;
+}
+
+static int lm75_i2c_reg_write(void *context, unsigned int reg, unsigned int val)
+{
+	struct lm75_data *data = context;
+	struct i2c_client *client = data->client;
+
+	if (reg == PCT2075_REG_IDLE ||
+	    (reg == LM75_REG_CONF && !data->params->config_reg_16bits))
+		return i2c_smbus_write_byte_data(client, reg, val);
+	else if (reg == LM75_REG_CONF)
+		return i2c_smbus_write_word_data(client, reg, val);
+	return i2c_smbus_write_word_swapped(client, reg, val);
+}
+
 static const struct regmap_config lm75_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 16,
@@ -619,6 +623,11 @@ static const struct regmap_config lm75_regmap_config = {
 	.use_single_write = true,
 };
 
+static const struct regmap_bus lm75_i2c_regmap_bus = {
+	.reg_read = lm75_i2c_reg_read,
+	.reg_write = lm75_i2c_reg_write,
+};
+
 static void lm75_disable_regulator(void *data)
 {
 	struct lm75_data *lm75 = data;
@@ -629,9 +638,8 @@ static void lm75_disable_regulator(void *data)
 static void lm75_remove(void *data)
 {
 	struct lm75_data *lm75 = data;
-	struct i2c_client *client = lm75->client;
 
-	i2c_smbus_write_byte_data(client, LM75_REG_CONF, lm75->orig_conf);
+	regmap_write(lm75->regmap, LM75_REG_CONF, lm75->orig_conf);
 }
 
 static int lm75_probe(struct i2c_client *client)
@@ -649,6 +657,9 @@ static int lm75_probe(struct i2c_client *client)
 	if (!data)
 		return -ENOMEM;
 
+	/* needed by custom regmap callbacks */
+	dev_set_drvdata(dev, data);
+
 	data->client = client;
 	data->kind = (uintptr_t)i2c_get_match_data(client);
 
@@ -656,7 +667,8 @@ static int lm75_probe(struct i2c_client *client)
 	if (IS_ERR(data->vs))
 		return PTR_ERR(data->vs);
 
-	data->regmap = devm_regmap_init_i2c(client, &lm75_regmap_config);
+	data->regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, data,
+					&lm75_regmap_config);
 	if (IS_ERR(data->regmap))
 		return PTR_ERR(data->regmap);
 
@@ -682,13 +694,10 @@ static int lm75_probe(struct i2c_client *client)
 		return err;
 
 	/* Cache original configuration */
-	status = lm75_read_config(data);
-	if (status < 0) {
-		dev_dbg(dev, "Can't read config? %d\n", status);
-		return status;
-	}
+	err = regmap_read(data->regmap, LM75_REG_CONF, &status);
+	if (err)
+		return err;
 	data->orig_conf = status;
-	data->current_conf = status;
 
 	err = lm75_write_config(data, data->params->set_mask,
 				data->params->clr_mask);
@@ -986,32 +995,16 @@ static int lm75_detect(struct i2c_client *new_client,
 #ifdef CONFIG_PM
 static int lm75_suspend(struct device *dev)
 {
-	int status;
-	struct i2c_client *client = to_i2c_client(dev);
+	struct lm75_data *data = dev_get_drvdata(dev);
 
-	status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
-	if (status < 0) {
-		dev_dbg(&client->dev, "Can't read config? %d\n", status);
-		return status;
-	}
-	status = status | LM75_SHUTDOWN;
-	i2c_smbus_write_byte_data(client, LM75_REG_CONF, status);
-	return 0;
+	return regmap_update_bits(data->regmap, LM75_REG_CONF, LM75_SHUTDOWN, LM75_SHUTDOWN);
 }
 
 static int lm75_resume(struct device *dev)
 {
-	int status;
-	struct i2c_client *client = to_i2c_client(dev);
+	struct lm75_data *data = dev_get_drvdata(dev);
 
-	status = i2c_smbus_read_byte_data(client, LM75_REG_CONF);
-	if (status < 0) {
-		dev_dbg(&client->dev, "Can't read config? %d\n", status);
-		return status;
-	}
-	status = status & ~LM75_SHUTDOWN;
-	i2c_smbus_write_byte_data(client, LM75_REG_CONF, status);
-	return 0;
+	return regmap_update_bits(data->regmap, LM75_REG_CONF, LM75_SHUTDOWN, 0);
 }
 
 static const struct dev_pm_ops lm75_dev_pm_ops = {
-- 
2.54.0



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

* [PATCH 6.1.y-cip 18/23] hwmon: (lm75) simplify lm75_write_config()
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (16 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 17/23] hwmon: (lm75) Hide register size differences in regmap access functions Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 19/23] hwmon: (lm75) simplify regulator handling Tommaso Merciai
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit c4d08cf8a03eb9b14858a9b8cf8f4d71a639da57 upstream.

After previous refactoring, it is now possible to make
lm75_write_config() a simple inline function.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20241219225522.3490-8-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 4bb3d2959593..81fce8bdb929 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -341,17 +341,11 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
 	return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8);
 }
 
-static int lm75_write_config(struct lm75_data *data, u16 set_mask,
-			     u16 clr_mask)
+static inline int lm75_write_config(struct lm75_data *data, u16 set_mask,
+				    u16 clr_mask)
 {
-	int err;
-
-	err = regmap_update_bits(data->regmap, LM75_REG_CONF,
-				 clr_mask | LM75_SHUTDOWN, set_mask);
-	if (err)
-		return err;
-
-	return 0;
+	return regmap_update_bits(data->regmap, LM75_REG_CONF,
+				  clr_mask | LM75_SHUTDOWN, set_mask);
 }
 
 static irqreturn_t lm75_alarm_handler(int irq, void *private)
-- 
2.54.0



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

* [PATCH 6.1.y-cip 19/23] hwmon: (lm75) simplify regulator handling
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (17 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 18/23] hwmon: (lm75) simplify lm75_write_config() Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 20/23] hwmon: (lm75) Remove superfluous 'client' member from private struct Tommaso Merciai
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 2b64c6f652b0f5435b293d33f7d231132e987fb2 upstream.

devm_regulator_get_enable() was introduced exactly to avoid open coding
regulator handling like in this driver. Make use of this helper.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20241219225522.3490-9-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 81fce8bdb929..0553e2e4520b 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -110,7 +110,6 @@ static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
 struct lm75_data {
 	struct i2c_client		*client;
 	struct regmap			*regmap;
-	struct regulator		*vs;
 	u16				orig_conf;
 	u8				resolution;	/* In bits, 9 to 16 */
 	unsigned int			sample_time;	/* In ms */
@@ -622,13 +621,6 @@ static const struct regmap_bus lm75_i2c_regmap_bus = {
 	.reg_write = lm75_i2c_reg_write,
 };
 
-static void lm75_disable_regulator(void *data)
-{
-	struct lm75_data *lm75 = data;
-
-	regulator_disable(lm75->vs);
-}
-
 static void lm75_remove(void *data)
 {
 	struct lm75_data *lm75 = data;
@@ -657,9 +649,9 @@ static int lm75_probe(struct i2c_client *client)
 	data->client = client;
 	data->kind = (uintptr_t)i2c_get_match_data(client);
 
-	data->vs = devm_regulator_get(dev, "vs");
-	if (IS_ERR(data->vs))
-		return PTR_ERR(data->vs);
+	err = devm_regulator_get_enable(dev, "vs");
+	if (err)
+		return err;
 
 	data->regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, data,
 					&lm75_regmap_config);
@@ -676,17 +668,6 @@ static int lm75_probe(struct i2c_client *client)
 	data->sample_time = data->params->default_sample_time;
 	data->resolution = data->params->default_resolution;
 
-	/* Enable the power */
-	err = regulator_enable(data->vs);
-	if (err) {
-		dev_err(dev, "failed to enable regulator: %d\n", err);
-		return err;
-	}
-
-	err = devm_add_action_or_reset(dev, lm75_disable_regulator, data);
-	if (err)
-		return err;
-
 	/* Cache original configuration */
 	err = regmap_read(data->regmap, LM75_REG_CONF, &status);
 	if (err)
-- 
2.54.0



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

* [PATCH 6.1.y-cip 20/23] hwmon: (lm75) Remove superfluous 'client' member from private struct
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (18 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 19/23] hwmon: (lm75) simplify regulator handling Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 21/23] hwmon: (lm75) separate probe into common and I2C parts Tommaso Merciai
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 7a5c24da4b3c96949a6d93c3c7fa4133c6f2b88e upstream.

The regmap-only conversion allows us to store the client-pointer as the
'context' parameter for regmap. This not only makes the private struct
smaller, but also allows proper separation of I2C and I3C in the future.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241219225522.3490-10-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 0553e2e4520b..cddd940c01ce 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -106,9 +106,7 @@ static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
 #define LM75_REG_MAX		0x03
 #define PCT2075_REG_IDLE	0x04
 
-/* Each client has this additional data */
 struct lm75_data {
-	struct i2c_client		*client;
 	struct regmap			*regmap;
 	u16				orig_conf;
 	u8				resolution;	/* In bits, 9 to 16 */
@@ -573,8 +571,8 @@ static bool lm75_is_volatile_reg(struct device *dev, unsigned int reg)
 
 static int lm75_i2c_reg_read(void *context, unsigned int reg, unsigned int *val)
 {
-	struct lm75_data *data = context;
-	struct i2c_client *client = data->client;
+	struct i2c_client *client = context;
+	struct lm75_data *data = i2c_get_clientdata(client);
 	int ret;
 
 	if (reg == LM75_REG_CONF) {
@@ -593,8 +591,8 @@ static int lm75_i2c_reg_read(void *context, unsigned int reg, unsigned int *val)
 
 static int lm75_i2c_reg_write(void *context, unsigned int reg, unsigned int val)
 {
-	struct lm75_data *data = context;
-	struct i2c_client *client = data->client;
+	struct i2c_client *client = context;
+	struct lm75_data *data = i2c_get_clientdata(client);
 
 	if (reg == PCT2075_REG_IDLE ||
 	    (reg == LM75_REG_CONF && !data->params->config_reg_16bits))
@@ -646,14 +644,13 @@ static int lm75_probe(struct i2c_client *client)
 	/* needed by custom regmap callbacks */
 	dev_set_drvdata(dev, data);
 
-	data->client = client;
 	data->kind = (uintptr_t)i2c_get_match_data(client);
 
 	err = devm_regulator_get_enable(dev, "vs");
 	if (err)
 		return err;
 
-	data->regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, data,
+	data->regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, client,
 					&lm75_regmap_config);
 	if (IS_ERR(data->regmap))
 		return PTR_ERR(data->regmap);
-- 
2.54.0



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

* [PATCH 6.1.y-cip 21/23] hwmon: (lm75) separate probe into common and I2C parts
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (19 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 20/23] hwmon: (lm75) Remove superfluous 'client' member from private struct Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 22/23] hwmon: (lm75) add I3C support for P3T1755 Tommaso Merciai
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit bc96dc1a1cdad999ccd84a7ea6d5e0926c26d8ce upstream.

Put generic probe functionality into a separate function and let the I2C
driver call it. This is a preparation for adding I3C support which will
also use the generic probe function.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241219225522.3490-11-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[tm: Use .probe_new instead of .probe]
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 68 +++++++++++++++++++++++++-------------------
 1 file changed, 38 insertions(+), 30 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index cddd940c01ce..d96497202ac0 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -602,6 +602,11 @@ static int lm75_i2c_reg_write(void *context, unsigned int reg, unsigned int val)
 	return i2c_smbus_write_word_swapped(client, reg, val);
 }
 
+static const struct regmap_bus lm75_i2c_regmap_bus = {
+	.reg_read = lm75_i2c_reg_read,
+	.reg_write = lm75_i2c_reg_write,
+};
+
 static const struct regmap_config lm75_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 16,
@@ -614,11 +619,6 @@ static const struct regmap_config lm75_regmap_config = {
 	.use_single_write = true,
 };
 
-static const struct regmap_bus lm75_i2c_regmap_bus = {
-	.reg_read = lm75_i2c_reg_read,
-	.reg_write = lm75_i2c_reg_write,
-};
-
 static void lm75_remove(void *data)
 {
 	struct lm75_data *lm75 = data;
@@ -626,17 +626,13 @@ static void lm75_remove(void *data)
 	regmap_write(lm75->regmap, LM75_REG_CONF, lm75->orig_conf);
 }
 
-static int lm75_probe(struct i2c_client *client)
+static int lm75_generic_probe(struct device *dev, const char *name,
+			      const void *kind_ptr, int irq, struct regmap *regmap)
 {
-	struct device *dev = &client->dev;
 	struct device *hwmon_dev;
 	struct lm75_data *data;
 	int status, err;
 
-	if (!i2c_check_functionality(client->adapter,
-			I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
-		return -EIO;
-
 	data = devm_kzalloc(dev, sizeof(struct lm75_data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
@@ -644,17 +640,13 @@ static int lm75_probe(struct i2c_client *client)
 	/* needed by custom regmap callbacks */
 	dev_set_drvdata(dev, data);
 
-	data->kind = (uintptr_t)i2c_get_match_data(client);
+	data->kind = (uintptr_t)kind_ptr;
+	data->regmap = regmap;
 
 	err = devm_regulator_get_enable(dev, "vs");
 	if (err)
 		return err;
 
-	data->regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, client,
-					&lm75_regmap_config);
-	if (IS_ERR(data->regmap))
-		return PTR_ERR(data->regmap);
-
 	/* Set to LM75 resolution (9 bits, 1/2 degree C) and range.
 	 * Then tweak to be more precise when appropriate.
 	 */
@@ -680,20 +672,19 @@ static int lm75_probe(struct i2c_client *client)
 	if (err)
 		return err;
 
-	hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
-							 data, &lm75_chip_info,
-							 NULL);
+	hwmon_dev = devm_hwmon_device_register_with_info(dev, name, data,
+							 &lm75_chip_info, NULL);
 	if (IS_ERR(hwmon_dev))
 		return PTR_ERR(hwmon_dev);
 
-	if (client->irq) {
+	if (irq) {
 		if (data->params->alarm) {
 			err = devm_request_threaded_irq(dev,
-							client->irq,
+							irq,
 							NULL,
 							&lm75_alarm_handler,
 							IRQF_ONESHOT,
-							client->name,
+							name,
 							hwmon_dev);
 			if (err)
 				return err;
@@ -703,12 +694,29 @@ static int lm75_probe(struct i2c_client *client)
 		}
 	}
 
-	dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), client->name);
+	dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), name);
 
 	return 0;
 }
 
-static const struct i2c_device_id lm75_ids[] = {
+static int lm75_i2c_probe(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+	struct regmap *regmap;
+
+	if (!i2c_check_functionality(client->adapter,
+			I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
+		return -EOPNOTSUPP;
+
+	regmap = devm_regmap_init(dev, &lm75_i2c_regmap_bus, client, &lm75_regmap_config);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	return lm75_generic_probe(dev, client->name, i2c_get_match_data(client),
+				  client->irq, regmap);
+}
+
+static const struct i2c_device_id lm75_i2c_ids[] = {
 	{ "adt75", adt75, },
 	{ "as6200", as6200, },
 	{ "at30ts74", at30ts74, },
@@ -741,7 +749,7 @@ static const struct i2c_device_id lm75_ids[] = {
 	{ "tmp1075", tmp1075, },
 	{ /* LIST END */ }
 };
-MODULE_DEVICE_TABLE(i2c, lm75_ids);
+MODULE_DEVICE_TABLE(i2c, lm75_i2c_ids);
 
 static const struct of_device_id __maybe_unused lm75_of_match[] = {
 	{
@@ -988,20 +996,20 @@ static const struct dev_pm_ops lm75_dev_pm_ops = {
 #define LM75_DEV_PM_OPS NULL
 #endif /* CONFIG_PM */
 
-static struct i2c_driver lm75_driver = {
+static struct i2c_driver lm75_i2c_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm75",
 		.of_match_table = of_match_ptr(lm75_of_match),
 		.pm	= LM75_DEV_PM_OPS,
 	},
-	.probe_new	= lm75_probe,
-	.id_table	= lm75_ids,
+	.probe_new	= lm75_i2c_probe,
+	.id_table	= lm75_i2c_ids,
 	.detect		= lm75_detect,
 	.address_list	= normal_i2c,
 };
 
-module_i2c_driver(lm75_driver);
+module_i2c_driver(lm75_i2c_driver);
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
 MODULE_DESCRIPTION("LM75 driver");
-- 
2.54.0



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

* [PATCH 6.1.y-cip 22/23] hwmon: (lm75) add I3C support for P3T1755
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (20 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 21/23] hwmon: (lm75) separate probe into common and I2C parts Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 23/23] hwmon: (lm75) Fix I3C transfer buffer pointer for incoming data Tommaso Merciai
  2026-07-20 20:14 ` [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Pavel Machek
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 6071d10413ff8489c3e842b19b1e0d539700068d upstream.

Introduce I3C support by defining I3C accessors for regmap and
implementing an I3C driver. Enable I3C for the NXP P3T1755.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241220093635.11218-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/Kconfig |   2 +
 drivers/hwmon/lm75.c  | 121 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 119 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index da55b19f244f..c87ca5261bb2 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1277,7 +1277,9 @@ config SENSORS_LM73
 config SENSORS_LM75
 	tristate "National Semiconductor LM75 and compatibles"
 	depends on I2C
+	depends on I3C || !I3C
 	select REGMAP_I2C
+	select REGMAP_I3C if I3C
 	help
 	  If you say yes here you get support for one common type of
 	  temperature sensor chip, with models including:
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index d96497202ac0..f755ed62c112 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -11,6 +11,7 @@
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
+#include <linux/i3c/device.h>
 #include <linux/hwmon.h>
 #include <linux/err.h>
 #include <linux/of_device.h>
@@ -113,6 +114,8 @@ struct lm75_data {
 	unsigned int			sample_time;	/* In ms */
 	enum lm75_type			kind;
 	const struct lm75_params	*params;
+	u8				reg_buf[1];
+	u8				val_buf[3];
 };
 
 /*-----------------------------------------------------------------------*/
@@ -607,6 +610,77 @@ static const struct regmap_bus lm75_i2c_regmap_bus = {
 	.reg_write = lm75_i2c_reg_write,
 };
 
+static int lm75_i3c_reg_read(void *context, unsigned int reg, unsigned int *val)
+{
+	struct i3c_device *i3cdev = context;
+	struct lm75_data *data = i3cdev_get_drvdata(i3cdev);
+	struct i3c_priv_xfer xfers[] = {
+		{
+			.rnw = false,
+			.len = 1,
+			.data.out = data->reg_buf,
+		},
+		{
+			.rnw = true,
+			.len = 2,
+			.data.out = data->val_buf,
+		},
+	};
+	int ret;
+
+	data->reg_buf[0] = reg;
+
+	if (reg == LM75_REG_CONF && !data->params->config_reg_16bits)
+		xfers[1].len--;
+
+	ret = i3c_device_do_priv_xfers(i3cdev, xfers, 2);
+	if (ret < 0)
+		return ret;
+
+	if (reg == LM75_REG_CONF && !data->params->config_reg_16bits)
+		*val = data->val_buf[0];
+	else if (reg == LM75_REG_CONF)
+		*val = data->val_buf[0] | (data->val_buf[1] << 8);
+	else
+		*val = data->val_buf[1] | (data->val_buf[0] << 8);
+
+	return 0;
+}
+
+static int lm75_i3c_reg_write(void *context, unsigned int reg, unsigned int val)
+{
+	struct i3c_device *i3cdev = context;
+	struct lm75_data *data = i3cdev_get_drvdata(i3cdev);
+	struct i3c_priv_xfer xfers[] = {
+		{
+			.rnw = false,
+			.len = 3,
+			.data.out = data->val_buf,
+		},
+	};
+
+	data->val_buf[0] = reg;
+
+	if (reg == PCT2075_REG_IDLE ||
+	    (reg == LM75_REG_CONF && !data->params->config_reg_16bits)) {
+		xfers[0].len--;
+		data->val_buf[1] = val & 0xff;
+	} else if (reg == LM75_REG_CONF) {
+		data->val_buf[1] = val & 0xff;
+		data->val_buf[2] = (val >> 8) & 0xff;
+	} else {
+		data->val_buf[1] = (val >> 8) & 0xff;
+		data->val_buf[2] = val & 0xff;
+	}
+
+	return i3c_device_do_priv_xfers(i3cdev, xfers, 1);
+}
+
+static const struct regmap_bus lm75_i3c_regmap_bus = {
+	.reg_read = lm75_i3c_reg_read,
+	.reg_write = lm75_i3c_reg_write,
+};
+
 static const struct regmap_config lm75_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 16,
@@ -627,7 +701,7 @@ static void lm75_remove(void *data)
 }
 
 static int lm75_generic_probe(struct device *dev, const char *name,
-			      const void *kind_ptr, int irq, struct regmap *regmap)
+			      enum lm75_type kind, int irq, struct regmap *regmap)
 {
 	struct device *hwmon_dev;
 	struct lm75_data *data;
@@ -640,7 +714,7 @@ static int lm75_generic_probe(struct device *dev, const char *name,
 	/* needed by custom regmap callbacks */
 	dev_set_drvdata(dev, data);
 
-	data->kind = (uintptr_t)kind_ptr;
+	data->kind = kind;
 	data->regmap = regmap;
 
 	err = devm_regulator_get_enable(dev, "vs");
@@ -712,7 +786,7 @@ static int lm75_i2c_probe(struct i2c_client *client)
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
-	return lm75_generic_probe(dev, client->name, i2c_get_match_data(client),
+	return lm75_generic_probe(dev, client->name, (uintptr_t)i2c_get_match_data(client),
 				  client->irq, regmap);
 }
 
@@ -751,6 +825,37 @@ static const struct i2c_device_id lm75_i2c_ids[] = {
 };
 MODULE_DEVICE_TABLE(i2c, lm75_i2c_ids);
 
+struct lm75_i3c_device {
+	enum lm75_type type;
+	const char *name;
+};
+
+static const struct lm75_i3c_device lm75_i3c_p3t1755 = {
+	.name = "p3t1755",
+	.type = p3t1755,
+};
+
+static const struct i3c_device_id lm75_i3c_ids[] = {
+	I3C_DEVICE(0x011b, 0x152a, &lm75_i3c_p3t1755),
+	{ /* LIST END */ }
+};
+MODULE_DEVICE_TABLE(i3c, lm75_i3c_ids);
+
+static int lm75_i3c_probe(struct i3c_device *i3cdev)
+{
+	struct device *dev = i3cdev_to_dev(i3cdev);
+	const struct lm75_i3c_device *id_data;
+	struct regmap *regmap;
+
+	regmap = devm_regmap_init(dev, &lm75_i3c_regmap_bus, i3cdev, &lm75_regmap_config);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	id_data = i3c_device_match_id(i3cdev, lm75_i3c_ids)->data;
+
+	return lm75_generic_probe(dev, id_data->name, id_data->type, 0, regmap);
+}
+
 static const struct of_device_id __maybe_unused lm75_of_match[] = {
 	{
 		.compatible = "adi,adt75",
@@ -1009,7 +1114,15 @@ static struct i2c_driver lm75_i2c_driver = {
 	.address_list	= normal_i2c,
 };
 
-module_i2c_driver(lm75_i2c_driver);
+static struct i3c_driver lm75_i3c_driver = {
+	.driver = {
+		.name = "lm75_i3c",
+	},
+	.probe = lm75_i3c_probe,
+	.id_table = lm75_i3c_ids,
+};
+
+module_i3c_i2c_driver(lm75_i3c_driver, &lm75_i2c_driver)
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
 MODULE_DESCRIPTION("LM75 driver");
-- 
2.54.0



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

* [PATCH 6.1.y-cip 23/23] hwmon: (lm75) Fix I3C transfer buffer pointer for incoming data
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (21 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 22/23] hwmon: (lm75) add I3C support for P3T1755 Tommaso Merciai
@ 2026-07-17 13:12 ` Tommaso Merciai
  2026-07-20 20:14 ` [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Pavel Machek
  23 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-17 13:12 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
  Cc: Biju Das, Lad Prabhakar, tomm.merciai

From: Jarkko Nikula <jarkko.nikula@linux.intel.com>

commit 0ddce5549012a3f3b9ddcf59822aa0d1be61e8e8 upstream.

Use the I3C private transfer input buffer pointer for incoming data
instead of output buffer. For now this is harmless since both of those
pointers are union members but may confuse when reading the code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20250513111739.508886-1-jarkko.nikula@linux.intel.com
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/hwmon/lm75.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index f755ed62c112..3e4d501ce316 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -623,7 +623,7 @@ static int lm75_i3c_reg_read(void *context, unsigned int reg, unsigned int *val)
 		{
 			.rnw = true,
 			.len = 2,
-			.data.out = data->val_buf,
+			.data.in = data->val_buf,
 		},
 	};
 	int ret;
-- 
2.54.0



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

* Re: [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support
  2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
                   ` (22 preceding siblings ...)
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 23/23] hwmon: (lm75) Fix I3C transfer buffer pointer for incoming data Tommaso Merciai
@ 2026-07-20 20:14 ` Pavel Machek
  2026-07-21 10:29   ` Tommaso Merciai
  23 siblings, 1 reply; 28+ messages in thread
From: Pavel Machek @ 2026-07-20 20:14 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das, Lad Prabhakar,
	tomm.merciai

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

hi!

> This series adds p3t1085 and p3t1755 i3c sensors support into linux-6.1.y-cip
> kernel.

I see support being added, but not being used. Could you provide some
background information?

Anyway, I'll have some minor comments here, but those should be fixed
in mainline, first, so they should not block the merge.

This looks okay to me.

Reviewed-by: Pavel Machek <pavel@nabladev.com>

I can apply the series if it passes testing and there are no other
comments.

Best regards,
									Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config Tommaso Merciai
@ 2026-07-20 20:14   ` Pavel Machek
  0 siblings, 0 replies; 28+ messages in thread
From: Pavel Machek @ 2026-07-20 20:14 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das, Lad Prabhakar,
	tomm.merciai

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

Hi!

> From: Abdel Alkuor <alkuor@gmail.com>
> 
> commit 8249a0e25dd2972e919a2552425bf4faa2581d24 upstream.
> 
> Set tmp112 conversion rate to 8 HZ and 12-bit mode.
> 
> Fixes: 35cd18048542 ("hwmon: (lm75) Aproximate sample times to data-sheet values")
> Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> Link: https://lore.kernel.org/r/20240106030254.384963-1-alkuor@gmail.com
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
>  drivers/hwmon/lm75.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
> index f6e16dfa11c5..5eba180b66a0 100644
> --- a/drivers/hwmon/lm75.c
> +++ b/drivers/hwmon/lm75.c
> @@ -270,8 +270,9 @@ static const struct lm75_params device_params[] = {
>  		.resolutions = (u8 []) {9, 10, 11, 12 },
>  	},
>  	[tmp112] = {
> -		.set_mask = 3 << 5,	/* 8 samples / second */
> -		.clr_mask = 1 << 7,	/* no one-shot mode*/
> +		.config_reg_16bits = true,
> +		.set_mask = 0x60C0,	/* 12-bit mode, 8 samples / second */
> +		.clr_mask = 1 << 15,	/* no one-shot mode*/

I would not mind space before "*/". But not your code and not your
patch...

Best regards,
								Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
  2026-07-17 13:12 ` [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
@ 2026-07-20 20:15   ` Pavel Machek
  0 siblings, 0 replies; 28+ messages in thread
From: Pavel Machek @ 2026-07-20 20:15 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das, Lad Prabhakar,
	tomm.merciai

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

Hi!

> From: Frank Li <Frank.Li@nxp.com>
> 
> commit 4585580781d69d8627e15f027873e46282ea3787 upstream.
> 
> The register layout of P3T1085 is the same as ti,tmp108. Add compatible
> string nxp,p3t1085 for it. The difference of P3T1085 is support I3C.

> +++ b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
> @@ -4,22 +4,26 @@
>  $id: http://devicetree.org/schemas/hwmon/ti,tmp108.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: TMP108 temperature sensor
> +title: TMP108/P3T1085(NXP) temperature sensor
>  
>  maintainers:
>    - Krzysztof Kozlowski <krzk@kernel.org>
>  
>  description: |
> -  The TMP108 is a digital-output temperature sensor with a
> +  The TMP108/P3T1085(NXP) is a digital-output temperature sensor with a
>    dynamically-programmable limit window, and under- and overtemperature
>    alert functions.
>  
> +  P3T1085(NXP) support I3C.

I believe this should be "supports".

Best regards,
									Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support
  2026-07-20 20:14 ` [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Pavel Machek
@ 2026-07-21 10:29   ` Tommaso Merciai
  0 siblings, 0 replies; 28+ messages in thread
From: Tommaso Merciai @ 2026-07-21 10:29 UTC (permalink / raw)
  To: Pavel Machek
  Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai

Hi Pavel,
Thanks for your review.

On 7/20/26 22:14, Pavel Machek wrote:
> hi!
> 
>> This series adds p3t1085 and p3t1755 i3c sensors support into linux-6.1.y-cip
>> kernel.
> 
> I see support being added, but not being used. Could you provide some
> background information?


I3C devices support DAA (Dynamic Address Assignment), so once the driver
is enabled at defconfig level, the controller will discover and bind 
them automatically, no static device node is required in the DT.

On RZ/G3E we already have I3C enabled [1], once the driver probes, it
finds the right devices via DAA.

Some results from testing after enabling the following defconfigs:

CONFIG_I3C=m
CONFIG_RENESAS_I3C=m
CONFIG_SENSORS_TMP108=m
CONFIG_SENSORS_LM75=m
CONFIG_THERMAL=y
CONFIG_THERMAL_HWMON=y

root@smarc-rzg3e:~# cat /proc/interrupts | grep i3c
146:         11          0          0          0     GICv3 709 Edge 
i3c-resp
147:          0          0          0          0     GICv3 712 Edge 
i3c-rx
148:          0          0          0          0     GICv3 713 Edge 
i3c-tx
149:          0          0          0          0     GICv3 721 Level 
i3c-start
150:          0          0          0          0     GICv3 722 Level 
i3c-stop
151:          0          0          0          0     GICv3 724 Level 
i3c-tend
152:          0          0          0          0     GICv3 725 Level 
i3c-nack
root@smarc-rzg3e:~# cat /sys/class/hwmon/*/temp1_input
29443
root@smarc-rzg3e:~# uname -a
Linux smarc-rzg3e 6.1.175-cip57-00064-g14df706f84ef #17 SMP PREEMPT Fri 
Jul 17 12:14:21 CEST 2026 aarch64 GNU/Linux


root@smarc-rzg3e:~# cat /proc/interrupts | grep i3c
146:         11          0          0          0     GICv3 709 Edge 
i3c-resp
147:          0          0          0          0     GICv3 712 Edge 
i3c-rx
148:          0          0          0          0     GICv3 713 Edge 
i3c-tx
149:          0          0          0          0     GICv3 721 Level 
i3c-start
150:          0          0          0          0     GICv3 722 Level 
i3c-stop
151:          0          0          0          0     GICv3 724 Level 
i3c-tend
152:          0          0          0          0     GICv3 725 Level 
i3c-nack
root@smarc-rzg3e:~# cat /sys/class/hwmon/*/temp1_input
33456

root@smarc-rzg3e:~# uname -a
Linux smarc-rzg3e 6.12.95-cip27-00043-g6eb147c1a999 #10 SMP PREEMPT Fri 
Jul 17 15:20:19 CEST 2026 aarch64 GNU/Linux

I will create also MR for [2] and [3].

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/tree/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi?h=linux-6.1.y-cip#n135
[2] 
https://gitlab.com/cip-project/cip-kernel/cip-kernel-config/-/blob/master/6.1.y-cip/arm64/renesas_defconfig?ref_type=heads
[3] 
https://gitlab.com/cip-project/cip-kernel/cip-kernel-config/-/blob/master/6.12.y-cip/arm64/renesas_defconfig?ref_type=heads

Kind Regards,
Tommaso

> 
> Anyway, I'll have some minor comments here, but those should be fixed
> in mainline, first, so they should not block the merge.
> 
> This looks okay to me.
> 
> Reviewed-by: Pavel Machek <pavel@nabladev.com>
> 
> I can apply the series if it passes testing and there are no other
> comments.
> 
> Best regards,
> 									Pavel



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

end of thread, other threads:[~2026-07-21 10:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 13:12 [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 01/23] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 02/23] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
2026-07-20 20:15   ` Pavel Machek
2026-07-17 13:12 ` [PATCH 6.1.y-cip 03/23] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 04/23] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 05/23] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 06/23] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 07/23] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 08/23] dt-bindings: hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 09/23] dt-bindings: hwmon: lm75: use common hwmon schema Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 10/23] dt-bindings: hwmon: lm75: Add NXP P3T1755 Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 11/23] hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 12/23] hwmon: (lm75) remove now-unused include Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 13/23] hwmon: (lm75) Add AMS AS6200 temperature sensor Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 14/23] hwmon: (lm75) Fix tmp112 default config Tommaso Merciai
2026-07-20 20:14   ` Pavel Machek
2026-07-17 13:12 ` [PATCH 6.1.y-cip 15/23] hwmon: (lm75) Remove use of i2c_match_id() Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 16/23] hwmon: (lm75) Add NXP P3T1755 support Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 17/23] hwmon: (lm75) Hide register size differences in regmap access functions Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 18/23] hwmon: (lm75) simplify lm75_write_config() Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 19/23] hwmon: (lm75) simplify regulator handling Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 20/23] hwmon: (lm75) Remove superfluous 'client' member from private struct Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 21/23] hwmon: (lm75) separate probe into common and I2C parts Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 22/23] hwmon: (lm75) add I3C support for P3T1755 Tommaso Merciai
2026-07-17 13:12 ` [PATCH 6.1.y-cip 23/23] hwmon: (lm75) Fix I3C transfer buffer pointer for incoming data Tommaso Merciai
2026-07-20 20:14 ` [PATCH 6.1.y-cip 00/23] Add p3t1085 and p3t1755 support Pavel Machek
2026-07-21 10:29   ` Tommaso Merciai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox