summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/stm32-usart.c
AgeCommit message (Collapse)Author
2016-09-27serial: stm32: mark symbols static where possibleBaoyou Xie
We get 2 warnings when building kernel with W=1: drivers/tty/serial/stm32-usart.c:63:5: warning: no previous prototype for 'stm32_pending_rx' [-Wmissing-prototypes] drivers/tty/serial/stm32-usart.c:88:15: warning: no previous prototype for 'stm32_get_char' [-Wmissing-prototypes] In fact, these two functions are only used in the file in which they are declared and don't need a declaration, but can be made static. So this patch marks these functions with 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27serial: stm32: use mapbase instead of membase for DMAArnd Bergmann
Building this driver with a 64-bit dma_addr_t type results in a compiler warning: drivers/tty/serial/stm32-usart.c: In function 'stm32_of_dma_rx_probe': drivers/tty/serial/stm32-usart.c:746:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] drivers/tty/serial/stm32-usart.c: In function 'stm32_of_dma_tx_probe': drivers/tty/serial/stm32-usart.c:818:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] While the type conversion here is harmless, this hints at a different problem: we pass an __iomem pointer into a DMA engine, which expects a phys_addr_t. This happens to work because stm32 has no MMU and ioremap() is an identity mapping here, but it's still an incorrect API use. Using dma_addr_t is doubly wrong here, because that would be the result of dma_map_single() rather than the physical address. Using the mapbase instead fixes multiple issues: - the warning is gone - we don't go through ioremap in error - the cast is gone, making it use the correct resource_size_t/phys_addr_t type in the process. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: fix uart enable managementAlexandre TORGUE
Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: fix spin_lock managementAlexandre TORGUE
Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: adding dma supportAlexandre TORGUE
This patch adds dma mode support for rx and tx with pio mode as fallback in case of dma error. Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: clock disabling managementAlexandre TORGUE
Keep the clock enabled at the end of stm32_init_port but disable it in stm32_serial_remove. Note that stm32_pm function is there to manage the clock at runtime. Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: correct flow control property spellingAlexandre TORGUE
"st,hw-flow-ctrl" property is documented in device tree binding whereas "auto-flow-control" was used in the code. The driver is now aligned with the binding name "st,hw-flow-ctrl". Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: disable tx and rx during shutdownAlexandre TORGUE
Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: header file creationAlexandre TORGUE
Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22serial: stm32: adding support for stm32f7Alexandre TORGUE
Register offset management rework to support both stm32f4 (default) and stm32f7. Driver rework to ensure same functional level on both stm32f4 and stm32f7: no new feature in this version yet. Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04tty/serial: st-asc: drop the use of IRQF_NO_SUSPENDSudeep Holla
These drivers doesn't claim the serial device to be wakeup source. Even if it is, it needs to use enable_irq_wake or other related PM wakeup APIs to enable it. This patch removes yet another misuse of IRQF_NO_SUSPEND. Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com> Cc: Maxime Coquelin <maxime.coquelin@st.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@stlinux.com Cc: linux-serial@vger.kernel.org Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-23serial: stm32-usart: Fix SysRq supportMaxime Coquelin
SysRq support activation depends on CONFIG_SERIAL_STM32_USART_CONSOLE, but this config flag does not exists. This patch fix this by depending on the valid config flag, which is SERIAL_STM32_CONSOLE. Reported-by: Andreas Ruprecht <andreas.ruprecht@fau.de> Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-10serial: stm32-usart: Add STM32 USART DriverMaxime Coquelin
This drivers adds support to the STM32 USART controller, which is a standard serial driver. Tested-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>