Commit 55046237 authored by Mayank Rana's avatar Mayank Rana Committed by Greg Kroah-Hartman

serial: msm_serial_hs: Add MSM high speed UART driver

This driver supports UART-DM HW on MSM platforms. It uses the on
chip DMA to drive data transfers and has optional support for UART
power management independent of Linux suspend/resume and wakeup
from Rx.

The driver was originally developed by Google. It is functionally
equivalent to the version available at:
http://android.git.kernel.org/?p=kernel/experimental.git
the differences being:
1) Remove wakelocks and change unsupported DMA API.
2) Replace clock selection register codes by macros.
3) Fix checkpatch errors and add inline documentation.
4) Add runtime PM hooks for active power state transitions.
5) Handle error path and cleanup resources if required.

CC: Nick Pelly <npelly@google.com>
Signed-off-by: default avatarSankalp Bose <sankalpb@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 00bff392
...@@ -1319,6 +1319,18 @@ config SERIAL_MSM_CONSOLE ...@@ -1319,6 +1319,18 @@ config SERIAL_MSM_CONSOLE
depends on SERIAL_MSM=y depends on SERIAL_MSM=y
select SERIAL_CORE_CONSOLE select SERIAL_CORE_CONSOLE
config SERIAL_MSM_HS
tristate "MSM UART High Speed: Serial Driver"
depends on ARCH_MSM
select SERIAL_CORE
help
If you have a machine based on MSM family of SoCs, you
can enable its onboard high speed serial port by enabling
this option.
Choose M here to compile it as a module. The module will be
called msm_serial_hs.
config SERIAL_VT8500 config SERIAL_VT8500
bool "VIA VT8500 on-chip serial port support" bool "VIA VT8500 on-chip serial port support"
depends on ARM && ARCH_VT8500 depends on ARM && ARCH_VT8500
......
...@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o ...@@ -76,6 +76,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
obj-$(CONFIG_SERIAL_MSM) += msm_serial.o obj-$(CONFIG_SERIAL_MSM) += msm_serial.o
obj-$(CONFIG_SERIAL_MSM_HS) += msm_serial_hs.o
obj-$(CONFIG_SERIAL_NETX) += netx-serial.o obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
......
This diff is collapsed.
/*
* Copyright (C) 2008 Google, Inc.
* Author: Nick Pelly <npelly@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_SERIAL_HS_H
#define __ASM_ARCH_MSM_SERIAL_HS_H
#include <linux/serial_core.h>
/* API to request the uart clock off or on for low power management
* Clients should call request_clock_off() when no uart data is expected,
* and must call request_clock_on() before any further uart data can be
* received. */
extern void msm_hs_request_clock_off(struct uart_port *uport);
extern void msm_hs_request_clock_on(struct uart_port *uport);
/**
* struct msm_serial_hs_platform_data
* @rx_wakeup_irq: Rx activity irq
* @rx_to_inject: extra character to be inserted to Rx tty on wakeup
* @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character
* @exit_lpm_cb: function called before every Tx transaction
*
* This is an optional structure required for UART Rx GPIO IRQ based
* wakeup from low power state. UART wakeup can be triggered by RX activity
* (using a wakeup GPIO on the UART RX pin). This should only be used if
* there is not a wakeup GPIO on the UART CTS, and the first RX byte is
* known (eg., with the Bluetooth Texas Instruments HCILL protocol),
* since the first RX byte will always be lost. RTS will be asserted even
* while the UART is clocked off in this mode of operation.
*/
struct msm_serial_hs_platform_data {
int rx_wakeup_irq;
unsigned char inject_rx_on_wakeup;
char rx_to_inject;
void (*exit_lpm_cb)(struct uart_port *);
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment