mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Saravanan Sekar <saravanan@linumiz.com>
Cc: jdelvare@suse.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, marten.lindahl@axis.com,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] hwmon: pm_bus: core: Add min_uV in pmbus regulator helper macro
Date: Thu, 29 Dec 2022 06:02:11 -0800	[thread overview]
Message-ID: <20221229140211.GA17976@roeck-us.net> (raw)
In-Reply-To: <20221207173716.123223-2-saravanan@linumiz.com>

On Wed, Dec 07, 2022 at 06:37:13PM +0100, Saravanan Sekar wrote:
> Some regulator operates in a range of voltage which should not allow
> below the lower threshold.
> 
> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>

Applied to hwmon-next.

> ---
>  drivers/hwmon/pmbus/ltc2978.c | 16 ++++++++--------
>  drivers/hwmon/pmbus/pmbus.h   |  5 +++--
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
> index 6d2592731ba3..406a36885ef3 100644
> --- a/drivers/hwmon/pmbus/ltc2978.c
> +++ b/drivers/hwmon/pmbus/ltc2978.c
> @@ -569,14 +569,14 @@ MODULE_DEVICE_TABLE(i2c, ltc2978_id);
>  #define LTC2978_N_VOLTAGES	((LTC2978_MAX_UV / LTC2978_UV_STEP) + 1)
>  
>  static const struct regulator_desc ltc2978_reg_desc[] = {
> -	PMBUS_REGULATOR_STEP("vout", 0, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 1, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 2, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 3, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 4, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 5, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 6, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> -	PMBUS_REGULATOR_STEP("vout", 7, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
> +	PMBUS_REGULATOR_STEP("vout", 0, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 1, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 2, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 3, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 4, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 5, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 6, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
> +	PMBUS_REGULATOR_STEP("vout", 7, LTC2978_N_VOLTAGES, LTC2978_UV_STEP, 0),
>  };
>  
>  static const struct regulator_desc ltc2978_reg_desc_default[] = {
> diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
> index 10fb17879f8e..713ea7915425 100644
> --- a/drivers/hwmon/pmbus/pmbus.h
> +++ b/drivers/hwmon/pmbus/pmbus.h
> @@ -464,7 +464,7 @@ struct pmbus_driver_info {
>  extern const struct regulator_ops pmbus_regulator_ops;
>  
>  /* Macros for filling in array of struct regulator_desc */
> -#define PMBUS_REGULATOR_STEP(_name, _id, _voltages, _step)  \
> +#define PMBUS_REGULATOR_STEP(_name, _id, _voltages, _step, _min_uV)  \
>  	[_id] = {						\
>  		.name = (_name # _id),				\
>  		.id = (_id),					\
> @@ -475,9 +475,10 @@ extern const struct regulator_ops pmbus_regulator_ops;
>  		.owner = THIS_MODULE,				\
>  		.n_voltages = _voltages,			\
>  		.uV_step = _step,				\
> +		.min_uV = _min_uV,				\
>  	}
>  
> -#define PMBUS_REGULATOR(_name, _id)	PMBUS_REGULATOR_STEP(_name, _id, 0, 0)
> +#define PMBUS_REGULATOR(_name, _id)   PMBUS_REGULATOR_STEP(_name, _id, 0, 0, 0)
>  
>  /* Function declarations */
>  

  reply	other threads:[~2022-12-29 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 17:37 [PATCH v3 0/4] Add support for mpq7932 PMIC IC Saravanan Sekar
2022-12-07 17:37 ` [PATCH v3 1/4] hwmon: pm_bus: core: Add min_uV in pmbus regulator helper macro Saravanan Sekar
2022-12-29 14:02   ` Guenter Roeck [this message]
2022-12-07 17:37 ` [PATCH v3 2/4] dt-bindings: regulator: Add mps,mpq7932 power-management IC Saravanan Sekar
2022-12-07 17:59   ` Krzysztof Kozlowski
2022-12-29 14:08   ` Guenter Roeck
2022-12-07 17:37 ` [PATCH v3 3/4] hwmon: (pmbus/mpq7932) Add a support for mpq7932 Power Management IC Saravanan Sekar
2022-12-29 14:01   ` Guenter Roeck
2022-12-07 17:37 ` [PATCH v3 4/4] MAINTAINERS: Update the entry for MPQ7932 PMIC driver Saravanan Sekar
2022-12-29 14:09   ` Guenter Roeck

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=20221229140211.GA17976@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marten.lindahl@axis.com \
    --cc=robh+dt@kernel.org \
    --cc=saravanan@linumiz.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

all inboxes | Powered by JetHome®