HID: amd_sfh: Don't show wrong status for amd_sfh_hpd_info()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 28 Feb 2025 16:31:53 +0000 (10:31 -0600)
committerJiri Kosina <jkosina@suse.com>
Tue, 4 Mar 2025 20:49:33 +0000 (21:49 +0100)
When HPD is present but has been disabled, avoid reporting HPD status
to PMF.

Cc: Pratap Nirujogi <pratap.nirujogi@amd.com>
Tested-by: Anson Tsao <anson.tsao@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c

index ffb98b4c36cbd93e1c36543f677f533816ec6b4c..837d59e7a661023ed763d9c9d1fe8b45a6a2d976 100644 (file)
@@ -129,7 +129,7 @@ static int amd_sfh_hpd_info(u8 *user_present)
        if (!user_present)
                return -EINVAL;
 
-       if (!emp2 || !emp2->dev_en.is_hpd_present)
+       if (!emp2 || !emp2->dev_en.is_hpd_present || !emp2->dev_en.is_hpd_enabled)
                return -ENODEV;
 
        hpdstatus.val = readl(emp2->mmio + amd_get_c2p_val(emp2, 4));