public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: puranjay12@gmail.com, lars@metafoo.de, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	thomas.haemmerle@leica-geosystems.com
Subject: Re: [RESEND PATCH 2/2] iio: temperature: tmp117: add support for vcc-supply
Date: Fri, 16 Feb 2024 11:29:10 +0000	[thread overview]
Message-ID: <20240216112910.4059a09b@jic23-huawei> (raw)
In-Reply-To: <20240216102820.1395815-2-m.felsch@pengutronix.de>

On Fri, 16 Feb 2024 11:28:20 +0100
Marco Felsch <m.felsch@pengutronix.de> wrote:

> From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
> 
> Add support to specify the VCC supply which is required to power the
> device.
> 
> Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Hi.

With power supply enables, the question that normally comes up is whether
the device takes significant time to become available after the power is
turned on.

I had a look at the datasheet but couldn't find clear language on
how long we need to wait before the device is usable following power up.
There is a number for reset of 1.5 msecs so I guess we could use that
safely?

Maybe no delay is fine for reading the device ID. I've no idea.
Sometimes we start with no delay and only end up adding one later when
people report issues.  We could do that here.

Jonathan

> ---
> Resend since I forgot to add the DT maintainers
> 
>  drivers/iio/temperature/tmp117.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
> index 059953015ae7..69328066811a 100644
> --- a/drivers/iio/temperature/tmp117.c
> +++ b/drivers/iio/temperature/tmp117.c
> @@ -17,6 +17,7 @@
>  #include <linux/kernel.h>
>  #include <linux/limits.h>
>  #include <linux/property.h>
> +#include <linux/regulator/consumer.h>
>  
>  #include <linux/iio/iio.h>
>  
> @@ -152,6 +153,10 @@ static int tmp117_probe(struct i2c_client *client)
>  	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;
> +
>  	dev_id = i2c_smbus_read_word_swapped(client, TMP117_REG_DEVICE_ID);
>  	if (dev_id < 0)
>  		return dev_id;


  reply	other threads:[~2024-02-16 11:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 10:28 [RESEND PATCH 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Marco Felsch
2024-02-16 10:28 ` [RESEND PATCH 2/2] iio: temperature: tmp117: add support for vcc-supply Marco Felsch
2024-02-16 11:29   ` Jonathan Cameron [this message]
2024-02-16 11:51     ` Marco Felsch
2024-02-16 11:21 ` [RESEND PATCH 1/2] dt-bindings: iio: ti,tmp117: add vcc supply binding Jonathan Cameron
2024-02-16 11:23   ` Marco Felsch
2024-02-16 15:50     ` Jonathan Cameron
2024-02-16 19:42   ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216112910.4059a09b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=puranjay12@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.haemmerle@leica-geosystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox