hwmon: emc1403: Convert to use OF bindings and add regulator support
Subsystems (2)
v3 cover hwmon: emc1403: Convert to use OF bindings and add regulator support
Document, add OF and regulator support to EMC14XX thermal sensor family.
Schema file was separated from LM90 since according to Guenter Roeck[1] these sensors are incompatible with LM90. Proposed schema has basic hardware description. All registers Guenter Roeck mentioned may be added later on, when/if driver would need to work with them. As for now driver successfully works as is.
[1] https://lore.kernel.org/lkml/[email protected]/
---
Changes in v2:
- schema separated into a dedicated file
- dropped chip id check
- fixed match data casting
- adjusted regulator name
Changes in v3:
- fixed number on channels for sensors in schema
---
Jonas Schwöbel (1):
hwmon: (emc1403) Convert to use OF bindings
Svyatoslav Ryhel (2):
dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
hwmon: (emc1403) Add regulator support
.../bindings/hwmon/smsc,emc1403.yaml | 203 ++++++++++++++++++ drivers/hwmon/emc1403.c | 23 +- 2 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
Signature · 1 line
2.53.0
PATCH v3 1/3 dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
Document the basic hardware layout of SMSC (now Microchip) EMC1402/1403/1404/1428 thermal sensors.
--- .../bindings/hwmon/smsc,emc1403.yaml | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml
Documentation/devicetree/bindings/hwmon/smsc,emc1403.yaml new file +203 -0
@@ -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 <[email protected]> + +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"; + }; + }; + };
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v3 1/3] dt-bindings: hwmon: Document SMSC EMC1402/1403/1404/1428
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 4 lines
Document the basic hardware layout of SMSC (now Microchip) EMC1402/1403/1404/1428 thermal sensors.
Signed-off-by Svyatoslav Ryhel <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v3 2/3 hwmon: (emc1403) Convert to use OF bindings
In reply to Svyatoslav RyhelFrom: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
--- drivers/hwmon/emc1403.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/hwmon/emc1403.c +14 -2
@@ -16,6 +16,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> +#include <linux/mod_devicetable.h> #include <linux/sysfs.h> #include <linux/regmap.h> #include <linux/util_macros.h>
@@ -659,14 +660,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 +683,21 @@ 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,
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
In reply to Svyatoslav RyhelHello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Please put your S-o-b line last.
drivers/hwmon/emc1403.c line 19
Quoted 13 lines
--- drivers/hwmon/emc1403.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)drivers/hwmon/emc1403.c +1
-0@@ -16,6 +16,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> +#include <linux/mod_devicetable.h>
Don't add <linux/mod_devicetable.h> please. struct of_device_id is also provided by <linux/i2c.h> so adding <linux/mod_devicetable.h> isn't needed.
Quoted 5 lines
drivers/hwmon/emc1403.c +0
-0#include <linux/sysfs.h> #include <linux/regmap.h> #include <linux/util_macros.h>
drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 692
Quoted 10 lines
drivers/hwmon/emc1403.c +7
-0@@ -682,10 +683,21 @@ 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 }, + { } +
Unusual empty line here.
drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 695
Quoted 3 lines
drivers/hwmon/emc1403.c +3
-0+}; +MODULE_DEVICE_TABLE (of, emc1403_of_match); +
Best regards
Uwe
Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:
Quoted 6 lines
Hello,
Quoted 2 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Quoted 9 lines
Quoted 6 lines
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Please put your S-o-b line last.
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
Quoted 42 lines
drivers/hwmon/emc1403.c line 19
Quoted 13 lines
--- drivers/hwmon/emc1403.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)drivers/hwmon/emc1403.c +1
-0@@ -16,6 +16,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> +#include <linux/mod_devicetable.h> Don't add <
linux/mod_devicetable.h> please. structof_device_idis also provided by <linux/i2c.h> so adding <linux/mod_devicetable.h> isn't needed.Quoted 5 lines
drivers/hwmon/emc1403.c +0
-0#include <linux/sysfs.h> #include <linux/regmap.h> #include <linux/util_macros.h> drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 692
Quoted 10 lines
drivers/hwmon/emc1403.c +7
-0@@ -682,10 +683,21 @@ 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 }, + { } +Unusual empty line here.
drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 695
Quoted 3 lines
drivers/hwmon/emc1403.c +3
-0+}; +MODULE_DEVICE_TABLE (of, emc1403_of_match); +Best regards
Uwe
Guenter Roeck
maintainerRe: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
Quoted 15 lines · Svyatoslav Ryhel
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:Quoted 13 lines
Hello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Quoted 6 lines
Quoted 2 lines
Please put your S-o-b line last.
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
That refers to S-o-B, not to Reviewed-by: trailers.
Do we really have to argue about something like this ? Do I have to mandate the order of non-SoB trailers for this subsystem ?
Guenter
Quoted 42 lines
Quoted 42 lines
drivers/hwmon/emc1403.c line 19
Quoted 13 lines
--- drivers/hwmon/emc1403.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)drivers/hwmon/emc1403.c +1
-0@@ -16,6 +16,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> +#include <linux/mod_devicetable.h> Don't add <
linux/mod_devicetable.h> please. structof_device_idis also provided by <linux/i2c.h> so adding <linux/mod_devicetable.h> isn't needed.Quoted 5 lines
drivers/hwmon/emc1403.c +0
-0#include <linux/sysfs.h> #include <linux/regmap.h> #include <linux/util_macros.h> drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 692
Quoted 10 lines
drivers/hwmon/emc1403.c +7
-0@@ -682,10 +683,21 @@ 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 }, + { } +Unusual empty line here.
drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 695
Quoted 3 lines
drivers/hwmon/emc1403.c +3
-0+}; +MODULE_DEVICE_TABLE (of, emc1403_of_match); +Best regards
Uwe
Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
сб, 25 лип. 2026 р. о 17:23 Guenter Roeck <[email protected]> пише:
Quoted 20 lines · Svyatoslav Ryhel
Quoted 18 lines
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:Quoted 15 lines
Hello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Please put your S-o-b line last.
Quoted 7 lines
Quoted 3 lines
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
That refers to S-o-B, not to Reviewed-by: trailers.
Do we really have to argue about something like this ?
I am not arguing, looking for answers.
Quoted 2 lines
Do I have to mandate the order of non-SoB trailers for this subsystem ?
That actually may be a decent idea. In you have this stated strictly for subsystem or have a consensus on kernel level then you can just point a link to a documentation. Might simplify your maintainer work ;)
Quoted 45 lines
Guenter
Quoted 42 lines
Quoted 42 lines
drivers/hwmon/emc1403.c line 19
Quoted 13 lines
--- drivers/hwmon/emc1403.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)drivers/hwmon/emc1403.c +1
-0@@ -16,6 +16,7 @@#include <linux/hwmon.h> #include <linux/hwmon-sysfs.h> #include <linux/err.h> +#include <linux/mod_devicetable.h> Don't add <
linux/mod_devicetable.h> please. structof_device_idis also provided by <linux/i2c.h> so adding <linux/mod_devicetable.h> isn't needed.Quoted 5 lines
drivers/hwmon/emc1403.c +0
-0#include <linux/sysfs.h> #include <linux/regmap.h> #include <linux/util_macros.h> drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 692
Quoted 10 lines
drivers/hwmon/emc1403.c +7
-0@@ -682,10 +683,21 @@ 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 }, + { } +Unusual empty line here.
drivers/hwmon/emc1403.c static const unsigned short emc1403_address_list[] = { · line 695
Quoted 3 lines
drivers/hwmon/emc1403.c +3
-0+}; +MODULE_DEVICE_TABLE (of, emc1403_of_match); +Best regards
Uwe
Guenter Roeck
maintainerRe: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
Quoted 31 lines · Svyatoslav Ryhel
сб, 25 лип. 2026 р. о 17:23 Guenter Roeck <[email protected]> пише:
Quoted 20 lines · Svyatoslav Ryhel
Quoted 18 lines
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:Quoted 15 lines
Hello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Please put your S-o-b line last.
Quoted 7 lines
Quoted 3 lines
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
That refers to S-o-B, not to Reviewed-by: trailers.
Do we really have to argue about something like this ?
I am not arguing, looking for answers.
Quoted 8 lines
Quoted 2 lines
Do I have to mandate the order of non-SoB trailers for this subsystem ?
That actually may be a decent idea. In you have this stated strictly for subsystem or have a consensus on kernel level then you can just point a link to a documentation. Might simplify your maintainer work ;)
Up to now there used to be a common consensus, and it didn't seem necessary to specifically mandate anything but the Signed-off-by: order. Unfortunately, we live in a time where everyone deems it necessary to question everything. That doesn't just include the order of trailers. I even get buggy patches where the authors argue that "but this other driver has the same bug, so it should be ok to introduce it here as well".
No, I am not going to explicitly mandate the order of trailers. If I'd do that, people would just find something else to argue about. I'll keep doing what I have always been doing: The more pointless arguments, the lower my review priority.
Guenter
Re: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
In reply to Guenter RoeckQuoted 16 lines · Guenter Roeck
Quoted 15 lines · Svyatoslav Ryhel
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:Quoted 13 lines
Hello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Please put your S-o-b line last.
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
It's a nitpick, but as you added Guenter's tag, you modified the commit log and then your S-o-b has to be renewed.
Quoted 4 lines
That refers to S-o-B, not to Reviewed-by: trailers.
Do we really have to argue about something like this ? Do I have to mandate the order of non-SoB trailers for this subsystem ?
I wouldn't have replied just for the order, but I think it's convenient and usual to have the own S-o-b last.
Depends on you how strict you want to be here, as usual. I for my part ask for reordering or announce to fix the ordering if nothing else is in the way for application.
Best regards
Uwe
Guenter Roeck
maintainerRe: [PATCH v3 2/3] hwmon: (emc1403) Convert to use OF bindings
Quoted 31 lines · Uwe Kleine-König
Quoted 16 lines · Guenter Roeck
Quoted 15 lines · Svyatoslav Ryhel
чт, 23 лип. 2026 р. о 09:28 Uwe Kleine-König
<[email protected]> пише:Quoted 13 lines
Hello,
Quoted 8 lines · Svyatoslav Ryhel
From: Jonas Schwöbel <[email protected]>
Add OF match compatible table to be able to use this driver with Device Trees.
Signed-off-by Jonas Schwöbel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Please put your S-o-b line last.
If S-o-b's should be chronological, then this order is correct. Guenter added his reviewed-by after I have added my signed-off-by.
It's a nitpick, but as you added Guenter's tag, you modified the commit log and then your S-o-b has to be renewed.
Quoted 4 lines
That refers to S-o-B, not to Reviewed-by: trailers.
Do we really have to argue about something like this ? Do I have to mandate the order of non-SoB trailers for this subsystem ?
Quoted 7 lines
I wouldn't have replied just for the order, but I think it's convenient and usual to have the own S-o-b last.
Depends on you how strict you want to be here, as usual. I for my part ask for reordering or announce to fix the ordering if nothing else is in the way for application.
FWIW, my feedback wasn't directed at you.
Guenter
PATCH v3 3/3 hwmon: (emc1403) Add regulator support
In reply to Svyatoslav RyhelAdd support for VDD power supply for this sensor. It is required on some devices for the sensor to start up and work properly.
--- drivers/hwmon/emc1403.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/hwmon/emc1403.c +7 -0
@@ -19,6 +19,7 @@#include <linux/mod_devicetable.h> #include <linux/sysfs.h> #include <linux/regmap.h> +#include <linux/regulator/consumer.h> #include <linux/util_macros.h> #define THERMAL_PID_REG 0xfd
@@ -660,6 +661,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 );
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v3 3/3] hwmon: (emc1403) Add regulator support
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 4 lines
Add support for VDD power supply for this sensor. It is required on some devices for the sensor to start up and work properly.
Signed-off-by Svyatoslav Ryhel <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3