Path: blob/master/drivers/hid/amd-sfh-hid/amd_sfh_hid.h
26282 views
/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* AMD MP2 Sensors transport driver3*4* Copyright 2020-2021 Advanced Micro Devices, Inc.5* Authors: Nehal Bakulchandra Shah <[email protected]>6* Sandeep Singh <[email protected]>7* Basavaraj Natikar <[email protected]>8*/910#ifndef AMDSFH_HID_H11#define AMDSFH_HID_H1213#define MAX_HID_DEVICES 714#define AMD_SFH_HID_VENDOR 0x102215#define AMD_SFH_HID_PRODUCT 0x00011617struct request_list {18struct hid_device *hid;19struct list_head list;20u8 report_id;21u8 sensor_idx;22u8 report_type;23u8 current_index;24};2526struct amd_input_data {27u32 *sensor_virt_addr[MAX_HID_DEVICES];28u8 *input_report[MAX_HID_DEVICES];29};3031struct amdtp_cl_data {32u8 init_done;33u32 cur_hid_dev;34bool is_any_sensor_enabled;35u32 hid_dev_count;36u32 num_hid_devices;37struct device_info *hid_devices;38u8 *report_descr[MAX_HID_DEVICES];39int report_descr_sz[MAX_HID_DEVICES];40struct hid_device *hid_sensor_hubs[MAX_HID_DEVICES];41u8 *hid_descr[MAX_HID_DEVICES];42int hid_descr_size[MAX_HID_DEVICES];43phys_addr_t phys_addr_base;44dma_addr_t sensor_dma_addr[MAX_HID_DEVICES];45u32 sensor_sts[MAX_HID_DEVICES];46u32 sensor_requested_cnt[MAX_HID_DEVICES];47u8 report_type[MAX_HID_DEVICES];48u8 report_id[MAX_HID_DEVICES];49u8 sensor_idx[MAX_HID_DEVICES];50u8 *feature_report[MAX_HID_DEVICES];51u8 request_done[MAX_HID_DEVICES];52struct amd_input_data *in_data;53struct delayed_work work;54struct delayed_work work_buffer;55struct request_list req_list;56};5758/**59* struct amdtp_hid_data - Per instance HID data60* @index: Device index in the order of enumeration61* @request_done: Get Feature/Input report complete flag62* used during get/set request from hid core63* @cli_data: Link to the client instance64* @hid_wait: Completion waitq65*66* Used to tie hid->driver data to driver client instance67*/68struct amdtp_hid_data {69int index;70struct amdtp_cl_data *cli_data;71wait_queue_head_t hid_wait;72};7374/* Interface functions between HID LL driver and AMD SFH client */75int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data);76void amdtp_hid_remove(struct amdtp_cl_data *cli_data);77int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type);78void amd_sfh_set_report(struct hid_device *hid, int report_id, int report_type);79void amdtp_hid_wakeup(struct hid_device *hid);80#endif818283