Re: [PATCH] leds: rgb: leds-qcom-lpg: Add PWM frequency mode support

From: Konrad Dybcio

Date: Thu Sep 03 2026 - 03:30:46 EST


On 8/3/26 3:50 AM, Fenglin Wu wrote:
>
>
> On 7/31/2026 10:20 PM, Konrad Dybcio wrote:
>>> regmap_read(lpg->map, chan->base + LPG_SUBTYPE_REG, &chan->subtype);
>>> + if (data->channels[i].fm_capable) {
>>> + ret = regmap_read(lpg->map, chan->base + PWM_STATUS1_REG, &status);
>>> + if (ret < 0)
>>> + return ret;
>>> +
>>> + chan->fm_capable = !!(status & PWM_FM_PRESENT);
>> Can we read this register blindly by chance and drop the match data?
>
> It would result unnecessary read for the PWM channels which don't
> support frequency mode. The register read here is actually just for
> differentiating the HW revisions for pm8350c, where only the V2 support
> frequency mode. And the newer variants of pm8350c PWM4 channel could
> support frequency mode by default.

Usually feature registers are read out unconditionally, since they do
just what they say they do..

but I see that this register doesn't exist on e.g. PM8916, so I'm
willing to go with the approach already present in the patch

Konrad