* [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
@ 2026-04-25 20:39 Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 1/4] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Antony Kurniawan Soemardi @ 2026-04-25 20:39 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Konrad Dybcio, Dmitry Baryshkov, Antony Kurniawan Soemardi
This series adds support for reading channel labels from the device tree
in the Qualcomm PM8xxx XOADC driver, along with the corresponding DT
updates for the PM8921 PMIC. Also removes the redundant error logs when
reading values, as returning -EINVAL and -ETIMEDOUT are sufficient to
report failures.
This series also includes minor refactors such as remove redundant
error logging and constifying pointers where applicable.
Tested on Sony Xperia SP (PM8921):
> cat /sys/bus/iio/devices/iio\:device0/in_voltage7_label
usb_vbus
> cat /sys/bus/iio/devices/iio\:device0/in_temp12_label
ref_muxoff
> sensors
iio_hwmon-isa-0000
Adapter: ISA adapter
vbat: 267.86 V
dcin: 4.82 kV
...
chg_temp: +1071.4°C
Note: the sensor readings above are incorrect due to pending calibration
fixes are not included in this series. This patch only addresses label
visibility. The values are expected to be wrong until the calibration
fixes lands separately.
---
Changes in v4:
- Constify pointers in read operations
- Reworked wait_for_completion_timeout() handling
- Updated variable declaration style in pm8xxx_read_label()
- Link to v3: https://lore.kernel.org/r/20260405-pm8xxx-xoadc-label-v3-0-9fe179c283ec@smankusors.com
Changes in v3:
- Simplify label assignment logic by removing the unnecessary
conditional branch
- Remove redundant error logging in pm8xxx_read_channel_rsv, since
-ETIMEDOUT is sufficient to report failures.
- Link to v2: https://lore.kernel.org/r/20260403-pm8xxx-xoadc-label-v2-0-29b50bf821e6@smankusors.com
Changes in v2:
- Remove redundant error logging in pm8xxx_read_raw, since -EINVAL is
sufficient to report failures.
- Reword the uncommon Tested-by commit tag to freeform text
- Link to v1: https://lore.kernel.org/r/20260326-pm8xxx-xoadc-label-v1-0-027805dad4db@smankusors.com
Changes since original patch:
- The label is now read from the platform description (device tree)
instead of the internal datasheet name.
- Link to original patch:
https://lore.kernel.org/all/20251028-pm8xxx-xoadc-fix-v1-1-b000e1036e41@smankusors.com/
---
Antony Kurniawan Soemardi (4):
ARM: dts: qcom: pm8921: add labels for ADC channels
iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values
iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations
iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
arch/arm/boot/dts/qcom/pm8921.dtsi | 12 ++++++++
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 56 ++++++++++++++++++++-----------------
2 files changed, 43 insertions(+), 25 deletions(-)
---
base-commit: 27d128c1cff64c3b8012cc56dd5a1391bb4f1821
change-id: 20260321-pm8xxx-xoadc-label-47afdf7f06a9
Best regards,
--
Antony Kurniawan Soemardi <linux@smankusors.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 1/4] ARM: dts: qcom: pm8921: add labels for ADC channels
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
@ 2026-04-25 20:39 ` Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values Antony Kurniawan Soemardi
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Antony Kurniawan Soemardi @ 2026-04-25 20:39 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Konrad Dybcio, Dmitry Baryshkov, Antony Kurniawan Soemardi
Add label properties to all XOADC ADC channel nodes in the PM8921 PMIC
device tree. This allows userspace and drivers to identify channels by
name rather than relying on datasheet name.
Acked-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Antony Kurniawan Soemardi <linux@smankusors.com>
---
arch/arm/boot/dts/qcom/pm8921.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/pm8921.dtsi b/arch/arm/boot/dts/qcom/pm8921.dtsi
index 535cb6a2543f..15246f4bd267 100644
--- a/arch/arm/boot/dts/qcom/pm8921.dtsi
+++ b/arch/arm/boot/dts/qcom/pm8921.dtsi
@@ -75,50 +75,62 @@ pm8921_xoadc: xoadc@197 {
vcoin: adc-channel@0 {
reg = <0x00 0x00>;
+ label = "vcoin";
};
vbat: adc-channel@1 {
reg = <0x00 0x01>;
+ label = "vbat";
};
dcin: adc-channel@2 {
reg = <0x00 0x02>;
+ label = "dcin";
};
vph_pwr: adc-channel@4 {
reg = <0x00 0x04>;
+ label = "vph_pwr";
};
batt_therm: adc-channel@8 {
reg = <0x00 0x08>;
+ label = "batt_therm";
};
batt_id: adc-channel@9 {
reg = <0x00 0x09>;
+ label = "batt_id";
};
usb_vbus: adc-channel@a {
reg = <0x00 0x0a>;
+ label = "usb_vbus";
};
die_temp: adc-channel@b {
reg = <0x00 0x0b>;
+ label = "die_temp";
};
ref_625mv: adc-channel@c {
reg = <0x00 0x0c>;
+ label = "ref_625mv";
};
ref_1250mv: adc-channel@d {
reg = <0x00 0x0d>;
+ label = "ref_1250mv";
};
chg_temp: adc-channel@e {
reg = <0x00 0x0e>;
+ label = "chg_temp";
};
ref_muxoff: adc-channel@f {
reg = <0x00 0x0f>;
+ label = "ref_muxoff";
};
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 1/4] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
@ 2026-04-25 20:39 ` Antony Kurniawan Soemardi
2026-04-27 7:53 ` Andy Shevchenko
2026-04-25 20:39 ` [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations Antony Kurniawan Soemardi
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Antony Kurniawan Soemardi @ 2026-04-25 20:39 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Dmitry Baryshkov, Antony Kurniawan Soemardi
Drop dev_err() logging for -EINVAL and -ETIMEDOUT cases and rely on
return values to report errors, reducing unnecessary log noise.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Antony Kurniawan Soemardi <linux@smankusors.com>
---
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index 31f88cf7f7f1..89858e81c859 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -535,10 +535,8 @@ static int pm8xxx_read_channel_rsv(struct pm8xxx_xoadc *adc,
goto unlock;
/* Next the interrupt occurs */
- ret = wait_for_completion_timeout(&adc->complete,
- VADC_CONV_TIME_MAX_US);
- if (!ret) {
- dev_err(adc->dev, "conversion timed out\n");
+ if (!wait_for_completion_timeout(&adc->complete,
+ VADC_CONV_TIME_MAX_US)) {
ret = -ETIMEDOUT;
goto unlock;
}
@@ -657,11 +655,8 @@ static int pm8xxx_read_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_PROCESSED:
ch = pm8xxx_get_channel(adc, chan->address);
- if (!ch) {
- dev_err(adc->dev, "no such channel %lu\n",
- chan->address);
+ if (!ch)
return -EINVAL;
- }
ret = pm8xxx_read_channel(adc, ch, &adc_code);
if (ret)
return ret;
@@ -677,11 +672,8 @@ static int pm8xxx_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT;
case IIO_CHAN_INFO_RAW:
ch = pm8xxx_get_channel(adc, chan->address);
- if (!ch) {
- dev_err(adc->dev, "no such channel %lu\n",
- chan->address);
+ if (!ch)
return -EINVAL;
- }
ret = pm8xxx_read_channel(adc, ch, &adc_code);
if (ret)
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 1/4] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values Antony Kurniawan Soemardi
@ 2026-04-25 20:39 ` Antony Kurniawan Soemardi
2026-04-27 7:58 ` Andy Shevchenko
2026-04-25 20:39 ` [PATCH v4 4/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels Antony Kurniawan Soemardi
2026-04-26 13:21 ` [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Jonathan Cameron
4 siblings, 1 reply; 9+ messages in thread
From: Antony Kurniawan Soemardi @ 2026-04-25 20:39 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Antony Kurniawan Soemardi
These functions do not modify the indio_dev & adc structure, so they
should be marked const to allow the compiler to catch any accidental
modifications and to document the read only nature of these functions.
Signed-off-by: Antony Kurniawan Soemardi <linux@smankusors.com>
---
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index 89858e81c859..2ee080b27d93 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -414,8 +414,8 @@ struct pm8xxx_xoadc {
static irqreturn_t pm8xxx_eoc_irq(int irq, void *d)
{
- struct iio_dev *indio_dev = d;
- struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
+ const struct iio_dev *indio_dev = d;
+ const struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
complete(&adc->complete);
@@ -423,7 +423,7 @@ static irqreturn_t pm8xxx_eoc_irq(int irq, void *d)
}
static struct pm8xxx_chan_info *
-pm8xxx_get_channel(struct pm8xxx_xoadc *adc, u8 chan)
+pm8xxx_get_channel(const struct pm8xxx_xoadc *adc, u8 chan)
{
int i;
@@ -435,7 +435,7 @@ pm8xxx_get_channel(struct pm8xxx_xoadc *adc, u8 chan)
return NULL;
}
-static int pm8xxx_read_channel_rsv(struct pm8xxx_xoadc *adc,
+static int pm8xxx_read_channel_rsv(const struct pm8xxx_xoadc *adc,
const struct pm8xxx_chan_info *ch,
u8 rsv, u16 *adc_code,
bool force_ratiometric)
@@ -564,7 +564,7 @@ static int pm8xxx_read_channel_rsv(struct pm8xxx_xoadc *adc,
return ret;
}
-static int pm8xxx_read_channel(struct pm8xxx_xoadc *adc,
+static int pm8xxx_read_channel(const struct pm8xxx_xoadc *adc,
const struct pm8xxx_chan_info *ch,
u16 *adc_code)
{
@@ -647,7 +647,7 @@ static int pm8xxx_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{
- struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
+ const struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
const struct pm8xxx_chan_info *ch;
u16 adc_code;
int ret;
@@ -948,8 +948,8 @@ static int pm8xxx_xoadc_probe(struct platform_device *pdev)
static void pm8xxx_xoadc_remove(struct platform_device *pdev)
{
- struct iio_dev *indio_dev = platform_get_drvdata(pdev);
- struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
+ const struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+ const struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v4 4/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
` (2 preceding siblings ...)
2026-04-25 20:39 ` [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations Antony Kurniawan Soemardi
@ 2026-04-25 20:39 ` Antony Kurniawan Soemardi
2026-04-26 13:21 ` [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Jonathan Cameron
4 siblings, 0 replies; 9+ messages in thread
From: Antony Kurniawan Soemardi @ 2026-04-25 20:39 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Dmitry Baryshkov, Antony Kurniawan Soemardi
Implement the .read_label callback to allow userspace to identify ADC
channels via the "label" property in the device tree. The name field in
pm8xxx_chan_info is renamed to label to better reflect its purpose. If
no label is provided in the device tree, it defaults to the hardware
datasheet name.
The change has been tested on Sony Xperia SP (PM8921).
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Antony Kurniawan Soemardi <linux@smankusors.com>
---
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index 2ee080b27d93..fbb58b340241 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -369,7 +369,7 @@ static const struct xoadc_channel pm8921_xoadc_channels[] = {
/**
* struct pm8xxx_chan_info - ADC channel information
- * @name: name of this channel
+ * @label: label of this channel from device tree (defaults to datasheet name if not specified)
* @hwchan: pointer to hardware channel information (muxing & scaling settings)
* @calibration: whether to use absolute or ratiometric calibration
* @decimation: 0,1,2,3
@@ -377,7 +377,7 @@ static const struct xoadc_channel pm8921_xoadc_channels[] = {
* calibration: 0, 1, 2, 4, 5.
*/
struct pm8xxx_chan_info {
- const char *name;
+ const char *label;
const struct xoadc_channel *hwchan;
enum vadc_calibration calibration;
u8 decimation:2;
@@ -446,7 +446,7 @@ static int pm8xxx_read_channel_rsv(const struct pm8xxx_xoadc *adc,
u8 lsb, msb;
dev_dbg(adc->dev, "read channel \"%s\", amux %d, prescale/mux: %d, rsv %d\n",
- ch->name, ch->hwchan->amux_channel, ch->hwchan->pre_scale_mux, rsv);
+ ch->label, ch->hwchan->amux_channel, ch->hwchan->pre_scale_mux, rsv);
mutex_lock(&adc->lock);
@@ -717,8 +717,21 @@ static int pm8xxx_fwnode_xlate(struct iio_dev *indio_dev,
return -EINVAL;
}
+static int pm8xxx_read_label(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan, char *label)
+{
+ const struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
+ const struct pm8xxx_chan_info *ch;
+
+ ch = pm8xxx_get_channel(adc, chan->address);
+ if (!ch)
+ return -EINVAL;
+ return sysfs_emit(label, "%s\n", ch->label);
+}
+
static const struct iio_info pm8xxx_xoadc_info = {
.fwnode_xlate = pm8xxx_fwnode_xlate,
+ .read_label = pm8xxx_read_label,
.read_raw = pm8xxx_read_raw,
};
@@ -762,7 +775,8 @@ static int pm8xxx_xoadc_parse_channel(struct device *dev,
pre_scale_mux, amux_channel);
return -EINVAL;
}
- ch->name = name;
+ ch->label = hwchan->datasheet_name;
+ fwnode_property_read_string(fwnode, "label", &ch->label);
ch->hwchan = hwchan;
/* Everyone seems to use absolute calibration except in special cases */
ch->calibration = VADC_CALIB_ABSOLUTE;
@@ -804,7 +818,7 @@ static int pm8xxx_xoadc_parse_channel(struct device *dev,
dev_dbg(dev,
"channel [PRESCALE/MUX: %02x AMUX: %02x] \"%s\" ref voltage: %d, decimation %d prescale %d/%d, scale function %d\n",
- hwchan->pre_scale_mux, hwchan->amux_channel, ch->name,
+ hwchan->pre_scale_mux, hwchan->amux_channel, ch->label,
ch->amux_ip_rsv, ch->decimation, hwchan->prescale.numerator,
hwchan->prescale.denominator, hwchan->scale_fn_type);
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
` (3 preceding siblings ...)
2026-04-25 20:39 ` [PATCH v4 4/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels Antony Kurniawan Soemardi
@ 2026-04-26 13:21 ` Jonathan Cameron
2026-04-26 13:24 ` Jonathan Cameron
4 siblings, 1 reply; 9+ messages in thread
From: Jonathan Cameron @ 2026-04-26 13:21 UTC (permalink / raw)
To: Antony Kurniawan Soemardi
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, David Lechner, Nuno Sá, Andy Shevchenko,
linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Konrad Dybcio, Dmitry Baryshkov
On Sat, 25 Apr 2026 20:39:06 +0000 (UTC)
Antony Kurniawan Soemardi <linux@smankusors.com> wrote:
> This series adds support for reading channel labels from the device tree
> in the Qualcomm PM8xxx XOADC driver, along with the corresponding DT
> updates for the PM8921 PMIC. Also removes the redundant error logs when
> reading values, as returning -EINVAL and -ETIMEDOUT are sufficient to
> report failures.
>
> This series also includes minor refactors such as remove redundant
> error logging and constifying pointers where applicable.
>
> Tested on Sony Xperia SP (PM8921):
> > cat /sys/bus/iio/devices/iio\:device0/in_voltage7_label
> usb_vbus
> > cat /sys/bus/iio/devices/iio\:device0/in_temp12_label
> ref_muxoff
> > sensors
> iio_hwmon-isa-0000
> Adapter: ISA adapter
> vbat: 267.86 V
> dcin: 4.82 kV
> ...
> chg_temp: +1071.4°C
>
> Note: the sensor readings above are incorrect due to pending calibration
> fixes are not included in this series. This patch only addresses label
> visibility. The values are expected to be wrong until the calibration
> fixes lands separately.
> ---
> Changes in v4:
> - Constify pointers in read operations
Whilst I can't say I care that much about whether we mark everything we
could const, it does no harm.
Applied patches 2-4 to the testing branch of iio.git. I'll rebase that
on rc1 once available and push out as togreg which linux-next will pick up.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
2026-04-26 13:21 ` [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Jonathan Cameron
@ 2026-04-26 13:24 ` Jonathan Cameron
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2026-04-26 13:24 UTC (permalink / raw)
To: Antony Kurniawan Soemardi
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, David Lechner, Nuno Sá, Andy Shevchenko,
linux-arm-msm, devicetree, linux-kernel, linux-iio, phone-devel,
Konrad Dybcio, Dmitry Baryshkov
On Sun, 26 Apr 2026 14:21:37 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Sat, 25 Apr 2026 20:39:06 +0000 (UTC)
> Antony Kurniawan Soemardi <linux@smankusors.com> wrote:
>
> > This series adds support for reading channel labels from the device tree
> > in the Qualcomm PM8xxx XOADC driver, along with the corresponding DT
> > updates for the PM8921 PMIC. Also removes the redundant error logs when
> > reading values, as returning -EINVAL and -ETIMEDOUT are sufficient to
> > report failures.
> >
> > This series also includes minor refactors such as remove redundant
> > error logging and constifying pointers where applicable.
> >
> > Tested on Sony Xperia SP (PM8921):
> > > cat /sys/bus/iio/devices/iio\:device0/in_voltage7_label
> > usb_vbus
> > > cat /sys/bus/iio/devices/iio\:device0/in_temp12_label
> > ref_muxoff
> > > sensors
> > iio_hwmon-isa-0000
> > Adapter: ISA adapter
> > vbat: 267.86 V
> > dcin: 4.82 kV
> > ...
> > chg_temp: +1071.4°C
> >
> > Note: the sensor readings above are incorrect due to pending calibration
> > fixes are not included in this series. This patch only addresses label
> > visibility. The values are expected to be wrong until the calibration
> > fixes lands separately.
>
> > ---
> > Changes in v4:
> > - Constify pointers in read operations
> Whilst I can't say I care that much about whether we mark everything we
> could const, it does no harm.
>
> Applied patches 2-4 to the testing branch of iio.git. I'll rebase that
> on rc1 once available and push out as togreg which linux-next will pick up.
>
Backed out as this constification results in masses of discarded const
marking warnings given some of these are passed into core code that
isn't marked up. Keep any constifying to stuff that is isolated to this
driver.
J
> Thanks,
>
> Jonathan
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values
2026-04-25 20:39 ` [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values Antony Kurniawan Soemardi
@ 2026-04-27 7:53 ` Andy Shevchenko
0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2026-04-27 7:53 UTC (permalink / raw)
To: Antony Kurniawan Soemardi
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-arm-msm, devicetree, linux-kernel,
linux-iio, phone-devel, Dmitry Baryshkov
On Sat, Apr 25, 2026 at 08:39:16PM +0000, Antony Kurniawan Soemardi wrote:
> Drop dev_err() logging for -EINVAL and -ETIMEDOUT cases and rely on
> return values to report errors, reducing unnecessary log noise.
Assuming that this error codes go to the user space without changes,
this LGTM, FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
The EINVAL --> ENOENT can be discussed / changed separately later on.
...
> + if (!wait_for_completion_timeout(&adc->complete,
> + VADC_CONV_TIME_MAX_US)) {
I would even dare to make this a single line (82 characters).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations
2026-04-25 20:39 ` [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations Antony Kurniawan Soemardi
@ 2026-04-27 7:58 ` Andy Shevchenko
0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2026-04-27 7:58 UTC (permalink / raw)
To: Antony Kurniawan Soemardi
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-arm-msm, devicetree, linux-kernel,
linux-iio, phone-devel
On Sat, Apr 25, 2026 at 08:39:20PM +0000, Antony Kurniawan Soemardi wrote:
> These functions do not modify the indio_dev & adc structure, so they
> should be marked const to allow the compiler to catch any accidental
> modifications and to document the read only nature of these functions.
...
> - struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
> + const struct iio_dev *indio_dev = d;
> + const struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
>
> complete(&adc->complete);
Pointer to a constant object assumes no modification to that, isn't it? Please,
compile your code first.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-04-27 7:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25 20:39 [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 1/4] ARM: dts: qcom: pm8921: add labels for ADC channels Antony Kurniawan Soemardi
2026-04-25 20:39 ` [PATCH v4 2/4] iio: adc: qcom-pm8xxx-xoadc: remove redundant error logs when reading values Antony Kurniawan Soemardi
2026-04-27 7:53 ` Andy Shevchenko
2026-04-25 20:39 ` [PATCH v4 3/4] iio: adc: qcom-pm8xxx-xoadc: constify pointers in read operations Antony Kurniawan Soemardi
2026-04-27 7:58 ` Andy Shevchenko
2026-04-25 20:39 ` [PATCH v4 4/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels Antony Kurniawan Soemardi
2026-04-26 13:21 ` [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT Jonathan Cameron
2026-04-26 13:24 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox