All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ye Xiang <xiang.ye@intel.com>
To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com
Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, Ye Xiang <xiang.ye@intel.com>
Subject: [PATCH 3/3] hid-sensors: Add more data fields for sensitivity checking
Date: Wed, 20 Jan 2021 15:47:06 +0800	[thread overview]
Message-ID: <20210120074706.23199-4-xiang.ye@intel.com> (raw)
In-Reply-To: <20210120074706.23199-1-xiang.ye@intel.com>

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 <xiang.ye@intel.com>
---
 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


      parent reply	other threads:[~2021-01-20  7:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  7:47 [PATCH 0/3] resolve read hystersis return invalid argument issue for hid sensors Ye Xiang
2021-01-20  7:47 ` [PATCH 1/3] iio: hid-sensors: Move get sensitivity attribute to hid-sensor-common Ye Xiang
2021-01-23 16:12   ` Jonathan Cameron
2021-01-20  7:47 ` [PATCH 2/3] hid-sensor-common: Add relative sensitivity check Ye Xiang
2021-01-24 13:14   ` Jonathan Cameron
2021-01-24 16:20     ` Srinivas Pandruvada
2021-01-28 16:35       ` Ye, Xiang
     [not found]         ` <20210131112648.3299b2a0@archlinux>
2021-01-31 20:32           ` Srinivas Pandruvada
2021-01-20  7:47 ` Ye Xiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210120074706.23199-4-xiang.ye@intel.com \
    --to=xiang.ye@intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.