Add pm_qos control to reduce the interrupt responce time

request pm_qos during the interrupt processing to prevent
the CPU from going to sleep state.

Change-Id: I78a67ef1aa9a363e9d7f9546b8d4c20a81ac04c4
Reviewed-on: https://gerrit.mot.com/2107618
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-11-22 11:12:55 +08:00 • committed by litong
commit cf6c77763e
2 changed files with 17 additions and 0 deletions

View file

@ -1097,6 +1097,11 @@ static int goodix_parse_dt(struct device_node *node,
}
}
board_data->pm_qos_enable = of_property_read_bool(node,
"goodix,pm_qos-enable");
if (board_data->pm_qos_enable)
ts_info("goodix pm_qos enabled");
board_data->sensitivity_ctrl = of_property_read_bool(node,
"goodix,sensitivity-ctrl");
if (board_data->sensitivity_ctrl)
@ -1227,8 +1232,13 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data)
struct goodix_ext_module *ext_module, *next;
struct goodix_ts_event *ts_event = &core_data->ts_event;
struct goodix_ts_esd *ts_esd = &core_data->ts_esd;
const struct goodix_ts_board_data *ts_bdata = board_data(core_data);
int ret;
if (ts_bdata->pm_qos_enable)
cpu_latency_qos_add_request(&core_data->goodix_pm_qos, 0);
ts_esd->irq_status = true;
core_data->irq_trig_cnt++;
/* inform external module */
@ -1267,6 +1277,10 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data)
hw_ops->after_event_handler(core_data);
ts_event->retry = 0;
if (ts_bdata->pm_qos_enable)
cpu_latency_qos_remove_request(&core_data->goodix_pm_qos);
return IRQ_HANDLED;
}

View file

@ -16,6 +16,7 @@
#include <linux/completion.h>
#include <linux/of_irq.h>
#include <linux/clk.h>
#include <linux/pm_qos.h>
#ifdef CONFIG_OF
#include <linux/of_gpio.h>
#include <linux/regulator/consumer.h>
@ -272,6 +273,7 @@ struct goodix_ts_board_data {
unsigned int panel_max_p; /*pressure*/
bool pen_enable;
bool pm_qos_enable;
char fw_name[GOODIX_MAX_STR_LABLE_LEN];
char cfg_bin_name[GOODIX_MAX_STR_LABLE_LEN];
char stylus_clk_src[GOODIX_MAX_STR_LABLE_LEN]; /*stylus clock source*/
@ -489,6 +491,7 @@ struct goodix_ts_core {
struct wakeup_source *gesture_wakelock;
struct notifier_block ts_notifier;
struct goodix_ts_esd ts_esd;
struct pm_qos_request goodix_pm_qos;
#ifdef CONFIG_FB
struct notifier_block fb_notifier;