summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/omap-serial.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-31serial: omap: fix missing commaPhilippe Proulx1-1/+1
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>, Signed-off-by: Philippe Proulx <philippe.proulx@savoirfairelinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29serial: omap: fix a few checkpatch warningsPhilippe Proulx1-9/+8
Signed-off-by: Philippe Proulx <philippe.proulx@savoirfairelinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29serial: omap: improve RS-485 performancePhilippe Proulx1-12/+38
If RS-485 is enabled, make the OMAP UART fire THR interrupts when both TX FIFO and TX shift register are empty instead of polling the equivalent status bit. This removes the burst of interrupt requests seen at every end of transmission. Also: the comment said that the TX FIFO trigger level was set at 16 characters when it's 32 in reality. Signed-off-by: Philippe Proulx <philippe.proulx@savoirfairelinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29serial: omap: Add support for optional wake-upTony Lindgren1-8/+46
With the recent pinctrl-single changes, omaps can treat wake-up events from deeper idle states as interrupts. There's a separate "io chain" controller on most omaps that stays enabled when the device hits off-idle and the regular interrupt controller is powered off. Let's add support for the optional second interrupt for wake-up events. And then serial-omap can manage the wake-up interrupt from it's runtime PM calls to avoid spurious interrupts during runtime. Note that the wake interrupt is board specific as it uses the UART RX pin, and for omap3, there are six pin options for UART3 RX pin. Also Note that the legacy platform based booting handles the wake-ups in the legacy mux driver and does not need to pass the wake-up interrupt to the driver. And finally, to pass the wake-up interrupt in the dts file, either interrupt-map or the pending interrupts-extended property needs to be passed. It's probably best to use interrupts-extended when it's available. Cc: Felipe Balbi <balbi@ti.com> Cc: Kevin Hilman <khilman@linaro.org> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16serial: omap: delete .set_wake callbackLinus Walleij1-10/+0
This callback is unused by the serial core since pre-git days and is not coming back. Delete it. Enabling wakeup on the OMAP serial driver is done through other runpaths these days. Cc: Tony Lindgren <tony@atomide.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26OMAP/serial: Fix Mode13 vs Mode16 priorityAlexey Pelykh1-1/+1
Make Mode16 more preferred than Mode13, to match TRM baudrates table. Signed-off-by: Alexey Pelykh <alexey.pelykh@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26OMAP/serial: Fix misnamed variableAlexey Pelykh1-4/+4
Fix misnamed variable to eliminate confusion. Signed-off-by: Alexey Pelykh <alexey.pelykh@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27Revert "OMAP: UART: Keep the TX fifo full when possible"Greg Kroah-Hartman1-2/+1
This reverts commit c4415084218c68c5ee2fc583431e89a78d896b19. Kevin writes: Hmm, another OMAP serial patch that wasn't Cc'd to linux-omap where OMAP users might have seen it. :( I just bisected a strange problem in linux-next on OMAP3 down to this patch. Reverting it fixes the problem. On OMAP3530 Beagle and Overo, after boot, doing a 'cat /proc/cpuinfo' was not returning to a prompt, suggesting something strange with the FIFO. Hitting return gets me back to a prompt. Greg, this one should also be dropped from tty-next until it can be further investgated and the problem solved. Reported-by: Kevin Hilman <khilman@linaro.org> Cc: Dmitry Fink <finik@ti.com> Cc: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27Revert "serial: omap: Fix IRQ handling return value"Greg Kroah-Hartman1-1/+3
This reverts commit 908fd7e566b4c12e36e4487d2d5946de5e5ea30f. Kevin writes: Greg, without a better justification in the changelog, I think this patch should be dropped from tty-next. Reported-by: Kevin Hilman <khilman@linaro.org> Cc: Ruchika Kharwar <ruchika@ti.com> Cc: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <mpfj@newflow.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <mpfj@newflow.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31serial: use dev_get_platdata()Jingoo Han1-3/+3
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26serial: omap: enable PM runtime only when its fully configuredGrygorii Strashko1-1/+2
If earlyprintk is enabled and current UART is console port the platform code can mark it as RPM_ACTIVE to sync real IP state with PM Runtime and avoid resuming of already active device, but now, driver initialization will be performed in the wrong way: pm_runtime_enable(&pdev->dev); <-- PM runtime alowed (device state RPM_ACTIVE) if (omap_up_info->autosuspend_timeout == 0) omap_up_info->autosuspend_timeout = -1; device_init_wakeup(up->dev, true); pm_runtime_use_autosuspend(&pdev->dev); <-- update_autosuspend() will be called and it will disable device (device state RPM_SUSPENDED) pm_runtime_set_autosuspend_delay(&pdev->dev, omap_up_info->autosuspend_timeout); <-- update_autosuspend() will be called which will re-enable device (device state RPM_ACTIVE), because autosuspend_timeout < 0 pm_runtime_irq_safe(&pdev->dev); pm_runtime_get_sync(&pdev->dev); <-- will do nothing Such behavior isn't expected by OMAP serial drivers and causes unpredictable calls of serial_omap_runtime_suspend() and serial_omap_runtime_resume(). Hence, fix it by allowing PM runtime only after all its parameters are configured. CC: Tony Lindgren <tony@atomide.com> CC: Rajendra Nayak <rnayak@ti.com> CC: Felipe Balbi <balbi@ti.com> CC: Kevin Hilman <khilman@linaro.org> Tested-by: Mark Jackson <mpfj-list@newflow.co.uk> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26serial: omap: Fix IRQ handling return valueRuchika Kharwar1-3/+1
Ensure the Interrupt handling routine return IRQ_HANDLED vs IRQ_NONE. Signed-off-by: Ruchika Kharwar <ruchika@ti.com> Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26serial: omap: Initialize platform_dataVikram Pandita1-1/+3
Otherwise serial driver would crash accessing platform_data that was not initialized in functions like: serial_omap_pm(...) ... if (!state && pdata->enable_wakeup) ^^^^^^^ ... Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26OMAP: UART: Fix the revision register read.Ruchika Kharwar1-1/+1
The revision register is a 32 bit register. The serial_in() function reads only the lower 16 bits of the register. This leads to an incorrect computation of the Module revision. Signed-off-by: Ruchika Kharwar <ruchika@ti.com> [oleksandr.savchenko@ti.com: add some whitespaces] Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26OMAP: UART: Keep the TX fifo full when possibleDmitry Fink1-1/+2
Current logic results in interrupt storm since the fifo is constantly below the threshold level. Change the logic to fill all the available spaces in the fifo as long as we have data to minimize the possibilty of underflow and elimiate excessive interrupts. Signed-off-by: Dmitry Fink <finik@ti.com> Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26OMAP2+: UART: enable tx wakeup bit for wer regGovindraj.R1-1/+15
wer has TX wakeup bit available enable the same by populating the necessary tx wakeup flag for the applicable module ip blocks and use the same while configuaring wer reg. Also wer is not context restored, restore wer when context is lost. Cc: Paul Walmsley <paul@pwsan.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Kevin Hilman <kevin.hilman@linaro.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (for drivers/tty changes) Signed-off-by: Govindraj.R <govindraj.raja@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24drivers/tty/serial: don't use devm_pinctrl_get_select_default() in probeWolfram Sang1-9/+0
Since commit ab78029 (drivers/pinctrl: grab default handles from device core), we can rely on device core for setting the default pins. Compile tested only. Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17serial: omap: Fix device tree based PM runtimeTony Lindgren1-6/+5
In the runtime_suspend function pdata is not being used, and also blocks the function in device tree based booting. Fix it by removing the unused pdata from the runtime_suspend function. Further, context loss count is not being passed in pdata, so let's just reinitialize the port every time for those case. This can be further optimized later on for the device tree case by adding detection for the hardware state and possibly by adding a driver specific autosuspend timeout. And doing this, we can then make the related dev_err into a dev_dbg message instead of an error. In order for the wake-up events to work, we also need to set autosuspend_timeout to -1 if 0, and also device_init_wakeup() as that's not being done by the platform init code for the device tree case. Note that this does not affect legacy booting, and in fact might make it work for the cases where the context loss info is not being passed in pdata. Thanks to Kevin Hilman <khilman@linaro.org> for debugging and suggesting fixes for the autosuspend_timeout and device_init_wakeup() related initializiation. Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06serial: omap: fix potential NULL pointer dereference in ↵Wei Yongjun1-3/+3
serial_omap_runtime_suspend() The dereference to 'up' should be moved below the NULL test. Introduced by commit ddd85e225c8885b5e4419b0499ab27100e7c366a (serial: omap: prevent runtime PM for "no_console_suspend") Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03serial: omap: repair building without PM_SLEEPArnd Bergmann1-1/+1
A recent bug fix in 3.10, ddd85e225c "serial: omap: prevent runtime PM for "no_console_suspend"", introduced a regression from an obvious typo: drivers/tty/serial/omap-serial.c:1677:14: error: 'serial_omap_complete' undeclared here (not in a function) This changes the incorrectly added macro to the one that we need instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Bin Liu <b-liu@ti.com> Acked-by: Sourav Poddar<sourav.poddar@ti.com> Tested-by: Sourav Poddar<sourav.poddar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-27Merge 3.10-rc3 into tty-nextGreg Kroah-Hartman1-23/+0
We want these fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-20serial: omap: prevent runtime PM for "no_console_suspend"Sourav Poddar1-1/+33
The driver manages "no_console_suspend" by preventing runtime PM during the suspend path, which forces the console UART to stay awake. Reviewed-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-19SERIAL: OMAP: Remove the slave idle handling from the driverSantosh Shilimkar1-23/+0
UART IP slave idle handling now taken care by runtime pm backend(hwmod layer) so remove the hackery from the driver. As discussed on the list, in future if dma mode needs to be brought back to this driver, UART sysc handling needs to be updated in framework such a way that no-idle/force idle profile can be supported. Given the broken dma mode for OMAP uarts, its very unlikely. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Vaibhav Bedia <vaibhav.bedia@ti.com> Tested-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Rajendra nayak <rnayak@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Kevin Hilman <khilman@linaro.org> Tested-by: Kevin Hilman <khilman@linaro.org> # OMAP4/Panda Signed-off-by: Paul Walmsley <paul@pwsan.com>
2013-04-03OMAP/serial: Revert bad fix of Rx FIFO threshold granularityAlexey Pelykh1-0/+11
Partially reverts 1776fd059c40907297d6c26c51876575d63fd9e2 that introduced regression reported by Paul Walmsley. This commit restores setting granularity in SCR register and adds note about comments below being inconsistent with actual code. Signed-off-by: Alexey Pelykh <alexey.pelykh@gmail.com> Tested-by: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@linaro.org> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05OMAP/serial: Fix incorrect Rx FIFO threshold setting, LSR validation on Tx, ↵Alexey Pelykh1-6/+2
and Tx FIFO IRQ generation Original configuration of Rx FIFO threshold contained an error that resulted Rx threshold to be effectively set to 1 character instead of 16 characters, as noted in comments. Checking LSR to contain UART_LSR_THRE bit set caused issue when not all UART_IER_THRI interrupts have been properly handled. This caused gap in Tx data, visible on high baud rates using oscilloscope. Setting OMAP_UART_SCR_TX_EMPTY bit in SCR caused UART_IER_THRI interrupt to be raised only when Tx FIFO and Tx shift registers are empty. Signed-off-by: Alexey Pelykh <alexey.pelykh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17OMAP/serial: Support 1Mbaud and similar baudrates that require Mode16 ↵Alexey Pelykh1-10/+28
instead of Mode13 Original table in OMAP TRM named "UART Mode Baud Rates, Divisor Values, and Error Rates" determines modes not for all common baud rates. E.g. for 1000000 baud rate mode should be 16x, but according to that table it's determined as 13x. According to current implementation of mode divisor selection, after requesting 1000000 baudrate from driver, later one will configure chip to use MODE13 divisor. Assuming 48Mhz as common UART clock speed, MODE13 divisor will effectively give 1230769 baudrate, what is quite far from desired 1000000 baudrate. While with MODE16 divisor, chip will produce exact 1000000 baudrate. In old driver that served UART devices (8250.c and serial_core.c) this divisor could have been configured by user-space program, but in omap_serial.c driver implementation this ability was not implemented (afaik, by design) thus disallowing proper usage of MODE16-compatible baudrates. Signed-off-by: Alexey Pelykh <alexey.pelykh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-15TTY: switch tty_flip_buffer_pushJiri Slaby1-2/+1
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. Now, the one where most of tty_port_tty_get gets removed: tty_flip_buffer_push. IOW we also closed all the races in drivers not using tty_port_tty_get at all yet. Also we move tty_flip_buffer_push declaration from include/linux/tty.h to include/linux/tty_flip.h to all others while we are changing it anyway. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-15serial: omap: add the functionality of a 9-bit UART with userspaces CMSPAREnric Balletbo i Serra1-0/+2
Some systems require the additional communication functionality of a 9-bit UART. For that we could use the "stick" (mark/space) parity bit supported on omap serial device. When is set, if PARODD is set the parity bit is always 1; if PARODD is not set, then the parity bit is always 0. Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-14ARM: OMAP: Move plat/omap-serial.h to include/linux/platform_data/serial-omap.hTony Lindgren1-2/+1
We need to move this file to allow ARM multiplatform configurations to build for omap2+. This can now be done as this file now only contains platform_data. cc: Russell King <linux@arm.linux.org.uk> cc: Alan Cox <alan@linux.intel.com> cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: Govindraj.R <govindraj.raja@ti.com> cc: Kevin Hilman <khilman@ti.com> cc: linux-serial@vger.kernel.org Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-12-12Merge branch 'omap-serial' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds1-81/+150
Pull ARM OMAP serial updates from Russell King: "This series is a major reworking of the OMAP serial driver code fixing various bugs in the hardware-assisted flow control, extending up into serial_core for a couple of issues. These fixes have been done as a set of progressive changes and transformations in the hope that no new bugs will be introduced by this series. The problems are many-fold, from the driver not being informed about updated settings, to the driver not knowing what the intentions of the upper layers are. The first four patches tackle the serial_core layer, allowing it to provide the necessary information to drivers, and the remaining patches allow the OMAP serial driver to take advantage of this. This brings hardware assisted RTS/CTS and XON/OFF flow control into a useful state. These patches have been in linux-next for most of the last cycle; indeed they predate the previous merge window. They've also been posted to the OMAP people." * 'omap-serial' of git://git.linaro.org/people/rmk/linux-arm: (21 commits) SERIAL: omap: fix hardware assisted flow control SERIAL: omap: simplify (2) SERIAL: omap: move xon/xoff setting earlier SERIAL: omap: always set TCR SERIAL: omap: simplify SERIAL: omap: don't read back LCR/MCR/EFR SERIAL: omap: serial_omap_configure_xonxoff() contents into set_termios SERIAL: omap: configure xon/xoff before setting modem control lines SERIAL: omap: remove OMAP_UART_SYSC_RESET and OMAP_UART_FIFO_CLR SERIAL: omap: move driver private definitions and structures to driver SERIAL: omap: remove 'irq_pending' bitfield SERIAL: omap: fix MCR TCRTLR bit handling SERIAL: omap: fix set_mctrl() breakage SERIAL: omap: no need to re-read EFR SERIAL: omap: remove setting of EFR SCD bit SERIAL: omap: allow hardware assisted IXANY mode to be disabled SERIAL: omap: allow hardware assisted rts/cts modes to be disabled SERIAL: core: add throttle/unthrottle callbacks for hardware assisted flow control SERIAL: core: add hardware assisted h/w flow control support SERIAL: core: add hardware assisted s/w flow control support ... Conflicts: drivers/tty/serial/omap-serial.c
2012-11-21tty: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Acked-by: Tobias Klauser <tklauser@distanz.ch> Cc: Lucas Tavares <lucaskt@linux.vnet.ibm.com> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Tony Prisk <linux@prisktech.co.nz> Acked-by: David Brown <davidb@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21tty: remove use of __devinitBill Pemberton1-3/+3
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Lucas Tavares <lucaskt@linux.vnet.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Tony Prisk <linux@prisktech.co.nz> Acked-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21tty: serial: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Alan Cox <alan@linux.intel.com> Cc: Lucas Tavares <lucaskt@linux.vnet.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Tony Prisk <linux@prisktech.co.nz> Acked-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-04SERIAL: omap: fix hardware assisted flow controlRussell King1-8/+39
When the UART device has hardware flow control enabled, it ignores the MCR RTS bit in the MCR register, and keeps RTS asserted as long as we continue to read characters from the UART receiver FIFO. This means that when the TTY buffers become full, the UART doesn't tell the remote end to stop sending, which causes the TTY layer to start dropping characters. A similar problem exists with software flow control. We need the FIFO register to fill when software flow control is enabled to provoke the UART to send the XOFF character. Fix this by implementing the throttle/unthrottle callbacks, and use these to disable receiver interrupts. This in turn means that the UART FIFO will fill, which will then cause the UART's hardware to deassert the RTS signal and/or send the XOFF character, stopping the remote end. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: simplify (2)Russell King1-9/+0
Simplify: - set ECB ... - LCR mode A - clear TCRTLR - LCR mode B - clear ECB - set ECB and update other bits - LCR mode A - update XONANY to: - set ECB ... - LCR mode B - set ECB and update other bits - LCR mode A - update XONANY and clear TCRTLR Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: move xon/xoff setting earlierRussell King1-6/+7
Take advantage of the switch to mode B for accessing the TCR register, and move the xon/xoff configuration there. This allows further simplication of this sequence. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: always set TCRRussell King1-17/+11
We always setup the TCR register in the software flow control path, and when hardware flow control is enabled. Remove this redundant setup, and place it before we setup any hardware flow control. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: simplifyRussell King1-11/+4
We have the sequence: - LCR mode B - write EFR with ECB clear - LCR mode normal - if s/w flow - LCR mode B - write EFR with ECB clear ... - LCR mode B - write EFR with ECB clear - LCR mode normal This can be simplified to: - if s/w flow - LCR mode B - write EFR with ECB clear ... - LCR mode B - write EFR with ECB clear - LCR mode normal Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: don't read back LCR/MCR/EFRRussell King1-7/+6
There's really no reason to read back these registers while setting the termios modes, provided we keep our cached copies up to date. Remove these readbacks. This has the benefit that we know that the EFR_ECB and MCR_TCRTLR bits will always be clear, so we don't need to keep masking these bits throughout the code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: serial_omap_configure_xonxoff() contents into set_termiosRussell King1-59/+53
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: configure xon/xoff before setting modem control linesRussell King1-1/+2
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: move driver private definitions and structures to driverRussell King1-0/+52
struct uart_omap_port and struct uart_omap_dma, and associated definitions are private to the driver, so there's no point them sitting in an include file under arch/arm. Move them into the driver itself. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: remove 'irq_pending' bitfieldRussell King1-1/+0
irq_pending is never used, so let's remove it. It seems to be result of a bad rebase of d37c6cebcb0c (serial: omap: move uart_omap_port definition to C file) Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: fix MCR TCRTLR bit handlingRussell King1-16/+21
The MCR TCRTLR bit can only be changed when ECB is set in the EFR. Unfortunately, several places were trying to alter this bit while ECB was clear: - serial_omap_configure_xonxoff() was attempting to clear the bit after explicitly clearing the ECB bit. - serial_omap_set_termios() was trying the same trick after setting the SCR, and when trying to change the TCR register when hardware flow control was enabled. Fix this by ensuring that we always have ECB set whenever the TCRTLR bit is changed. Moreover, we start out by reading the EFR and MCR registers, which may have indeterminent bit settings for the ECB and TCRTLR bits. Ensure that these bits always start off in a known state. In order to avoid any undesired behaviour appearing through fixing this, we also ensure that hardware assisted flow control is disabled while new driver specific parts are not in place. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: fix set_mctrl() breakageRussell King1-3/+5
c538d20c7f (and maybe previous commits) broke set_mctrl() by making it only capable of setting bits in the MCR register. This prevents software controlled flow control and modem control line manipulation via TIOCMSET/TIOCMBIC from working correctly. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: no need to re-read EFRRussell King1-2/+0
There's no need to re-read EFR after we've recently written it; the register is a configuration register which doesn't change its value without us writing to it. The last value which was written to this register was up->efr. Removing this re-reading avoids the possibility that we end up with up->efr having unintended bits set, which should only be temporarily set when accessing the enhanced features. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: remove setting of EFR SCD bitRussell King1-6/+2
The SCD (special character detect) bit enables comparisons with XOFF2, which we do not program. As the XOFF2 character remains unprogrammed, there's little point enabling this feature along with its associated interrupt. Remove this, and ensure that the SCD bit is cleared. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04SERIAL: omap: allow hardware assisted IXANY mode to be disabledRussell King1-0/+2
Nothing was clearing the UART_MCR_XONANY bit, so once the ixany mode gets set, there's no possibility to disable it. Clear this bit when IXANY mode is cleared. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>