1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * AMD MP2 PCIe communication driver
4 * Copyright 2020-2021 Advanced Micro Devices, Inc.
5 * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
6 * Sandeep Singh <Sandeep.singh@amd.com>
7 * Basavaraj Natikar <Basavaraj.Natikar@amd.com>
10 #ifndef PCIE_MP2_AMD_H
11 #define PCIE_MP2_AMD_H
13 #include "amd_sfh_common.h"
15 /* MP2 C2P Message Registers */
16 #define AMD_C2P_MSG0 0x10500
17 #define AMD_C2P_MSG1 0x10504
18 #define AMD_C2P_MSG2 0x10508
20 /* MP2 P2C Message Registers */
21 #define AMD_P2C_MSG3 0x1068C /* Supported Sensors info */
28 #define SENSOR_DISCOVERY_STATUS_MASK GENMASK(5, 3)
29 #define SENSOR_DISCOVERY_STATUS_SHIFT 3
31 /* SFH Command register */
73 union sfh_cmd_base cmd_base;
74 union sfh_cmd_param cmd_param;
75 phys_addr_t phys_addr;
93 u32 human_presence_report : 4;
94 u32 human_presence_actual : 4;
96 u32 object_distance : 16;
102 int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id);
103 int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata);
104 int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata);
105 void amd_sfh_set_desc_ops(struct amd_mp2_ops *mp2_ops);