Re: [PATCH 2/2] hwmon: temperature: add support for EMC1812

From: Guenter Roeck

Date: Wed Oct 29 2025 - 18:03:32 EST


On Wed, Oct 29, 2025 at 05:50:59PM +0200, Marius Cristea wrote:
> This is the hwmon driver for Microchip EMC1812/13/14/15/33
> Multichannel Low-Voltage Remote Diode Sensor Family.
>
> Signed-off-by: Marius Cristea <marius.cristea@xxxxxxxxxxxxx>

One more ...

> +static int emc1812_parse_fw_config(struct emc1812_data *data, struct device *dev)
> +{
> + unsigned int reg_nr = 0;
> + int ret;
> +

I added
if (!dev_fwnode(dev)) {
data->num_channels = data->chip->phys_channels;
data->active_ch_mask = BIT(data->num_channels) - 1;
return 0;
}

to be able to load the driver and run basic unit tests.
I expect something similar in the final driver.

Also, here is the unit test result from writing negative values
into the limit registers:

temp1_crit: Suspected underflow: [min=0, read 4294903296, written -2147483648]
temp1_min: Suspected underflow: [min=0, read 4294903296, written -2147483648]
temp1_max: Suspected underflow: [min=0, read 4294903296, written -2147483648]
temp2_crit: Suspected underflow: [min=0, read 4294903296, written -2147483648]
temp2_min: Suspected underflow: [min=0, read 4294903296, written -2147483648]
temp2_max: Suspected underflow: [min=0, read 4294903296, written -2147483648]

Thanks,
Guenter