Skip to content

Commit cedecdb

Browse files
Shyam Sundar S Kjwrdegoede
authored andcommitted
platform/x86/amd/pmf: Get ambient light information from AMD SFH driver
AMD SFH driver has APIs defined to export the ambient light information; use this within the PMF driver to send inputs to the PMF TA, so that PMF driver can enact to the actions coming from the TA. Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20240123141458.3715211-2-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 118063f commit cedecdb

File tree

1 file changed

+8
-0
lines changed
  • drivers/platform/x86/amd/pmf

1 file changed

+8
-0
lines changed

drivers/platform/x86/amd/pmf/spc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void amd_pmf_dump_ta_inputs(struct amd_pmf_dev *dev, struct ta_pmf_enact_table *
4646
dev_dbg(dev->dev, "GFX Busy: %u\n", in->ev_info.gfx_busy);
4747
dev_dbg(dev->dev, "LID State: %s\n", in->ev_info.lid_state ? "close" : "open");
4848
dev_dbg(dev->dev, "User Presence: %s\n", in->ev_info.user_present ? "Present" : "Away");
49+
dev_dbg(dev->dev, "Ambient Light: %d\n", in->ev_info.ambient_light);
4950
dev_dbg(dev->dev, "==== TA inputs END ====\n");
5051
}
5152
#else
@@ -154,6 +155,13 @@ static int amd_pmf_get_sensor_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
154155
struct amd_sfh_info sfh_info;
155156
int ret;
156157

158+
/* Get ALS data */
159+
ret = amd_get_sfh_info(&sfh_info, MT_ALS);
160+
if (!ret)
161+
in->ev_info.ambient_light = sfh_info.ambient_light;
162+
else
163+
return ret;
164+
157165
/* get HPD data */
158166
ret = amd_get_sfh_info(&sfh_info, MT_HPD);
159167
if (ret)

0 commit comments

Comments
 (0)