Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rakesh Kota" <rakesh.kota@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 2/3] regulator: qcom_usb_vbus: add support for qcom,pm4125-vbus-reg
Date: Wed, 01 Jul 2026 10:34:35 +0000	[thread overview]
Message-ID: <20260701103435.D6DEA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260701-add_pm4125-vbus-reg-v2-2-6bac2bac7131@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The macro `PM4125_VBOOST_CFG` is defined twice with conflicting values (`0x52` and `0x56`), causing the voltage selector to write to the wrong register and corrupt the OTG configuration.
--

commit 3778477cc88a05791ed34dc272e50cbdb4893643
Author: Rakesh Kota <rakesh.kota@oss.qualcomm.com>

regulator: qcom_usb_vbus: add support for qcom,pm4125-vbus-reg

The PM4125 PMIC uses a different register layout for USB VBUS control
compared to PM8150B. On PM4125, CMD_OTG is at offset 0x50, OTG_CFG is
at 0x56, and offset 0x52 is a 2-bit VBOOST voltage selector rather than
a current-limit selector. Introduce per-compatible regulator descriptor
data to accommodate these differences.

> diff --git a/drivers/regulator/qcom_usb_vbus-regulator.c b/drivers/regulator/qcom_usb_vbus-regulator.c
> index cd94ed67621fe..40e7e5589d5b4 100644
> --- a/drivers/regulator/qcom_usb_vbus-regulator.c
> +++ b/drivers/regulator/qcom_usb_vbus-regulator.c
> @@ -20,10 +20,35 @@
>  #define OTG_CFG				0x53
>  #define OTG_EN_SRC_CFG			BIT(1)
>  
> +#define PM4125_VBOOST_EN		0x50
> +#define PM4125_VBOOST_CFG		0x52
> +#define PM4125_VBOOST_CFG_MASK		GENMASK(1, 0)
> +#define PM4125_VBOOST_CFG		0x56

[Severity: High]
Will this redefine PM4125_VBOOST_CFG to 0x56 and silently override the
intended 0x52 offset?

When pm4125_data.vsel_reg is assigned PM4125_VBOOST_CFG, it appears the
regulator core will write to 0x56 instead of the 0x52 VBOOST selector
register.

Should the 0x56 definition be named PM4125_OTG_CFG instead?

> +#define PM4125_OTG_EN_SRC_CFG		BIT(0)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260701-add_pm4125-vbus-reg-v2-0-6bac2bac7131@oss.qualcomm.com?part=2

  reply	other threads:[~2026-07-01 10:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 10:28 [PATCH v2 0/3] regulator: qcom_usb_vbus: add pm4125 VBUS regulator support Rakesh Kota
2026-07-01 10:28 ` [PATCH v2 1/3] dt-bindings: regulator: qcom,usb-vbus-regulator: add qcom,pm4125-vbus-reg Rakesh Kota
2026-07-01 10:28 ` [PATCH v2 2/3] regulator: qcom_usb_vbus: add support for qcom,pm4125-vbus-reg Rakesh Kota
2026-07-01 10:34   ` sashiko-bot [this message]
2026-07-02  7:54     ` Rakesh Kota
2026-07-02 12:59       ` Dmitry Baryshkov
2026-07-01 11:25   ` Konrad Dybcio
2026-07-01 11:28   ` Bryan O'Donoghue
2026-07-02  7:51     ` Rakesh Kota
2026-07-01 10:28 ` [PATCH v2 3/3] arm64: dts: qcom: Fix pm4125 vbus regulator compatible and constraints Rakesh Kota
2026-07-01 10:34   ` sashiko-bot
2026-07-02  7:25     ` Rakesh Kota
2026-07-01 11:26   ` Konrad Dybcio
2026-07-02  7:33     ` Rakesh Kota
2026-07-02 12:07       ` Konrad Dybcio
2026-07-02 12:43         ` Rakesh Kota
2026-07-02 13:01           ` Dmitry Baryshkov
2026-07-01 11:29   ` Bryan O'Donoghue
2026-07-02  8:02     ` Rakesh Kota
2026-07-02 16:10       ` Bryan O'Donoghue

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=20260701103435.D6DEA1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=rakesh.kota@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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