Re: [PATCH] HID: intel_ish-hid: HBM: Use connected standby state bit during suspend/resume

2021-03-09 Thread Ye, Xiang
Hi Srinivas Thanks for the review. On Tue, Mar 09, 2021 at 08:08:36AM -0800, Srinivas Pandruvada wrote: > On Tue, 2021-03-09 at 11:47 +0800, Ye, Xiang wrote: > > Hi Srinivas, Jiri > > > > On Mon, Mar 08, 2021 at 08:00:41AM -0800, Srinivas Pandruvada wrote: > > &g

Re: [PATCH] HID: intel_ish-hid: HBM: Use connected standby state bit during suspend/resume

2021-03-08 Thread Ye, Xiang
Hi Srinivas, Jiri On Mon, Mar 08, 2021 at 08:00:41AM -0800, Srinivas Pandruvada wrote: > On Mon, 2021-03-08 at 11:26 +0100, Jiri Kosina wrote: > > On Wed, 3 Mar 2021, Ye Xiang wrote: > > > > > ISH firmware uses connected standby state bit > > > (CONNECTED_STANDBY

[PATCH 3/4] iio: hid-sensor-temperature: Fix issues of timestamp channel

2021-03-03 Thread Ye Xiang
This patch fixes 2 issues of timestamp channel: 1. This patch ensures that there is sufficient space and correct alignment for the timestamp. 2. Correct the timestamp channel scan index. Fixes: 59d0f2da3569 ("iio: hid: Add temperature sensor support") Signed-off-by: Ye Xiang --- d

[PATCH 4/4] iio: hid-sensor-temperature: Get sample timestamp from sensor hub

2021-03-03 Thread Ye Xiang
Try to get sample timestamp from sensor hub first, if failed then use system timestamp. Signed-off-by: Ye Xiang --- drivers/iio/temperature/hid-sensor-temperature.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/hid-sensor

[PATCH 2/4] iio: hid-sensor-humidity: Get sample timestamp from sensor hub

2021-03-03 Thread Ye Xiang
Try to get sample timestamp from sensor hub first, if failed then use system timestamp. Signed-off-by: Ye Xiang --- drivers/iio/humidity/hid-sensor-humidity.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b

[PATCH 1/4] iio: hid-sensor-humidity: Fix alignment issue of timestamp channel

2021-03-03 Thread Ye Xiang
This patch ensures that, there is sufficient space and correct alignment for the timestamp. Fixes: d7ed89d5aadf ("iio: hid: Add humidity sensor support") Signed-off-by: Ye Xiang --- drivers/iio/humidity/hid-sensor-humidity.c | 12 +++- 1 file changed, 7 insertions(+), 5

[PATCH 0/4] Fix humidity and temperature timestamp channel issues

2021-03-03 Thread Ye Xiang
This patch series fixes timestamp issues for humidity and temperature sensor. Ye Xiang (4): iio: hid-sensor-humidity: Fix alignment issue of timestamp channel iio: hid-sensor-humidity: Get sample timestamp from sensor hub iio: hid-sensor-temperature: Fix issues of timestamp channel iio

[PATCH] HID: intel_ish-hid: HBM: Use connected standby state bit during suspend/resume

2021-03-03 Thread Ye Xiang
ISH firmware uses connected standby state bit (CONNECTED_STANDBY_STATE_BIT bit 1) to notify current power state to sensors instead of suspend state bit (bit 0). So send both SUSPEND_STATE_BIT and CONNECTED_STANDBY_STATE_BIT to firmware to be compatible with the previous version. Signed-off-by:

[PATCH v2 1/3] iio: Add relative sensitivity support

2021-02-06 Thread Ye Xiang
Some hid sensors may use relative sensitivity such as als sensor. This patch adds relative sensitivity checking for all hid sensors. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 74 ++- drivers/iio/industrialio-core.c | 1 + include

[PATCH v2 3/3] iio: Add relative hysteresis in ABI documentation

2021-02-06 Thread Ye Xiang
Add relative hysteresis in ABI documentation for als sensor. Signed-off-by: Ye Xiang --- Documentation/ABI/testing/sysfs-bus-iio | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index d957f5da5c04

[PATCH v2 2/3] iio: hid-sensor-als: Add relative hysteresis support

2021-02-06 Thread Ye Xiang
Hid sensor als use relative hysteresis, this patch adds the support. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-als.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index

[PATCH v2 0/3] Add relative hysteresis support for hid sensors

2021-02-06 Thread Ye Xiang
Currently, hid sensor als are using the relative hysteresis. This patch series add the relative hysteresis for hid sensors. --- v2: - (1/3) fix the formatting issue in hid_sensor_read_raw_hyst_rel_value. - (3/3) add documentation just for light sensor. Ye Xiang (3): iio: Add relative

[PATCH 1/3] iio: Add relative sensitivity support

2021-01-31 Thread Ye Xiang
Some hid sensors may use relative sensitivity such as als sensor. This patch adds relative sensitivity checking for all hid sensors. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 75 ++- drivers/iio/industrialio-core.c | 1 + include

[PATCH 3/3] iio: Add relative hysteresis in ABI documentation

2021-01-31 Thread Ye Xiang
Add relative hysteresis in ABI documentation. Signed-off-by: Ye Xiang --- Documentation/ABI/testing/sysfs-bus-iio | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index d957f5da5c04..1c51db7eb8ef

[PATCH 2/3] iio: hid-sensor-als: Add relative hysteresis support

2021-01-31 Thread Ye Xiang
Hid sensor als uses relative hysteresis, this patch adds the support. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-als.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index

[PATCH 0/3] Add relative hysteresis support for hid sensors

2021-01-31 Thread Ye Xiang
Currently, hid sensor als are using the relative hysteresis. This patch series add the relative hysteresis for hid sensors. Ye Xiang (3): iio: Add relative sensitivity support iio: hid-sensor-als: Add relative hysteresis support iio: Add relative hysteresis in ABI documentation

[PATCH v2 0/2] resolve read hystersis return invalid argument issue for hid sensors

2021-01-31 Thread Ye Xiang
This patch series move get sensitivity attribute to common layer and resolve read hystersis return invalid argument issue for hid sensors als, incli-3d, rotation, and press on intel ISH Platform. --- v2: - separate the add relative sensitivity patch to the next patch series. Ye Xiang (2

[PATCH v2 2/2] hid-sensors: Add more data fields for sensitivity checking

2021-01-31 Thread Ye Xiang
Before, when reading/writing the hysteresis of als, incli-3d, press, and rotation sensor, we will get invalid argument error. This patch add more sensitivity data fields for these sensors, so that these sensors can get sensitivity index and return correct hysteresis value. Signed-off-by: Ye

[PATCH v2 1/2] iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common

2021-01-31 Thread Ye Xiang
this to common place will avoid code repetition. Signed-off-by: Ye Xiang --- drivers/iio/accel/hid-sensor-accel-3d.c | 23 ++--- .../hid-sensors/hid-sensor-attributes.c | 17 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 19 --- drivers/iio/humidity/hid-sensor

[PATCH v2 2/2] hid-sensors: Add more data fields for sensitivity checking

2021-01-31 Thread Ye Xiang
Before, when reading/writing the hysteresis of als, incli-3d, press, and rotation sensor, we will get invalid argument error. This patch add more sensitivity data fields for these sensors, so that these sensors can get sensitivity index and return correct hysteresis value. Signed-off-by: Ye

[PATCH v2 0/2] resolve read hystersis return invalid argument issue for hid sensors

2021-01-31 Thread Ye Xiang
This patch series move get sensitivity attribute to common layer and resolve read hystersis return invalid argument issue for hid sensors als, incli-3d, rotation, and press on intel ISH Platform. --- v2: - separate the add relative sensitivity patch to the next patch series. Ye Xiang (2

[PATCH v2 1/2] iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common

2021-01-31 Thread Ye Xiang
this to common place will avoid code repetition. Signed-off-by: Ye Xiang --- drivers/iio/accel/hid-sensor-accel-3d.c | 23 ++--- .../hid-sensors/hid-sensor-attributes.c | 17 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 19 --- drivers/iio/humidity/hid-sensor

Re: [PATCH v2] iio: hid-sensor-prox: Fix scale not correct issue

2021-01-30 Thread Ye, Xiang
On Sat, Jan 30, 2021 at 07:14:29PM +, Jonathan Cameron wrote: > On Sat, 30 Jan 2021 18:25:30 +0800 > Ye Xiang wrote: > > > Currently, the proxy sensor scale is zero because it just return the > > exponent directly. To fix this issue, this patch use > > hid_sen

Re: [PATCH v2] iio: hid-sensor-prox: Fix scale not correct issue

2021-01-30 Thread Ye, Xiang
On Sat, Jan 30, 2021 at 07:14:29PM +, Jonathan Cameron wrote: > On Sat, 30 Jan 2021 18:25:30 +0800 > Ye Xiang wrote: > > > Currently, the proxy sensor scale is zero because it just return the > > exponent directly. To fix this issue, this patch use > > hid_sen

[PATCH v2] iio: hid-sensor-rotation: Fix quaternion data not correct

2021-01-30 Thread Ye Xiang
Because the data of HID_USAGE_SENSOR_ORIENT_QUATERNION defined by ISH FW is s16, but quaternion data type is in_rot_quaternion_type(le:s16/32X4>>0), need to transform data type from s16 to s32 Fixes: fc18dddc0625 ("iio: hid-sensors: Added device rotation support") Signed-off-by:

[PATCH v2] iio: hid-sensor-prox: Fix scale not correct issue

2021-01-30 Thread Ye Xiang
Currently, the proxy sensor scale is zero because it just return the exponent directly. To fix this issue, this patch use hid_sensor_format_scale to process the scale first then return the output. Fixes: 39a3a0138f61 ("iio: hid-sensors: Added Proximity Sensor Driver") Signed-off-by

Re: [PATCH 2/3] hid-sensor-common: Add relative sensitivity check

2021-01-28 Thread Ye, Xiang
Hi Srinivas andd Jonathan Thanks for the review. On Sun, Jan 24, 2021 at 08:20:12AM -0800, Srinivas Pandruvada wrote: > On Sun, 2021-01-24 at 13:14 +, Jonathan Cameron wrote: > > On Wed, 20 Jan 2021 15:47:05 +0800 > > Ye Xiang wrote: > > > > > Some hid sensor

[PATCH] iio: hid-sensor-prox: Fix scale not correct issue

2021-01-19 Thread Ye Xiang
Currently, the proxy sensor scale is zero because it just return the exponent directly. To fix this issue, this patch use hid_sensor_format_scale to process the scale first then return the output. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-prox.c | 13 +++-- 1 file changed

[PATCH] iio: hid-sensor-rotation: Fix quaternion data not correct

2021-01-19 Thread Ye Xiang
Because the data of HID_USAGE_SENSOR_ORIENT_QUATERNION defined by ISH FW is s16, but quaternion data type is in_rot_quaternion_type(le:s16/32X4>>0), need to transform data type from s16 to s32 Signed-off-by: Ye Xiang --- drivers/iio/orientation/hid-sensor-rotation.c | 13 ++---

[PATCH 2/3] hid-sensor-common: Add relative sensitivity check

2021-01-19 Thread Ye Xiang
Some hid sensors may use relative sensitivity such as als sensor. This patch add relative sensitivity check for all hid-sensors. Signed-off-by: Ye Xiang --- .../iio/common/hid-sensors/hid-sensor-attributes.c| 11 ++- include/linux/hid-sensor-ids.h| 1 + 2

[PATCH 3/3] hid-sensors: Add more data fields for sensitivity checking

2021-01-19 Thread Ye Xiang
Before, when reading/writing the hysteresis of als, incli-3d, press, and rotation sensor, we will get invalid argument error. This patch add more sensitivity data fields for these sensors, so that these sensors can get sensitivity index and return correct hysteresis value. Signed-off-by: Ye

[PATCH 1/3] iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common

2021-01-19 Thread Ye Xiang
this to common place will avoid code repetition. Signed-off-by: Ye Xiang --- drivers/iio/accel/hid-sensor-accel-3d.c | 23 + .../hid-sensors/hid-sensor-attributes.c | 17 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 19 --- drivers/iio/humidity/hid-sensor

[PATCH 0/3] resolve read hystersis return invalid argument issue for hid sensors

2021-01-19 Thread Ye Xiang
This patch series move get sensitivity attribute to common layer and resolve read hystersis return invalid argument issue for hid sensors als, incli-3d, rotation, and press on intel ISH Platform. Ye Xiang (3): iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common hid-sensor

Re: [PATCH v3 0/6] add timestamp channel for hid-sensors

2021-01-09 Thread Ye, Xiang
On Sat, Jan 09, 2021 at 07:28:05PM +, Jonathan Cameron wrote: > On Tue, 5 Jan 2021 17:26:33 +0800 > "Ye, Xiang" wrote: > > > On Tue, Jan 05, 2021 at 12:53:44AM -0800, Srinivas Pandruvada wrote: > > > On Tue, 2021-01-05 at 15:21 +0800, Ye Xiang wrot

[PATCH 6/6] iio: hid-sensor-rotation: Add timestamp channel

2021-01-05 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/orientation/hid-sensor-rotation.c | 46 +++ 1 file changed, 26

[PATCH 4/6] iio: hid-sensor-magn-3d: Add timestamp channel

2021-01-05 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 48 --- 1 file changed, 30

[PATCH 5/6] iio: hid-sensor-incl-3d: Add timestamp channel

2021-01-05 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/orientation/hid-sensor-incl-3d.c | 43 1 file changed, 27

[PATCH 3/6] iio: hid-sensor-als: Add timestamp channel

2021-01-05 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-als.c | 39 ++ 1 file changed, 23

[PATCH 2/6] iio: hid-sensor-gyro-3d: Add timestamp channel

2021-01-05 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/gyro/hid-sensor-gyro-3d.c | 40 --- 1 file changed, 24

[PATCH 1/6] iio: hid-sensor-accel-3d: Add timestamp channel for gravity sensor

2021-01-05 Thread Ye Xiang
The accel_3d sensor already has a timestamp channel, this patch just replicate that for gravity sensor. Signed-off-by: Ye Xiang --- drivers/iio/accel/hid-sensor-accel-3d.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b

[PATCH 0/6] Add timestamp channel for hid-sensors

2021-01-05 Thread Ye Xiang
This patch series add a timestamp channel for hid sensors, including gravity sensor, gyro sensor, magnetometer sensor, ambient light sensor, inclinometer sensor, and rotation sensor. With this patch series, user can get the time when sensor yield a sample. Ye Xiang (6): iio: hid-sensor-accel

Re: [PATCH v3 0/6] add timestamp channel for hid-sensors

2021-01-05 Thread Ye, Xiang
On Tue, Jan 05, 2021 at 12:53:44AM -0800, Srinivas Pandruvada wrote: > On Tue, 2021-01-05 at 15:21 +0800, Ye Xiang wrote: > > This patch series add a timestamp channel for hid sensors, > > including gravity sensor, gyro sensor, magnetometer sensor, > > ambient light sensor

[PATCH v3 1/6] iio: hid-sensor-accel-3d: Add timestamp channel for gravity sensor

2021-01-04 Thread Ye Xiang
The accel_3d sensor already has a timestamp channel, this patch just replicate that for gravity sensor. Signed-off-by: Ye Xiang --- drivers/iio/accel/hid-sensor-accel-3d.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b

[PATCH v3 6/6] iio: hid-sensor-rotation: Add timestamp channel

2021-01-04 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/orientation/hid-sensor-rotation.c | 46 +++ 1 file changed, 26

[PATCH v3 2/6] iio: hid-sensor-gyro-3d: Add timestamp channel

2021-01-04 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/gyro/hid-sensor-gyro-3d.c | 40 --- 1 file changed, 24

[PATCH v3 3/6] iio: hid-sensor-als: Add timestamp channel

2021-01-04 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-als.c | 39 ++ 1 file changed, 23

[PATCH v3 5/6] iio: hid-sensor-incl-3d: Add timestamp channel

2021-01-04 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/orientation/hid-sensor-incl-3d.c | 43 1 file changed, 27

[PATCH v3 0/6] add timestamp channel for hid-sensors

2021-01-04 Thread Ye Xiang
iio_val buffer len issue. - hid-sensor-accel-3d: refine commit message v2: - remove unrelated changes. Ye Xiang (6): iio: hid-sensor-accel-3d: Add timestamp channel for gravity sensor iio: hid-sensor-gyro-3d: Add timestamp channel iio: hid-sensor-als: Add timestamp channel iio: hid-sensor

[PATCH v3 4/6] iio: hid-sensor-magn-3d: Add timestamp channel

2021-01-04 Thread Ye Xiang
Each sample has a timestamp field with this change. This timestamp may be from the sensor hub when present or local kernel timestamp. And the unit of timestamp is nanosecond. Signed-off-by: Ye Xiang --- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 48 --- 1 file changed, 30

Re: [PATCH v4 0/3] add custom hinge sensor support

2020-12-30 Thread Ye, Xiang
On Wed, Dec 30, 2020 at 12:05:17PM +, Jonathan Cameron wrote: > On Tue, 15 Dec 2020 13:44:41 +0800 > Ye Xiang wrote: > > > Here we register one iio device with three channels which present angle for > > hinge, keyboard and screen. > > > > This driver works

[PATCH v4 0/3] add custom hinge sensor support

2020-12-14 Thread Ye Xiang
meaningful return value in get_known_custom_sensor_index and checked in call side. - hid-sensor-ids.h: use HID_USAGE_SENSOR_DATA_FIELD_CUSTOM_VALUE(x) to define custom sensor value. Changes since v1: - fixed errors reported by lkp Ye Xiang (3): HID: hid-sensor-custom: Add custom

[PATCH v4 3/3] iio:Documentation: Add documentation for hinge sensor channels

2020-12-14 Thread Ye Xiang
Add channel description for hinge sensor, including channel label attribute and raw data description. Signed-off-by: Ye Xiang --- Documentation/ABI/testing/sysfs-bus-iio | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI

[PATCH v4 2/3] iio: hid-sensors: Add hinge sensor driver

2020-12-14 Thread Ye Xiang
, in order to display appropriate user interface. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 2 + drivers/iio/position/Kconfig | 16 + drivers/iio/position/Makefile | 1 + .../position/hid-sensor-custom-intel-hinge.c | 391

[PATCH v4 1/3] HID: hid-sensor-custom: Add custom sensor iio support

2020-12-14 Thread Ye Xiang
in the report. This change is identifying hinge sensor when the manufacturer is "INTEL". This creates a platform device so that a sensor driver can be loaded to process these sensors. Signed-off-by: Ye Xiang --- drivers/hid/hid-sensor-custom.c | 143 inc

Re: [PATCH v3 3/3] iio:Documentation: Add documentation for hinge sensor channels

2020-12-13 Thread Ye, Xiang
On Sun, Dec 13, 2020 at 02:15:45PM +, Jonathan Cameron wrote: > On Mon, 7 Dec 2020 17:18:18 +0800 > "Ye, Xiang" wrote: > > > Hi Jonathan > > > > Thanks for review and comments. > > > > On Sat, Dec 05, 2020 at 04:05:40PM +, Jonathan

Re: [PATCH v3 3/3] iio:Documentation: Add documentation for hinge sensor channels

2020-12-07 Thread Ye, Xiang
Hi Jonathan Thanks for review and comments. On Sat, Dec 05, 2020 at 04:05:40PM +, Jonathan Cameron wrote: > On Thu, 3 Dec 2020 11:53:52 +0800 > Ye Xiang wrote: > > > Add channel description for hinge sensor, including channel label > > attribute and raw data descrip

[PATCH v3 3/3] iio:Documentation: Add documentation for hinge sensor channels

2020-12-02 Thread Ye Xiang
Add channel description for hinge sensor, including channel label attribute and raw data description. Signed-off-by: Ye Xiang --- Documentation/ABI/testing/sysfs-bus-iio | 17 + 1 file changed, 17 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b

[PATCH v3 2/3] iio: hid-sensors: Add hinge sensor driver

2020-12-02 Thread Ye Xiang
, in order to display appropriate user interface. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 2 + drivers/iio/position/Kconfig | 16 + drivers/iio/position/Makefile | 1 + .../position/hid-sensor-custom-intel-hinge.c | 393

[PATCH v3 1/3] HID: hid-sensor-custom: Add custom sensor iio support

2020-12-02 Thread Ye Xiang
in the report. This change is identifying hinge sensor when the manufacturer is "INTEL". This creates a platform device so that a sensor driver can be loaded to process these sensors. Signed-off-by: Ye Xiang --- drivers/hid/hid-sensor-custom.c | 181 inc

add custom hinge sensor support

2020-12-02 Thread Ye Xiang
in get_known_custom_sensor_index and checked in call side. - hid-sensor-ids.h: use HID_USAGE_SENSOR_DATA_FIELD_CUSTOM_VALUE(x) to define custom sensor value. Changes since v1: - fixed errors reported by lkp Ye Xiang (3): HID: hid-sensor-custom: Add custom sensor iio support iio

Re: [PATCH v2 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-24 Thread Ye, Xiang
On Tue, Nov 24, 2020 at 11:36:56AM +, Jonathan Cameron wrote: > On Tue, 24 Nov 2020 11:30:50 +0800 > "Ye, Xiang" wrote: > > > On Sun, Nov 22, 2020 at 04:50:47PM +, Jonathan Cameron wrote: > > > On Sun, 22 Nov 2020 15:51:18 + &

Re: [PATCH v2 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-24 Thread Ye, Xiang
clude "hid-sensor-trigger.h", if not using > > this cflag-y > > it should be #include "../common/hid-sensors/hid-sensor-trigger.h" > > Even though that looks a bit ugly, I'd prefer that rather than having to > realize we > were doing something not entirely obvious in the Makefile. Okay, will remove ccflags-y in the makefile Thanks Ye, Xiang > > Thanks, > > Jonathan

Re: [PATCH v2 1/4] HID: hid-sensor-custom: Add custom sensor iio support

2020-11-24 Thread Ye, Xiang
\ BUILD_BUG_ON(x > 28); \ BUILD_BUG_ON(x < 0); \ (HID_USAGE_SENSOR_DATA_FIELD_CUSTOM_VALUE_BASE + (x)); \ }) I can use the define with a comments to

Re: [PATCH v2 1/4] HID: hid-sensor-custom: Add custom sensor iio support

2020-11-24 Thread Ye, Xiang
On Sat, Nov 21, 2020 at 05:21:27PM +, Jonathan Cameron wrote: > On Thu, 19 Nov 2020 18:03:28 +0800 > Ye Xiang wrote: > > > Currently custom sensors properties are not decoded and it is up to > > user space to interpret. > > > > Some manufacturers already

Re: [PATCH v2 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-23 Thread Ye, Xiang
On Sat, Nov 21, 2020 at 05:56:29PM +, Jonathan Cameron wrote: > On Thu, 19 Nov 2020 18:03:31 +0800 > Ye Xiang wrote: > > > The Hinge sensor is a common custom sensor on laptops. It calculates > > the angle between the lid (screen) and the base (keyboard). In addition

Re: [PATCH v2 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-23 Thread Ye, Xiang
gt; > > "Pandruvada, Srinivas" wrote: > > > > > > > On Sat, 2020-11-21 at 17:46 -0800, Srinivas Pandruvada wrote: > > > > > On Sat, 2020-11-21 at 17:56 +, Jonathan Cameron wrote: > > > > > > On Thu, 19 Nov 2020 18:03:31 +0800 > &

[PATCH v2 1/4] HID: hid-sensor-custom: Add custom sensor iio support

2020-11-19 Thread Ye Xiang
in the report. This change is identifying hinge sensor when the manufacturer is "INTEL". This creates a platform device so that a sensor driver can be loaded to process these sensors. Signed-off-by: Ye Xiang --- drivers/hid/hid-sensor-custom.c | 170 inc

[PATCH v2 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-19 Thread Ye Xiang
, in order to display appropriate user interface. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 2 + drivers/iio/position/Kconfig | 16 + drivers/iio/position/Makefile | 3 + .../iio/position/hid-sensor-custom-hinge.c| 412

[PATCH v2 3/4] iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure

2020-11-19 Thread Ye Xiang
ll iio devices. Signed-off-by: Ye Xiang --- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index 30340abcbc8d..bb5e7c

[PATCH v2 2/4] iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal

2020-11-19 Thread Ye Xiang
To avoid pm_runtime_disable called repeatedly by hid sensor drivers, decrease runtime pm enable count after call it. Signed-off-by: Ye Xiang --- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/common/hid

[PATCH v2 0/4] add custom hinge sensor support

2020-11-19 Thread Ye Xiang
. Changes since v1: - fixed errors reported by lkp Ye Xiang (4): HID: hid-sensor-custom: Add custom sensor iio support iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure iio:

[PATCH 1/4] HID: hid-sensor-custom: Add custom sensor iio support

2020-11-18 Thread Ye Xiang
in the report. This change is identifying hinge sensor when the manufacturer is "INTEL". This creates a platform device so that a sensor driver can be loaded to process these sensors. Signed-off-by: Ye Xiang --- drivers/hid/hid-sensor-custom.c | 169 inc

[PATCH 4/4] iio: hid-sensors: Add hinge sensor driver

2020-11-18 Thread Ye Xiang
, in order to display appropriate user interface. Signed-off-by: Ye Xiang --- .../hid-sensors/hid-sensor-attributes.c | 2 + drivers/iio/position/Kconfig | 16 + drivers/iio/position/Makefile | 3 + .../iio/position/hid-sensor-custom-hinge.c| 412

[PATCH 3/4] iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure

2020-11-18 Thread Ye Xiang
ll iio devices. Signed-off-by: Ye Xiang --- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index 30340abcbc8d..bb5e7c

[PATCH 2/4] iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal

2020-11-18 Thread Ye Xiang
To avoid pm_runtime_disable called repeatedly by hid sensor drivers, decrease runtime pm enable count after call it. Signed-off-by: Ye Xiang --- drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/common/hid

[PATCH 0/4] add custom hinge sensor support

2020-11-18 Thread Ye Xiang
. Ye Xiang (4): HID: hid-sensor-custom: Add custom sensor iio support iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure iio: hid-sensors: Add hinge sensor driver drivers/hid/