mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-01 15:14:52 +00:00

Human presence detection (HPD) sensor uses a camera to determine when user is physically in front of the machine. This might not be a desirable behavior because it can (for example) cause the machine to wake on approach. Add a new sysfs file "hpd" that will control whether this sensor is enabled. Use the value of this sysfs file to turn off HPD and prevent it from re-enabling after resume from suspend. 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>
30 lines
689 B
C
30 lines
689 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* AMD MP2 1.1 initialization structures
|
|
*
|
|
* Copyright (c) 2022, Advanced Micro Devices, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* Author: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
|
*/
|
|
|
|
#ifndef AMD_SFH_INIT_H
|
|
#define AMD_SFH_INIT_H
|
|
|
|
#include "../amd_sfh_common.h"
|
|
|
|
struct amd_sfh1_1_ops {
|
|
int (*init)(struct amd_mp2_dev *mp2);
|
|
void (*toggle_hpd)(struct amd_mp2_dev *mp2, bool enable);
|
|
};
|
|
|
|
int amd_sfh1_1_init(struct amd_mp2_dev *mp2);
|
|
void amd_sfh_toggle_hpd(struct amd_mp2_dev *mp2, bool enabled);
|
|
|
|
static const struct amd_sfh1_1_ops __maybe_unused sfh1_1_ops = {
|
|
.init = amd_sfh1_1_init,
|
|
.toggle_hpd = amd_sfh_toggle_hpd,
|
|
};
|
|
|
|
#endif
|