lkml.org 
[lkml]   [2015]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] iio: pressure: add support for MS5611 pressure and temperature sensor
From
Hi Tomasz,

On Sun, Mar 8, 2015 at 7:29 PM, Tomasz Duszynski <tduszyns@gmail.com> wrote:
> Add support for Measurement Specialities MS5611 pressure
> and temperature sensor.
>
> Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>

<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@gmail.com>
> + *
> + * 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.


\
 
 \ /
  Last update: 2015-03-08 20:21    [W:0.098 / U:2.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site