All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: "James A. MacInnes" <james.a.macinnes@gmail.com>,
	linux-arm-msm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	andersson@kernel.org, konradybcio@kernel.org,
	quic_wcheng@quicinc.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org
Subject: Re: [PATCH 2/3] regulator: qcom_usb_vbus: Add support for PMI8998 VBUS
Date: Tue, 11 Feb 2025 23:55:47 +0000	[thread overview]
Message-ID: <84682c43-e480-41df-a258-1f5311bb441a@linaro.org> (raw)
In-Reply-To: <20250211194918.2517593-3-james.a.macinnes@gmail.com>

On 11/02/2025 19:49, James A. MacInnes wrote:
> +	// Determine PMIC type
> +	pmic_type = of_device_get_match_data(dev);
> +	if (pmic_type && strcmp(pmic_type, "pmi8998") == 0) {
> +		qcom_usb_vbus_rdesc.curr_table = curr_table_pmi8998;
> +		qcom_usb_vbus_rdesc.n_current_limits =
> +			ARRAY_SIZE(curr_table_pmi8998);
> +	} else if (pmic_type && strcmp(pmic_type, "pm8150b") == 0) {
> +		qcom_usb_vbus_rdesc.curr_table = curr_table_pm8150b;
> +		qcom_usb_vbus_rdesc.n_current_limits =
> +			ARRAY_SIZE(curr_table_pm8150b);
> +	} else {
> +		return -ENODEV;
> +	}
>   	qcom_usb_vbus_rdesc.enable_reg = base + CMD_OTG;
>   	qcom_usb_vbus_rdesc.enable_mask = OTG_EN;
>   	qcom_usb_vbus_rdesc.csel_reg = base + OTG_CURRENT_LIMIT_CFG;
> @@ -80,18 +99,22 @@ static int qcom_usb_vbus_regulator_probe(struct platform_device *pdev)
>   	rdev = devm_regulator_register(dev, &qcom_usb_vbus_rdesc, &config);
>   	if (IS_ERR(rdev)) {
>   		ret = PTR_ERR(rdev);
> -		dev_err(dev, "not able to register vbus reg %d\n", ret);
> +		dev_err(dev, "Failed to register vbus reg %d\n", ret);
>   		return ret;
>   	}
>   
>   	/* Disable HW logic for VBUS enable */
>   	regmap_update_bits(regmap, base + OTG_CFG, OTG_EN_SRC_CFG, 0);
>   
> +	dev_info(dev, "Registered QCOM %s VBUS regulator\n",
> +		 pmic_type);
> +
>   	return 0;
>   }
>   
>   static const struct of_device_id qcom_usb_vbus_regulator_match[] = {
> -	{ .compatible = "qcom,pm8150b-vbus-reg" },
> +	{ .compatible = "qcom,pm8150b-vbus-reg", .data = "pm8150b" },
> +	{ .compatible = "qcom,pmi8998-vbus-reg", .data = "pmi8998" },

I think the other two said much the same thing but .data should point to 
the differentiator instead of being a string which you disjoin on and 
then hook your differentiated data.

i.e.

.data = &my_driver_specific_static_data_here.

---
bod

  parent reply	other threads:[~2025-02-11 23:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 19:49 [PATCH 0/3] Add PMI8998 VBUS Regulator Support James A. MacInnes
2025-02-11 19:49 ` [PATCH 1/3] regulator: qcom_usb_vbus: Update DTS binding for PMI8998 support James A. MacInnes
2025-02-11 19:49 ` [PATCH 2/3] regulator: qcom_usb_vbus: Add support for PMI8998 VBUS James A. MacInnes
2025-02-11 20:00   ` Mark Brown
2025-02-11 23:16   ` Dmitry Baryshkov
2025-02-12  0:09     ` Mark Brown
2025-02-11 23:55   ` Bryan O'Donoghue [this message]
2025-02-11 19:49 ` [PATCH 3/3] arm64: boot: dts: pmi8998.dtsi: Add VBUS regulator James A. MacInnes
2025-02-11 23:32   ` Dmitry Baryshkov
  -- strict thread matches above, loose matches on Subject: below --
2025-02-12  1:07 [PATCH 0/3] Add PMI8998 VBUS Regulator Support v2 James A. MacInnes
2025-02-12  1:07 ` [PATCH 2/3] regulator: qcom_usb_vbus: Add support for PMI8998 VBUS James A. MacInnes
2025-02-12  3:48   ` Dmitry Baryshkov
2025-02-12 12:55   ` Konrad Dybcio
2025-02-12 16:46     ` James A. MacInnes
2025-02-12 15:29   ` Caleb Connolly
2025-02-12 15:37     ` Mark Brown
2025-02-12 16:09       ` Caleb Connolly
2025-02-12 19:25         ` James A. MacInnes
2025-02-12 16:56     ` James A. MacInnes
2025-02-12 17:12       ` Caleb Connolly

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=84682c43-e480-41df-a258-1f5311bb441a@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.a.macinnes@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_wcheng@quicinc.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 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.