sm8450-common: udfps: Simplify display request ioctl struct
Change-Id: I99db6477dd6c14aab5e60bce841b48b68cd36b1d
This commit is contained in:
@@ -68,6 +68,11 @@ static disp_event_resp* parseDispEvent(int fd) {
|
||||
return response;
|
||||
}
|
||||
|
||||
struct disp_base displayBasePrimary = {
|
||||
.flag = 0,
|
||||
.disp_id = MI_DISP_PRIMARY,
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
||||
@@ -86,11 +91,11 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
||||
}
|
||||
|
||||
// Register for FOD events
|
||||
disp_event_req req;
|
||||
req.base.flag = 0;
|
||||
req.base.disp_id = MI_DISP_PRIMARY;
|
||||
req.type = MI_DISP_EVENT_FOD;
|
||||
ioctl(fd, MI_DISP_IOCTL_REGISTER_EVENT, &req);
|
||||
struct disp_event_req displayEventRequest = {
|
||||
.base = displayBasePrimary,
|
||||
.type = MI_DISP_EVENT_FOD,
|
||||
};
|
||||
ioctl(fd, MI_DISP_IOCTL_REGISTER_EVENT, &displayEventRequest);
|
||||
|
||||
struct pollfd dispEventPoll = {
|
||||
.fd = fd,
|
||||
@@ -145,11 +150,11 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
||||
ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &touchRequest);
|
||||
|
||||
// Request HBM
|
||||
disp_local_hbm_req req;
|
||||
req.base.flag = 0;
|
||||
req.base.disp_id = MI_DISP_PRIMARY;
|
||||
req.local_hbm_value = LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT;
|
||||
ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &req);
|
||||
struct disp_local_hbm_req displayLhbmRequest = {
|
||||
.base = displayBasePrimary,
|
||||
.local_hbm_value = LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT,
|
||||
};
|
||||
ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &displayLhbmRequest);
|
||||
}
|
||||
|
||||
void onFingerUp() {
|
||||
@@ -160,11 +165,11 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
||||
mDevice->extCmd(mDevice, COMMAND_FOD_PRESS_STATUS, PARAM_FOD_RELEASED);
|
||||
|
||||
// Disable HBM
|
||||
disp_local_hbm_req req;
|
||||
req.base.flag = 0;
|
||||
req.base.disp_id = MI_DISP_PRIMARY;
|
||||
req.local_hbm_value = LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP;
|
||||
ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &req);
|
||||
struct disp_local_hbm_req displayLhbmRequest = {
|
||||
.base = displayBasePrimary,
|
||||
.local_hbm_value = LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP,
|
||||
};
|
||||
ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &displayLhbmRequest);
|
||||
|
||||
// Update fod_finger_state node in case hwmodule polls it
|
||||
struct touch_mode_request touchRequest = {
|
||||
@@ -181,9 +186,7 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
||||
}
|
||||
}
|
||||
|
||||
void cancel() {
|
||||
LOG(DEBUG) << __func__;
|
||||
}
|
||||
void cancel() { LOG(DEBUG) << __func__; }
|
||||
|
||||
private:
|
||||
fingerprint_device_t* mDevice;
|
||||
|
Reference in New Issue
Block a user