Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391033 > unrolled thread

[PATCH 0/3] Add available sampling frequency and scale attributes

Started byDaniel Baluta <daniel.baluta@intel.com>
First post2016-04-29 13:50 +0200
Last post2016-05-01 23:30 +0200
Articles 8 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] Add available sampling frequency and scale attributes Daniel Baluta <daniel.baluta@intel.com> - 2016-04-29 13:50 +0200
    [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes Daniel Baluta <daniel.baluta@intel.com> - 2016-04-29 13:50 +0200
      Re: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes Jonathan Cameron <jic23@kernel.org> - 2016-05-01 23:30 +0200
        Re: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes Jonathan Cameron <jic23@kernel.org> - 2016-05-04 16:40 +0200
    [PATCH 1/3] iio: bmi160: Fix output data rate for accel Daniel Baluta <daniel.baluta@intel.com> - 2016-04-29 13:50 +0200
      Re: [PATCH 1/3] iio: bmi160: Fix output data rate for accel Jonathan Cameron <jic23@kernel.org> - 2016-05-01 23:30 +0200
        Re: [PATCH 1/3] iio: bmi160: Fix output data rate for accel Jonathan Cameron <jic23@kernel.org> - 2016-05-04 16:40 +0200
    Re: [PATCH 0/3] Add available sampling frequency and scale attributes Jonathan Cameron <jic23@kernel.org> - 2016-05-01 23:30 +0200

#1391033 — [PATCH 0/3] Add available sampling frequency and scale attributes

FromDaniel Baluta <daniel.baluta@intel.com>
Date2016-04-29 13:50 +0200
Subject[PATCH 0/3] Add available sampling frequency and scale attributes
Message-ID<rtf5M-5f6-3@gated-at.bofh.it>
First two patches are bugfixes related to sampling frequency and the last
one is adding support for exporting available sampling frequency and scale.

Daniel Baluta (3):
  iio: bmi160: Fix output data rate for accel
  iio: bmi160: Fix ODR setting
  imu: bmi160: Add avail frequency and scale attributes

 drivers/iio/imu/bmi160/bmi160_core.c | 43 +++++++++++++++++++++++++++++-------
 1 file changed, 35 insertions(+), 8 deletions(-)

-- 
2.5.0

[toc] | [next] | [standalone]


#1391034 — [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes

FromDaniel Baluta <daniel.baluta@intel.com>
Date2016-04-29 13:50 +0200
Subject[PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes
Message-ID<rtf5N-5f6-15@gated-at.bofh.it>
In reply to#1391033
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 drivers/iio/imu/bmi160/bmi160_core.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
index b8a290e..97928d5 100644
--- a/drivers/iio/imu/bmi160/bmi160_core.c
+++ b/drivers/iio/imu/bmi160/bmi160_core.c
@@ -20,6 +20,7 @@
 #include <linux/iio/triggered_buffer.h>
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/buffer.h>
+#include <linux/iio/sysfs.h>
 
 #include "bmi160.h"
 
@@ -466,10 +467,36 @@ static int bmi160_write_raw(struct iio_dev *indio_dev,
 	return 0;
 }
 
+static
+IIO_CONST_ATTR(in_accel_sampling_frequency_available,
+	       "0.78125 1.5625 3.125 6.25 12.5 25 50 100 200 400 800 1600");
+static
+IIO_CONST_ATTR(in_anglvel_sampling_frequency_available,
+	       "25 50 100 200 400 800 1600 3200");
+static
+IIO_CONST_ATTR(in_accel_scale_available,
+	       "0.000598 0.001197 0.002394 0.004788");
+static
+IIO_CONST_ATTR(in_anglvel_scale_available,
+	       "0.001065 0.000532 0.000266 0.000133 0.000066");
+
+static struct attribute *bmi160_attrs[] = {
+	&iio_const_attr_in_accel_sampling_frequency_available.dev_attr.attr,
+	&iio_const_attr_in_anglvel_sampling_frequency_available.dev_attr.attr,
+	&iio_const_attr_in_accel_scale_available.dev_attr.attr,
+	&iio_const_attr_in_anglvel_scale_available.dev_attr.attr,
+	NULL,
+};
+
+static const struct attribute_group bmi160_attrs_group = {
+	.attrs = bmi160_attrs,
+};
+
 static const struct iio_info bmi160_info = {
 	.driver_module = THIS_MODULE,
 	.read_raw = bmi160_read_raw,
 	.write_raw = bmi160_write_raw,
+	.attrs = &bmi160_attrs_group,
 };
 
 static const char *bmi160_match_acpi_device(struct device *dev)
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1391889 — Re: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes

FromJonathan Cameron <jic23@kernel.org>
Date2016-05-01 23:30 +0200
SubjectRe: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes
Message-ID<ru76a-86o-5@gated-at.bofh.it>
In reply to#1391034
On 29/04/16 12:42, Daniel Baluta wrote:
> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
These are not strictly 'required' so will have to be next cycle now...

Again, poke me if I haven't  picked this up in a week or so...
Jonathan
> ---
>  drivers/iio/imu/bmi160/bmi160_core.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
> index b8a290e..97928d5 100644
> --- a/drivers/iio/imu/bmi160/bmi160_core.c
> +++ b/drivers/iio/imu/bmi160/bmi160_core.c
> @@ -20,6 +20,7 @@
>  #include <linux/iio/triggered_buffer.h>
>  #include <linux/iio/trigger_consumer.h>
>  #include <linux/iio/buffer.h>
> +#include <linux/iio/sysfs.h>
>  
>  #include "bmi160.h"
>  
> @@ -466,10 +467,36 @@ static int bmi160_write_raw(struct iio_dev *indio_dev,
>  	return 0;
>  }
>  
> +static
> +IIO_CONST_ATTR(in_accel_sampling_frequency_available,
> +	       "0.78125 1.5625 3.125 6.25 12.5 25 50 100 200 400 800 1600");
> +static
> +IIO_CONST_ATTR(in_anglvel_sampling_frequency_available,
> +	       "25 50 100 200 400 800 1600 3200");
> +static
> +IIO_CONST_ATTR(in_accel_scale_available,
> +	       "0.000598 0.001197 0.002394 0.004788");
> +static
> +IIO_CONST_ATTR(in_anglvel_scale_available,
> +	       "0.001065 0.000532 0.000266 0.000133 0.000066");
> +
> +static struct attribute *bmi160_attrs[] = {
> +	&iio_const_attr_in_accel_sampling_frequency_available.dev_attr.attr,
> +	&iio_const_attr_in_anglvel_sampling_frequency_available.dev_attr.attr,
> +	&iio_const_attr_in_accel_scale_available.dev_attr.attr,
> +	&iio_const_attr_in_anglvel_scale_available.dev_attr.attr,
> +	NULL,
> +};
> +
> +static const struct attribute_group bmi160_attrs_group = {
> +	.attrs = bmi160_attrs,
> +};
> +
>  static const struct iio_info bmi160_info = {
>  	.driver_module = THIS_MODULE,
>  	.read_raw = bmi160_read_raw,
>  	.write_raw = bmi160_write_raw,
> +	.attrs = &bmi160_attrs_group,
>  };
>  
>  static const char *bmi160_match_acpi_device(struct device *dev)
> 

[toc] | [prev] | [next] | [standalone]


#1394365 — Re: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes

FromJonathan Cameron <jic23@kernel.org>
Date2016-05-04 16:40 +0200
SubjectRe: [PATCH 3/3] imu: bmi160: Add avail frequency and scale attributes
Message-ID<rv683-5L8-53@gated-at.bofh.it>
In reply to#1391889
On 01/05/16 20:01, Jonathan Cameron wrote:
> On 29/04/16 12:42, Daniel Baluta wrote:
>> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
> These are not strictly 'required' so will have to be next cycle now...
> 
> Again, poke me if I haven't  picked this up in a week or so...
> Jonathan
Applied to the togreg branch of iio.git

Thanks,

Jonathan
>> ---
>>  drivers/iio/imu/bmi160/bmi160_core.c | 27 +++++++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
>> index b8a290e..97928d5 100644
>> --- a/drivers/iio/imu/bmi160/bmi160_core.c
>> +++ b/drivers/iio/imu/bmi160/bmi160_core.c
>> @@ -20,6 +20,7 @@
>>  #include <linux/iio/triggered_buffer.h>
>>  #include <linux/iio/trigger_consumer.h>
>>  #include <linux/iio/buffer.h>
>> +#include <linux/iio/sysfs.h>
>>  
>>  #include "bmi160.h"
>>  
>> @@ -466,10 +467,36 @@ static int bmi160_write_raw(struct iio_dev *indio_dev,
>>  	return 0;
>>  }
>>  
>> +static
>> +IIO_CONST_ATTR(in_accel_sampling_frequency_available,
>> +	       "0.78125 1.5625 3.125 6.25 12.5 25 50 100 200 400 800 1600");
>> +static
>> +IIO_CONST_ATTR(in_anglvel_sampling_frequency_available,
>> +	       "25 50 100 200 400 800 1600 3200");
>> +static
>> +IIO_CONST_ATTR(in_accel_scale_available,
>> +	       "0.000598 0.001197 0.002394 0.004788");
>> +static
>> +IIO_CONST_ATTR(in_anglvel_scale_available,
>> +	       "0.001065 0.000532 0.000266 0.000133 0.000066");
>> +
>> +static struct attribute *bmi160_attrs[] = {
>> +	&iio_const_attr_in_accel_sampling_frequency_available.dev_attr.attr,
>> +	&iio_const_attr_in_anglvel_sampling_frequency_available.dev_attr.attr,
>> +	&iio_const_attr_in_accel_scale_available.dev_attr.attr,
>> +	&iio_const_attr_in_anglvel_scale_available.dev_attr.attr,
>> +	NULL,
>> +};
>> +
>> +static const struct attribute_group bmi160_attrs_group = {
>> +	.attrs = bmi160_attrs,
>> +};
>> +
>>  static const struct iio_info bmi160_info = {
>>  	.driver_module = THIS_MODULE,
>>  	.read_raw = bmi160_read_raw,
>>  	.write_raw = bmi160_write_raw,
>> +	.attrs = &bmi160_attrs_group,
>>  };
>>  
>>  static const char *bmi160_match_acpi_device(struct device *dev)
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [prev] | [next] | [standalone]


#1391036 — [PATCH 1/3] iio: bmi160: Fix output data rate for accel

FromDaniel Baluta <daniel.baluta@intel.com>
Date2016-04-29 13:50 +0200
Subject[PATCH 1/3] iio: bmi160: Fix output data rate for accel
Message-ID<rtf5N-5f6-23@gated-at.bofh.it>
In reply to#1391033
Format is INT_PLUS_MICRO and micro odr part of ODR should
be parts of a micro.

Also s/8000/800 this is obviously a typo.

Fixes: 77c4ad2d6a9 ("iio: imu: Add initial support for Bosch BMI160")
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 drivers/iio/imu/bmi160/bmi160_core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
index 0bf92b0..cd9b75e 100644
--- a/drivers/iio/imu/bmi160/bmi160_core.c
+++ b/drivers/iio/imu/bmi160/bmi160_core.c
@@ -209,11 +209,11 @@ static const struct  bmi160_scale_item bmi160_scale_table[] = {
 };
 
 static const struct bmi160_odr bmi160_accel_odr[] = {
-	{0x01, 0, 78125},
-	{0x02, 1, 5625},
-	{0x03, 3, 125},
-	{0x04, 6, 25},
-	{0x05, 12, 5},
+	{0x01, 0, 781250},
+	{0x02, 1, 562500},
+	{0x03, 3, 125000},
+	{0x04, 6, 250000},
+	{0x05, 12, 500000},
 	{0x06, 25, 0},
 	{0x07, 50, 0},
 	{0x08, 100, 0},
@@ -229,7 +229,7 @@ static const struct bmi160_odr bmi160_gyro_odr[] = {
 	{0x08, 100, 0},
 	{0x09, 200, 0},
 	{0x0A, 400, 0},
-	{0x0B, 8000, 0},
+	{0x0B, 800, 0},
 	{0x0C, 1600, 0},
 	{0x0D, 3200, 0},
 };
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1391905 — Re: [PATCH 1/3] iio: bmi160: Fix output data rate for accel

FromJonathan Cameron <jic23@kernel.org>
Date2016-05-01 23:30 +0200
SubjectRe: [PATCH 1/3] iio: bmi160: Fix output data rate for accel
Message-ID<ru76c-86o-47@gated-at.bofh.it>
In reply to#1391036
On 29/04/16 12:42, Daniel Baluta wrote:
> Format is INT_PLUS_MICRO and micro odr part of ODR should
> be parts of a micro.
> 
> Also s/8000/800 this is obviously a typo.
> 
> Fixes: 77c4ad2d6a9 ("iio: imu: Add initial support for Bosch BMI160")
> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
I can't set up a suitable fixes branch for this as I'm without internet to grab an
updated staging-next tree right now.  Will mark it to be sorted out when I get some time
back on a sensible internet connection (France is always a lot bigger than I expect it
to be for some reason...)

Anyhow, poke me if you don't hear anything before the end of the week.

Note this will probably have to go in post merge window now as I doubt I'll be doing
another pull before that opens.

Jonathan
> ---
>  drivers/iio/imu/bmi160/bmi160_core.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
> index 0bf92b0..cd9b75e 100644
> --- a/drivers/iio/imu/bmi160/bmi160_core.c
> +++ b/drivers/iio/imu/bmi160/bmi160_core.c
> @@ -209,11 +209,11 @@ static const struct  bmi160_scale_item bmi160_scale_table[] = {
>  };
>  
>  static const struct bmi160_odr bmi160_accel_odr[] = {
> -	{0x01, 0, 78125},
> -	{0x02, 1, 5625},
> -	{0x03, 3, 125},
> -	{0x04, 6, 25},
> -	{0x05, 12, 5},
> +	{0x01, 0, 781250},
> +	{0x02, 1, 562500},
> +	{0x03, 3, 125000},
> +	{0x04, 6, 250000},
> +	{0x05, 12, 500000},
>  	{0x06, 25, 0},
>  	{0x07, 50, 0},
>  	{0x08, 100, 0},
> @@ -229,7 +229,7 @@ static const struct bmi160_odr bmi160_gyro_odr[] = {
>  	{0x08, 100, 0},
>  	{0x09, 200, 0},
>  	{0x0A, 400, 0},
> -	{0x0B, 8000, 0},
> +	{0x0B, 800, 0},
>  	{0x0C, 1600, 0},
>  	{0x0D, 3200, 0},
>  };
> 

[toc] | [prev] | [next] | [standalone]


#1394366 — Re: [PATCH 1/3] iio: bmi160: Fix output data rate for accel

FromJonathan Cameron <jic23@kernel.org>
Date2016-05-04 16:40 +0200
SubjectRe: [PATCH 1/3] iio: bmi160: Fix output data rate for accel
Message-ID<rv683-5L8-51@gated-at.bofh.it>
In reply to#1391905
On 01/05/16 20:00, Jonathan Cameron wrote:
> On 29/04/16 12:42, Daniel Baluta wrote:
>> Format is INT_PLUS_MICRO and micro odr part of ODR should
>> be parts of a micro.
>>
>> Also s/8000/800 this is obviously a typo.
>>
>> Fixes: 77c4ad2d6a9 ("iio: imu: Add initial support for Bosch BMI160")
>> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
> I can't set up a suitable fixes branch for this as I'm without internet to grab an
> updated staging-next tree right now.  Will mark it to be sorted out when I get some time
> back on a sensible internet connection (France is always a lot bigger than I expect it
> to be for some reason...)
> 
> Anyhow, poke me if you don't hear anything before the end of the week.
> 
> Note this will probably have to go in post merge window now as I doubt I'll be doing
> another pull before that opens.
> 
> Jonathan
Applied to the fixes-togreg-post-rc1 branch which will get pushed out when
I get home.  France is awfully big sometimes.

Jonathan
>> ---
>>  drivers/iio/imu/bmi160/bmi160_core.c | 12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
>> index 0bf92b0..cd9b75e 100644
>> --- a/drivers/iio/imu/bmi160/bmi160_core.c
>> +++ b/drivers/iio/imu/bmi160/bmi160_core.c
>> @@ -209,11 +209,11 @@ static const struct  bmi160_scale_item bmi160_scale_table[] = {
>>  };
>>  
>>  static const struct bmi160_odr bmi160_accel_odr[] = {
>> -	{0x01, 0, 78125},
>> -	{0x02, 1, 5625},
>> -	{0x03, 3, 125},
>> -	{0x04, 6, 25},
>> -	{0x05, 12, 5},
>> +	{0x01, 0, 781250},
>> +	{0x02, 1, 562500},
>> +	{0x03, 3, 125000},
>> +	{0x04, 6, 250000},
>> +	{0x05, 12, 500000},
>>  	{0x06, 25, 0},
>>  	{0x07, 50, 0},
>>  	{0x08, 100, 0},
>> @@ -229,7 +229,7 @@ static const struct bmi160_odr bmi160_gyro_odr[] = {
>>  	{0x08, 100, 0},
>>  	{0x09, 200, 0},
>>  	{0x0A, 400, 0},
>> -	{0x0B, 8000, 0},
>> +	{0x0B, 800, 0},
>>  	{0x0C, 1600, 0},
>>  	{0x0D, 3200, 0},
>>  };
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [prev] | [next] | [standalone]


#1391902

FromJonathan Cameron <jic23@kernel.org>
Date2016-05-01 23:30 +0200
Message-ID<ru76c-86o-41@gated-at.bofh.it>
In reply to#1391033
On 29/04/16 12:42, Daniel Baluta wrote:
> First two patches are bugfixes related to sampling frequency and the last
> one is adding support for exporting available sampling frequency and scale.
> 
> Daniel Baluta (3):
>   iio: bmi160: Fix output data rate for accel
>   iio: bmi160: Fix ODR setting
>   imu: bmi160: Add avail frequency and scale attributes
> 
>  drivers/iio/imu/bmi160/bmi160_core.c | 43 +++++++++++++++++++++++++++++-------
>  1 file changed, 35 insertions(+), 8 deletions(-)
> 
*cough* Daniel, a part name might be nice in the cover letter title!

J

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web