Re: [PATCH 3/3] iio:bma180: Fix scale factors to report correct acceleration units

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the default value (250->2452) needs to be changed as well, I'll send an 
updated patch

p.

> The userspace interface for acceleration sensors is documented as using
> m/s^2 units [Documentation/ABI/testing/sysfs-bus-iio]
> 
> The fullscale raw values for the BMA80 corresponds to -/+ 1, 1.5, 2, etc G
> depending on the selected mode.
> 
> The scale table was converting to G rather than m/s^2.
> Change the scaling table to match the documented interface.
> 
> See commit 71702e6e, iio: mma8452: Use correct acceleration units,
> for a related fix.
> 
> Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>
> Cc: Oleksandr Kravchenko <o.v.kravchenko@xxxxxxxxxxxxxxx>
> ---
>  drivers/iio/accel/bma180.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
> index a7e68c8..b1c7ab4 100644
> --- a/drivers/iio/accel/bma180.c
> +++ b/drivers/iio/accel/bma180.c
> @@ -74,7 +74,7 @@
>  #define BMA180_FLP_FREQ_AVAILABLE \
>  	"10 20 40 75 150 300"
>  #define BMA180_SCALE_AVAILABLE \
> -	"0.000130 0.000190 0.000250 0.000380 0.000500 0.000990 0.001980"
> +	"0.001275 0.001863 0.002452 0.003727 0.004903 0.009709 0.019417"
>  
>  struct bma180_data {
>  	struct i2c_client *client;
> @@ -94,7 +94,7 @@ enum bma180_axis {
>  };
>  
>  static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */
> -static int scale_table[] = { 130, 190, 250, 380, 500, 990, 1980 };
> +static int scale_table[] = { 1275, 1863, 2452, 3727, 4903, 9709, 19417 };
>  
>  static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis)
>  {
> 

-- 

Peter Meerwald
+43-664-2444418 (mobile)
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux