mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guru Das Srinagesh <linux@gurudas.dev>
To: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Cc: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-arm-msm@vger.kernel.org, mfd@lists.linux.dev,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Dhruvin Rajpura <drajpura@qti.qualcomm.com>,
	Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>,
	Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>,
	Oleg Keri <okerixx@gmail.com>
Subject: Re: [PATCH v2 3/7] regulator: qcom-pm8008: Add PM8010 mode support
Date: Mon, 19 Oct 2026 00:31:55 -0700	[thread overview]
Message-ID: <atXHa8ZhwEaVUlGa@gurudas.dev> (raw)
In-Reply-To: <20261014-pm8010_i2c_support-v2-3-b395d2b3f668@oss.qualcomm.com>

On Wed, Oct 14, 2026 at 04:02:00PM +0530, Jishnu Prakash wrote:
> From: Dhruvin Rajpura <drajpura@qti.qualcomm.com>
> 
> Implement set_mode/get_mode support for PM8010 LDOs using the mode
> control and status registers to allow clients to vote for LDO modes.
> Mode voting is not supported in the PM8008 LDOs.
> 
> Signed-off-by: Dhruvin Rajpura <drajpura@qti.qualcomm.com>
> Tested-by: Oleg Keri <okerixx@gmail.com> # Lenovo Yoga Slim 7x Gen 11 (Glymur)
> Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
> ---
>  drivers/regulator/qcom-pm8008-regulator.c | 75 ++++++++++++++++++++++++++++++-
>  1 file changed, 74 insertions(+), 1 deletion(-)

...

>  static int pm8008_regulator_probe(struct platform_device *pdev)
>  {
>  	const struct pm8008_match_data *match_data;
> @@ -155,6 +222,7 @@ static int pm8008_regulator_probe(struct platform_device *pdev)
>  	struct regulator_dev *rdev;
>  	struct regmap *regmap;
>  	unsigned int val;
> +	bool is_pm8010;
>  	int ret, i;
>  
>  	id = platform_get_device_id(pdev);
> @@ -169,6 +237,9 @@ static int pm8008_regulator_probe(struct platform_device *pdev)
>  	if (!regmap)
>  		return -EINVAL;
>  
> +	is_pm8010 = of_device_is_compatible(dev->parent->of_node,
> +					    "qcom,pm8010-i2c");

Patch 2 adds a new `driver_data` match data struct for PM8010. Could this is_pm8010
variable be avoided by stashing the regulator ops in the match data for each
variant and using that instead?

> +
>  	for (i = 0; i < match_data->num_regulators; i++) {
>  		data = &match_data->regulator_data[i];
>  
> @@ -185,7 +256,9 @@ static int pm8008_regulator_probe(struct platform_device *pdev)
>  		desc->supply_name = data->supply_name;
>  		desc->of_match = data->name;
>  		desc->regulators_node = of_match_ptr("regulators");
> -		desc->ops = &pm8008_regulator_ops;
> +		desc->ops = is_pm8010 ? &pm8010_regulator_ops : &pm8008_regulator_ops;
> +		if (is_pm8010)
> +			desc->of_map_mode = pm8010_regulator_of_map_mode;
>  		desc->type = REGULATOR_VOLTAGE;
>  		desc->owner = THIS_MODULE;

  reply	other threads:[~2026-10-19  7:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 10:31 [PATCH v2 0/7] mfd: qcom-pm8008: Add support for PM8010 over I2C Jishnu Prakash
2026-10-14 10:31 ` [PATCH v2 1/7] dt-bindings: mfd: pm8008: Add qcom,pm8010-i2c compatible Jishnu Prakash
2026-10-19  7:44   ` Guru Das Srinagesh
2026-10-14 10:31 ` [PATCH v2 2/7] regulator: pm8008: Add PM8010 support Jishnu Prakash
2026-10-14 10:32 ` [PATCH v2 3/7] regulator: qcom-pm8008: Add PM8010 mode support Jishnu Prakash
2026-10-19  7:31   ` Guru Das Srinagesh [this message]
2026-10-19  7:41   ` Guru Das Srinagesh
2026-10-14 10:32 ` [PATCH v2 4/7] mfd: qcom-pm8008: Drop GPIO support Jishnu Prakash
2026-10-15 12:01   ` Konrad Dybcio
2026-10-14 10:32 ` [PATCH v2 5/7] mfd: qcom-pm8008: Add PM8010 support Jishnu Prakash
2026-10-15 12:04   ` Konrad Dybcio
2026-10-19  5:00     ` Jishnu Prakash
2026-10-14 10:32 ` [PATCH v2 6/7] dt-bindings: mfd: pm8008: Make interrupts optional Jishnu Prakash
2026-10-14 10:32 ` [PATCH v2 7/7] mfd: qcom-pm8008: Tolerate missing interrupt Jishnu Prakash
2026-10-15 11:00   ` Nihal Kumar Gupta
2026-10-15 12:05   ` Konrad Dybcio
2026-10-19  5:01     ` Jishnu Prakash

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=atXHa8ZhwEaVUlGa@gurudas.dev \
    --to=linux@gurudas.dev \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=drajpura@qti.qualcomm.com \
    --cc=jishnu.prakash@oss.qualcomm.com \
    --cc=kamal.wadhwa@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=nihal.gupta@oss.qualcomm.com \
    --cc=okerixx@gmail.com \
    --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 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®