All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v5 5/5] hwmon: Add support for Amphenol ChipCap 2
Date: Thu, 18 Jan 2024 13:49:55 +0000	[thread overview]
Message-ID: <226d3abd-e372-4c66-b2b0-cc86e6a4bb27@sirena.org.uk> (raw)
In-Reply-To: <20240115-topic-chipcap2-v5-5-0cc7a15aeece@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]

On Mon, Jan 15, 2024 at 09:02:25PM +0100, Javier Carrasco wrote:

> +static int cc2_enable(struct cc2_data *data)
> +{
> +	int ret;
> +
> +	if (regulator_is_enabled(data->regulator))
> +		return 0;

This is generally a sign that the regulator API usage is not good, the
driver should not rely on references to the regulator held by anything
else since whatever else is holding the regulator on could turn it off
at any time.  If the driver did the enable itself then it should know
that it did so and not need to query.

> +	ret = regulator_enable(data->regulator);
> +	if (ret < 0)
> +		return ret;
> +
> +	/*
> +	 * TODO: the startup-delay-us property of the regulator might be
> +	 * added to the delay (if provided).
> +	 * Currently there is no interface to read its value apart from
> +	 * a direct access to regulator->rdev->constraints->enable_time,
> +	 * which is discouraged like any direct access to the regulator_dev
> +	 * structure. This would be relevant in cases where the startup delay
> +	 * is in the range of milliseconds.
> +	 */
> +	usleep_range(CC2_STARTUP_TIME_US, CC2_STARTUP_TIME_US + 125);

Note that the regulator startup delay is the time taken for the
regulator to power up so if the device needs additional delay then that
will always need to be in addition to whatever the regulator is doing.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-01-18 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 20:02 [PATCH v5 0/5] hwmon: Add support for Amphenol ChipCap 2 Javier Carrasco
2024-01-15 20:02 ` [PATCH v5 1/5] dt-bindings: vendor-prefixes: add Amphenol Javier Carrasco
2024-01-15 20:02 ` [PATCH v5 2/5] hwmon: (core) Add support for humidity min/max alarm Javier Carrasco
2024-01-15 20:02 ` [PATCH v5 3/5] ABI: sysfs-class-hwmon: add descriptions for humidity min/max alarms Javier Carrasco
2024-01-15 20:02 ` [PATCH v5 4/5] dt-bindings: hwmon: Add Amphenol ChipCap 2 Javier Carrasco
2024-01-15 20:02 ` [PATCH v5 5/5] hwmon: Add support for " Javier Carrasco
2024-01-18 13:49   ` Mark Brown [this message]
2024-01-18 15:30     ` Javier Carrasco
2024-01-18 16:04       ` Mark Brown
2024-01-18 16:37         ` Javier Carrasco

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=226d3abd-e372-4c66-b2b0-cc86e6a4bb27@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.