Re: [PATCH 2/6] hwmon: (max6697) Drop platform data support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 23, 2024 at 05:37:11AM +0000, Tzung-Bi Shih wrote:
> On Mon, Jul 22, 2024 at 05:52:00PM -0700, Guenter Roeck wrote:
> > +static int max6697_config_of(struct max6697_data *data, struct i2c_client *client)
> >  {
> [...]
> > -	pdata->smbus_timeout_disable =
> > -		of_property_read_bool(node, "smbus-timeout-disable");
> > -	pdata->extended_range_enable =
> > -		of_property_read_bool(node, "extended-range-enable");
> > -	pdata->beta_compensation =
> > -		of_property_read_bool(node, "beta-compensation-enable");
> > +	confreg = 0;
> > +	if (of_property_read_bool(node, "smbus-timeout-disable") &&
> > +	    (data->chip->valid_conf & MAX6697_CONF_TIMEOUT)) {
> 
> s/data->chip/chip/.
> 
> > +	if (data->type == max6581) {
> 
> Should be `data->type != max6581`.
> 

Correct, It needs a bit more, actually. For max6581, the check needs to be

	if (of_property_read_u32(node, "resistance-cancellation", &vals[0]) &&
	    of_property_read_bool(node, "resistance-cancellation"))
		vals[0] = 0xfe;
	else
		vals[0] = 0;

because the bindings specifically permit to have a boolean
resistance-cancellation for this chip as well.

Thanks!

Guenter




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux