Re: [PATCH 4/5] iio: mcp9600: Add support for thermocouple-type
From: Ben Collins
Date: Sat Aug 16 2025 - 09:18:32 EST
> On Aug 16, 2025, at 6:11 AM, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> On Fri, 15 Aug 2025 16:46:06 +0000
> Ben Collins <bcollins@xxxxxxxxxx> 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@xxxxxxxxxx>
> Hi Ben,
>
> Just one trivial thing inline.
...
>>
>> +static int mcp9600_config(struct mcp9600_data *data)
>> +{
>> + struct i2c_client *client = data->client;
>> + int ret;
>> + u8 cfg;
>> +
>> + cfg = FIELD_PREP(MCP9600_SENSOR_TYPE_MASK,
>> + mcp9600_type_map[data->thermocouple_type]);
>> +
>> + ret = i2c_smbus_write_byte_data(client, MCP9600_SENSOR_CFG, cfg);
>> + if (ret < 0) {
>> + dev_err(&client->dev, "Failed to set sensor configuration\n");
>
> Only called from probe so use return dev_err_probe() here
Hi Johnathan. That’s correct in this patch. However, in the IIR patch
I call this when the filter is set, so it didn’t seem to make sense to
do it that way, just to change it in the next patch.
I appreciate all the feedback. I’ll get things cleaned in for v4.