Re: [lm-sensors] [PATCH v2] hwmon: (max31722) Add threshold alarm support

Guenter Roeck <[email protected]> Tue, 05 Apr 2016 16:02:31 +0000
Newsgroups org.kernel.vger.lm-sensors
Message-ID <[email protected]>
On Tue, Apr 05, 2016 at 03:53:33PM +0300, Tiberiu Breana wrote:
> Add threshold alarm support for the max31722 temperature sensor driver.
> 
> Signed-off-by: Tiberiu Breana <[email protected]>
> ---
[ ... ]
> +
> +	/*
> +	 * Do a quick temperature reading and compare it with TLOW/THIGH
> +	 * so we can tell which threshold has been met.
> +	 */
> +	ret = spi_w8r16(data->spi_device, MAX31722_REG_TEMP_LSB);
> +	if (ret < 0)
> +		goto exit_err;
> +	temp = (s16)(le16_to_cpu(ret) * 125 / 32);

Another comment: No need to convert values to milli-degrees here.
Just use raw register values.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors