[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f420c40f-f2a5-4b64-8e89-dfc6db042edc@oss.qualcomm.com>
Date: Thu, 18 Sep 2025 01:17:30 +0530
From: Jishnu Prakash <jishnu.prakash@....qualcomm.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: robh@...nel.org, krzysztof.kozlowski@...aro.org, krzk+dt@...nel.org,
conor+dt@...nel.org, agross@...nel.org, andersson@...nel.org,
lumag@...nel.org, dmitry.baryshkov@....qualcomm.com,
konradybcio@...nel.org, daniel.lezcano@...aro.org, sboyd@...nel.org,
amitk@...nel.org, thara.gopinath@...il.com, lee@...nel.org,
rafael@...nel.org, subbaraman.narayanamurthy@....qualcomm.com,
david.collins@....qualcomm.com, anjelique.melendez@....qualcomm.com,
kamal.wadhwa@....qualcomm.com, rui.zhang@...el.com,
lukasz.luba@....com, devicetree@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
cros-qcom-dts-watchers@...omium.org, quic_kotarake@...cinc.com,
neil.armstrong@...aro.org, stephan.gerhold@...aro.org
Subject: Re: [PATCH V7 4/5] iio: adc: Add support for QCOM PMIC5 Gen3 ADC
Hi Jonathan,
On 8/30/2025 11:12 PM, Jonathan Cameron wrote:
> On Tue, 26 Aug 2025 14:06:56 +0530
> Jishnu Prakash <jishnu.prakash@....qualcomm.com> wrote:
>
>> The ADC architecture on PMIC5 Gen3 is similar to that on PMIC5 Gen2,
>> with all SW communication to ADC going through PMK8550 which
>> communicates with other PMICs through PBS.
>>
>> One major difference is that the register interface used here is that
>> of an SDAM (Shared Direct Access Memory) peripheral present on PMK8550.
>> There may be more than one SDAM used for ADC5 Gen3 and each has eight
>> channels, which may be used for either immediate reads (same functionality
>> as previous PMIC5 and PMIC5 Gen2 ADC peripherals) or recurring measurements
>> (same as ADC_TM functionality).
>>
>> By convention, we reserve the first channel of the first SDAM for all
>> immediate reads and use the remaining channels across all SDAMs for
>> ADC_TM monitoring functionality.
>>
>> Add support for PMIC5 Gen3 ADC driver for immediate read functionality.
>> ADC_TM is implemented as an auxiliary thermal driver under this ADC
>> driver.
>>
>> Signed-off-by: Jishnu Prakash <jishnu.prakash@....qualcomm.com>
>
> Hi Jishnu,
>
> A few additional comments from a fresh read through.
>
> Thanks,
>
> Jonathan
>
....
>> +
>> +static int adc5_gen3_get_fw_channel_data(struct adc5_chip *adc,
>> + struct adc5_channel_prop *prop,
>> + struct fwnode_handle *fwnode)
>> +{
>> + const char *name = fwnode_get_name(fwnode);
>> + const struct adc5_data *data = adc->data;
>> + u32 chan, value, varr[2], sid = 0;
>
> Why initialize sid?
I think this is not needed, I'll remove it.
I'll also address all your other comments in the next patch series.
Thanks,
Jishnu
>
>> + struct device *dev = adc->dev;
>> + const char *channel_name;
>> + int ret;
>> +
>> + ret = fwnode_property_read_u32(fwnode, "reg", &chan);
>> + if (ret < 0)
>> + return dev_err_probe(dev, ret, "invalid channel number %s\n",
>> + name);
>> +
>> + /*
>> + * Value read from "reg" is virtual channel number
>> + * virtual channel number = sid << 8 | channel number
>> + */
>> + sid = FIELD_GET(ADC5_GEN3_VIRTUAL_SID_MASK, chan);
>> + chan = FIELD_GET(ADC5_GEN3_CHANNEL_MASK, chan);
>
>> + return 0;
>> +}
>
Powered by blists - more mailing lists