From 98e7f2cfa2fa0a62bf09e04a90719f04a8472588 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Thu, 17 Jun 2010 14:16:19 +0530 Subject: [arm/tegra]serial: Power control api for bluesleep power management. Adding apis for following function to hooking up tegra serial driver with bluesleep power management: - Clock off. - Clock on. - Setting flow control to desired state. - Checking for tx fifo status. Following 4 state of uart state machine is developed to achieve this: UART_CLOSED, UART_OPENED, UART_SUSPEND, UART_CLOCK_OFF. The transitions of states are as follows: UART_CLOSED: the init state on which resource is allocated but not opened by client or when device is closed. UART_OPENED: Able to do data transfer. CLOSED to OPENED by opening the port. CLOCK_OFF to OPENED by calling function tegra_uart_request_clock_on(). SUSPEND to OPENED by calling resume(). UART_CLOCK_OFF: The controller clock is disabled and so no data transfer can happen. At this state, controller is not ready for deep power down. OPENED to CLOCK_OFF by calling tegra_uart_request_clock_off(). Can not go to this state from CLOSED and SUSPEND. UART_SUSPEND: The controller is in suspended state and ready for deep power down. UART_CLOCK_OFF to SUSPEND: OPENED to SUSPEND. Change-Id: Ib0c40547665181cadd172840be9aed2cc18ba448 Reviewed-on: http://git-master/r/2819 Reviewed-by: Anantha Idapalapati Tested-by: Anantha Idapalapati Reviewed-by: Udaykumar Rameshchan Raval Reviewed-by: Gary King --- arch/arm/mach-tegra/include/mach/serial.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-tegra/include/mach/serial.h b/arch/arm/mach-tegra/include/mach/serial.h index c77afa190998..fb4c92a9902c 100644 --- a/arch/arm/mach-tegra/include/mach/serial.h +++ b/arch/arm/mach-tegra/include/mach/serial.h @@ -24,6 +24,7 @@ #include #include +#include #include @@ -33,4 +34,18 @@ struct tegra_serial_platform_data { int nr_pins; }; +/* Switch off the clock of the uart controller. */ +void tegra_uart_request_clock_off(struct uart_port *uport); + +/* Switch on the clock of the uart controller */ +void tegra_uart_request_clock_on(struct uart_port *uport); + +/* Set the modem control signals state of uart controller. */ +void tegra_uart_set_mctrl(struct uart_port *uport, unsigned int mctrl); + +/* Return the status of the transmit fifo whether empty or not. + * Return 0 if tx fifo is not empty. + * Return TIOCSER_TEMT if tx fifo is empty */ +int tegra_uart_is_tx_empty(struct uart_port *uport); + #endif -- cgit v1.2.3