aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:06:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:06:17 -0400
commit38f56f33ca381751f9b8910f67e7a805ec0b68cb (patch)
tree202f2ce60f3f43a948607ec76c8cc48c1cf73a4b /drivers/tty
parentfcba914542082b272f31c8e4c40000b88ed3208d (diff)
parent4183bef2e093a2f0aab45f2d5fed82b0e02aeacf (diff)
Merge tag 'dt-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree updates (part 2) from Arnd Bergmann: "These are mostly new device tree bindings for existing drivers, as well as changes to the device tree source files to add support for those devices, and a couple of new boards, most notably Samsung's Exynos5 based Chromebook. The changes depend on earlier platform specific updates and touch the usual platforms: omap, exynos, tegra, mxs, mvebu and davinci." * tag 'dt-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (169 commits) ARM: exynos: dts: cros5250: add EC device ARM: dts: Add sbs-battery for exynos5250-snow ARM: dts: Add i2c-arbitrator bus for exynos5250-snow ARM: dts: add mshc controller node for Exynos4x12 SoCs ARM: dts: Add chip-id controller node on Exynos4/5 SoC ARM: EXYNOS: Create virtual I/O mapping for Chip-ID controller using device tree ARM: davinci: da850-evm: add SPI flash support ARM: davinci: da850: override SPI DT node device name ARM: davinci: da850: add SPI1 DT node spi/davinci: add DT binding documentation spi/davinci: no wildcards in DT compatible property ARM: dts: mvebu: Convert mvebu device tree files to 64 bits ARM: dts: mvebu: introduce internal-regs node ARM: dts: mvebu: Convert all the mvebu files to use the range property ARM: dts: mvebu: move all peripherals inside soc ARM: dts: mvebu: fix cpus section indentation ARM: davinci: da850: add EHRPWM & ECAP DT node ARM/dts: OMAP3: fix pinctrl-single configuration ARM: dts: Add OMAP3430 SDP NOR flash memory binding ARM: dts: Add NOR flash bindings for OMAP2420 H4 ...
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mxs-auart.c52
1 files changed, 4 insertions, 48 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 62e7d3b015a1..4f5f161896a1 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -35,7 +35,7 @@
35#include <linux/pinctrl/consumer.h> 35#include <linux/pinctrl/consumer.h>
36#include <linux/of_device.h> 36#include <linux/of_device.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38#include <linux/fsl/mxs-dma.h> 38#include <linux/dmaengine.h>
39 39
40#include <asm/cacheflush.h> 40#include <asm/cacheflush.h>
41 41
@@ -148,11 +148,6 @@ struct mxs_auart_port {
148 struct device *dev; 148 struct device *dev;
149 149
150 /* for DMA */ 150 /* for DMA */
151 struct mxs_dma_data dma_data;
152 int dma_channel_rx, dma_channel_tx;
153 int dma_irq_rx, dma_irq_tx;
154 int dma_channel;
155
156 struct scatterlist tx_sgl; 151 struct scatterlist tx_sgl;
157 struct dma_chan *tx_dma_chan; 152 struct dma_chan *tx_dma_chan;
158 void *tx_dma_buf; 153 void *tx_dma_buf;
@@ -440,20 +435,6 @@ static u32 mxs_auart_get_mctrl(struct uart_port *u)
440 return mctrl; 435 return mctrl;
441} 436}
442 437
443static bool mxs_auart_dma_filter(struct dma_chan *chan, void *param)
444{
445 struct mxs_auart_port *s = param;
446
447 if (!mxs_dma_is_apbx(chan))
448 return false;
449
450 if (s->dma_channel == chan->chan_id) {
451 chan->private = &s->dma_data;
452 return true;
453 }
454 return false;
455}
456
457static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s); 438static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s);
458static void dma_rx_callback(void *arg) 439static void dma_rx_callback(void *arg)
459{ 440{
@@ -545,21 +526,11 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s)
545 526
546static int mxs_auart_dma_init(struct mxs_auart_port *s) 527static int mxs_auart_dma_init(struct mxs_auart_port *s)
547{ 528{
548 dma_cap_mask_t mask;
549
550 if (auart_dma_enabled(s)) 529 if (auart_dma_enabled(s))
551 return 0; 530 return 0;
552 531
553 /* We do not get the right DMA channels. */
554 if (s->dma_channel_rx == -1 || s->dma_channel_tx == -1)
555 return -EINVAL;
556
557 /* init for RX */ 532 /* init for RX */
558 dma_cap_zero(mask); 533 s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx");
559 dma_cap_set(DMA_SLAVE, mask);
560 s->dma_channel = s->dma_channel_rx;
561 s->dma_data.chan_irq = s->dma_irq_rx;
562 s->rx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
563 if (!s->rx_dma_chan) 534 if (!s->rx_dma_chan)
564 goto err_out; 535 goto err_out;
565 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 536 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -567,9 +538,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
567 goto err_out; 538 goto err_out;
568 539
569 /* init for TX */ 540 /* init for TX */
570 s->dma_channel = s->dma_channel_tx; 541 s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx");
571 s->dma_data.chan_irq = s->dma_irq_tx;
572 s->tx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
573 if (!s->tx_dma_chan) 542 if (!s->tx_dma_chan)
574 goto err_out; 543 goto err_out;
575 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 544 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -1020,7 +989,6 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1020 struct platform_device *pdev) 989 struct platform_device *pdev)
1021{ 990{
1022 struct device_node *np = pdev->dev.of_node; 991 struct device_node *np = pdev->dev.of_node;
1023 u32 dma_channel[2];
1024 int ret; 992 int ret;
1025 993
1026 if (!np) 994 if (!np)
@@ -1034,20 +1002,8 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1034 } 1002 }
1035 s->port.line = ret; 1003 s->port.line = ret;
1036 1004
1037 s->dma_irq_rx = platform_get_irq(pdev, 1); 1005 s->flags |= MXS_AUART_DMA_CONFIG;
1038 s->dma_irq_tx = platform_get_irq(pdev, 2);
1039 1006
1040 ret = of_property_read_u32_array(np, "fsl,auart-dma-channel",
1041 dma_channel, 2);
1042 if (ret == 0) {
1043 s->dma_channel_rx = dma_channel[0];
1044 s->dma_channel_tx = dma_channel[1];
1045
1046 s->flags |= MXS_AUART_DMA_CONFIG;
1047 } else {
1048 s->dma_channel_rx = -1;
1049 s->dma_channel_tx = -1;
1050 }
1051 return 0; 1007 return 0;
1052} 1008}
1053 1009