summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/samsung.h
Commit message (Collapse)AuthorAgeFilesLines
* serial: samsung: fix DMA mode enter condition for small FIFO sizesMarek Szyprowski2015-08-041-0/+1
| | | | | | | | | | | | | | | Due to some of serial ports can have FIFO size smaller than cache line size, and because of need to align DMA buffer address to cache line size, it's necessary to calculate minimum number of bytes for which we want to start DMA transaction to be at least cache line size. The simplest way to meet this requirement is to get maximum of cache line size and FIFO size. Cc: <stable@vger.kernel.org> # v3.18+ Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: add DMA support for RXRobert Baldyga2015-01-091-0/+1
| | | | | | | | | | | | | | | | Add RX DMA transfers support for samsung serial driver. It's enabled when DMA controller for RX channel is specified in device-tree. DMA transactions are started when number of bytes in RX FIFO reaches trigger level, otherwise PIO mode is used. DMA transfer size is always PAGE_SIZE which can cause large latency when smaller data amount is transferred, so we always terminate DMA transaction on RX timeout interrupt. Timeout interval is set to 64 frame times. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: add DMA support for TXRobert Baldyga2015-01-091-0/+3
| | | | | | | | | | | | | | | | | | | | Add TX DMA transfers support for samsung serial driver. It's enabled when "dmas" property is defined in serial device-tree node, otherwise TX transfers are prerformed using PIO. TX DMA is used for data segments larger than fifosize to reduce number of interrupts during data transmission. For buffers shorter than fifosize PIO mode is selected. Data blocks for DMA transfers are aligned to cache line size to avoid problems with coherency (some areas of TX circ buffer can be used by CPU during DMA transaction, so we have to ensure that our data is always consistent). Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: add struct s3c24xx_uart_dmaRobert Baldyga2015-01-091-0/+38
| | | | | | | | | | This struct contains DMA configuration for each serial port. It will be used in next commits adding DMA support in driver. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: Neaten dbg usesJoe Perches2014-05-281-20/+3
| | | | | | | | | | | | | Add format and argument checking and fix misuses in the dbg macro. Add __printf Use %pR for resource Add #include guard to samsung.h Move static functions from .h to .c Use vscnprintf instead of length unguarded vsprintf Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: Remove casting the return value which is a void pointerJingoo Han2013-09-261-1/+1
| | | | | | | | | | Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: fix casting warningJingoo Han2013-08-121-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 <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial/samsung: fix modular buildArnd Bergmann2013-04-111-1/+3
| | | | | | | | | | There are a few bugs in the samsung serial driver when built as a loadable module, which makes the console code unavailable, as well as giving no access to the 'printascii' early debug function. This adds the appropriate compile time conditionals. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: samsung: merge probe() function from all SoC specific extensionsThomas Abraham2011-12-231-11/+7
| | | | | | | | | | | | With reset port, set clock and get clock functions in SoC specific extentions being removed, only the driver probe is left over in these extensions. The probe function itself can be merged into one and moved into the samsung common serial driver. With driver probe also moved, all the SoC specific extentions are no longer required and they are deleted. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* serial: samsung: remove all uses of get_clksrc and set_clksrcThomas Abraham2011-12-231-5/+0
| | | | | | | | | | | | | | | | | | | With clkdev based clock lookup support, the clock set and get operation using clock names communicated between the samsung uart driver and the SoC specific extension can be removed. In addition to that, for each platform specific extension, add the default clock selection, number of clock options for uart baud generator, clock selection bit mask and shift values which is required by the clkdev support in samsung uart driver. The default clock selection value 'def_clk_sel' specifies the default clock to be used as the source clock for baud rate generator in case the platform code does not specify the same. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* ARM: SAMSUNG: remove struct 's3c24xx_uart_clksrc' and all uses of itThomas Abraham2011-12-231-1/+0
| | | | | | | | | | | | With clkdev based clock lookup added to samsung serial driver, the use of 'struct s3c24xx_uart_clksrc' to supply clock names in platform data is removed from all the Samsung platform code. Cc: Ben Dooks <ben-linux@fluff.org> Cc: Ramax Lo <ramaxlo@gmail.com> Cc: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* serial: samsung: switch to clkdev based clock lookupThomas Abraham2011-12-231-0/+4
| | | | | | | | | | | | | | | | | | | Instead of using clock names supplied in platform data, use a generic clock name 'clk_uart_baud' to look up clocks. The platform code should register clocks with the name 'clk_uart_baud' which can be used by the baud rate generator. The clock lookup and selection of the best clock as baud rate clock is reworked. Platform code can specify the clocks that can be used as source for the baud clock (as supported previously by passing names of clocks). A new member is added to the platform data 'clk_sel' which holds a bit-field value with each bit representing a baud source clock. If a bit at any bit position is set, that clock is looked up to participate in the selection of the baud clock source. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* serial: samsung: Keep a copy of the location of platform data in driver's ↵Thomas Abraham2011-12-231-1/+3
| | | | | | | | | | | | | | private data Add a pointer to the location of the platform data in the driver's private data. When instantiated using device tree, pdev->dev->platform_data does not necessarily point to a valid instance of platform data. The platform data pointer in the driver's private data could be set to pdev->dev->platform_data or platform data instance created from device tree. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* serial: samsung: Add unified interrupt handler for s3c64xx and later SoC'sThomas Abraham2011-08-231-0/+1
| | | | | | | | | | | | | | | | s3c64xx and later SoC's include the interrupt mask and pending registers in the uart controller, unlike the s3c24xx SoC's which have these registers in the interrupt controller. When the mask and pending registers are part of the uart controller, a unified interrupt handler can handle the tx/rx interrupt. With this, the static reservation of interrupt numbers for the uart tx/rx/err interrupts in the linux irq space is not required and simplifies adding device tree support. Suggested-by: Grant Likely <grant.likely@secretlab.ca> CC: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* serial: Remove redundant console_initcall from s3c and s5p console driversThomas Abraham2011-07-201-19/+0
| | | | | | | | | | Uart port is registered as a console during the driver's probe. So explict registration of console with console_initcall is removed. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> [kgene.kim@samsung.com: removed changes of s3c2400 and s3c24a0] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
* tty: remove invalid location line in file headerJovi Zhang2011-04-191-2/+1
| | | | | | | | remove invalid location line in each file header after location moved from driver/char to driver/tty Signed-off-by: Jovi Zhang <bookjovi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: move drivers/serial/ to drivers/tty/serial/Greg Kroah-Hartman2011-01-131-0/+120
The serial drivers are really just tty drivers, so move them to drivers/tty/ to make things a bit neater overall. This is part of the tty/serial driver movement proceedure as proposed by Arnd Bergmann and approved by everyone involved a number of months ago. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Rogier Wolff <R.E.Wolff@bitwizard.nl> Cc: Michael H. Warfield <mhw@wittsend.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud