[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7cd6f642-b26a-45aa-a2f2-ccb7fbc28b20@baylibre.com>
Date: Sat, 16 Aug 2025 13:24:24 -0500
From: David Lechner <dlechner@...libre.com>
To: Ben Collins <bcollins@...ter.com>, Jonathan Cameron <jic23@...nel.org>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] iio: mcp9600: Add support for thermocouple-type
On 8/15/25 11:46 AM, Ben Collins wrote:
> dt-bindings documentation for this driver claims to support
> thermocouple-type, but the driver does not actually make use of
> the property.
>
> Implement usage of the property to configure the chip for the
> selected thermocouple-type.
>
> Signed-off-by: Ben Collins <bcollins@...ter.com>
> ---
...
> @@ -453,6 +504,24 @@ static int mcp9600_probe(struct i2c_client *client)
> data = iio_priv(indio_dev);
> data->client = client;
>
> + /* Accept type from dt with default of Type-K. */
We still also need a dt-bindings patch to specify the default there as well.
> + data->thermocouple_type = THERMOCOUPLE_TYPE_K;
> + ret = device_property_read_u32(&client->dev, "thermocouple-type",
> + &data->thermocouple_type);
> + if (ret < 0 && ret != -EINVAL)
> + return dev_err_probe(&client->dev, ret,
> + "Error reading thermocouple-type property\n");
> +
> + if (data->thermocouple_type >= ARRAY_SIZE(mcp9600_type_map))
> + return dev_err_probe(&client->dev, -EINVAL,
> + "Invalid thermocouple-type property %u.\n",
> + data->thermocouple_type);
> +
> + /* Set initial config. */
> + ret = mcp9600_config(data);
> + if (ret < 0)
> + return ret;
> +
> ch_sel = mcp9600_probe_alerts(indio_dev);
> if (ch_sel < 0)
> return ch_sel;
Powered by blists - more mailing lists