Commit 82cdcdf2 authored by Basavaraj Natikar's avatar Basavaraj Natikar Committed by Jonathan Cameron

HID: amd_sfh: Add support for SFH1.1 light color temperature

In most cases, ambient color sensors also support light color temperature.
As a result, add support of light color temperature for SFH1.1.
Signed-off-by: default avatarBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
Link: https://lore.kernel.org/r/20230919081054.2050714-6-Basavaraj.Natikar@amd.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 908fee51
......@@ -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,11 @@ 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;
report_size = sizeof(als_input);
memcpy(input_report, &als_input, sizeof(als_input));
break;
......
......@@ -88,6 +88,16 @@ struct sfh_sensor_list {
};
};
struct sfh_sensor_prop {
union {
u32 sprop;
struct {
u32 elist : 16;
u32 feat : 16;
} sf;
};
};
struct sfh_base_info {
union {
u32 sfh_base[24];
......@@ -95,6 +105,8 @@ struct sfh_base_info {
struct sfh_platform_info plat_info;
struct sfh_firmware_info fw_info;
struct sfh_sensor_list s_list;
u32 rsvd;
struct sfh_sensor_prop s_prop[16];
} sbase;
};
};
......@@ -134,6 +146,7 @@ struct sfh_mag_data {
struct sfh_als_data {
struct sfh_common_data commondata;
u32 lux;
u32 light_color_temp;
};
struct hpd_status {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment