[PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT

Antony Kurniawan Soemardi posted 4 patches 1 month, 3 weeks ago
There is a newer version of this series
arch/arm/boot/dts/qcom/pm8921.dtsi  | 12 ++++++++
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 56 ++++++++++++++++++++-----------------
2 files changed, 43 insertions(+), 25 deletions(-)
[PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
Posted by Antony Kurniawan Soemardi 1 month, 3 weeks ago
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>

Re: [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
Posted by Jonathan Cameron 1 month, 3 weeks ago
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
Re: [PATCH v4 0/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels from DT
Posted by Jonathan Cameron 1 month, 3 weeks ago
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
>