Re: [PATCH v6 4/4] iio: adc: qcom-pm8xxx-xoadc: add support for reading channel labels
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.phone-devel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
On Sun, May 10, 2026 at 07:01:45AM +0000, Antony Kurniawan Soemardi wrote: > Implement the .read_label callback to allow userspace to identify ADC I would write in a usual pattern here, id est .read_label(). But no need to resend just for that. > 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: Andy Shevchenko <[email protected]> ... > +{ > + 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; Usually we add blank line here (and in similar cases). > + return sysfs_emit(label, "%s\n", ch->label); > +} Again, no need to resend, I hope these can be fixed by Jonathan whilst applying. -- With Best Regards, Andy Shevchenko