Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] iio: cros_ec: Set Gyroscope default frequency to 25Hz
@ 2020-07-28 20:48 Gwendal Grignou
  2020-07-31 11:17 ` Enric Balletbo i Serra
  0 siblings, 1 reply; 3+ messages in thread
From: Gwendal Grignou @ 2020-07-28 20:48 UTC (permalink / raw)
  To: jic23, bleung, enric.balletbo; +Cc: lars, linux-iio, Gwendal Grignou

BMI160 Minimium gyroscope frequency in normal mode is 25Hz.
When older EC firmware do not report their sensors frequencies,
use 25Hz as the minimum for gyroscope to be sure it works on BMI160.

Fixes: ae7b02ad2f32d ("iio: common: cros_ec_sensors: Expose cros_ec_sensors
frequency range via iio sysfs")

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
Change since v1: Fix spelling.

 drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index 156848d27c473..213837c2ecee2 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -85,10 +85,13 @@ static void get_default_min_max_freq(enum motionsensor_type type,
 
 	switch (type) {
 	case MOTIONSENSE_TYPE_ACCEL:
-	case MOTIONSENSE_TYPE_GYRO:
 		*min_freq = 12500;
 		*max_freq = 100000;
 		break;
+	case MOTIONSENSE_TYPE_GYRO:
+		*min_freq = 25000;
+		*max_freq = 100000;
+		break;
 	case MOTIONSENSE_TYPE_MAG:
 		*min_freq = 5000;
 		*max_freq = 25000;
-- 
2.28.0.rc0.142.g3c755180ce-goog


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

* Re: [PATCH v2] iio: cros_ec: Set Gyroscope default frequency to 25Hz
  2020-07-28 20:48 [PATCH v2] iio: cros_ec: Set Gyroscope default frequency to 25Hz Gwendal Grignou
@ 2020-07-31 11:17 ` Enric Balletbo i Serra
  2020-08-01 15:46   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Enric Balletbo i Serra @ 2020-07-31 11:17 UTC (permalink / raw)
  To: Gwendal Grignou, jic23, bleung; +Cc: lars, linux-iio

Hi Gwendal,

Thank you for your patch.

On 28/7/20 22:48, Gwendal Grignou wrote:
> BMI160 Minimium gyroscope frequency in normal mode is 25Hz.
> When older EC firmware do not report their sensors frequencies,
> use 25Hz as the minimum for gyroscope to be sure it works on BMI160.
> 
> Fixes: ae7b02ad2f32d ("iio: common: cros_ec_sensors: Expose cros_ec_sensors
> frequency range via iio sysfs")
> 

I think your email broke this line, it should be a single line. Other than that ...

> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

> ---
> Change since v1: Fix spelling.
> 
>  drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> index 156848d27c473..213837c2ecee2 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> @@ -85,10 +85,13 @@ static void get_default_min_max_freq(enum motionsensor_type type,
>  
>  	switch (type) {
>  	case MOTIONSENSE_TYPE_ACCEL:
> -	case MOTIONSENSE_TYPE_GYRO:
>  		*min_freq = 12500;
>  		*max_freq = 100000;
>  		break;
> +	case MOTIONSENSE_TYPE_GYRO:
> +		*min_freq = 25000;
> +		*max_freq = 100000;
> +		break;
>  	case MOTIONSENSE_TYPE_MAG:
>  		*min_freq = 5000;
>  		*max_freq = 25000;
> 

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

* Re: [PATCH v2] iio: cros_ec: Set Gyroscope default frequency to 25Hz
  2020-07-31 11:17 ` Enric Balletbo i Serra
@ 2020-08-01 15:46   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2020-08-01 15:46 UTC (permalink / raw)
  To: Enric Balletbo i Serra; +Cc: Gwendal Grignou, bleung, lars, linux-iio

On Fri, 31 Jul 2020 13:17:53 +0200
Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote:

> Hi Gwendal,
> 
> Thank you for your patch.
> 
> On 28/7/20 22:48, Gwendal Grignou wrote:
> > BMI160 Minimium gyroscope frequency in normal mode is 25Hz.
> > When older EC firmware do not report their sensors frequencies,
> > use 25Hz as the minimum for gyroscope to be sure it works on BMI160.
> > 
> > Fixes: ae7b02ad2f32d ("iio: common: cros_ec_sensors: Expose cros_ec_sensors
> > frequency range via iio sysfs")
> >   
> 
> I think your email broke this line, it should be a single line. Other than that ...
> 
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>  
> 
> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> 
> > ---
> > Change since v1: Fix spelling.
> > 
> >  drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> > index 156848d27c473..213837c2ecee2 100644
> > --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> > +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> > @@ -85,10 +85,13 @@ static void get_default_min_max_freq(enum motionsensor_type type,
> >  
> >  	switch (type) {
> >  	case MOTIONSENSE_TYPE_ACCEL:
> > -	case MOTIONSENSE_TYPE_GYRO:
> >  		*min_freq = 12500;
> >  		*max_freq = 100000;
> >  		break;
> > +	case MOTIONSENSE_TYPE_GYRO:
> > +		*min_freq = 25000;
> > +		*max_freq = 100000;
> > +		break;
> >  	case MOTIONSENSE_TYPE_MAG:
> >  		*min_freq = 5000;
> >  		*max_freq = 25000;
> >   


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 20:48 [PATCH v2] iio: cros_ec: Set Gyroscope default frequency to 25Hz Gwendal Grignou
2020-07-31 11:17 ` Enric Balletbo i Serra
2020-08-01 15:46   ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git