1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * AMD MP2 PCIe communication driver
4 * Copyright 2020 Advanced Micro Devices, Inc.
5 * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
6 * Sandeep Singh <Sandeep.singh@amd.com>
10 #define PCIE_MP2_AMD_H
12 #include <linux/pci.h>
14 #define PCI_DEVICE_ID_AMD_MP2 0x15E4
16 #define ENABLE_SENSOR 1
17 #define DISABLE_SENSOR 2
18 #define STOP_ALL_SENSORS 8
20 /* MP2 C2P Message Registers */
21 #define AMD_C2P_MSG0 0x10500
22 #define AMD_C2P_MSG1 0x10504
23 #define AMD_C2P_MSG2 0x10508
25 /* MP2 P2C Message Registers */
26 #define AMD_P2C_MSG3 0x1068C /* Supported Sensors info */
28 /* SFH Command register */
48 union sfh_cmd_base cmd_base;
49 union sfh_cmd_param cmd_param;
50 phys_addr_t phys_addr;
62 struct amdtp_cl_data *cl_data;
66 struct amd_mp2_sensor_info {
69 dma_addr_t dma_address;
72 void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info);
73 void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx);
74 void amd_stop_all_sensors(struct amd_mp2_dev *privdata);
75 int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id);
76 int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata);
77 int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata);