Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
Hi Guenter, On Dec 1, 2016, at 2:08 PM, Guenter Roeck wrote: > >> >> Should we be concerned about restoring the configuration here? >> > Interesting question. If the chip was really powered off, you would > have to restore the entire configuration, not just the

Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread Guenter Roeck
Hi John, On Thu, Dec 01, 2016 at 01:50:22PM -0800, John Muir wrote: > Hi Guenter, > [ ... ] > > >> +static int __maybe_unused tmp108_resume(struct device *dev) > >> +{ > >> + struct tmp108 *tmp108 = dev_get_drvdata(dev); > >> + int err; > >> + > >> + err = regmap_write(tmp108->regmap,

Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
Hi Guenter, On Dec 1, 2016, at 7:19 AM, Guenter Roeck wrote: > >> +/* convert 12-bit TMP108 register value to milliCelsius */ >> +static inline int tmp108_temp_reg_to_mC(s16 val) >> +{ >> +return (val & ~0x01) * 1000 / 256; > > Why ~0x01 and not ~0x0f ? The lower 4 bits