* [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
2026-07-31 11:30 [PATCH v4 0/3] hwmon: emc1403: Convert to use OF bindings and add regulator support Svyatoslav Ryhel
@ 2026-07-31 11:30 ` Svyatoslav Ryhel
2026-08-11 13:40 ` Rob Herring (Arm)
2026-08-11 15:56 ` Guenter Roeck
2026-07-31 11:30 ` [PATCH v4 2/3] hwmon: (emc1403) Convert to use OF bindings Svyatoslav Ryhel
2026-07-31 11:30 ` [PATCH v4 3/3] hwmon: (emc1403) Add regulator support Svyatoslav Ryhel
2 siblings, 2 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-07-31 11:30 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Svyatoslav Ryhel
Cc: linux-hwmon, devicetree, linux-kernel
Document the basic hardware layout of SMSC (now Microchip)
EMC1402/1403/1404/1428 thermal sensors.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../bindings/hwmon/smsc,emc1403.yaml | 203 ++++++++++++++++++
1 file changed, 203 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
diff --git a/Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml b/Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
new file mode 100644
index 0000000000000..d7873a37c3295
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
@@ -0,0 +1,203 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/smsc,emc1403.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SMSC EMC1402/1403/1404/1428 thermal sensors
+
+maintainers:
+ - Svyatoslav Ryhel <clamor95@gmail.com>
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - smsc,emc1402
+ - smsc,emc1403
+ - smsc,emc1404
+ - smsc,emc1428
+
+ - items:
+ - enum:
+ - smsc,emc1412
+ - smsc,emc1422
+ - smsc,emc1442
+ - const: smsc,emc1402
+
+ - items:
+ - enum:
+ - smsc,emc1413
+ - smsc,emc1423
+ - const: smsc,emc1403
+
+ - items:
+ - enum:
+ - smsc,emc1414
+ - smsc,emc1424
+ - const: smsc,emc1404
+
+ - items:
+ - enum:
+ - smsc,emc1438
+ - const: smsc,emc1428
+
+ interrupts:
+ items:
+ - description: Sensors "ALERT" pin output.
+
+ reg:
+ maxItems: 1
+
+ "#thermal-sensor-cells":
+ const: 1
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ vdd-supply: true
+
+required:
+ - compatible
+ - reg
+
+patternProperties:
+ "^channel@([0-7])$":
+ type: object
+ description: Represents channels of the device and their specific configuration.
+
+ properties:
+ reg:
+ description: The channel number. 0 is local channel, 1-7 are remote channels.
+ items:
+ minimum: 0
+ maximum: 7
+
+ label:
+ description: A descriptive name for this channel, like "ambient" or "psu".
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - smsc,emc1402
+ then:
+ patternProperties:
+ "^channel@([0-7])$":
+ properties:
+ reg:
+ items:
+ maximum: 1
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - smsc,emc1403
+ then:
+ patternProperties:
+ "^channel@([0-7])$":
+ properties:
+ reg:
+ items:
+ maximum: 2
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - smsc,emc1404
+ then:
+ patternProperties:
+ "^channel@([0-7])$":
+ properties:
+ reg:
+ items:
+ maximum: 3
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor@4c {
+ compatible = "smsc,emc1412", "smsc,emc1402";
+ reg = <0x4c>;
+
+ interrupt-parent = <&gpio>;
+ interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
+
+ vdd-supply = <&vdd_3v3_sys>;
+ #thermal-sensor-cells = <1>;
+ };
+ };
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sensor@29 {
+ compatible = "smsc,emc1428";
+ reg = <0x29>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ channel@0 {
+ reg = <0x0>;
+ label = "local";
+ };
+
+ channel@1 {
+ reg = <0x1>;
+ label = "chan1";
+ };
+
+ channel@2 {
+ reg = <0x2>;
+ label = "chan2";
+ };
+
+ channel@3 {
+ reg = <0x3>;
+ label = "chan3";
+ };
+
+ channel@4 {
+ reg = <0x4>;
+ label = "chan4";
+ };
+
+ channel@5 {
+ reg = <0x5>;
+ label = "chan5";
+ };
+
+ channel@6 {
+ reg = <0x6>;
+ label = "chan6";
+ };
+
+ channel@7 {
+ reg = <0x7>;
+ label = "chan7";
+ };
+ };
+ };
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
2026-07-31 11:30 ` [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428 Svyatoslav Ryhel
@ 2026-08-11 13:40 ` Rob Herring (Arm)
2026-08-11 15:56 ` Guenter Roeck
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2026-08-11 13:40 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Krzysztof Kozlowski, linux-hwmon, Conor Dooley, Guenter Roeck,
devicetree, linux-kernel
On Fri, 31 Jul 2026 14:30:05 +0300, Svyatoslav Ryhel wrote:
> Document the basic hardware layout of SMSC (now Microchip)
> EMC1402/1403/1404/1428 thermal sensors.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
> .../bindings/hwmon/smsc,emc1403.yaml | 203 ++++++++++++++++++
> 1 file changed, 203 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
2026-07-31 11:30 ` [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428 Svyatoslav Ryhel
2026-08-11 13:40 ` Rob Herring (Arm)
@ 2026-08-11 15:56 ` Guenter Roeck
1 sibling, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2026-08-11 15:56 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
devicetree, linux-kernel
On Fri, Jul 31, 2026 at 02:30:05PM +0300, Svyatoslav Ryhel wrote:
> Document the basic hardware layout of SMSC (now Microchip)
> EMC1402/1403/1404/1428 thermal sensors.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 2/3] hwmon: (emc1403) Convert to use OF bindings
2026-07-31 11:30 [PATCH v4 0/3] hwmon: emc1403: Convert to use OF bindings and add regulator support Svyatoslav Ryhel
2026-07-31 11:30 ` [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428 Svyatoslav Ryhel
@ 2026-07-31 11:30 ` Svyatoslav Ryhel
2026-08-11 15:56 ` Guenter Roeck
2026-07-31 11:30 ` [PATCH v4 3/3] hwmon: (emc1403) Add regulator support Svyatoslav Ryhel
2 siblings, 1 reply; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-07-31 11:30 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Svyatoslav Ryhel
Cc: linux-hwmon, devicetree, linux-kernel
From: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Add OF match compatible table to be able to use this driver with Device
Trees.
Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/hwmon/emc1403.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index cd753b38709f2..8b3173da25973 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -659,14 +659,14 @@ static int emc1403_probe(struct i2c_client *client)
{
struct thermal_data *data;
struct device *hwmon_dev;
- const struct i2c_device_id *id = i2c_match_id(emc1403_idtable, client);
data = devm_kzalloc(&client->dev, sizeof(struct thermal_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;
- data->chip = id->driver_data;
+ data->chip = (uintptr_t)i2c_get_match_data(client);
+
data->regmap = devm_regmap_init_i2c(client, &emc1403_regmap_config);
if (IS_ERR(data->regmap))
return PTR_ERR(data->regmap);
@@ -682,10 +682,20 @@ static const unsigned short emc1403_address_list[] = {
0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
};
+static const struct of_device_id emc1403_of_match[] = {
+ { .compatible = "smsc,emc1402", .data = (void *)emc1402 },
+ { .compatible = "smsc,emc1403", .data = (void *)emc1403 },
+ { .compatible = "smsc,emc1404", .data = (void *)emc1404 },
+ { .compatible = "smsc,emc1428", .data = (void *)emc1428 },
+ { }
+};
+MODULE_DEVICE_TABLE(of, emc1403_of_match);
+
static struct i2c_driver sensor_emc1403 = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "emc1403",
+ .of_match_table = emc1403_of_match,
},
.detect = emc1403_detect,
.probe = emc1403_probe,
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v4 2/3] hwmon: (emc1403) Convert to use OF bindings
2026-07-31 11:30 ` [PATCH v4 2/3] hwmon: (emc1403) Convert to use OF bindings Svyatoslav Ryhel
@ 2026-08-11 15:56 ` Guenter Roeck
0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2026-08-11 15:56 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
devicetree, linux-kernel
On Fri, Jul 31, 2026 at 02:30:06PM +0300, Svyatoslav Ryhel wrote:
> From: Jonas Schwöbel <jonasschwoebel@yahoo.de>
>
> Add OF match compatible table to be able to use this driver with Device
> Trees.
>
> Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 3/3] hwmon: (emc1403) Add regulator support
2026-07-31 11:30 [PATCH v4 0/3] hwmon: emc1403: Convert to use OF bindings and add regulator support Svyatoslav Ryhel
2026-07-31 11:30 ` [PATCH v4 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428 Svyatoslav Ryhel
2026-07-31 11:30 ` [PATCH v4 2/3] hwmon: (emc1403) Convert to use OF bindings Svyatoslav Ryhel
@ 2026-07-31 11:30 ` Svyatoslav Ryhel
2026-08-11 15:57 ` Guenter Roeck
2 siblings, 1 reply; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-07-31 11:30 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Svyatoslav Ryhel
Cc: linux-hwmon, devicetree, linux-kernel
Add support for VDD power supply for this sensor. It is required on some
devices for the sensor to start up and work properly.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/hwmon/emc1403.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 8b3173da25973..a0f8d29eb6c76 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -18,6 +18,7 @@
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#include <linux/util_macros.h>
#define THERMAL_PID_REG 0xfd
@@ -659,6 +660,12 @@ static int emc1403_probe(struct i2c_client *client)
{
struct thermal_data *data;
struct device *hwmon_dev;
+ int ret;
+
+ ret = devm_regulator_get_enable(&client->dev, "vdd");
+ if (ret)
+ return dev_err_probe(&client->dev, ret,
+ "Failed to enable regulator\n");
data = devm_kzalloc(&client->dev, sizeof(struct thermal_data),
GFP_KERNEL);
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v4 3/3] hwmon: (emc1403) Add regulator support
2026-07-31 11:30 ` [PATCH v4 3/3] hwmon: (emc1403) Add regulator support Svyatoslav Ryhel
@ 2026-08-11 15:57 ` Guenter Roeck
0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2026-08-11 15:57 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
devicetree, linux-kernel
On Fri, Jul 31, 2026 at 02:30:07PM +0300, Svyatoslav Ryhel wrote:
> Add support for VDD power supply for this sensor. It is required on some
> devices for the sensor to start up and work properly.
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 8+ messages in thread