|
@@ -149,6 +149,7 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
|
|
int report_id = -1;
|
|
int report_id = -1;
|
|
u32 address;
|
|
u32 address;
|
|
int ret_type;
|
|
int ret_type;
|
|
|
|
+ s32 min;
|
|
struct hid_sensor_hub_device *hsdev =
|
|
struct hid_sensor_hub_device *hsdev =
|
|
accel_state->common_attributes.hsdev;
|
|
accel_state->common_attributes.hsdev;
|
|
|
|
|
|
@@ -158,12 +159,14 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
|
|
case IIO_CHAN_INFO_RAW:
|
|
case IIO_CHAN_INFO_RAW:
|
|
hid_sensor_power_state(&accel_state->common_attributes, true);
|
|
hid_sensor_power_state(&accel_state->common_attributes, true);
|
|
report_id = accel_state->accel[chan->scan_index].report_id;
|
|
report_id = accel_state->accel[chan->scan_index].report_id;
|
|
|
|
+ min = accel_state->accel[chan->scan_index].logical_minimum;
|
|
address = accel_3d_addresses[chan->scan_index];
|
|
address = accel_3d_addresses[chan->scan_index];
|
|
if (report_id >= 0)
|
|
if (report_id >= 0)
|
|
*val = sensor_hub_input_attr_get_raw_value(
|
|
*val = sensor_hub_input_attr_get_raw_value(
|
|
accel_state->common_attributes.hsdev,
|
|
accel_state->common_attributes.hsdev,
|
|
hsdev->usage, address, report_id,
|
|
hsdev->usage, address, report_id,
|
|
- SENSOR_HUB_SYNC);
|
|
|
|
|
|
+ SENSOR_HUB_SYNC,
|
|
|
|
+ min < 0);
|
|
else {
|
|
else {
|
|
*val = 0;
|
|
*val = 0;
|
|
hid_sensor_power_state(&accel_state->common_attributes,
|
|
hid_sensor_power_state(&accel_state->common_attributes,
|