From 7018becc915cfd8eae269fa8c148f09dd39dee44 Mon Sep 17 00:00:00 2001 From: LADI RAM SAI Date: Fri, 15 Dec 2023 13:09:37 +0530 Subject: [PATCH] serial: msm_geni_serial: Add the conditional check for Deepsleep In kernel-5.15 we have driver called power_state.c. power_state.c updated the state via pm_set_suspend_via_firmware(), From kernel 6.1 onward we are not using power_state.c due to GKI compliance. So, we are updating the state via pm_suspend_target_state. Change-Id: I9a071d485589f9530324bf80db6c206546a21966 Signed-off-by: LADI RAM SAI --- drivers/tty/serial/msm_geni_serial.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/msm_geni_serial.c b/drivers/tty/serial/msm_geni_serial.c index 700aac0234e3..c7e4a19d0994 100644 --- a/drivers/tty/serial/msm_geni_serial.c +++ b/drivers/tty/serial/msm_geni_serial.c @@ -5719,24 +5719,22 @@ static int msm_geni_serial_sys_resume(struct device *dev) start_time = geni_capture_start_time(&port->se, port->ipc_log_kpi, __func__, port->uart_kpi); -#ifdef CONFIG_DEEPSLEEP - UART_LOG_DBG(port->ipc_log_pwr, dev, "%s: Deep Sleep Sys resume Start %d\n", + + UART_LOG_DBG(port->ipc_log_pwr, dev, "%s: System resume Start %d\n", __func__, true); - if (pm_suspend_via_firmware()) { + if (pm_suspend_target_state == PM_SUSPEND_MEM) { UART_LOG_DBG(port->ipc_log_pwr, dev, "deepsleep: %s\n", __func__); if (!uart_console(uport)) port->resuming_from_deep_sleep = true; - geni_capture_stop_time(&port->se, port->ipc_log_kpi, - __func__, port->uart_kpi, start_time, 0, 0); + geni_capture_stop_time(&port->se, port->ipc_log_kpi, + __func__, port->uart_kpi, start_time, 0, 0); return msm_geni_serial_sys_hib_resume(dev); } -#endif - UART_LOG_DBG(port->ipc_log_pwr, dev, "%s: Start %d\n", __func__, true); /* Platform driver is registered for console and when console * is disabled from cmdline simply return success.