Message ID | 20230502-iio-adc-propagate-fw-node-label-v3-0-6be5db6e6b5a@somainline.org |
---|---|
Headers | show |
Series | iio: adc: qcom-spmi-vadc: Propagate fw node label to userspace | expand |
On 02/05/2023 02:17, Marijn Suijten wrote: > Set the read_label() callback to return a friendly name provided in DT > (firmware), in order to make in_{therm,voltage}X_label attributes show > up in sysfs for userspace to consume a channel name. This is > particularly useful for custom thermistors being attached to otherwise > generically named GPIOs, where the name is known by the board DT. > > If the channel name isn't set in DT, use the datasheet_name hardcoded in > the driver instead. > > Note that this doesn't fall back to fwnode_get_name() as that provides > suboptimally readable names, with an @xx address suffix from board DT. > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > --- > drivers/iio/adc/qcom-spmi-vadc.c | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
On 02/05/2023 02:17, Marijn Suijten wrote: > Since the migration to fwnode_get_name in commit 4f47a236a23d ("iio: > adc: qcom-spmi-adc5: convert to device properties") the resulting > adc5_channel_prop::channel_name (renamed from datasheet_name in the > previous patch) - which is propagated into iio_chan_spec::extend_name - > was containing the DT node name including @xx suffix if a "label" > property is not present, while adc5_channels::datasheet_name was thus > far set by the macros but always remained unread. Put it to use instead > of using a confusing name containing @xx in sysfs filenames (again, when > "label" is not set). > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > --- > drivers/iio/adc/qcom-spmi-adc5.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
On Sun, 7 May 2023 18:43:16 +0300 Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote: > On 02/05/2023 02:17, Marijn Suijten wrote: > > Set the read_label() callback to return a friendly name provided in DT > > (firmware), in order to make in_{therm,voltage}X_label attributes show > > up in sysfs for userspace to consume a channel name. This is > > particularly useful for custom thermistors being attached to otherwise > > generically named GPIOs, where the name is known by the board DT. > > > > If the channel name isn't set in DT, use the datasheet_name hardcoded in > > the driver instead. > > > > Note that this doesn't fall back to fwnode_get_name() as that provides > > suboptimally readable names, with an @xx address suffix from board DT. > > > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> > > --- > > drivers/iio/adc/qcom-spmi-vadc.c | 19 ++++++++++++++++++- > > 1 file changed, 18 insertions(+), 1 deletion(-) > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Thanks, Series applied to the togreg branch of iio.git - initially pushed out as testing to let 0-day work it's magic before I go potentially making a mess in linux-next. Jonathan