Input: gt1x - Enable async suspend/resume on fb blank
On rk3588-evb1-lp4-v10: Before: [ 101.214271][ T1989] PM: suspend exit [ 101.772978][ T412] dw-mipi-dsi2 fde20000.dsi: [drm:dw_mipi_dsi2_encoder_atomic_enable] final DSI-Link bandwidth: 880000 x 4 Kbps total: 0.558707 After: [ 266.604393][ T1971] PM: suspend exit [ 266.792421][ T410] dw-mipi-dsi2 fde20000.dsi: [drm:dw_mipi_dsi2_encoder_atomic_enable] final DSI-Link bandwidth: 880000 x 4 Kbps total: 0.188028, save about 0.37s. Signed-off-by: Tao Huang <huangtao@rock-chips.com> Change-Id: I7310b11e2897c79ce8b0c61d8b98760a4f8699f3
This commit is contained in:
@@ -656,6 +656,18 @@ static int gt1x_ts_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
#include <linux/async.h>
|
||||
|
||||
static void gt1x_resume_async(void *data, async_cookie_t cookie)
|
||||
{
|
||||
gt1x_resume();
|
||||
}
|
||||
|
||||
static void gt1x_suspend_async(void *data, async_cookie_t cookie)
|
||||
{
|
||||
gt1x_suspend();
|
||||
}
|
||||
|
||||
/* frame buffer notifier block control the suspend/resume procedure */
|
||||
static struct notifier_block gt1x_fb_notifier;
|
||||
static int tp_status;
|
||||
@@ -686,7 +698,7 @@ static int gtp_fb_notifier_callback(struct notifier_block *noti, unsigned long e
|
||||
if (*blank == FB_BLANK_UNBLANK) {
|
||||
tp_status = *blank;
|
||||
GTP_DEBUG("Resume by fb notifier.");
|
||||
gt1x_resume();
|
||||
async_schedule(gt1x_resume_async, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -697,7 +709,7 @@ static int gtp_fb_notifier_callback(struct notifier_block *noti, unsigned long e
|
||||
if (*blank == FB_BLANK_POWERDOWN) {
|
||||
tp_status = *blank;
|
||||
GTP_DEBUG("Suspend by fb notifier.");
|
||||
gt1x_suspend();
|
||||
async_schedule(gt1x_suspend_async, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user