drivers: soc: qti: Add support for fingerprint driver

Port qbt_handler from msm-4.19 branch upto commit
f5526dd3667d (qbt: Make IPC irq falling edge triggered).

Change-Id: I5adb23732850e56bfce0af89b378bf0bc0e4c192
Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
This commit is contained in:
Abir Ghosh 2020-01-30 18:04:32 +05:30
parent 2a1334dded
commit c6d5ee8048
10 changed files with 1339 additions and 1 deletions

View File

@ -6,7 +6,7 @@
# Each configuration option enables a list of files.
obj-$(CONFIG_INPUT) += input-core.o
input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o
input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o event_notify.o
obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o

View File

@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
*/
#include <linux/export.h>
#include <linux/notifier.h>
#include <linux/input/touch_event_notify.h>
static BLOCKING_NOTIFIER_HEAD(touch_notifier_list);
int touch_event_register_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&touch_notifier_list, nb);
}
EXPORT_SYMBOL(touch_event_register_notifier);
int touch_event_unregister_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&touch_notifier_list, nb);
}
EXPORT_SYMBOL(touch_event_unregister_notifier);
void touch_event_call_notifier(unsigned long action, void *data)
{
blocking_notifier_call_chain(&touch_notifier_list, action, data);
}
EXPORT_SYMBOL(touch_event_call_notifier);

View File

@ -106,6 +106,15 @@ config MSM_SPSS_UTILS
because the SPSS firmware size is too small to support multiple
HW versions.
config MSM_QBT_HANDLER
tristate "Event Handler for QTI Ultrasonic Fingerprint Sensor"
help
This driver acts as a interrupt handler, where the interrupt is generated
by the QTI Ultrasonic Fingerprint Sensor. It queues the events for each
interrupt in an event queue and notifies the userspace to read the events
from the queue. It also creates an input device to send key events such as
KEY_POWER, KEY_HOME.
config QCOM_GSBI
tristate "QCOM General Serial Bus Interface"
depends on ARCH_QCOM || COMPILE_TEST

View File

@ -72,3 +72,4 @@ obj-$(CONFIG_MSM_SPCOM) += spcom.o
obj-$(CONFIG_QCOM_FSA4480_I2C) += fsa4480-i2c.o
obj-$(CONFIG_QCOM_EUD) += eud.o
obj-$(CONFIG_QCOM_GUESTVM) += guestvm_loader.o
obj-$(CONFIG_MSM_QBT_HANDLER) += qbt_handler.o

File diff suppressed because it is too large Load Diff

View File

@ -465,6 +465,7 @@ gen_headers_out_arm = [
"linux/psp-sev.h",
"linux/ptp_clock.h",
"linux/ptrace.h",
"linux/qbt_handler.h",
"linux/qcedev.h",
"linux/qcota.h",
"linux/qemu_fw_cfg.h",

View File

@ -461,6 +461,7 @@ gen_headers_out_arm64 = [
"linux/psp-sev.h",
"linux/ptp_clock.h",
"linux/ptrace.h",
"linux/qbt_handler.h",
"linux/qcedev.h",
"linux/qcota.h",
"linux/qemu_fw_cfg.h",

View File

@ -0,0 +1,33 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
*/
#ifndef _TOUCHEVENTNOTIFY_H
#define _TOUCHEVENTNOTIFY_H
struct touch_event {
struct timeval time;
int x;
int y;
int fid; /* Finger ID */
char type; /* 'D' - Down, 'M' - Move, 'U' - Up, */
};
#define EVENT_TYPE_DOWN 'D'
#define EVENT_TYPE_MOVE 'M'
#define EVENT_TYPE_UP 'U'
/* caller API */
int touch_event_register_notifier(struct notifier_block *nb);
int touch_event_unregister_notifier(struct notifier_block *nb);
/* callee API */
void touch_event_call_notifier(unsigned long action, void *data);
#endif

View File

@ -7,6 +7,8 @@ ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
no-export-headers += linux/kvm.h
endif
header-y += linux/qbt_handler.h
ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
ifeq ($(wildcard $(objtree)/arch/$(SRCARCH)/include/generated/uapi/asm/kvm_para.h),)
no-export-headers += linux/kvm_para.h

View File

@ -0,0 +1,80 @@
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*/
#ifndef _UAPI_QBT_HANDLER_H_
#define _UAPI_QBT_HANDLER_H_
#define MAX_NAME_SIZE 32
#define QBT_IS_WUHB_CONNECTED 100
#define QBT_SEND_KEY_EVENT 101
#define QBT_ENABLE_IPC 102
#define QBT_DISABLE_IPC 103
#define QBT_ENABLE_FD 104
#define QBT_DISABLE_FD 105
#define QBT_CONFIGURE_TOUCH_FD 106
#define QBT_ACQUIRE_WAKELOCK 107
#define QBT_RELEASE_WAKELOCK 108
/*
* enum qbt_finger_events -
* enumeration of qbt finger events
* @QBT_EVENT_FINGER_UP - finger up detected
* @QBT_EVENT_FINGER_DOWN - finger down detected
* @QBT_EVENT_FINGER_MOVE - finger move detected
*/
enum qbt_finger_events {
QBT_EVENT_FINGER_UP,
QBT_EVENT_FINGER_DOWN,
QBT_EVENT_FINGER_MOVE
};
/*
* enum qbt_fw_event -
* enumeration of firmware events
* @FW_EVENT_FINGER_DOWN - finger down detected
* @FW_EVENT_FINGER_UP - finger up detected
* @FW_EVENT_IPC - an IPC from the firmware is pending
*/
enum qbt_fw_event {
FW_EVENT_FINGER_DOWN = 1,
FW_EVENT_FINGER_UP = 2,
FW_EVENT_IPC = 3,
};
/*
* struct qbt_wuhb_connected_status -
* used to query whether WUHB INT line is connected
* @is_wuhb_connected - if non-zero, WUHB INT line is connected
*/
struct qbt_wuhb_connected_status {
bool is_wuhb_connected;
};
/*
* struct qbt_key_event -
* used to send key event
* @key - the key event to send
* @value - value of the key event
*/
struct qbt_key_event {
int key;
int value;
};
/*
* struct qbt_touch_config -
* used to configure touch finger detect
* @rad_filter_enable - flag to enable/disable radius based filtering
* @rad_x: movement radius in x direction
* @rad_y: movement radius in y direction
*/
struct qbt_touch_config {
bool rad_filter_enable;
int rad_x;
int rad_y;
};
#endif /* _UAPI_QBT_HANDLER_H_ */