Re: [PATCH 3/6] hwmon: (max1619) Convert to use regmap

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

 



On Sat, Jul 27, 2024 at 10:22:42PM -0700, Guenter Roeck wrote:
> On 7/27/24 21:26, Tzung-Bi Shih wrote:
> > On Sat, Jul 27, 2024 at 07:38:17AM -0700, Guenter Roeck wrote:
> > > +static int get_alarms(struct regmap *regmap)
> > > +{
> > > +	static u32 regs[2] = { MAX1619_REG_STATUS, MAX1619_REG_CONFIG };
> > > +	u8 regdata[2];
> > > +	int ret;
> > > +
> > > +	ret = regmap_multi_reg_read(regmap, regs, regdata, 2);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	/* OVERT status bit may be reversed */
> > > +	if (!(regdata[1] & 0x20))
> > > +		regdata[0] ^= 0x02;
> > > +
> > > +	return regdata[0] & 0x1e;
> > 
> > Why `& 0x1e`?  Original max1619_update_device() doesn't do that.
> > 
> 
> Bit 7 is the busy bit, and the other three masked bits are reserved.
> Maybe I should make that change in a separate patch. What do you think ?

Yes, please separate the change.




[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