From c38f93d1100c099fcf968c21d291829c8d8db455 Mon Sep 17 00:00:00 2001 From: Alex Sarraf Date: Fri, 16 Sep 2016 10:26:47 -0700 Subject: input: misc: hbtp_input: Add support for multiple AFE Add support for both HI04 and JDI/Rohm with DDIC synchronization. Change-Id: Ib6bddd5f43b41660304d240db39f4e273ede3af0 Signed-off-by: Alex Sarraf --- include/uapi/linux/hbtp_input.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/hbtp_input.h b/include/uapi/linux/hbtp_input.h index 67692ed8e3b8..9173c2ab72ed 100644 --- a/include/uapi/linux/hbtp_input.h +++ b/include/uapi/linux/hbtp_input.h @@ -43,6 +43,17 @@ struct hbtp_input_key { __s32 value; }; +enum hbtp_afe_signal { + HBTP_AFE_SIGNAL_ON_RESUME, + HBTP_AFE_SIGNAL_ON_SUSPEND, +}; + +enum hbtp_afe_power_ctrl { + HBTP_AFE_POWER_ENABLE_SYNC, + HBTP_AFE_POWER_ENABLE_SYNC_SIGNAL, +}; + + /* ioctl */ #define HBTP_INPUT_IOCTL_BASE 'T' #define HBTP_SET_ABSPARAM _IOW(HBTP_INPUT_IOCTL_BASE, 201, \ @@ -53,6 +64,10 @@ struct hbtp_input_key { enum hbtp_afe_power_cmd) #define HBTP_SET_KEYDATA _IOW(HBTP_INPUT_IOCTL_BASE, 204, \ struct hbtp_input_key) +#define HBTP_SET_SYNCSIGNAL _IOW(HBTP_INPUT_IOCTL_BASE, 205, \ + enum hbtp_afe_signal) +#define HBTP_SET_POWER_CTRL _IOW(HBTP_INPUT_IOCTL_BASE, 206, \ + enum hbtp_afe_power_ctrl) #endif /* _UAPI_HBTP_INPUT_H */ -- cgit v1.2.3 From 1e0b8d4f59968423afea1bcbe95bd93c68b1f0bd Mon Sep 17 00:00:00 2001 From: Lior Barenboim Date: Sun, 9 Oct 2016 11:47:28 +0300 Subject: soc: qcom: add support for fingerprint sensor driver The QBT1000 driver provides an API for communicating with trustzone applications and handles firmware event interrupts. The driver supports the following features: - loading and unloading trustzone applications - sending commands to trustzone applications - voting/un-voting for clocks before/after making a trustzone call - receiving firmware events, signalled by interrupts, and providing them to the driver client - sending a key event in response to firmware finger detect events Change-Id: I1d9d7a6b6bd2d3420a28a8c09868143bb9bd3b27 Signed-off-by: Lior Barenboim --- include/uapi/linux/Kbuild | 1 + include/uapi/linux/qbt1000.h | 99 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 include/uapi/linux/qbt1000.h (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 0bac6947a1cb..d6ff882ad6a7 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -381,6 +381,7 @@ header-y += prctl.h header-y += psci.h header-y += ptp_clock.h header-y += ptrace.h +header-y += qbt1000.h header-y += qcedev.h header-y += qcota.h header-y += qnx4_fs.h diff --git a/include/uapi/linux/qbt1000.h b/include/uapi/linux/qbt1000.h new file mode 100644 index 000000000000..8a3be2c634d3 --- /dev/null +++ b/include/uapi/linux/qbt1000.h @@ -0,0 +1,99 @@ +#ifndef _UAPI_QBT1000_H_ +#define _UAPI_QBT1000_H_ + +#define MAX_NAME_SIZE 32 + +/* +* enum qbt1000_commands - +* enumeration of command options +* @QBT1000_LOAD_APP - cmd loads TZ app +* @QBT1000_UNLOAD_APP - cmd unloads TZ app +* @QBT1000_SEND_TZCMD - sends cmd to TZ app +* @QBT1000_SET_FINGER_DETECT_KEY - sets the input key to send on finger detect +* @QBT1000_CONFIGURE_POWER_KEY - enables/disables sending the power key on + finger down events +*/ +enum qbt1000_commands { + QBT1000_LOAD_APP = 100, + QBT1000_UNLOAD_APP = 101, + QBT1000_SEND_TZCMD = 102, + QBT1000_SET_FINGER_DETECT_KEY = 103, + QBT1000_CONFIGURE_POWER_KEY = 104 +}; + +/* +* enum qbt1000_fw_event - +* enumeration of firmware events +* @FW_EVENT_FINGER_DOWN - finger down detected +* @FW_EVENT_FINGER_UP - finger up detected +* @FW_EVENT_INDICATION - an indication IPC from the firmware is pending +*/ +enum qbt1000_fw_event { + FW_EVENT_FINGER_DOWN = 1, + FW_EVENT_FINGER_UP = 2, + FW_EVENT_CBGE_REQUIRED = 3, +}; + +/* +* struct qbt1000_app - +* used to load and unload apps in TZ +* @app_handle - qseecom handle for clients +* @name - Name of secure app to load +* @size - Size of requested buffer of secure app +* @high_band_width - 1 - for high bandwidth usage +* 0 - for normal bandwidth usage +*/ +struct qbt1000_app { + struct qseecom_handle **app_handle; + char name[MAX_NAME_SIZE]; + uint32_t size; + uint8_t high_band_width; +}; + +/* +* struct qbt1000_send_tz_cmd - +* used to cmds to TZ App +* @app_handle - qseecom handle for clients +* @req_buf - Buffer containing request for secure app +* @req_buf_len - Length of request buffer +* @rsp_buf - Buffer containing response from secure app +* @rsp_buf_len - Length of response buffer +*/ +struct qbt1000_send_tz_cmd { + struct qseecom_handle *app_handle; + uint8_t *req_buf; + uint32_t req_buf_len; + uint8_t *rsp_buf; + uint32_t rsp_buf_len; +}; + +/* +* struct qbt1000_erie_event - +* used to receive events from Erie +* @buf - Buffer containing event from Erie +* @buf_len - Length of buffer +*/ +struct qbt1000_erie_event { + uint8_t *buf; + uint32_t buf_len; +}; + +/* +* struct qbt1000_set_finger_detect_key - +* used to configure the input key which is sent on finger down/up event +* @key_code - Key code to send on finger down/up. 0 disables sending key events +*/ +struct qbt1000_set_finger_detect_key { + unsigned int key_code; +}; + +/* +* struct qbt1000_configure_power_key - +* used to configure whether the power key is sent on finger down +* @enable - if non-zero, power key is sent on finger down +*/ +struct qbt1000_configure_power_key { + unsigned int enable; +}; + +#endif /* _UAPI_QBT1000_H_ */ -- cgit v1.2.3