Re: [PATCH v7 3/7] iio: adc: mcp3564: Add support for spi-device-addr
From: Marius.Cristea
Date: Wed Jul 22 2026 - 13:09:38 EST
On Wed, 2026-07-22 at 09:54 +0200, Janani Sunil wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Read the generic spi-device-addr property when determining the
> hardware
> device address. Fall back to the deprecated microchip,hw-device-
> address
> property to preserve compatibility with existing device trees.
>
> The device address remains 1 when neither property is present.
>
> Signed-off-by: Janani Sunil <janani.sunil@xxxxxxxxxx>
> ---
> drivers/iio/adc/mcp3564.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/mcp3564.c b/drivers/iio/adc/mcp3564.c
> index 36675563829e..71deb05e878e 100644
> --- a/drivers/iio/adc/mcp3564.c
> +++ b/drivers/iio/adc/mcp3564.c
> @@ -1122,7 +1122,9 @@ static int mcp3564_config(struct iio_dev
> *indio_dev, bool *use_internal_vref_att
> * addresses are available when multiple devices are present
> on the same
> * SPI bus with only one Chip Select line for all devices.
> */
> - device_property_read_u32(dev, "microchip,hw-device-address",
> &tmp);
> + ret = device_property_read_u32(dev, "spi-device-addr", &tmp);
> + if (ret)
> + device_property_read_u32(dev, "microchip,hw-device-
> address", &tmp);
>
> if (tmp > 3) {
> dev_err_probe(dev, tmp,
>
> --
> 2.43.0
Reviewed-by: Marius Cristea <marius.cristea@xxxxxxxxxxxxx>