Skip to content

Commit

Permalink
hid-sensors: Add more data fields for sensitivity checking
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20210201054921.18214-3-xiang.ye@intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Ye Xiang authored and Jonathan Cameron committed Mar 11, 2021
1 parent 0e41fd5 commit 4efd13c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iio/light/hid-sensor-als.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/orientation/hid-sensor-incl-3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/orientation/hid-sensor-rotation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/pressure/hid-sensor-press.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4efd13c

Please sign in to comment.