diff options
| author | Hyungwoo Yang <hyungwoo.yang@intel.com> | 2016-11-07 10:22:47 -0800 |
|---|---|---|
| committer | Edward O'Callaghan <funfunctor@folklore1984.net> | 2016-12-06 13:01:50 +1100 |
| commit | c9b509bf8fc0ac96d824de3cd87c3fc0d2e49986 (patch) | |
| tree | 9cbf71bc94b20e9e133e306d1e71fdba3d6d6273 /drivers/misc/ipts/ipts-mei.c | |
| parent | 1fab878a1cb8ef8fd60a8573b247cac702116864 (diff) | |
misc: ipts: handle gfx event in a separate contextSP4
mei_cldev_send() returns immediately if current thread is signaled.
Some contexts sending gfx events(for now, there's only one event)
is already signaled and it prevents from sending messages to MEI.
This patch moves handling gfx event into a separate work item.
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Diffstat (limited to 'drivers/misc/ipts/ipts-mei.c')
| -rw-r--r-- | drivers/misc/ipts/ipts-mei.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/misc/ipts/ipts-mei.c b/drivers/misc/ipts/ipts-mei.c index 8c332ba351b1..39667e75dafd 100644 --- a/drivers/misc/ipts/ipts-mei.c +++ b/drivers/misc/ipts/ipts-mei.c @@ -110,6 +110,29 @@ static void raw_data_work_func(struct work_struct *work) ipts_handle_processed_data(ipts); } +static void gfx_status_work_func(struct work_struct *work) +{ + ipts_info_t *ipts = container_of(work, ipts_info_t, gfx_status_work); + ipts_state_t state; + int status = ipts->gfx_status; + + ipts_dbg(ipts, "notify gfx status : %d\n", status); + + state = ipts_get_state(ipts); + + if (state == IPTS_STA_RAW_DATA_STARTED || state == IPTS_STA_HID_STARTED) { + if (status == IPTS_NOTIFY_STA_BACKLIGHT_ON && + ipts->display_status == false) { + ipts_send_sensor_clear_mem_window_cmd(ipts); + ipts->display_status = true; + } else if (status == IPTS_NOTIFY_STA_BACKLIGHT_OFF && + ipts->display_status == true) { + ipts_send_sensor_quiesce_io_cmd(ipts); + ipts->display_status = false; + } + } +} + /* event loop */ static int ipts_mei_cl_event_thread(void *data) { @@ -186,6 +209,7 @@ static int ipts_mei_cl_probe(struct mei_cl_device *cldev, INIT_WORK(&ipts->init_work, init_work_func); INIT_WORK(&ipts->raw_data_work, raw_data_work_func); + INIT_WORK(&ipts->gfx_status_work, gfx_status_work_func); ret = sysfs_create_group(&cldev->dev.kobj, &ipts_grp); if (ret != 0) { @@ -215,6 +239,8 @@ static int ipts_mei_cl_remove(struct mei_cl_device *cldev) kthread_stop(ipts->event_loop); + pr_info("IPTS removed\n"); + return 0; } |
