Skip to contentSkip to conversation

iio: temperature: ltc2983: small improvements

PATCH Applied Nuno Sa 2 participants 4 messages Apr 4, 2024 – Apr 6, 2024

Subsystems (4)
lore
Share & tools
lore

Nuno Sa

author maintainer
#0 lore raw

v5 cover iio: temperature: ltc2983: small improvements

Hi Jonathan,

As suggested by you, v5 only has the regulator stuff. I'll send another series for the new dev_errp_helper().

---
Changes in v5:
- Dropped patches 1,2,5 and 6.
- Link to v4: https://lore.kernel.org/all/[email protected]/

---
Nuno Sa (2):
dt-bindings: iio: temperature: ltc2983: document power supply
iio: temperature: ltc2983: support vdd regulator

 Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 4 ++++
 drivers/iio/temperature/ltc2983.c                                  | 5 +++++
 2 files changed, 9 insertions(+)

---
base-commit: 6020ca4de8e5404b20f15a6d9873cd6eb5f6d8d6
change-id: 20240222-ltc2983-misc-improv-1c7a78ece93f --

Thanks!
- Nuno Sá

author maintainer
#1 lore raw

PATCH v5 1/2 dt-bindings: iio: temperature: ltc2983: document power supply

Add a property for the VDD power supply regulator.

---
 Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +4 -0
index dbb85135fd66..312febeeb3bb 100644
@@ -57,6 +57,8 @@ properties:
   interrupts:
     maxItems: 1
 
+  vdd-supply: true
+
   adi,mux-delay-config-us:
     description: |
       Extra delay prior to each conversion, in addition to the internal 1ms
@@ -460,6 +462,7 @@ required:
   - compatible
   - reg
   - interrupts
+  - vdd-supply
 
 additionalProperties: false
 
@@ -489,6 +492,7 @@ examples:
             #address-cells = <1>;
             #size-cells = <0>;
 
+            vdd-supply = <&supply>;
             interrupts = <20 IRQ_TYPE_EDGE_RISING>;
             interrupt-parent = <&gpio>;
 
Signature · 1 line
2.44.0
author maintainer
#2 lore raw

PATCH v5 2/2 iio: temperature: ltc2983: support vdd regulator

In reply to Nuno Sa

Add support for the power supply regulator.

---
 drivers/iio/temperature/ltc2983.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/iio/temperature/ltc2983.c +5 -0
index 3c4524d57b8e..24d19f3c7292 100644
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
 #include <asm/byteorder.h>
@@ -1597,6 +1598,10 @@ static int ltc2983_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
+	ret = devm_regulator_get_enable(&spi->dev, "vdd");
+	if (ret)
+		return ret;
+
 	gpio = devm_gpiod_get_optional(&st->spi->dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(gpio))
 		return PTR_ERR(gpio);
Signature · 1 line
2.44.0
maintainer Applied
#3 lore raw
In reply to Nuno Sa
Quoted 4 lines · On Thu, 4 Apr 2024 10:58:16 +0200 Nuno Sa <[email protected]> wrote:

Hi Jonathan,

As suggested by you, v5 only has the regulator stuff. I'll send another series for the new dev_errp_helper().

Applied.

Thanks,

Jonathan

Quoted 22 lines

---
Changes in v5:
- Dropped patches 1,2,5 and 6.
- Link to v4: https://lore.kernel.org/all/[email protected]/

---
Nuno Sa (2):
dt-bindings: iio: temperature: ltc2983: document power supply
iio: temperature: ltc2983: support vdd regulator

 Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 4 ++++
 drivers/iio/temperature/ltc2983.c                                  | 5 +++++
 2 files changed, 9 insertions(+)

---
base-commit: 6020ca4de8e5404b20f15a6d9873cd6eb5f6d8d6
change-id: 20240222-ltc2983-misc-improv-1c7a78ece93f --

Thanks!
- Nuno Sá