summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>2024-01-23 15:14:58 +0100
committerHans de Goede <hdegoede@redhat.com>2024-01-26 20:12:05 +0100
commitcedecdba60f4a42a8562574119f317ed0c674b5a (patch)
tree2da23aede41f771001e75c9d2afce0a403a6e9ea /drivers
parentplatform/x86/amd/pmf: Get Human presence information from AMD SFH driver (diff)
downloadlinux-cedecdba60f4a42a8562574119f317ed0c674b5a.tar.xz
linux-cedecdba60f4a42a8562574119f317ed0c674b5a.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/amd/pmf/spc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
index 87ae7c41c9f8..a3dec14c3004 100644
--- a/drivers/platform/x86/amd/pmf/spc.c
+++ b/drivers/platform/x86/amd/pmf/spc.c
@@ -46,6 +46,7 @@ void amd_pmf_dump_ta_inputs(struct amd_pmf_dev *dev, struct ta_pmf_enact_table *
dev_dbg(dev->dev, "GFX Busy: %u\n", in->ev_info.gfx_busy);
dev_dbg(dev->dev, "LID State: %s\n", in->ev_info.lid_state ? "close" : "open");
dev_dbg(dev->dev, "User Presence: %s\n", in->ev_info.user_present ? "Present" : "Away");
+ dev_dbg(dev->dev, "Ambient Light: %d\n", in->ev_info.ambient_light);
dev_dbg(dev->dev, "==== TA inputs END ====\n");
}
#else
@@ -154,6 +155,13 @@ static int amd_pmf_get_sensor_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_
struct amd_sfh_info sfh_info;
int ret;
+ /* Get ALS data */
+ ret = amd_get_sfh_info(&sfh_info, MT_ALS);
+ if (!ret)
+ in->ev_info.ambient_light = sfh_info.ambient_light;
+ else
+ return ret;
+
/* get HPD data */
ret = amd_get_sfh_info(&sfh_info, MT_HPD);
if (ret)