linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: adis16480: Fix scales factors
@ 2019-10-25 12:45 Nuno Sá
  2019-10-25 12:45 ` [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry Nuno Sá
  2019-10-27 16:24 ` [PATCH 1/2] iio: adis16480: Fix scales factors Jonathan Cameron
  0 siblings, 2 replies; 7+ messages in thread
From: Nuno Sá @ 2019-10-25 12:45 UTC (permalink / raw)
  To: linux-iio
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Stable

This patch fixes the scales for the gyroscope, accelerometer and
barometer. The pressure scale was just wrong. For the others, the scale
factors were not taking into account that a 32bit word is being read
from the device.

Fixes: 7abad1063deb ("iio: adis16480: Fix scale factors")
Fixes: 9fe09f1337ee ("iio: imu: adis16480: Add support for ADIS1649x family of devices")
Fixes: 49c4a18357c8 ("iio: imu: adis16480: Add support for ADIS16490")
Cc: <Stable@vger.kernel.org>

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/iio/imu/adis16480.c | 77 ++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 36 deletions(-)

diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index b99d73887c9f..3b53bbb11bfb 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -620,9 +620,13 @@ static int adis16480_read_raw(struct iio_dev *indio_dev,
 			*val2 = (st->chip_info->temp_scale % 1000) * 1000;
 			return IIO_VAL_INT_PLUS_MICRO;
 		case IIO_PRESSURE:
-			*val = 0;
-			*val2 = 4000; /* 40ubar = 0.004 kPa */
-			return IIO_VAL_INT_PLUS_MICRO;
+			/*
+			 * max scale is 1310 mbar
+			 * max raw value is 32767 shifted for 32bits
+			 */
+			*val = 131; /* 1310mbar = 131 kPa */
+			*val2 = 32767 << 16;
+			return IIO_VAL_FRACTIONAL;
 		default:
 			return -EINVAL;
 		}
@@ -783,13 +787,14 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
 		/*
-		 * storing the value in rad/degree and the scale in degree
-		 * gives us the result in rad and better precession than
-		 * storing the scale directly in rad.
+		 * Typically we do IIO_RAD_TO_DEGREE in the denominator, which
+		 * is exactly the same as IIO_DEGREE_TO_RAD in numerator, since
+		 * it gives better approximation. However, in this case we
+		 * cannot do it since it would not fit in a 32bit variable.
 		 */
-		.gyro_max_val = IIO_RAD_TO_DEGREE(22887),
-		.gyro_max_scale = 300,
-		.accel_max_val = IIO_M_S_2_TO_G(21973),
+		.gyro_max_val = 22887 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(300),
+		.accel_max_val = IIO_M_S_2_TO_G(21973 << 16),
 		.accel_max_scale = 18,
 		.temp_scale = 5650, /* 5.65 milli degree Celsius */
 		.int_clk = 2460000,
@@ -799,9 +804,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16480] = {
 		.channels = adis16480_channels,
 		.num_channels = ARRAY_SIZE(adis16480_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
-		.gyro_max_scale = 450,
-		.accel_max_val = IIO_M_S_2_TO_G(12500),
+		.gyro_max_val = 22500 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
+		.accel_max_val = IIO_M_S_2_TO_G(12500 << 16),
 		.accel_max_scale = 10,
 		.temp_scale = 5650, /* 5.65 milli degree Celsius */
 		.int_clk = 2460000,
@@ -811,9 +816,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16485] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
-		.gyro_max_scale = 450,
-		.accel_max_val = IIO_M_S_2_TO_G(20000),
+		.gyro_max_val = 22500 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
+		.accel_max_val = IIO_M_S_2_TO_G(20000 << 16),
 		.accel_max_scale = 5,
 		.temp_scale = 5650, /* 5.65 milli degree Celsius */
 		.int_clk = 2460000,
@@ -823,9 +828,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16488] = {
 		.channels = adis16480_channels,
 		.num_channels = ARRAY_SIZE(adis16480_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
-		.gyro_max_scale = 450,
-		.accel_max_val = IIO_M_S_2_TO_G(22500),
+		.gyro_max_val = 22500 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
+		.accel_max_val = IIO_M_S_2_TO_G(22500 << 16),
 		.accel_max_scale = 18,
 		.temp_scale = 5650, /* 5.65 milli degree Celsius */
 		.int_clk = 2460000,
@@ -835,9 +840,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16495_1] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
-		.gyro_max_scale = 125,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 20000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(125),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 8,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
@@ -848,9 +853,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16495_2] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(18000),
-		.gyro_max_scale = 450,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 18000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 8,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
@@ -861,9 +866,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16495_3] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
-		.gyro_max_scale = 2000,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 20000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(2000),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 8,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
@@ -874,9 +879,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16497_1] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
-		.gyro_max_scale = 125,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 20000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(125),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 40,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
@@ -887,9 +892,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16497_2] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(18000),
-		.gyro_max_scale = 450,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 18000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 40,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
@@ -900,9 +905,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16497_3] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
-		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
-		.gyro_max_scale = 2000,
-		.accel_max_val = IIO_M_S_2_TO_G(32000),
+		.gyro_max_val = 20000 << 16,
+		.gyro_max_scale = IIO_DEGREE_TO_RAD(2000),
+		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
 		.accel_max_scale = 40,
 		.temp_scale = 12500, /* 12.5 milli degree Celsius */
 		.int_clk = 4250000,
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry
  2019-10-25 12:45 [PATCH 1/2] iio: adis16480: Fix scales factors Nuno Sá
@ 2019-10-25 12:45 ` Nuno Sá
  2019-10-27 16:37   ` Jonathan Cameron
  2019-10-27 16:24 ` [PATCH 1/2] iio: adis16480: Fix scales factors Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Nuno Sá @ 2019-10-25 12:45 UTC (permalink / raw)
  To: linux-iio
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler

The driver is defining debugfs entries by calling
`adis16480_debugfs_init()`. However, those entries are attached to the
iio_dev debugfs entry which won't exist if no debugfs_reg_access
callback is provided.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/iio/imu/adis16480.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index 3b53bbb11bfb..94aa1c57e605 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -921,6 +921,7 @@ static const struct iio_info adis16480_info = {
 	.read_raw = &adis16480_read_raw,
 	.write_raw = &adis16480_write_raw,
 	.update_scan_mode = adis_update_scan_mode,
+	.debugfs_reg_access = adis_debugfs_reg_access,
 };
 
 static int adis16480_stop_device(struct iio_dev *indio_dev)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] iio: adis16480: Fix scales factors
  2019-10-25 12:45 [PATCH 1/2] iio: adis16480: Fix scales factors Nuno Sá
  2019-10-25 12:45 ` [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry Nuno Sá
@ 2019-10-27 16:24 ` Jonathan Cameron
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2019-10-27 16:24 UTC (permalink / raw)
  To: Nuno Sá
  Cc: linux-iio, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Stable

On Fri, 25 Oct 2019 14:45:07 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> This patch fixes the scales for the gyroscope, accelerometer and
> barometer. The pressure scale was just wrong. For the others, the scale
> factors were not taking into account that a 32bit word is being read
> from the device.
> 
> Fixes: 7abad1063deb ("iio: adis16480: Fix scale factors")
> Fixes: 9fe09f1337ee ("iio: imu: adis16480: Add support for ADIS1649x family of devices")
> Fixes: 49c4a18357c8 ("iio: imu: adis16480: Add support for ADIS16490")
> Cc: <Stable@vger.kernel.org>
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>

I can see why this was wrong.  The adis16375 data sheet presents what looks
like a nice easy to understand table with the values stated (Table 14) but
that only covers the upper 16 bits.

Anyhow, fix seems correct to me. The snag is going to be that backporting
is going to be tricky.

Also, that second fixes tag appears to be non existent in my tree or
mainline.  Could you fix that and resend.

Thanks,

Jonathan


> ---
>  drivers/iio/imu/adis16480.c | 77 ++++++++++++++++++++-----------------
>  1 file changed, 41 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index b99d73887c9f..3b53bbb11bfb 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -620,9 +620,13 @@ static int adis16480_read_raw(struct iio_dev *indio_dev,
>  			*val2 = (st->chip_info->temp_scale % 1000) * 1000;
>  			return IIO_VAL_INT_PLUS_MICRO;
>  		case IIO_PRESSURE:
> -			*val = 0;
> -			*val2 = 4000; /* 40ubar = 0.004 kPa */
> -			return IIO_VAL_INT_PLUS_MICRO;
> +			/*
> +			 * max scale is 1310 mbar
> +			 * max raw value is 32767 shifted for 32bits
> +			 */
> +			*val = 131; /* 1310mbar = 131 kPa */
> +			*val2 = 32767 << 16;
> +			return IIO_VAL_FRACTIONAL;
>  		default:
>  			return -EINVAL;
>  		}
> @@ -783,13 +787,14 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
>  		/*
> -		 * storing the value in rad/degree and the scale in degree
> -		 * gives us the result in rad and better precession than
> -		 * storing the scale directly in rad.
> +		 * Typically we do IIO_RAD_TO_DEGREE in the denominator, which
> +		 * is exactly the same as IIO_DEGREE_TO_RAD in numerator, since
> +		 * it gives better approximation. However, in this case we
> +		 * cannot do it since it would not fit in a 32bit variable.
>  		 */
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(22887),
> -		.gyro_max_scale = 300,
> -		.accel_max_val = IIO_M_S_2_TO_G(21973),
> +		.gyro_max_val = 22887 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(300),
> +		.accel_max_val = IIO_M_S_2_TO_G(21973 << 16),
>  		.accel_max_scale = 18,
>  		.temp_scale = 5650, /* 5.65 milli degree Celsius */
>  		.int_clk = 2460000,
> @@ -799,9 +804,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16480] = {
>  		.channels = adis16480_channels,
>  		.num_channels = ARRAY_SIZE(adis16480_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
> -		.gyro_max_scale = 450,
> -		.accel_max_val = IIO_M_S_2_TO_G(12500),
> +		.gyro_max_val = 22500 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
> +		.accel_max_val = IIO_M_S_2_TO_G(12500 << 16),
>  		.accel_max_scale = 10,
>  		.temp_scale = 5650, /* 5.65 milli degree Celsius */
>  		.int_clk = 2460000,
> @@ -811,9 +816,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16485] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
> -		.gyro_max_scale = 450,
> -		.accel_max_val = IIO_M_S_2_TO_G(20000),
> +		.gyro_max_val = 22500 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
> +		.accel_max_val = IIO_M_S_2_TO_G(20000 << 16),
>  		.accel_max_scale = 5,
>  		.temp_scale = 5650, /* 5.65 milli degree Celsius */
>  		.int_clk = 2460000,
> @@ -823,9 +828,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16488] = {
>  		.channels = adis16480_channels,
>  		.num_channels = ARRAY_SIZE(adis16480_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
> -		.gyro_max_scale = 450,
> -		.accel_max_val = IIO_M_S_2_TO_G(22500),
> +		.gyro_max_val = 22500 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
> +		.accel_max_val = IIO_M_S_2_TO_G(22500 << 16),
>  		.accel_max_scale = 18,
>  		.temp_scale = 5650, /* 5.65 milli degree Celsius */
>  		.int_clk = 2460000,
> @@ -835,9 +840,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16495_1] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
> -		.gyro_max_scale = 125,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 20000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(125),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 8,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,
> @@ -848,9 +853,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16495_2] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(18000),
> -		.gyro_max_scale = 450,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 18000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 8,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,
> @@ -861,9 +866,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16495_3] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
> -		.gyro_max_scale = 2000,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 20000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(2000),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 8,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,
> @@ -874,9 +879,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16497_1] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
> -		.gyro_max_scale = 125,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 20000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(125),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 40,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,
> @@ -887,9 +892,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16497_2] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(18000),
> -		.gyro_max_scale = 450,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 18000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(450),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 40,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,
> @@ -900,9 +905,9 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
>  	[ADIS16497_3] = {
>  		.channels = adis16485_channels,
>  		.num_channels = ARRAY_SIZE(adis16485_channels),
> -		.gyro_max_val = IIO_RAD_TO_DEGREE(20000),
> -		.gyro_max_scale = 2000,
> -		.accel_max_val = IIO_M_S_2_TO_G(32000),
> +		.gyro_max_val = 20000 << 16,
> +		.gyro_max_scale = IIO_DEGREE_TO_RAD(2000),
> +		.accel_max_val = IIO_M_S_2_TO_G(32000 << 16),
>  		.accel_max_scale = 40,
>  		.temp_scale = 12500, /* 12.5 milli degree Celsius */
>  		.int_clk = 4250000,


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry
  2019-10-25 12:45 ` [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry Nuno Sá
@ 2019-10-27 16:37   ` Jonathan Cameron
  2019-10-28  8:25     ` Sa, Nuno
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2019-10-27 16:37 UTC (permalink / raw)
  To: Nuno Sá
  Cc: linux-iio, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler

On Fri, 25 Oct 2019 14:45:08 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> The driver is defining debugfs entries by calling
> `adis16480_debugfs_init()`. However, those entries are attached to the
> iio_dev debugfs entry which won't exist if no debugfs_reg_access
> callback is provided.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
As you are respinning the first one and this is probably stable
material as well, please add a fixes tag for v2.
Thanks,

Jonathan

> ---
>  drivers/iio/imu/adis16480.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index 3b53bbb11bfb..94aa1c57e605 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -921,6 +921,7 @@ static const struct iio_info adis16480_info = {
>  	.read_raw = &adis16480_read_raw,
>  	.write_raw = &adis16480_write_raw,
>  	.update_scan_mode = adis_update_scan_mode,
> +	.debugfs_reg_access = adis_debugfs_reg_access,
>  };
>  
>  static int adis16480_stop_device(struct iio_dev *indio_dev)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry
  2019-10-27 16:37   ` Jonathan Cameron
@ 2019-10-28  8:25     ` Sa, Nuno
  2019-10-29 18:25       ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Sa, Nuno @ 2019-10-28  8:25 UTC (permalink / raw)
  To: jic23; +Cc: Hennerich, Michael, lars, linux-iio, pmeerw, knaack.h

On Sun, 2019-10-27 at 16:37 +0000, Jonathan Cameron wrote:
> On Fri, 25 Oct 2019 14:45:08 +0200
> Nuno Sá <nuno.sa@analog.com> wrote:
> 
> > The driver is defining debugfs entries by calling
> > `adis16480_debugfs_init()`. However, those entries are attached to
> > the
> > iio_dev debugfs entry which won't exist if no debugfs_reg_access
> > callback is provided.
> > 
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> As you are respinning the first one and this is probably stable
> material as well, please add a fixes tag for v2.
> Thanks,
> 

Will do that. Should I also cc Stable?

Thanks!
Nuno Sá

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry
  2019-10-28  8:25     ` Sa, Nuno
@ 2019-10-29 18:25       ` Jonathan Cameron
  2019-10-30  7:53         ` Sa, Nuno
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2019-10-29 18:25 UTC (permalink / raw)
  To: Sa, Nuno; +Cc: jic23, Hennerich, Michael, lars, linux-iio, pmeerw, knaack.h

On Mon, 28 Oct 2019 08:25:24 +0000
"Sa, Nuno" <Nuno.Sa@analog.com> wrote:

> On Sun, 2019-10-27 at 16:37 +0000, Jonathan Cameron wrote:
> > On Fri, 25 Oct 2019 14:45:08 +0200
> > Nuno Sá <nuno.sa@analog.com> wrote:
> >   
> > > The driver is defining debugfs entries by calling
> > > `adis16480_debugfs_init()`. However, those entries are attached to
> > > the
> > > iio_dev debugfs entry which won't exist if no debugfs_reg_access
> > > callback is provided.
> > > 
> > > Signed-off-by: Nuno Sá <nuno.sa@analog.com>  
> > As you are respinning the first one and this is probably stable
> > material as well, please add a fixes tag for v2.
> > Thanks,
> >   
> 
> Will do that. Should I also cc Stable?
Nope, I'll add that once we are happy with it.  Otherwise they'll
get spammed with every version along the way.  They only need
to care once it hit's Linus' tree.

Thanks,

Jonathan
> 
> Thanks!
> Nuno Sá



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry
  2019-10-29 18:25       ` Jonathan Cameron
@ 2019-10-30  7:53         ` Sa, Nuno
  0 siblings, 0 replies; 7+ messages in thread
From: Sa, Nuno @ 2019-10-30  7:53 UTC (permalink / raw)
  To: jonathan.cameron
  Cc: jic23, Hennerich, Michael, lars, linux-iio, pmeerw, knaack.h

On Tue, 2019-10-29 at 18:25 +0000, Jonathan Cameron wrote:
> On Mon, 28 Oct 2019 08:25:24 +0000
> "Sa, Nuno" <Nuno.Sa@analog.com> wrote:
> 
> > On Sun, 2019-10-27 at 16:37 +0000, Jonathan Cameron wrote:
> > > On Fri, 25 Oct 2019 14:45:08 +0200
> > > Nuno Sá <nuno.sa@analog.com> wrote:
> > >   
> > > > The driver is defining debugfs entries by calling
> > > > `adis16480_debugfs_init()`. However, those entries are attached
> > > > to
> > > > the
> > > > iio_dev debugfs entry which won't exist if no
> > > > debugfs_reg_access
> > > > callback is provided.
> > > > 
> > > > Signed-off-by: Nuno Sá <nuno.sa@analog.com>  
> > > As you are respinning the first one and this is probably stable
> > > material as well, please add a fixes tag for v2.
> > > Thanks,
> > >   
> > 
> > Will do that. Should I also cc Stable?
> Nope, I'll add that once we are happy with it.  Otherwise they'll
> get spammed with every version along the way.  They only need
> to care once it hit's Linus' tree.
> 

Ups, I already sent a v2 with stable on Cc. Sorry for that, next time I
know.
 
Nuno Sá

> Thanks,
> 
> Jonathan
> > Thanks!
> > Nuno Sá
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-30  7:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 12:45 [PATCH 1/2] iio: adis16480: Fix scales factors Nuno Sá
2019-10-25 12:45 ` [PATCH 2/2] iio: adis16480: Add debugfs_reg_access entry Nuno Sá
2019-10-27 16:37   ` Jonathan Cameron
2019-10-28  8:25     ` Sa, Nuno
2019-10-29 18:25       ` Jonathan Cameron
2019-10-30  7:53         ` Sa, Nuno
2019-10-27 16:24 ` [PATCH 1/2] iio: adis16480: Fix scales factors Jonathan Cameron

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).