Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9514ed9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm_serial_hs: manage PM state when callbacks are disabled"

parents edd854c9 c170c731
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -281,6 +281,7 @@ static void msm_hs_bus_voting(struct msm_hs_port *msm_uport, unsigned int vote);
static struct msm_hs_port *msm_hs_get_hs_port(int port_index);
static void msm_hs_queue_rx_desc(struct msm_hs_port *msm_uport);
static int disconnect_rx_endpoint(struct msm_hs_port *msm_uport);
static int msm_hs_pm_resume(struct device *dev);

#define UARTDM_TO_MSM(uart_port) \
	container_of((uart_port), struct msm_hs_port, uport)
@@ -2255,6 +2256,12 @@ void msm_hs_request_clock_on(struct uart_port *uport)
	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
	msm_hs_resource_vote(UARTDM_TO_MSM(uport));

	if (msm_uport->pm_state != MSM_HS_PM_ACTIVE) {
		MSM_HS_WARN("%s(): %p runtime PM callback not invoked",
			__func__, uport->dev);
		msm_hs_pm_resume(uport->dev);
	}

	/* Clear the flag */
	if (msm_uport->obs)
		atomic_set(&msm_uport->client_req_state, 0);
@@ -3030,6 +3037,8 @@ static int msm_hs_pm_resume(struct device *dev)

	if (!msm_uport)
		goto err_resume;
	if (msm_uport->pm_state == MSM_HS_PM_ACTIVE)
		return 0;
	if (!atomic_read(&msm_uport->client_req_state))
		toggle_wakeup_interrupt(msm_uport);
	msm_hs_clk_bus_vote(msm_uport);
@@ -3063,6 +3072,7 @@ static int msm_hs_pm_sys_suspend_noirq(struct device *dev)
	if (IS_ERR_OR_NULL(msm_uport))
		return -ENODEV;

	MSM_HS_DBG("%s(): suspending", __func__);
	prev_pwr_state = msm_uport->pm_state;
	uport	= &(msm_uport->uport);
	mutex_lock(&msm_uport->mtx);