Re: [PATCH v6 6/6] iio: dac: ad5504: support scale via output-range-microvolt property

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The driver ignores the unified 'output-range-microvolt' device property for ACPI nodes.
--

--- Patch [6]: [PATCH v6 6/6] iio: dac: ad5504: support scale via output-range-microvolt property ---
commit b4531e8367c77df3a5fc929eab7e4b61b58ad05a
Author: Taha Ed-Dafili <[email protected]>

iio: dac: ad5504: support scale via output-range-microvolt property

This commit introduces the output-range-microvolt device property to
configure the vref_mv scale directly from firmware. It provides a fallback
to the vcc regulator voltage for older device trees that do not have this
property.

> diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
> index d22bb16e911b9..9ad9d0666e271 100644
> --- a/drivers/iio/dac/ad5504.c
> +++ b/drivers/iio/dac/ad5504.c
> @@ -315,12 +316,30 @@ static int ad5504_probe(struct spi_device *spi)
>  	if (is_acpi_device_node(dev_fwnode(dev))) {
>  		st->vref_mv = AD5504_VREF_ACPI_DEFAULT_mV;
>  	} else {
> +		if (device_property_present(dev, "output-range-microvolt")) {

[Severity: Medium]
Does this structure prevent ACPI devices from utilizing the newly added
output-range-microvolt property?

Since the device_property_present() check in ad5504_probe() is located inside
the else block of the is_acpi_device_node() condition, an ACPI platform
specifying this property via _DSD will have it silently ignored. The driver
will instead always use the hardcoded AD5504_VREF_ACPI_DEFAULT_mV value.

Should the firmware-agnostic device property check occur before falling back
to the legacy ACPI-specific default?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.