Linux 6.14-rc1
[linux.git] / include / linux / amd-pmf-io.h
blob6fa510f419c0c59258ceaaf6b69e3908ece55b0a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * AMD Platform Management Framework Interface
5 * Copyright (c) 2023, Advanced Micro Devices, Inc.
6 * All Rights Reserved.
8 * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
9 * Basavaraj Natikar <Basavaraj.Natikar@amd.com>
12 #ifndef AMD_PMF_IO_H
13 #define AMD_PMF_IO_H
15 #include <linux/types.h>
17 /**
18 * enum sfh_message_type - Query the SFH message type
19 * @MT_HPD: Message ID to know the Human presence info from MP2 FW
20 * @MT_ALS: Message ID to know the Ambient light info from MP2 FW
21 * @MT_SRA: Message ID to know the SRA data from MP2 FW
23 enum sfh_message_type {
24 MT_HPD,
25 MT_ALS,
26 MT_SRA,
29 /**
30 * enum sfh_hpd_info - Query the Human presence information
31 * @SFH_NOT_DETECTED: Check the HPD connection information from MP2 FW
32 * @SFH_USER_PRESENT: Check if the user is present from HPD sensor
33 * @SFH_USER_AWAY: Check if the user is away from HPD sensor
35 enum sfh_hpd_info {
36 SFH_NOT_DETECTED,
37 SFH_USER_PRESENT,
38 SFH_USER_AWAY,
41 /**
42 * struct amd_sfh_info - get HPD sensor info from MP2 FW
43 * @ambient_light: Populates the ambient light information
44 * @user_present: Populates the user presence information
45 * @platform_type: Operating modes (clamshell, flat, tent, etc.)
46 * @laptop_placement: Device states (ontable, onlap, outbag)
48 struct amd_sfh_info {
49 u32 ambient_light;
50 u8 user_present;
51 u32 platform_type;
52 u32 laptop_placement;
55 enum laptop_placement {
56 LP_UNKNOWN = 0,
57 ON_TABLE,
58 ON_LAP_MOTION,
59 IN_BAG,
60 OUT_OF_BAG,
61 LP_UNDEFINED,
64 int amd_get_sfh_info(struct amd_sfh_info *sfh_info, enum sfh_message_type op);
65 #endif