Re: [PATCH 09/11] hwmon: (ina2xx) Consolidate chip initialization code

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

 



On Tue, Aug 27, 2024 at 08:34:53AM -0700, Guenter Roeck wrote:
> +static int ina2xx_init(struct device *dev, struct ina2xx_data *data)
> +{
> +	u16 config = data->config->config_default;
> +	struct regmap *regmap = data->regmap;
> +	u32 shunt;
> +	int ret;
[...]
> +	if (data->chip == ina226 &&
> +	    device_property_read_bool(dev, "ti,alert-polarity-active-high"))
> +		config |= INA226_ALERT_POLARITY;

This looks wrong to me.  The polarity setting should be in INA226_MASK_ENABLE
instead of INA2XX_CONFIG.

> +
> +	ret = regmap_write(regmap, INA2XX_CONFIG, config);
> +	if (ret < 0)
> +		return ret;
> +




[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