All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue
@ 2017-03-20  9:12 ` Song Hongyan
  0 siblings, 0 replies; 4+ messages in thread
From: Song Hongyan @ 2017-03-20  9:12 UTC (permalink / raw)
  To: linux-input-u79uwXL29TY76Z2rM5mHXA, linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: jikos-DgEjT+Ai2ygdnm+yROfE0A, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	srinivas.pandruvada-ral2JQCrhuEAvxtiuMwx3w, Song Hongyan

Scale value include two parts: unit conversion and exponent conversion.
Add gravity unit convert table to fix gravity sensor scale value not
right issue.

Signed-off-by: Song Hongyan <hongyan.song-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index cc2ce2a..2884783 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -38,6 +38,12 @@
 	{HID_USAGE_SENSOR_ACCEL_3D,
 		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
 
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR, 0, 9, 806650000},
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
+		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
+		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
+
 	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293},
 	{HID_USAGE_SENSOR_GYRO_3D,
 		HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
-- 
1.9.1

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

* [PATCH] iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue
@ 2017-03-20  9:12 ` Song Hongyan
  0 siblings, 0 replies; 4+ messages in thread
From: Song Hongyan @ 2017-03-20  9:12 UTC (permalink / raw)
  To: linux-input, linux-iio; +Cc: jikos, jic23, srinivas.pandruvada, Song Hongyan

Scale value include two parts: unit conversion and exponent conversion.
Add gravity unit convert table to fix gravity sensor scale value not
right issue.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index cc2ce2a..2884783 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -38,6 +38,12 @@
 	{HID_USAGE_SENSOR_ACCEL_3D,
 		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
 
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR, 0, 9, 806650000},
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
+		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
+	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
+		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
+
 	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293},
 	{HID_USAGE_SENSOR_GYRO_3D,
 		HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
-- 
1.9.1


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

* Re: [PATCH] iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue
  2017-03-20  9:12 ` Song Hongyan
@ 2017-03-25 16:24     ` Jonathan Cameron
  -1 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-03-25 16:24 UTC (permalink / raw)
  To: Song Hongyan, linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: jikos-DgEjT+Ai2ygdnm+yROfE0A, srinivas.pandruvada-ral2JQCrhuEAvxtiuMwx3w

On 20/03/17 09:12, Song Hongyan wrote:
> Scale value include two parts: unit conversion and exponent conversion.
> Add gravity unit convert table to fix gravity sensor scale value not
> right issue.
> 
> Signed-off-by: Song Hongyan <hongyan.song-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
I guess this only effects the recently added gravity driver, but
would have been good to have a fixes tag.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index cc2ce2a..2884783 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -38,6 +38,12 @@
>  	{HID_USAGE_SENSOR_ACCEL_3D,
>  		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
>  
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR, 0, 9, 806650000},
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
> +		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
> +		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
> +
>  	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293},
>  	{HID_USAGE_SENSOR_GYRO_3D,
>  		HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
> 

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

* Re: [PATCH] iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue
@ 2017-03-25 16:24     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-03-25 16:24 UTC (permalink / raw)
  To: Song Hongyan, linux-input, linux-iio; +Cc: jikos, srinivas.pandruvada

On 20/03/17 09:12, Song Hongyan wrote:
> Scale value include two parts: unit conversion and exponent conversion.
> Add gravity unit convert table to fix gravity sensor scale value not
> right issue.
> 
> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
I guess this only effects the recently added gravity driver, but
would have been good to have a fixes tag.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index cc2ce2a..2884783 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -38,6 +38,12 @@
>  	{HID_USAGE_SENSOR_ACCEL_3D,
>  		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
>  
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR, 0, 9, 806650000},
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
> +		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
> +	{HID_USAGE_SENSOR_GRAVITY_VECTOR,
> +		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
> +
>  	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293},
>  	{HID_USAGE_SENSOR_GYRO_3D,
>  		HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
> 


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

end of thread, other threads:[~2017-03-25 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20  9:12 [PATCH] iio: hid-sensor-attributes: Fix gravity sensor scale value not right issue Song Hongyan
2017-03-20  9:12 ` Song Hongyan
     [not found] ` <1490001174-897-1-git-send-email-hongyan.song-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-25 16:24   ` Jonathan Cameron
2017-03-25 16:24     ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.