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

Commit cf15448c authored by Mukesh Kumar Savaliya's avatar Mukesh Kumar Savaliya Committed by Chandana Kishori Chiluveru
Browse files

serial: msm_geni_serial: Log UART CTS and RX IO line status



This change adds the status of UART input lines namely CTS and RX.
These two lines are driven from peer device hence it helps in debug
to confirm peer device status.

This is requested by BT HOST driver to help understand logs clearly.

Change-Id: I892961a5889aea1f46fed1fbde2c924844bc3946
Signed-off-by: default avatarMukesh Kumar Savaliya <msavaliy@codeaurora.org>
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent c6d2596d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -483,6 +483,7 @@ static void wait_for_transfers_inflight(struct uart_port *uport)
	int iter = 0;
	struct msm_geni_serial_port *port = GET_DEV_PORT(uport);
	unsigned int geni_status;
	bool CTS, RX;

	geni_status = geni_read_reg_nolog(uport->membase, SE_GENI_STATUS);
	/* Possible stop rx is called before this. */
@@ -506,10 +507,12 @@ static void wait_for_transfers_inflight(struct uart_port *uport)
							SE_GENI_RX_FIFO_STATUS);
		u32 rx_dma =
			geni_read_reg_nolog(uport->membase, SE_DMA_RX_LEN_IN);
		CTS = geni_ios & BIT(1); // b[1] = UART CTS <- Peer RFR
		RX = geni_ios & BIT(0);  // b[0] = UART RX <- Peer TX

		IPC_LOG_MSG(port->ipc_log_misc,
			"%s IOS 0x%x geni status 0x%x rx: fifo 0x%x dma 0x%x\n",
		__func__, geni_ios, geni_status, rx_fifo_status, rx_dma);
		"%s: geni=0x%x rx_fifo=0x%x rx_dma=0x%x, CTS_IO=%d, RX_IO=%d\n",
		 __func__, geni_status, rx_fifo_status, rx_dma, CTS, RX);
	}
}

@@ -1766,7 +1769,7 @@ static int msm_geni_serial_handle_dma_tx(struct uart_port *uport)
		 */
		if (!uart_console(uport)) {
			IPC_LOG_MSG(msm_port->ipc_log_misc,
				"%s.Power Off.\n", __func__);
				"%s.Tx sent out, Power off\n", __func__);
			msm_geni_serial_power_off(uport);
		}
		uart_write_wakeup(uport);