Re: [PATCH v4 5/8] power: supply: qcom_battmgr: update compats for SM8550 and X1E80100

Stephan Gerhold
2025-09-15T09:48:34Z

On Mon, Sep 15, 2025 at 05:44:40PM +0800, Fenglin Wu wrote:
>
> On 9/15/2025 5:02 PM, Stephan Gerhold wrote:
> > On Mon, Sep 15, 2025 at 04:49:57PM +0800, Fenglin Wu via B4 Relay wrote:
> > > From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> > >
> > > Add variant definitions for SM8550 and X1E80100 platforms. Add a compat
> > > for SM8550 and update match data for X1E80100 specifically so that they
> > > could be handled differently in supporting charge control functionality.
> > >
> > > Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on Thinkpad T14S OLED
> > > Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> > > ---
> > > drivers/power/supply/qcom_battmgr.c | 7 +++++--
> > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
> > > index 008e241e3eac3574a78459a2256e006e48c9f508..174d3f83ac2b070bb90c21a498686e91cc629ebe 100644
> > > --- a/drivers/power/supply/qcom_battmgr.c
> > > +++ b/drivers/power/supply/qcom_battmgr.c
> > > @@ -19,8 +19,10 @@
> > > #define BATTMGR_STRING_LEN 128
> > > enum qcom_battmgr_variant {
> > > - QCOM_BATTMGR_SM8350,
> > > QCOM_BATTMGR_SC8280XP,
> > > + QCOM_BATTMGR_SM8350,
> > > + QCOM_BATTMGR_SM8550,
> > > + QCOM_BATTMGR_X1E80100,
> > > };
> > > #define BATTMGR_BAT_STATUS 0x1
> > > @@ -1333,7 +1335,8 @@ static void qcom_battmgr_pdr_notify(void *priv, int state)
> > > static const struct of_device_id qcom_battmgr_of_variants[] = {
> > > { .compatible = "qcom,sc8180x-pmic-glink", .data = (void *)QCOM_BATTMGR_SC8280XP },
> > > { .compatible = "qcom,sc8280xp-pmic-glink", .data = (void *)QCOM_BATTMGR_SC8280XP },
> > > - { .compatible = "qcom,x1e80100-pmic-glink", .data = (void *)QCOM_BATTMGR_SC8280XP },
> > > + { .compatible = "qcom,sm8550-pmic-glink", .data = (void *)QCOM_BATTMGR_SM8550 },
> > > + { .compatible = "qcom,x1e80100-pmic-glink", .data = (void *)QCOM_BATTMGR_X1E80100 },
> > > /* Unmatched devices falls back to QCOM_BATTMGR_SM8350 */
> > > {}
> > > };
> > I think you need to squash this with "[PATCH 7/8] power: supply:
> > qcom_battmgr: Add charge control support", or move the modified checks
> > for
> >
> > if (battmgr->variant == QCOM_BATTMGR_SC8280XP ||
> > battmgr->variant == QCOM_BATTMGR_X1E80100) {
> >
> > into this patch.
> >
> > With this patch right now, I would expect that your series is not
> > bisectable: The wrong code paths are chosen if you only apply this patch
> > because e.g. X1E doesn't use the QCOM_BATTMGR_SC8280XP code anymore.
> >
> > Thanks,
> > Stephan
>
> I see.
>
> I was making it this way to address the review comment from Bryan in patch
> v2 about separating the compats change. See here:
> https://lore.kernel.org/all/7f001134-e099-492d-8ce5-4122d83a3de3@linaro.org/
>
> If I revise it according to your 2nd suggestion, would it conflict with
> Bryan's feedback?
>

I would expect that Bryan had my second suggestion in mind - separating
the refactoring (without functional change) from the new feature
addition.

You need to add the new cases to the if statements in this patch, or you
will (temporarily) change and break functionality.

Thanks,
Stephan