* [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding
@ 2024-02-19 13:11 Marco Felsch
2024-02-19 13:11 ` [PATCH v2 2/2] iio: temperature: tmp117: add support for vcc-supply Marco Felsch
2024-02-24 16:05 ` [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Jonathan Cameron
0 siblings, 2 replies; 3+ messages in thread
From: Marco Felsch @ 2024-02-19 13:11 UTC (permalink / raw)
To: puranjay12, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
conor+dt
Cc: linux-iio, devicetree, linux-kernel, kernel
From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Add the binding to specify the vcc supply. We can't make it required
since this would break the backward compatibility.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
v2:
- mark vcc-supply as required
.../devicetree/bindings/iio/temperature/ti,tmp117.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
index 8c6d7735e875..33f2e9c5bd81 100644
--- a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
+++ b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
@@ -24,9 +24,13 @@ properties:
reg:
maxItems: 1
+ vcc-supply:
+ description: provide VCC power to the sensor.
+
required:
- compatible
- reg
+ - vcc-supply
additionalProperties: false
@@ -39,5 +43,6 @@ examples:
tmp117@48 {
compatible = "ti,tmp117";
reg = <0x48>;
+ vcc-supply = <&pmic_reg_3v3>;
};
};
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] iio: temperature: tmp117: add support for vcc-supply
2024-02-19 13:11 [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Marco Felsch
@ 2024-02-19 13:11 ` Marco Felsch
2024-02-24 16:05 ` [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Marco Felsch @ 2024-02-19 13:11 UTC (permalink / raw)
To: puranjay12, jic23, lars, robh+dt, krzysztof.kozlowski+dt,
conor+dt
Cc: linux-iio, devicetree, linux-kernel, kernel
From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Add support to specify the VCC supply which is required to power the
device. According the datasheet 7.3.1 Power Up, the device needs 1.5ms
after the supply voltage reaches the operating range before the
communcation can begin.
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
v2:
- add fsleep() after powering the device
drivers/iio/temperature/tmp117.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
index 059953015ae7..8972083d903a 100644
--- a/drivers/iio/temperature/tmp117.c
+++ b/drivers/iio/temperature/tmp117.c
@@ -9,6 +9,7 @@
* Note: This driver assumes that the sensor has been calibrated beforehand.
*/
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
@@ -17,6 +18,7 @@
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/property.h>
+#include <linux/regulator/consumer.h>
#include <linux/iio/iio.h>
@@ -148,10 +150,17 @@ static int tmp117_probe(struct i2c_client *client)
struct tmp117_data *data;
struct iio_dev *indio_dev;
int dev_id;
+ int ret;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
return -EOPNOTSUPP;
+ ret = devm_regulator_get_enable(&client->dev, "vcc");
+ if (ret)
+ return ret;
+
+ fsleep(1500);
+
dev_id = i2c_smbus_read_word_swapped(client, TMP117_REG_DEVICE_ID);
if (dev_id < 0)
return dev_id;
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding
2024-02-19 13:11 [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Marco Felsch
2024-02-19 13:11 ` [PATCH v2 2/2] iio: temperature: tmp117: add support for vcc-supply Marco Felsch
@ 2024-02-24 16:05 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-02-24 16:05 UTC (permalink / raw)
To: Marco Felsch
Cc: puranjay12, lars, robh+dt, krzysztof.kozlowski+dt, conor+dt,
linux-iio, devicetree, linux-kernel, kernel
On Mon, 19 Feb 2024 14:11:13 +0100
Marco Felsch <m.felsch@pengutronix.de> wrote:
> From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
>
> Add the binding to specify the vcc supply. We can't make it required
> since this would break the backward compatibility.
>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Series applied to the togreg branch of iio.git and pushed out as testing
for 0-day to see if it can find anything we missed.
Jonathan
> ---
> v2:
> - mark vcc-supply as required
>
> .../devicetree/bindings/iio/temperature/ti,tmp117.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
> index 8c6d7735e875..33f2e9c5bd81 100644
> --- a/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
> +++ b/Documentation/devicetree/bindings/iio/temperature/ti,tmp117.yaml
> @@ -24,9 +24,13 @@ properties:
> reg:
> maxItems: 1
>
> + vcc-supply:
> + description: provide VCC power to the sensor.
> +
> required:
> - compatible
> - reg
> + - vcc-supply
>
> additionalProperties: false
>
> @@ -39,5 +43,6 @@ examples:
> tmp117@48 {
> compatible = "ti,tmp117";
> reg = <0x48>;
> + vcc-supply = <&pmic_reg_3v3>;
> };
> };
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-24 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-19 13:11 [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Marco Felsch
2024-02-19 13:11 ` [PATCH v2 2/2] iio: temperature: tmp117: add support for vcc-supply Marco Felsch
2024-02-24 16:05 ` [PATCH v2 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox