From: Jonathan Cameron <jic23@kernel.org>
To: Denis CIOCCA <denis.ciocca@st.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:magnetometer: bugfix magnetometers gain values
Date: Sun, 14 Sep 2014 18:21:52 +0100 [thread overview]
Message-ID: <5415CEB0.8070105@kernel.org> (raw)
In-Reply-To: <1410353737-17542-1-git-send-email-denis.ciocca@st.com>
On 10/09/14 13:55, Denis CIOCCA wrote:
> This patch fix gains values. The first driver was designed using
> engineering samples, in mass production the values are changed.
>
> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
Jonathan
> ---
> drivers/iio/magnetometer/st_magn_core.c | 52 +++++++++++++++++++--------------
> 1 file changed, 30 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index a4b6413..68cae86 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -42,7 +42,8 @@
> #define ST_MAGN_FS_AVL_5600MG 5600
> #define ST_MAGN_FS_AVL_8000MG 8000
> #define ST_MAGN_FS_AVL_8100MG 8100
> -#define ST_MAGN_FS_AVL_10000MG 10000
> +#define ST_MAGN_FS_AVL_12000MG 12000
> +#define ST_MAGN_FS_AVL_16000MG 16000
>
> /* CUSTOM VALUES FOR SENSOR 1 */
> #define ST_MAGN_1_WAI_EXP 0x3c
> @@ -69,20 +70,20 @@
> #define ST_MAGN_1_FS_AVL_4700_VAL 0x05
> #define ST_MAGN_1_FS_AVL_5600_VAL 0x06
> #define ST_MAGN_1_FS_AVL_8100_VAL 0x07
> -#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100
> -#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855
> -#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670
> -#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450
> -#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400
> -#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330
> -#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230
> -#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980
> -#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760
> -#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600
> -#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400
> -#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355
> -#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295
> -#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205
> +#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909
> +#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169
> +#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492
> +#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222
> +#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500
> +#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030
> +#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347
> +#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020
> +#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315
> +#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666
> +#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500
> +#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816
> +#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389
> +#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878
> #define ST_MAGN_1_MULTIREAD_BIT false
>
> /* CUSTOM VALUES FOR SENSOR 2 */
> @@ -105,10 +106,12 @@
> #define ST_MAGN_2_FS_MASK 0x60
> #define ST_MAGN_2_FS_AVL_4000_VAL 0x00
> #define ST_MAGN_2_FS_AVL_8000_VAL 0x01
> -#define ST_MAGN_2_FS_AVL_10000_VAL 0x02
> -#define ST_MAGN_2_FS_AVL_4000_GAIN 430
> -#define ST_MAGN_2_FS_AVL_8000_GAIN 230
> -#define ST_MAGN_2_FS_AVL_10000_GAIN 230
> +#define ST_MAGN_2_FS_AVL_12000_VAL 0x02
> +#define ST_MAGN_2_FS_AVL_16000_VAL 0x03
> +#define ST_MAGN_2_FS_AVL_4000_GAIN 146
> +#define ST_MAGN_2_FS_AVL_8000_GAIN 292
> +#define ST_MAGN_2_FS_AVL_12000_GAIN 438
> +#define ST_MAGN_2_FS_AVL_16000_GAIN 584
> #define ST_MAGN_2_MULTIREAD_BIT false
> #define ST_MAGN_2_OUT_X_L_ADDR 0x28
> #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a
> @@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = {
> .gain = ST_MAGN_2_FS_AVL_8000_GAIN,
> },
> [2] = {
> - .num = ST_MAGN_FS_AVL_10000MG,
> - .value = ST_MAGN_2_FS_AVL_10000_VAL,
> - .gain = ST_MAGN_2_FS_AVL_10000_GAIN,
> + .num = ST_MAGN_FS_AVL_12000MG,
> + .value = ST_MAGN_2_FS_AVL_12000_VAL,
> + .gain = ST_MAGN_2_FS_AVL_12000_GAIN,
> + },
> + [3] = {
> + .num = ST_MAGN_FS_AVL_16000MG,
> + .value = ST_MAGN_2_FS_AVL_16000_VAL,
> + .gain = ST_MAGN_2_FS_AVL_16000_GAIN,
> },
> },
> },
>
prev parent reply other threads:[~2014-09-14 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-10 12:55 [PATCH] iio:magnetometer: bugfix magnetometers gain values Denis CIOCCA
2014-09-14 17:21 ` Jonathan Cameron [this message]
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=5415CEB0.8070105@kernel.org \
--to=jic23@kernel.org \
--cc=denis.ciocca@st.com \
--cc=linux-iio@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).