Re: [PATCH] iio: pressure: add support for MS5611 pressure and temperature sensor
From: Daniel Baluta
Date: Sun Mar 08 2015 - 15:11:21 EST
Hi Tomasz,
On Sun, Mar 8, 2015 at 7:29 PM, Tomasz Duszynski <tduszyns@xxxxxxxxx> wrote:
> Add support for Measurement Specialities MS5611 pressure
> and temperature sensor.
>
> Signed-off-by: Tomasz Duszynski <tduszyns@xxxxxxxxx>
<snip>
> +++ b/drivers/iio/pressure/ms5611_i2c.c
> @@ -0,0 +1,131 @@
> +/*
> + * MS5611 pressure and temperature sensor driver (I2C bus)
> + *
> + * Copyright (c) Tomasz Duszynski <tduszyns@xxxxxxxxx>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
If fixed, please specify here the I2C slave address.
> + */
> +#include <linux/delay.h>
<snip>
> +static int ms5611_read_adc(struct ms5611_state *st, s32 *val)
> +{
> + int ret;
> + u8 buf[3];
> +
> + ret = i2c_smbus_read_i2c_block_data(st->client, MS5611_READ_ADC,
> + 3, buf);
> + if (ret < 0)
> + return ret;
> +
> + *val = (buf[0] << 16) | (buf[1] << 8) | buf[0];
Hmm, buf[2] is not used. Is this intended or the formula
has buf[2] as the last OR factor?
thanks,
Daniel.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/