* [PATCH 2/5] staging:iio:adis16201: Set self_test_no_autoclear flag
2016-04-15 14:59 [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Lars-Peter Clausen
@ 2016-04-15 14:59 ` Lars-Peter Clausen
2016-04-16 12:44 ` Jonathan Cameron
2016-04-15 14:59 ` [PATCH 3/5] staging:iio:adis16203: " Lars-Peter Clausen
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Lars-Peter Clausen @ 2016-04-15 14:59 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio,
Lars-Peter Clausen
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/accel/adis16201_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c
index 06c0b75..6f3f8ff 100644
--- a/drivers/staging/iio/accel/adis16201_core.c
+++ b/drivers/staging/iio/accel/adis16201_core.c
@@ -167,6 +167,7 @@ static const struct adis_data adis16201_data = {
.diag_stat_reg = ADIS16201_DIAG_STAT,
.self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN,
+ .self_test_no_autoclear = true,
.startup_delay = ADIS16201_STARTUP_DELAY,
.status_error_msgs = adis16201_status_error_msgs,
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] staging:iio:adis16201: Set self_test_no_autoclear flag
2016-04-15 14:59 ` [PATCH 2/5] staging:iio:adis16201: Set self_test_no_autoclear flag Lars-Peter Clausen
@ 2016-04-16 12:44 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2016-04-16 12:44 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio
On 15/04/16 15:59, Lars-Peter Clausen wrote:
> The ADIS16201 does not automatically clear the self test flag bit the self
> test has been, so clear it manually. Otherwise we'll see a offset caused by
> the self-test bias on the output values during normal operation.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
> ---
> drivers/staging/iio/accel/adis16201_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c
> index 06c0b75..6f3f8ff 100644
> --- a/drivers/staging/iio/accel/adis16201_core.c
> +++ b/drivers/staging/iio/accel/adis16201_core.c
> @@ -167,6 +167,7 @@ static const struct adis_data adis16201_data = {
> .diag_stat_reg = ADIS16201_DIAG_STAT,
>
> .self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN,
> + .self_test_no_autoclear = true,
> .startup_delay = ADIS16201_STARTUP_DELAY,
>
> .status_error_msgs = adis16201_status_error_msgs,
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/5] staging:iio:adis16203: Set self_test_no_autoclear flag
2016-04-15 14:59 [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Lars-Peter Clausen
2016-04-15 14:59 ` [PATCH 2/5] staging:iio:adis16201: Set self_test_no_autoclear flag Lars-Peter Clausen
@ 2016-04-15 14:59 ` Lars-Peter Clausen
2016-04-16 12:44 ` Jonathan Cameron
2016-04-15 14:59 ` [PATCH 4/5] staging:iio:adis16209: " Lars-Peter Clausen
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Lars-Peter Clausen @ 2016-04-15 14:59 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio,
Lars-Peter Clausen
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/accel/adis16203_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c
index de5b84a..c706717 100644
--- a/drivers/staging/iio/accel/adis16203_core.c
+++ b/drivers/staging/iio/accel/adis16203_core.c
@@ -134,6 +134,7 @@ static const struct adis_data adis16203_data = {
.diag_stat_reg = ADIS16203_DIAG_STAT,
.self_test_mask = ADIS16203_MSC_CTRL_SELF_TEST_EN,
+ .self_test_no_autoclear = true,
.startup_delay = ADIS16203_STARTUP_DELAY,
.status_error_msgs = adis16203_status_error_msgs,
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/5] staging:iio:adis16203: Set self_test_no_autoclear flag
2016-04-15 14:59 ` [PATCH 3/5] staging:iio:adis16203: " Lars-Peter Clausen
@ 2016-04-16 12:44 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2016-04-16 12:44 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio
On 15/04/16 15:59, Lars-Peter Clausen wrote:
> The ADIS16201 does not automatically clear the self test flag bit the self
> test has been, so clear it manually. Otherwise we'll see a offset caused by
> the self-test bias on the output values during normal operation.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
> ---
> drivers/staging/iio/accel/adis16203_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c
> index de5b84a..c706717 100644
> --- a/drivers/staging/iio/accel/adis16203_core.c
> +++ b/drivers/staging/iio/accel/adis16203_core.c
> @@ -134,6 +134,7 @@ static const struct adis_data adis16203_data = {
> .diag_stat_reg = ADIS16203_DIAG_STAT,
>
> .self_test_mask = ADIS16203_MSC_CTRL_SELF_TEST_EN,
> + .self_test_no_autoclear = true,
> .startup_delay = ADIS16203_STARTUP_DELAY,
>
> .status_error_msgs = adis16203_status_error_msgs,
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/5] staging:iio:adis16209: Set self_test_no_autoclear flag
2016-04-15 14:59 [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Lars-Peter Clausen
2016-04-15 14:59 ` [PATCH 2/5] staging:iio:adis16201: Set self_test_no_autoclear flag Lars-Peter Clausen
2016-04-15 14:59 ` [PATCH 3/5] staging:iio:adis16203: " Lars-Peter Clausen
@ 2016-04-15 14:59 ` Lars-Peter Clausen
2016-04-16 12:44 ` Jonathan Cameron
2016-04-15 14:59 ` [PATCH 5/5] staging:iio:adis16240: " Lars-Peter Clausen
2016-04-16 12:43 ` [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Jonathan Cameron
4 siblings, 1 reply; 10+ messages in thread
From: Lars-Peter Clausen @ 2016-04-15 14:59 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio,
Lars-Peter Clausen
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/accel/adis16209_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c
index 8b42bf8..8dbad58 100644
--- a/drivers/staging/iio/accel/adis16209_core.c
+++ b/drivers/staging/iio/accel/adis16209_core.c
@@ -168,6 +168,7 @@ static const struct adis_data adis16209_data = {
.diag_stat_reg = ADIS16209_DIAG_STAT,
.self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN,
+ .self_test_no_autoclear = true,
.startup_delay = ADIS16209_STARTUP_DELAY,
.status_error_msgs = adis16209_status_error_msgs,
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] staging:iio:adis16209: Set self_test_no_autoclear flag
2016-04-15 14:59 ` [PATCH 4/5] staging:iio:adis16209: " Lars-Peter Clausen
@ 2016-04-16 12:44 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2016-04-16 12:44 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio
On 15/04/16 15:59, Lars-Peter Clausen wrote:
> The ADIS16201 does not automatically clear the self test flag bit the self
> test has been, so clear it manually. Otherwise we'll see a offset caused by
> the self-test bias on the output values during normal operation.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
> ---
> drivers/staging/iio/accel/adis16209_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c
> index 8b42bf8..8dbad58 100644
> --- a/drivers/staging/iio/accel/adis16209_core.c
> +++ b/drivers/staging/iio/accel/adis16209_core.c
> @@ -168,6 +168,7 @@ static const struct adis_data adis16209_data = {
> .diag_stat_reg = ADIS16209_DIAG_STAT,
>
> .self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN,
> + .self_test_no_autoclear = true,
> .startup_delay = ADIS16209_STARTUP_DELAY,
>
> .status_error_msgs = adis16209_status_error_msgs,
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 5/5] staging:iio:adis16240: Set self_test_no_autoclear flag
2016-04-15 14:59 [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Lars-Peter Clausen
` (2 preceding siblings ...)
2016-04-15 14:59 ` [PATCH 4/5] staging:iio:adis16209: " Lars-Peter Clausen
@ 2016-04-15 14:59 ` Lars-Peter Clausen
2016-04-16 12:44 ` Jonathan Cameron
2016-04-16 12:43 ` [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Jonathan Cameron
4 siblings, 1 reply; 10+ messages in thread
From: Lars-Peter Clausen @ 2016-04-15 14:59 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio,
Lars-Peter Clausen
The ADIS16201 does not automatically clear the self test flag bit the self
test has been, so clear it manually. Otherwise we'll see a offset caused by
the self-test bias on the output values during normal operation.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/staging/iio/accel/adis16240_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c
index a425e18..d5b99e6 100644
--- a/drivers/staging/iio/accel/adis16240_core.c
+++ b/drivers/staging/iio/accel/adis16240_core.c
@@ -222,6 +222,7 @@ static const struct adis_data adis16240_data = {
.diag_stat_reg = ADIS16240_DIAG_STAT,
.self_test_mask = ADIS16240_MSC_CTRL_SELF_TEST_EN,
+ .self_test_no_autoclear = true,
.startup_delay = ADIS16240_STARTUP_DELAY,
.status_error_msgs = adis16240_status_error_msgs,
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] staging:iio:adis16240: Set self_test_no_autoclear flag
2016-04-15 14:59 ` [PATCH 5/5] staging:iio:adis16240: " Lars-Peter Clausen
@ 2016-04-16 12:44 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2016-04-16 12:44 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio
On 15/04/16 15:59, Lars-Peter Clausen wrote:
> The ADIS16201 does not automatically clear the self test flag bit the self
> test has been, so clear it manually. Otherwise we'll see a offset caused by
> the self-test bias on the output values during normal operation.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
> ---
> drivers/staging/iio/accel/adis16240_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c
> index a425e18..d5b99e6 100644
> --- a/drivers/staging/iio/accel/adis16240_core.c
> +++ b/drivers/staging/iio/accel/adis16240_core.c
> @@ -222,6 +222,7 @@ static const struct adis_data adis16240_data = {
> .diag_stat_reg = ADIS16240_DIAG_STAT,
>
> .self_test_mask = ADIS16240_MSC_CTRL_SELF_TEST_EN,
> + .self_test_no_autoclear = true,
> .startup_delay = ADIS16240_STARTUP_DELAY,
>
> .status_error_msgs = adis16240_status_error_msgs,
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] iio:adis: Add support for manual self-test flag clear
2016-04-15 14:59 [PATCH 1/5] iio:adis: Add support for manual self-test flag clear Lars-Peter Clausen
` (3 preceding siblings ...)
2016-04-15 14:59 ` [PATCH 5/5] staging:iio:adis16240: " Lars-Peter Clausen
@ 2016-04-16 12:43 ` Jonathan Cameron
4 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2016-04-16 12:43 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio
On 15/04/16 15:59, Lars-Peter Clausen wrote:
> Some variants of the devices from the ADIS family don't auto-clear the
> self-test bit after the self-test has completed. Instead we have to
> manually clear. Add support for this to the ADIS library.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> I think we can get away without applying this to stable since the drivers
> have been broken since forever and so this is more of a new feature rather
> than a regression fix.
OK, though then I'm going to route them the slow way rather than as fixes
so applied to the togreg branch of iio.git.
We can always backport if anyone cares.
Jonathan
> ---
> drivers/iio/imu/adis.c | 7 ++++++-
> include/linux/iio/imu/adis.h | 1 +
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
> index 911255d..ad6f91d 100644
> --- a/drivers/iio/imu/adis.c
> +++ b/drivers/iio/imu/adis.c
> @@ -324,7 +324,12 @@ static int adis_self_test(struct adis *adis)
>
> msleep(adis->data->startup_delay);
>
> - return adis_check_status(adis);
> + ret = adis_check_status(adis);
> +
> + if (adis->data->self_test_no_autoclear)
> + adis_write_reg_16(adis, adis->data->msc_ctrl_reg, 0x00);
> +
> + return ret;
> }
>
> /**
> diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
> index fa2d01e..360da7d 100644
> --- a/include/linux/iio/imu/adis.h
> +++ b/include/linux/iio/imu/adis.h
> @@ -41,6 +41,7 @@ struct adis_data {
> unsigned int diag_stat_reg;
>
> unsigned int self_test_mask;
> + bool self_test_no_autoclear;
> unsigned int startup_delay;
>
> const char * const *status_error_msgs;
>
^ permalink raw reply [flat|nested] 10+ messages in thread