aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial
AgeCommit message (Collapse)AuthorFilesLines
2013-08-19serial: sirf: add DMA support using dmaengine APIsQipan Li2-56/+615
if we get the valid dma channels from dts, move to use dmaengine to do rx/tx. because the dma hardware requires dma address and length to be 4bytes aligned, in this driver, we will still use PIO for non-aligned bytes, and use dma for aligned bytes. for rx, to keep the dmaengine always active, we use double-buffer, so we issue two dma_desc at first, and maintain the status of both 1. dma transfer done: update in rx dma finish callback 2. dma buffer is inserted into tty: update in rx dma finish tasklet and rx timeout tasklet so we re-issue the dma_desc only if both 1&2 are finished. for tx, as we know the actual length for every transfer, we don't need the above double buffering. Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-19serial: sirf: fix the namespace of startup_uart entryQipan Li1-29/+23
startup_uart_controller() loses namespace, this patch drops the function directly and move the content into sirfsoc_uart_startup(). Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-19serial: sirf: fix the typo for rts/cts gpioQipan Li1-5/+5
fix the typo in commit 2eb5618de87927e54 which uses two gpios for rts/cts. Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-19serial: st-asc: replace devm_request_and_ioremap by devm_ioremap_resourceJulia Lawall1-12/+6
Use devm_ioremap_resource instead of devm_request_and_ioremap. This was done using the semantic patch scripts/coccinelle/api/devm_ioremap_resource.cocci and various manual modifications to move associated calls to platform_get_resource closer to the resulting call to devm_ioremap_resource and to remove the associated error handling code. The initialization of port->mapbase is also moved lower, to take advantage of the NULL test on res performed by devm_ioremap_resource. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-19serial: 8250_dw: Report CTS asserted for auto flowTim Kryger1-8/+26
When a serial port is configured for RTS/CTS flow control, serial core will disable the transmitter if it observes CTS is de-asserted. This is perfectly reasonable and appropriate when the UART lacks the ability to automatically perform CTS flow control. However, if the UART hardware can manage flow control automatically, it is important that software not get involved. When the DesignWare UART enables 16C750 style auto-RTS/CTS it stops generating interrupts for changes in CTS state so software mostly stays out of the way. However, it does report the true state of CTS in the MSR so software may notice it is de-asserted and respond by improperly disabling the transmitter. Once this happens the transmitter will be blocked forever. To avoid this situation, we simply lie to the 8250 and serial core by reporting that CTS is asserted whenever auto-RTS/CTS mode is enabled. Signed-off-by: Tim Kryger <[email protected]> Reviewed-by: Matt Porter <[email protected]> Reviewed-by: Markus Mayer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-15OMAP: serial: Remove incorrect disabling of IER interruptMark Jackson1-3/+0
The recent patch to add RS485 contained a bug whereby the IER interrupt was cleared down incorrectly. This patch fixes the problem. Signed-off-by: Mark Jackson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-14serial: pch_uart: fix compilation warningLuis Henriques1-0/+2
Function wait_for_xmitr is invoked only on functions that either depend on CONFIG_CONSOLE_POLL or CONFIG_SERIAL_PCH_UART_CONSOLE. This patch fixes the following warning: drivers/tty/serial/pch_uart.c:1504:13: warning: ‘wait_for_xmitr’ defined but not used [-Wunused-function] Signed-off-by: Luis Henriques <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-14serial: sirf: fix the hardware-flow-ctrl for USP-based UARTQipan Li2-45/+122
for USP-based UART, we use two gpios as RTS and CST pins. Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-14serial: sirf: drop redundant pinctrl_get_select_default as pinctrl core does itBarry Song2-16/+1
pinctrl core will get default pinmux, so drop it in the sirfsoc serial driver. Cc: Linus Walleij <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-14OMAP: add RS485 supportMark Jackson1-0/+179
This patch adds RS485 support to the OMAP serial driver, as defined in:- Documentation/devicetree/bindings/serial/rs485.txt When a UART transmitter is connected to (eg) a RS485 driver, it is necessary to turn the driver on/off as quickly as possible. This is best achieved in the serial driver itself (rather than in userspace where the latency can be quite large). This patch allows a GPIO pin to be defined (via DT) that controls the enabling of the driver at the start of a message, and disables the driver when the message has been completed. When RS485 is disabled, the RTS pin is set to on. Signed-off-by: Mark Jackson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-14tty: ar933x_uart: simplify use of devm_ioremap_resourceJulia Lawall1-6/+1
Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. Move the call to platform_get_resource adjacent to the call to devm_ioremap_resource to make the connection between them more clear. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: amba-pl011: Use __releases/__acquires annotationsFabio Estevam1-0/+4
Fix the following sparse warnings: drivers/tty/serial/amba-pl011.c:687:20: warning: context imbalance in 'pl011_dma_flush_buffer' - unexpected unlock drivers/tty/serial/amba-pl011.c:1200:13: warning: context imbalance in 'pl011_rx_chars' - unexpected unlock Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: MIPS: lantiq: fix clock error checkJohn Crispin1-2/+2
The clock should be checked with the proper IS_ERR() api before using it. Signed-off-by: John Crispin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: MIPS: lantiq: add clk_enable() call to driverThomas Langer1-0/+3
Enable the clock if one is present when setting up the console. Signed-off-by: Thomas Langer <[email protected]> Acked-by: John Crispin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: bfin_uart: Fix incorrect placement of __initdataSachin Kamat1-3/+3
__initdata should be placed between the variable name and equal sign for the variable to be placed in the intended section. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: bfin_sport_uart: Fix incorrect placement of __initdataSachin Kamat1-1/+1
__initdata should be placed between the variable name and equal sign for the variable to be placed in the intended section. Signed-off-by: Sachin Kamat <[email protected]> Acked-by: Sonic Zhang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: tegra: use NULL instead of 0Jingoo Han1-3/+3
'cons' is a pointer; thus NULL should be used instead of 0. Also, local symbols are staticized. Fix the following sparse warnings: drivers/tty/serial/serial-tegra.c:1209:27: warning: Using plain integer as NULL pointer drivers/tty/serial/serial-tegra.c:1240:29: warning: symbol 'tegra20_uart_chip_data' was not declared. Should it be static? drivers/tty/serial/serial-tegra.c:1246:29: warning: symbol 'tegra30_uart_chip_data' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: msm_serial: fix comparison of different typesJingoo Han1-1/+2
Fix the following sparse warning: drivers/tty/serial/msm_serial.c:237:37: error: incompatible types in comparison expression (different type sizes) Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: ioc4_serial: Staticize ioc4_serial_attach_one()Jingoo Han1-2/+2
ioc4_serial_attach_one() is used only in this file. Also, ioc4_serial is not used; it can be removed. Fix the following sparse warnings: drivers/tty/serial/ioc4_serial.c:300:3: warning: symbol 'ioc4_serial' was not declared. Should it be static? drivers/tty/serial/ioc4_serial.c:2771:1: warning: symbol 'ioc4_serial_attach_one' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Acked-by: Patrick Gefre <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: icom: fix casting warningJingoo Han1-6/+5
icom_port->uart_port.membase is (unsigned char __iomem *); thus, casting (unsigned char __iomem *) is necessary to fix the following warning. Also, local symbols are staticized. drivers/tty/serial/icom.c:108:26: warning: symbol 'start_proc' was not declared. Should it be static? drivers/tty/serial/icom.c:116:26: warning: symbol 'stop_proc' was not declared. Should it be static? drivers/tty/serial/icom.c:123:25: warning: symbol 'int_mask_tbl' was not declared. Should it be static? drivers/tty/serial/icom.c:1569:54: warning: incorrect type in assignment (different address spaces) drivers/tty/serial/icom.c:1569:54: expected unsigned char [noderef] <asn:2>*membase drivers/tty/serial/icom.c:1569:54: got char *<noident> drivers/tty/serial/icom.c:1090:9: warning: cast truncates bits from constant value (ffffff7f becomes 7f) Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: timbuart: Staticize local symbolsJingoo Han1-2/+2
These local symbols are used only in this file. Fix the following sparse warnings: drivers/tty/serial/timbuart.c:165:6: warning: symbol 'timbuart_handle_rx_port' was not declared. Should it be static? drivers/tty/serial/timbuart.c:187:6: warning: symbol 'timbuart_tasklet' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: mrst_max3110: fix casting warningJingoo Han1-2/+2
max->port.membase is (unsigned char __iomem *); thus, casting (unsigned char __iomem *) is necessary to fix the following warning. Also, serial_m3110_ops() is staticized. drivers/tty/serial/mrst_max3110.c:716:17: warning: symbol 'serial_m3110_ops' was not declared. Should it be static? drivers/tty/serial/mrst_max3110.c:847:27: warning: incorrect type in assignment (different address spaces) drivers/tty/serial/mrst_max3110.c:847:27: expected unsigned char [noderef] <asn:2>*membase drivers/tty/serial/mrst_max3110.c:847:27: got void *<noident> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: 8250_early: fix comparison of different typesJingoo Han1-1/+1
Fix the following sparse warning: drivers/tty/serial/8250/8250_early.c:196:26: error: incompatible types in comparison expression (different type sizes) Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: samsung: fix casting warningJingoo Han1-1/+2
port->membase is (unsigned char __iomem *), not (unsigned long *) __set_bit() uses (unsigned long *) as the second argument. Thus, casting (unsigned long *)(unsigned long) is necessary to fix the following sparse warnings. drivers/tty/serial/samsung.c:142:33: warning: cast removes address space of expression drivers/tty/serial/samsung.c:161:33: warning: cast removes address space of expression drivers/tty/serial/samsung.c:176:33: warning: cast removes address space of expression drivers/tty/serial/samsung.c:526:40: warning: cast removes address space of expression Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: sirf: Staticize local symbolsJingoo Han1-2/+2
These local symbols are used only in this file. Fix the following sparse warnings: drivers/tty/serial/sirfsoc_uart.c:147:6: warning: symbol 'sirfsoc_uart_start_tx' was not declared. Should it be static? drivers/tty/serial/sirfsoc_uart.c:636:5: warning: symbol 'sirfsoc_uart_probe' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Acked-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: sirf: make the driver also support USP-based UARTQipan Li2-298/+655
Universal Serial Ports (USP) can be used as PCM, UART, SPI, I2S etc. this makes the USP work as UART. the basic work flow is same with UART controller, the main difference will be offset of registers and bits. this patch makes the old sirfsoc uart driver support both sirf UART and USP-based UART by making their differences become private data. Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: sirf: add support for Marco chipBarry Song2-14/+65
the marco and coming new CSR multiple SoCs have SET/CLR pair for INTEN registers to avoid some read-modify-write. this patch adds support for this and make the driver support current up and coming mp SoCs. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: i.MX: evaluate linux,stdout-path propertySascha Hauer1-0/+3
devicetrees may have the linux,stdout-path property to specify the console. This patch adds support to the i.MX serial driver for this. Signed-off-by: Sascha Hauer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12tty: ar933x_uart: convert to use devm_* functionsGabor Juhos1-18/+8
Use devm_* functions in order to simplify cleanup paths. Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12serial: pxa: Staticize local symbolsJingoo Han1-3/+3
These local symbols are used only in this file. Fix the following sparse warnings: drivers/tty/serial/pxa.c:793:17: warning: symbol 'serial_pxa_pops' was not declared. Should it be static? drivers/tty/serial/pxa.c:971:12: warning: symbol 'serial_pxa_init' was not declared. Should it be static? drivers/tty/serial/pxa.c:986:13: warning: symbol 'serial_pxa_exit' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12tty: serial: pxa: remove old cruftDaniel Mack1-25/+0
This #if-0'd block wouldn't compile, so let's dispose it. Signed-off-by: Daniel Mack <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-05serial: mxs: remove the MXS_AUART_DMA_CONFIGHuang Shijie1-4/+1
The MXS_AUART_DMA_CONFIG is originally used to check if the DT node is configured with the DMA property. But now, the MXS_AUART_DMA_CONFIG is set unconditionally in the serial_mxs_probe_dt(), so the check in the mxs_auart_settermios() is not necessary anymore. This patch removes this macro. Signed-off-by: Huang Shijie <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-05serial: mxs: enable the DMA only when the RTS/CTS is validHuang Shijie1-1/+6
The original DMA support works only when RTS/CTS is enabled. (see the "e800163 serial: mxs-auart: add the DMA support for mx28") But after several patches, DMA support has lost this limit. (see the "bcc20f9 serial: mxs-auart: move to use generic DMA helper") So an UART without the RTS/CTS lines may also enables the DMA support, in which case the UART may gets unpredictable results. This patch adds an optional property for the UART DT node which indicates the UART has RTS and CTS lines, and it also means you enable the DMA support for this UART. This patch also adds a macro MXS_AUART_RTSCTS, and uses it to check RTS/CTS before we enable the DMA for the UART. Signed-off-by: Huang Shijie <[email protected]> Signed-off-by: Huang Shijie <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-05Merge 3.11-rc4 into tty-nextGreg Kroah-Hartman3-19/+24
We want the tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-03serial: st-asc: Fix unused variable warning for non DT.Srinivas Kandagatla1-0/+2
This patch fixes a below warning reported by kbuild test robot. drivers/tty/serial/st-asc.c:727:28: warning: 'asc_match' defined but not used [-Wunused-variable] The code used in DT case is now ifdefed under CONFIG_OF to fix this warning. Signed-off-by: Srinivas Kandagatla <[email protected]> Reported-by: Kbuild Test Robot <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02Revert "serial: sccnxp: Add DT support"Greg Kroah-Hartman1-37/+9
This reverts commit 85c996907473e4ef824774b97b26499adf66521f. Alexander wishes to remove this patch as it is incorrect. Reported-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02serial: sh-sci: use dev_get_platdata()Jingoo Han1-1/+1
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02serial/arc-uart: Remove the goto/labelVineet Gupta1-5/+2
Signed-off-by: Vineet Gupta <[email protected]> Cc: Mischa Jonker <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02serial/arc-uart: Handle Rx Error Interrupts w/o any dataVineet Gupta1-10/+16
Currently, Rx error handling only triggers if there is some Rx data. Fix that by checking for error - before the data handling. Reported-by: Mischa Jonker <[email protected]> Tested-by: Mischa Jonker <[email protected]> Signed-off-by: Vineet Gupta <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Add DT supportAlexander Shiyan1-9/+37
Add DT support to the SCCNCP serial driver. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Using structure for each supported IC instead of switch in probeAlexander Shiyan1-148/+124
This patch replaces switch in probe function to constant structure for each supported IC. This makes code a bit smaller and cleaner and helps adding DT support to the driver in the future. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Using CLK API for getting UART clockAlexander Shiyan1-14/+22
This patch removes "frequency" parameter from SCCNXP platform_data and uses CLK API for getting clock. If CLK ommited, default IC frequency will be used instead. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Disable regulator on errorAlexander Shiyan1-22/+18
The patch disables the regulator in case of errors, if we have it. In addition, the patch adds support for deferred regulator probe and makes error path are a bit clean. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial/efm32-uart: don't slur over failure in probe_dtUwe Kleine-König1-1/+3
Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial/efm32-uart: don't use pdev->id to determine the port's lineUwe Kleine-König1-7/+10
pdev->id is not a valid choice for device-tree probed devices. So use the (properly determined) line from efm32_uart_probe consistenly Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: use dev_get_platdata()Jingoo Han22-46/+50
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31parisc: Fix interrupt routing for C8000 serial portsThomas Bogendoerfer1-2/+1
We can't use dev->mod_index for selecting the interrupt routing entry, because it's not an index into interrupt routing table. It will be even wrong on a machine with 2 CPUs (4 cores). But all needed information is contained in the PAT entries for the serial ports. mod[0] contains the iosapic address and mod_info has some indications for the interrupt input (at least it looks like it). This patch implements the searching for the right iosapic and uses this interrupt input information. Signed-off-by: Thomas Bogendoerfer <[email protected]> Cc: <[email protected]> # 3.10 Signed-off-by: Helge Deller <[email protected]>
2013-07-29serial: pch_uart: Fix signed-ness and casting of uartclk related fieldsDarren Hart1-7/+6
Storing one struct per known board would be overkill. Pre-cast the driver_data pointer to an unsigned long to avoid the pointer to int compiler warning: drivers/tty/serial/pch_uart.c:431:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Unify the signed-ness of the baud and uartclk types throughout the driver. Signed-off-by: Darren Hart <[email protected]> Reported-by: kbuild test robot <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-29serial: at91: make UART support dma and pdc transfersElen Song1-6/+42
Because the UART lack of receive timeout register, so we use a timer to trigger data receive. The DBGU is regarded as UART. Signed-off-by: Elen Song <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-29serial: at91: distinguish usart and uartElen Song1-0/+37
Distinguish usart and uart by read ip name register, The usart read name is "USAR", The uart and dbgu read name is "DBGU". Signed-off-by: Elen Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>