sm8450-common: udfps: Use MI_DISP_PRIMARY as touch id

Change-Id: Ie4144887165d56f37c871bb85da56e8c80dfd721
This commit is contained in:
Arian 2024-03-14 13:35:14 +01:00
parent 1328eabc27
commit 5588bbf3dd

View file

@ -31,7 +31,6 @@
#define FOD_STATUS_ON 1 #define FOD_STATUS_ON 1
#define TOUCH_DEV_PATH "/dev/xiaomi-touch" #define TOUCH_DEV_PATH "/dev/xiaomi-touch"
#define TOUCH_ID 0
#define TOUCH_MAGIC 'T' #define TOUCH_MAGIC 'T'
#define TOUCH_IOC_SET_CUR_VALUE _IO(TOUCH_MAGIC, SET_CUR_VALUE) #define TOUCH_IOC_SET_CUR_VALUE _IO(TOUCH_MAGIC, SET_CUR_VALUE)
#define TOUCH_IOC_GET_CUR_VALUE _IO(TOUCH_MAGIC, GET_CUR_VALUE) #define TOUCH_IOC_GET_CUR_VALUE _IO(TOUCH_MAGIC, GET_CUR_VALUE)
@ -154,14 +153,14 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
bool enrolling = false; bool enrolling = false;
void setFodStatus(int value) { void setFodStatus(int value) {
int buf[MAX_BUF_SIZE] = {TOUCH_ID, Touch_Fod_Enable, value}; int buf[MAX_BUF_SIZE] = {MI_DISP_PRIMARY, Touch_Fod_Enable, value};
ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &buf); ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &buf);
} }
void setFingerDown(bool pressed) { void setFingerDown(bool pressed) {
mDevice->extCmd(mDevice, COMMAND_NIT, pressed ? PARAM_NIT_FOD : PARAM_NIT_NONE); mDevice->extCmd(mDevice, COMMAND_NIT, pressed ? PARAM_NIT_FOD : PARAM_NIT_NONE);
int buf[MAX_BUF_SIZE] = {TOUCH_ID, THP_FOD_DOWNUP_CTL, pressed ? 1 : 0}; int buf[MAX_BUF_SIZE] = {MI_DISP_PRIMARY, THP_FOD_DOWNUP_CTL, pressed ? 1 : 0};
ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &buf); ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &buf);
// Request HBM // Request HBM