2021-02-01 05:55:42

by Ye Xiang

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

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):
iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common
hid-sensors: Add more data fields for sensitivity checking

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-humidity.c | 16 ++++------
drivers/iio/light/hid-sensor-als.c | 20 +++++-------
drivers/iio/light/hid-sensor-prox.c | 27 +++++-----------
drivers/iio/magnetometer/hid-sensor-magn-3d.c | 32 ++++++-------------
drivers/iio/orientation/hid-sensor-incl-3d.c | 20 +++++-------
drivers/iio/orientation/hid-sensor-rotation.c | 24 ++++++--------
.../position/hid-sensor-custom-intel-hinge.c | 20 ++++--------
drivers/iio/pressure/hid-sensor-press.c | 20 +++++-------
.../iio/temperature/hid-sensor-temperature.c | 16 ++++------
drivers/rtc/rtc-hid-sensor-time.c | 4 ++-
include/linux/hid-sensor-hub.h | 4 ++-
14 files changed, 111 insertions(+), 151 deletions(-)

--
2.17.1


2021-02-01 05:57:59

by Ye Xiang

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

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 Xiang <[email protected]>
---
drivers/iio/light/hid-sensor-als.c | 1 +
drivers/iio/orientation/hid-sensor-incl-3d.c | 1 +
drivers/iio/orientation/hid-sensor-rotation.c | 1 +
drivers/iio/pressure/hid-sensor-press.c | 1 +
4 files changed, 4 insertions(+)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 8bf6e9e0a0e0..afcdb424bfb8 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -41,6 +41,7 @@ struct als_state {

static const u32 als_sensitivity_addresses[] = {
HID_USAGE_SENSOR_DATA_LIGHT,
+ HID_USAGE_SENSOR_LIGHT_ILLUM,
};

/* Channel definitions */
diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c
index 6e69f6e673cc..7af48d336285 100644
--- a/drivers/iio/orientation/hid-sensor-incl-3d.c
+++ b/drivers/iio/orientation/hid-sensor-incl-3d.c
@@ -49,6 +49,7 @@ static const u32 incl_3d_addresses[INCLI_3D_CHANNEL_MAX] = {

static const u32 incl_3d_sensitivity_addresses[] = {
HID_USAGE_SENSOR_DATA_ORIENTATION,
+ HID_USAGE_SENSOR_ORIENT_TILT,
};

/* Channel definitions */
diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
index 03d2845a7b2c..b0245b3b7ffc 100644
--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -33,6 +33,7 @@ struct dev_rot_state {

static const u32 rotation_sensitivity_addresses[] = {
HID_USAGE_SENSOR_DATA_ORIENTATION,
+ HID_USAGE_SENSOR_ORIENT_QUATERNION,
};

/* Channel definitions */
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index 8cac2c94e75a..c416d261e3e3 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -31,6 +31,7 @@ struct press_state {

static const u32 press_sensitivity_addresses[] = {
HID_USAGE_SENSOR_DATA_ATMOSPHERIC_PRESSURE,
+ HID_USAGE_SENSOR_ATMOSPHERIC_PRESSURE
};

/* Channel definitions */
--
2.17.1

2021-02-06 18:34:09

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] resolve read hystersis return invalid argument issue for hid sensors

On Mon, 1 Feb 2021 13:49:19 +0800
Ye Xiang <[email protected]> wrote:

> 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.
Hi Ye Xiang


Series looks good to me.

Now this series touches a few bits of code outside of IIO so ideally
I'm looking for acks from:
@ Jiri for the header
@ Alessandro / Alexandre (+CC) for RTC

Both changes are trivial but might cause them some noise in other work
going on in their subsystems.

For reference:
https://lore.kernel.org/linux-iio/[email protected]/

Thanks,

Jonathan

>
> ---
> v2:
> - separate the add relative sensitivity patch to the next patch series.
>
> Ye Xiang (2):
> iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common
> hid-sensors: Add more data fields for sensitivity checking
>
> 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-humidity.c | 16 ++++------
> drivers/iio/light/hid-sensor-als.c | 20 +++++-------
> drivers/iio/light/hid-sensor-prox.c | 27 +++++-----------
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 32 ++++++-------------
> drivers/iio/orientation/hid-sensor-incl-3d.c | 20 +++++-------
> drivers/iio/orientation/hid-sensor-rotation.c | 24 ++++++--------
> .../position/hid-sensor-custom-intel-hinge.c | 20 ++++--------
> drivers/iio/pressure/hid-sensor-press.c | 20 +++++-------
> .../iio/temperature/hid-sensor-temperature.c | 16 ++++------
> drivers/rtc/rtc-hid-sensor-time.c | 4 ++-
> include/linux/hid-sensor-hub.h | 4 ++-
> 14 files changed, 111 insertions(+), 151 deletions(-)
>

2021-02-18 15:31:33

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] resolve read hystersis return invalid argument issue for hid sensors

On Mon, 1 Feb 2021 13:49:19 +0800
Ye Xiang <[email protected]> wrote:

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

Given Jiri was fine with the follow up series, I'm going to guess he
just missed this one and apply it with out his explicit ack.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to see if they can find anything we missed.

Thanks,

Jonathan

>
> ---
> v2:
> - separate the add relative sensitivity patch to the next patch series.
>
> Ye Xiang (2):
> iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common
> hid-sensors: Add more data fields for sensitivity checking
>
> 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-humidity.c | 16 ++++------
> drivers/iio/light/hid-sensor-als.c | 20 +++++-------
> drivers/iio/light/hid-sensor-prox.c | 27 +++++-----------
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 32 ++++++-------------
> drivers/iio/orientation/hid-sensor-incl-3d.c | 20 +++++-------
> drivers/iio/orientation/hid-sensor-rotation.c | 24 ++++++--------
> .../position/hid-sensor-custom-intel-hinge.c | 20 ++++--------
> drivers/iio/pressure/hid-sensor-press.c | 20 +++++-------
> .../iio/temperature/hid-sensor-temperature.c | 16 ++++------
> drivers/rtc/rtc-hid-sensor-time.c | 4 ++-
> include/linux/hid-sensor-hub.h | 4 ++-
> 14 files changed, 111 insertions(+), 151 deletions(-)
>