summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/omap-serial.c
Commit message (Collapse)AuthorAgeFilesLines
* tty: serial: omap: fix Sparse warningsFelipe Balbi2014-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix the following Sparse warnings: drivers/tty/serial/omap-serial.c:1418:49: warning: incorrect \ type in argument 2 (different address spaces) drivers/tty/serial/omap-serial.c:1418:49: expected void const \ [noderef] <asn:1>*from drivers/tty/serial/omap-serial.c:1418:49: got struct serial_rs485 \ *<noident> drivers/tty/serial/omap-serial.c:1426:35: warning: incorrect \ type in argument 1 (different address spaces) drivers/tty/serial/omap-serial.c:1426:35: expected void [noderef] \ <asn:1>*to drivers/tty/serial/omap-serial.c:1426:35: got struct serial_rs485 \ *<noident> Reported-by: Nishanth Menon <nm@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: remove unneeded singlethread workqueueFelipe Balbi2014-04-241-3/+0
| | | | | | | it wasn't used by anything, just remove it. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: remove some dead codeFelipe Balbi2014-04-241-39/+0
| | | | | | | | nobody passes a DTR_gpio to this driver, so this code is not necessary. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: switch over to devm_ioremap_resourceFelipe Balbi2014-04-241-23/+9
| | | | | | | | | | just using helper function to remove some duplicated code a bit. While at that, also move allocation of struct uart_omap_port higher in the code so that we return much earlier in case of no memory. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: switch over to platform_get_resourceFelipe Balbi2014-04-241-7/+3
| | | | | | | this way we can remove one pointer declaration. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: cleanup variable declarationsFelipe Balbi2014-04-241-3/+6
| | | | | | | cleanup only, no functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: omap: switch over to devm_request_gpioFelipe Balbi2014-04-241-2/+3
| | | | | | | | this will make sure gpio gets freed automatically when this device is destroyed. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: add missing bracesFelipe Balbi2014-04-241-1/+4
| | | | | | | | per CodingStyle we should have those braces, no functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Revert "serial: omap: unlock the port lock"Felipe Balbi2014-04-241-4/+1
| | | | | | | | | | | | | | | | This reverts commit 0324a821029e1f54e7a7f8fed48693cfce42dc0e. That commit tried to fix a deadlock problem when using hci_ldisc, but it turns out the bug was in hci_ldsic all along where it was calling ->write() from within ->write_wakeup() callback. The problem is that ->write_wakeup() was called with port lock held and ->write() tried to grab the same port lock. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: Fix missing pm_runtime_resume handling by simplifying codeTony Lindgren2014-04-161-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lack of pm_runtime_resume handling for the device state leads into device wake-up interrupts not working after a while for runtime PM. Also, serial-omap is confused about the use of device_may_wakeup. The checks for device_may_wakeup should only be done for suspend and resume, not for pm_runtime_suspend and pm_runtime_resume. The wake-up events for PM runtime should always be enabled. The lack of pm_runtime_resume handling leads into device wake-up interrupts not working after a while for runtime PM. Rather than try to patch over the issue of adding complex tests to the pm_runtime_resume, let's fix the issues properly: 1. Make serial_omap_enable_wakeup deal with all internal PM state handling so we don't need to test for up->wakeups_enabled elsewhere. Later on once omap3 boots in device tree only mode we can also remove the up->wakeups_enabled flag and rely on the wake-up interrupt enable/disable state alone. 2. Do the device_may_wakeup checks in suspend and resume only, for runtime PM the wake-up events need to be always enabled. 3. Finally just call serial_omap_enable_wakeup and make sure we call it also in pm_runtime_resume. 4. Note that we also have to use disable_irq_nosync as serial_omap_irq calls pm_runtime_get_sync. Fixes: 2a0b965cfb6e (serial: omap: Add support for optional wake-up) Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: free the wakeup settings in removeSanjay Singh Rawat2014-04-161-0/+1
| | | | | Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty/serial: omap: empty the RX FIFO at the end of half-duplex TXDimitris Lampridis2014-03-171-0/+6
| | | | | | | | Provided that the SER_RS485_RX_DURING_TX flag is not set, empty the RX FIFO to prevent reading back the transmitted data. Signed-off-by: Dimitris Lampridis <dlampridis@logikonlabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty/serial: omap: fix RX interrupt enable/disable in half-duplex TXDimitris Lampridis2014-03-171-2/+3
| | | | | | | | | | | | | | | | Make sure that serial_omap_stop_rx() also disables RDI (Receiver Data Interrupt), otherwise the interrupt handler will call serial_omap_rdi() to read the new data, resulting in the transmission being echoed back. When the half-duplex transmission is complete, in order to reverse the effects of serial_omap_stop_rx(), we should re-enable: * the RX interrupts _without_ overwriting up->ier * the UART_LSR_DR bit of the up->port.read_status_mask Signed-off-by: Dimitris Lampridis <dlampridis@logikonlabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: fix rs485 probe on defered pinctrlMichael Grzeschik2014-02-131-1/+4
| | | | | | | | | If the gpio is not yet available we better also defer the probing in the rs485 case. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap-serial: Move info message to probe functionMarkus Pargmann2014-02-131-3/+3
| | | | | | | | | | | | | | | | | | | | Currently the info message about a missing wakeirq for uart is printed every time the serial driver's startup function is called. This happens multiple times and not just once. This can cause lots of extra messages at boot time, slowing things down. It is caused by commit 2a0b965cfb6e (serial: omap: Add support for optional wake-up) which was applied for v3.13-rc1. This patch moves the infomessage to the probe function to display it only once. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: stable <stable@vger.kernel.org> # 3.13 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: fix missing commaPhilippe Proulx2013-10-311-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>
* serial: omap: fix a few checkpatch warningsPhilippe Proulx2013-10-291-9/+8
| | | | | Signed-off-by: Philippe Proulx <philippe.proulx@savoirfairelinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: omap: improve RS-485 performancePhilippe Proulx2013-10-291-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>
* serial: omap: Add support for optional wake-upTony Lindgren2013-10-291-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>
* serial: omap: delete .set_wake callbackLinus Walleij2013-10-161-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>
* OMAP/serial: Fix Mode13 vs Mode16 priorityAlexey Pelykh2013-09-261-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>
* OMAP/serial: Fix misnamed variableAlexey Pelykh2013-09-261-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>
* Revert "OMAP: UART: Keep the TX fifo full when possible"Greg Kroah-Hartman2013-08-271-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>
* Revert "serial: omap: Fix IRQ handling return value"Greg Kroah-Hartman2013-08-271-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>
* OMAP: serial: Remove incorrect disabling of IER interruptMark Jackson2013-08-151-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>
* OMAP: add RS485 supportMark Jackson2013-08-141-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>
* serial: use dev_get_platdata()Jingoo Han2013-07-311-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>
* serial: omap: enable PM runtime only when its fully configuredGrygorii Strashko2013-07-261-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>
* serial: omap: Fix IRQ handling return valueRuchika Kharwar2013-07-261-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>
* serial: omap: Initialize platform_dataVikram Pandita2013-07-261-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>
* OMAP: UART: Fix the revision register read.Ruchika Kharwar2013-07-261-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>
* OMAP: UART: Keep the TX fifo full when possibleDmitry Fink2013-07-261-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>
* OMAP2+: UART: enable tx wakeup bit for wer regGovindraj.R2013-07-261-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>
* drivers/tty/serial: don't use devm_pinctrl_get_select_default() in probeWolfram Sang2013-07-241-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>
* serial: omap: Fix device tree based PM runtimeTony Lindgren2013-06-171-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>
* serial: omap: fix potential NULL pointer dereference in ↵Wei Yongjun2013-06-061-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>
* serial: omap: repair building without PM_SLEEPArnd Bergmann2013-06-031-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>
* Merge 3.10-rc3 into tty-nextGreg Kroah-Hartman2013-05-271-23/+0
|\ | | | | | | | | | | We want these fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * SERIAL: OMAP: Remove the slave idle handling from the driverSantosh Shilimkar2013-05-191-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>
* | serial: omap: prevent runtime PM for "no_console_suspend"Sourav Poddar2013-05-201-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>
* OMAP/serial: Revert bad fix of Rx FIFO threshold granularityAlexey Pelykh2013-04-031-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>
* OMAP/serial: Fix incorrect Rx FIFO threshold setting, LSR validation on Tx, ↵Alexey Pelykh2013-02-051-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>
* OMAP/serial: Support 1Mbaud and similar baudrates that require Mode16 ↵Alexey Pelykh2013-01-171-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>
* TTY: switch tty_flip_buffer_pushJiri Slaby2013-01-151-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>
* serial: omap: add the functionality of a 9-bit UART with userspaces CMSPAREnric Balletbo i Serra2013-01-151-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>
* ARM: OMAP: Move plat/omap-serial.h to include/linux/platform_data/serial-omap.hTony Lindgren2012-12-141-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>
* Merge branch 'omap-serial' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds2012-12-121-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
| * SERIAL: omap: fix hardware assisted flow controlRussell King2012-11-041-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>
| * SERIAL: omap: simplify (2)Russell King2012-11-041-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>
| * SERIAL: omap: move xon/xoff setting earlierRussell King2012-11-041-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>
OpenPOWER on IntegriCloud