diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-09-24 13:39:25 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-09-24 13:39:25 +0100 |
commit | 431dffc1df07b93ce9be26d264b7946cd65cb949 (patch) | |
tree | f8aaf7d46c8d90f5b2ebe0d6af6f8991b658ea0b /drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | |
parent | 57d3909596f9941c7d0777004994438df1b5ba0a (diff) | |
parent | c6c97210e27237438689611980f8a7b87bcc79bf (diff) |
Merge branch 'ib-iio-hid-sensors-v6.6-rc1' into togreg
The deta angle and deta velocity channels were added in parallel with
color temperature and chromacity so this merge had to assign a
consistent order. I put the color related ones second.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c')
-rw-r--r-- | drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c index 06bdcf072d10..8a037de08e92 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c @@ -188,6 +188,7 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id, struct sfh_mag_data mag_data; struct sfh_als_data als_data; struct hpd_status hpdstatus; + struct sfh_base_info binfo; void __iomem *sensoraddr; u8 report_size = 0; @@ -235,6 +236,14 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id, memcpy_fromio(&als_data, sensoraddr, sizeof(struct sfh_als_data)); get_common_inputs(&als_input.common_property, report_id); als_input.illuminance_value = float_to_int(als_data.lux); + + memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info)); + if (binfo.sbase.s_prop[ALS_IDX].sf.feat & 0x2) { + als_input.light_color_temp = als_data.light_color_temp; + als_input.chromaticity_x_value = float_to_int(als_data.chromaticity_x); + als_input.chromaticity_y_value = float_to_int(als_data.chromaticity_y); + } + report_size = sizeof(als_input); memcpy(input_report, &als_input, sizeof(als_input)); break; |