lkml.org 
[lkml]   [2015]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/10] iio: imu: kmx61: Use correct base when reading data
Daniel Baluta schrieb am 23.12.2014 um 14:22:
> We have two IIO devices and we need to adjust the base
> when reading data.
>
> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
> drivers/iio/imu/kmx61.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
> index 98369eb..6178cea 100644
> --- a/drivers/iio/imu/kmx61.c
> +++ b/drivers/iio/imu/kmx61.c
> @@ -1210,12 +1210,18 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p)
> struct iio_dev *indio_dev = pf->indio_dev;
> struct kmx61_data *data = kmx61_get_data(indio_dev);
> int bit, ret, i = 0;
> + u8 base;
> s16 buffer[8];
>
> + if (indio_dev == data->acc_indio_dev)
> + base = KMX61_ACC_XOUT_L;
> + else
> + base = KMX61_MAG_XOUT_L;
> +
> mutex_lock(&data->lock);
> for_each_set_bit(bit, indio_dev->buffer->scan_mask,
> indio_dev->masklength) {
> - ret = kmx61_read_measurement(data, KMX61_ACC_XOUT_L, bit);
> + ret = kmx61_read_measurement(data, base, bit);
> if (ret < 0) {
> mutex_unlock(&data->lock);
> goto err;
>



\
 
 \ /
  Last update: 2015-01-01 15:01    [W:0.092 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site