|
14 | 14 | #include "../common/hid-sensors/hid-sensor-trigger.h"
|
15 | 15 |
|
16 | 16 | enum {
|
17 |
| - CHANNEL_SCAN_INDEX_INTENSITY, |
18 |
| - CHANNEL_SCAN_INDEX_ILLUM, |
19 |
| - CHANNEL_SCAN_INDEX_COLOR_TEMP, |
| 17 | + CHANNEL_SCAN_INDEX_INTENSITY = 0, |
| 18 | + CHANNEL_SCAN_INDEX_ILLUM = 1, |
20 | 19 | CHANNEL_SCAN_INDEX_MAX
|
21 | 20 | };
|
22 | 21 |
|
@@ -66,16 +65,6 @@ static const struct iio_chan_spec als_channels[] = {
|
66 | 65 | BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
|
67 | 66 | .scan_index = CHANNEL_SCAN_INDEX_ILLUM,
|
68 | 67 | },
|
69 |
| - { |
70 |
| - .type = IIO_COLORTEMP, |
71 |
| - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), |
72 |
| - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) | |
73 |
| - BIT(IIO_CHAN_INFO_SCALE) | |
74 |
| - BIT(IIO_CHAN_INFO_SAMP_FREQ) | |
75 |
| - BIT(IIO_CHAN_INFO_HYSTERESIS) | |
76 |
| - BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE), |
77 |
| - .scan_index = CHANNEL_SCAN_INDEX_COLOR_TEMP, |
78 |
| - }, |
79 | 68 | IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
|
80 | 69 | };
|
81 | 70 |
|
@@ -114,11 +103,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
|
114 | 103 | min = als_state->als[chan->scan_index].logical_minimum;
|
115 | 104 | address = HID_USAGE_SENSOR_LIGHT_ILLUM;
|
116 | 105 | break;
|
117 |
| - case CHANNEL_SCAN_INDEX_COLOR_TEMP: |
118 |
| - report_id = als_state->als[chan->scan_index].report_id; |
119 |
| - min = als_state->als[chan->scan_index].logical_minimum; |
120 |
| - address = HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE; |
121 |
| - break; |
122 | 106 | default:
|
123 | 107 | report_id = -1;
|
124 | 108 | break;
|
@@ -239,10 +223,6 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
|
239 | 223 | als_state->scan.illum[CHANNEL_SCAN_INDEX_ILLUM] = sample_data;
|
240 | 224 | ret = 0;
|
241 | 225 | break;
|
242 |
| - case HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE: |
243 |
| - als_state->scan.illum[CHANNEL_SCAN_INDEX_COLOR_TEMP] = sample_data; |
244 |
| - ret = 0; |
245 |
| - break; |
246 | 226 | case HID_USAGE_SENSOR_TIME_TIMESTAMP:
|
247 | 227 | als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes,
|
248 | 228 | *(s64 *)raw_data);
|
@@ -278,19 +258,6 @@ static int als_parse_report(struct platform_device *pdev,
|
278 | 258 | st->als[i].report_id);
|
279 | 259 | }
|
280 | 260 |
|
281 |
| - ret = sensor_hub_input_get_attribute_info(hsdev, HID_INPUT_REPORT, |
282 |
| - usage_id, |
283 |
| - HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE, |
284 |
| - &st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]); |
285 |
| - if (ret < 0) |
286 |
| - return ret; |
287 |
| - als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP, |
288 |
| - st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size); |
289 |
| - |
290 |
| - dev_dbg(&pdev->dev, "als %x:%x\n", |
291 |
| - st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index, |
292 |
| - st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id); |
293 |
| - |
294 | 261 | st->scale_precision = hid_sensor_format_scale(usage_id,
|
295 | 262 | &st->als[CHANNEL_SCAN_INDEX_INTENSITY],
|
296 | 263 | &st->scale_pre_decml, &st->scale_post_decml);
|
|
0 commit comments