All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>, linux-iio@vger.kernel.org
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Subject: Re: [PATCH 01/13] iio:bma180: Fix scale factors to report correct acceleration units
Date: Sun, 20 Jul 2014 17:39:06 +0100	[thread overview]
Message-ID: <53CBF0AA.2090003@kernel.org> (raw)
In-Reply-To: <1405535576-26482-2-git-send-email-pmeerw@pmeerw.net>

On 16/07/14 19:32, Peter Meerwald wrote:
> 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@pmeerw.net>
> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

> ---
>   drivers/iio/accel/bma180.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
> index a7e68c8..28388bb 100644
> --- a/drivers/iio/accel/bma180.c
> +++ b/drivers/iio/accel/bma180.c
> @@ -68,13 +68,13 @@
>   /* Defaults values */
>   #define BMA180_DEF_PMODE	0
>   #define BMA180_DEF_BW		20
> -#define BMA180_DEF_SCALE	250
> +#define BMA180_DEF_SCALE	2452
>
>   /* Available values for sysfs */
>   #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)
>   {
>


  reply	other threads:[~2014-07-20 16:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 18:32 [PATCH 00/13] iio:bma180: Fixes and BMA250 support Peter Meerwald
2014-07-16 18:32 ` [PATCH 01/13] iio:bma180: Fix scale factors to report correct acceleration units Peter Meerwald
2014-07-20 16:39   ` Jonathan Cameron [this message]
2014-07-16 18:32 ` [PATCH 02/13] iio:bma180: Missing check for frequency fractional part Peter Meerwald
2014-07-20 16:41   ` Jonathan Cameron
2014-07-16 18:32 ` [PATCH 03/13] iio:bma180: Enable use of device without IRQ Peter Meerwald
2014-07-16 18:32 ` [PATCH 04/13] iio:bma180: Prefix remaining tables and functions with bma18_ Peter Meerwald
2014-07-16 18:32 ` [PATCH 05/13] iio:bma180: Rename BMA_180 to BMA180_ Peter Meerwald
2014-07-16 18:32 ` [PATCH 06/13] iio:bma180: Use bool instead of int for state Peter Meerwald
2014-07-16 18:32 ` [PATCH 07/13] iio:bma180: Expose temperature channel Peter Meerwald
2014-07-16 18:32 ` [PATCH 08/13] iio:bma180: Drop _update_scan_mode() Peter Meerwald
2014-07-16 18:32 ` [PATCH 09/13] iio:bma180: Introduce part_info to differentiate further chip variants Peter Meerwald
2014-07-16 18:32 ` [PATCH 10/13] iio:bma180: Introduce part-specific _config() and disable() code Peter Meerwald
2014-07-16 18:32 ` [PATCH 11/13] iio:bma180: Prepare for accelerometer channels with different resolutions Peter Meerwald
2014-07-16 18:32 ` [PATCH 12/13] iio:bma180: Implement _available sysfs attribute dynamically Peter Meerwald
2014-07-16 18:32 ` [PATCH 13/13] iio:bma180: Add BMA250 chip support Peter Meerwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53CBF0AA.2090003@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=o.v.kravchenko@globallogic.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.