diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 14:22:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 14:22:14 -0400 |
commit | 1bf25e78af317e6d5d9b5594dfeb0036e0d589d6 (patch) | |
tree | 49dbd2d7bd6856b8ae1864c2dd0c0eb5e36d5398 /drivers/tty/serial/amba-pl011.c | |
parent | 38f56f33ca381751f9b8910f67e7a805ec0b68cb (diff) | |
parent | 0592c2189ece16f3e0c5a56245634aba93d0c9dd (diff) |
Merge tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC late cleanups from Arnd Bergmann:
"These are cleanups and smaller changes that either depend on earlier
feature branches or came in late during the development cycle. We
normally try to get all cleanups early, so these are the exceptions:
- A follow-up on the clocksource reworks, hopefully the last time we
need to merge clocksource subsystem changes through arm-soc.
A first set of patches was part of the original 3.10 arm-soc
cleanup series because of interdependencies with timer drivers now
moved out of arch/arm.
- Migrating the SPEAr13xx platform away from using auxdata for DMA
channel descriptions towards using information in device tree,
based on the earlier SPEAr multiplatform series
- A few follow-ups on the Atmel SAMA5 support and other changes for
Atmel at91 based on the larger at91 reworks.
- Moving the armada irqchip implementation to drivers/irqchip
- Several OMAP cleanups following up on the larger series already
merged in 3.10."
* tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits)
ARM: OMAP4: change the device names in usb_bind_phy
ARM: OMAP2+: Fix mismerge for timer.c between ff931c82 and da4a686a
ARM: SPEAr: conditionalize SMP code
ARM: arch_timer: Silence debug preempt warnings
ARM: OMAP: remove unused variable
serial: amba-pl011: fix !CONFIG_DMA_ENGINE case
ata: arasan: remove the need for platform_data
ARM: at91/sama5d34ek.dts: remove not needed compatibility string
ARM: at91: dts: add MCI DMA support
ARM: at91: dts: add i2c dma support
ARM: at91: dts: set #dma-cells to the correct value
ARM: at91: suspend both memory controllers on at91sam9263
irqchip: armada-370-xp: slightly cleanup irq controller driver
irqchip: armada-370-xp: move IRQ handler to avoid forward declaration
irqchip: move IRQ driver for Armada 370/XP
ARM: mvebu: move L2 cache initialization in init_early()
devtree: add binding documentation for sp804
ARM: integrator-cp: convert use CLKSRC_OF for timer init
ARM: versatile: use OF init for sp804 timer
ARM: versatile: add versatile dtbs to dtbs target
...
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index b2e9e177a354..8ab70a620919 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -267,7 +267,7 @@ static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg, | |||
267 | } | 267 | } |
268 | } | 268 | } |
269 | 269 | ||
270 | static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | 270 | static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap) |
271 | { | 271 | { |
272 | /* DMA is the sole user of the platform data right now */ | 272 | /* DMA is the sole user of the platform data right now */ |
273 | struct amba_pl011_data *plat = uap->port.dev->platform_data; | 273 | struct amba_pl011_data *plat = uap->port.dev->platform_data; |
@@ -281,20 +281,25 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | |||
281 | struct dma_chan *chan; | 281 | struct dma_chan *chan; |
282 | dma_cap_mask_t mask; | 282 | dma_cap_mask_t mask; |
283 | 283 | ||
284 | /* We need platform data */ | 284 | chan = dma_request_slave_channel(dev, "tx"); |
285 | if (!plat || !plat->dma_filter) { | ||
286 | dev_info(uap->port.dev, "no DMA platform data\n"); | ||
287 | return; | ||
288 | } | ||
289 | 285 | ||
290 | /* Try to acquire a generic DMA engine slave TX channel */ | ||
291 | dma_cap_zero(mask); | ||
292 | dma_cap_set(DMA_SLAVE, mask); | ||
293 | |||
294 | chan = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param); | ||
295 | if (!chan) { | 286 | if (!chan) { |
296 | dev_err(uap->port.dev, "no TX DMA channel!\n"); | 287 | /* We need platform data */ |
297 | return; | 288 | if (!plat || !plat->dma_filter) { |
289 | dev_info(uap->port.dev, "no DMA platform data\n"); | ||
290 | return; | ||
291 | } | ||
292 | |||
293 | /* Try to acquire a generic DMA engine slave TX channel */ | ||
294 | dma_cap_zero(mask); | ||
295 | dma_cap_set(DMA_SLAVE, mask); | ||
296 | |||
297 | chan = dma_request_channel(mask, plat->dma_filter, | ||
298 | plat->dma_tx_param); | ||
299 | if (!chan) { | ||
300 | dev_err(uap->port.dev, "no TX DMA channel!\n"); | ||
301 | return; | ||
302 | } | ||
298 | } | 303 | } |
299 | 304 | ||
300 | dmaengine_slave_config(chan, &tx_conf); | 305 | dmaengine_slave_config(chan, &tx_conf); |
@@ -304,7 +309,18 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | |||
304 | dma_chan_name(uap->dmatx.chan)); | 309 | dma_chan_name(uap->dmatx.chan)); |
305 | 310 | ||
306 | /* Optionally make use of an RX channel as well */ | 311 | /* Optionally make use of an RX channel as well */ |
307 | if (plat->dma_rx_param) { | 312 | chan = dma_request_slave_channel(dev, "rx"); |
313 | |||
314 | if (!chan && plat->dma_rx_param) { | ||
315 | chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param); | ||
316 | |||
317 | if (!chan) { | ||
318 | dev_err(uap->port.dev, "no RX DMA channel!\n"); | ||
319 | return; | ||
320 | } | ||
321 | } | ||
322 | |||
323 | if (chan) { | ||
308 | struct dma_slave_config rx_conf = { | 324 | struct dma_slave_config rx_conf = { |
309 | .src_addr = uap->port.mapbase + UART01x_DR, | 325 | .src_addr = uap->port.mapbase + UART01x_DR, |
310 | .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, | 326 | .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, |
@@ -313,12 +329,6 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | |||
313 | .device_fc = false, | 329 | .device_fc = false, |
314 | }; | 330 | }; |
315 | 331 | ||
316 | chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param); | ||
317 | if (!chan) { | ||
318 | dev_err(uap->port.dev, "no RX DMA channel!\n"); | ||
319 | return; | ||
320 | } | ||
321 | |||
322 | dmaengine_slave_config(chan, &rx_conf); | 332 | dmaengine_slave_config(chan, &rx_conf); |
323 | uap->dmarx.chan = chan; | 333 | uap->dmarx.chan = chan; |
324 | 334 | ||
@@ -360,6 +370,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | |||
360 | struct dma_uap { | 370 | struct dma_uap { |
361 | struct list_head node; | 371 | struct list_head node; |
362 | struct uart_amba_port *uap; | 372 | struct uart_amba_port *uap; |
373 | struct device *dev; | ||
363 | }; | 374 | }; |
364 | 375 | ||
365 | static LIST_HEAD(pl011_dma_uarts); | 376 | static LIST_HEAD(pl011_dma_uarts); |
@@ -370,7 +381,7 @@ static int __init pl011_dma_initcall(void) | |||
370 | 381 | ||
371 | list_for_each_safe(node, tmp, &pl011_dma_uarts) { | 382 | list_for_each_safe(node, tmp, &pl011_dma_uarts) { |
372 | struct dma_uap *dmau = list_entry(node, struct dma_uap, node); | 383 | struct dma_uap *dmau = list_entry(node, struct dma_uap, node); |
373 | pl011_dma_probe_initcall(dmau->uap); | 384 | pl011_dma_probe_initcall(dmau->dev, dmau->uap); |
374 | list_del(node); | 385 | list_del(node); |
375 | kfree(dmau); | 386 | kfree(dmau); |
376 | } | 387 | } |
@@ -379,18 +390,19 @@ static int __init pl011_dma_initcall(void) | |||
379 | 390 | ||
380 | device_initcall(pl011_dma_initcall); | 391 | device_initcall(pl011_dma_initcall); |
381 | 392 | ||
382 | static void pl011_dma_probe(struct uart_amba_port *uap) | 393 | static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap) |
383 | { | 394 | { |
384 | struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL); | 395 | struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL); |
385 | if (dmau) { | 396 | if (dmau) { |
386 | dmau->uap = uap; | 397 | dmau->uap = uap; |
398 | dmau->dev = dev; | ||
387 | list_add_tail(&dmau->node, &pl011_dma_uarts); | 399 | list_add_tail(&dmau->node, &pl011_dma_uarts); |
388 | } | 400 | } |
389 | } | 401 | } |
390 | #else | 402 | #else |
391 | static void pl011_dma_probe(struct uart_amba_port *uap) | 403 | static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap) |
392 | { | 404 | { |
393 | pl011_dma_probe_initcall(uap); | 405 | pl011_dma_probe_initcall(dev, uap); |
394 | } | 406 | } |
395 | #endif | 407 | #endif |
396 | 408 | ||
@@ -1096,7 +1108,7 @@ static inline bool pl011_dma_rx_running(struct uart_amba_port *uap) | |||
1096 | 1108 | ||
1097 | #else | 1109 | #else |
1098 | /* Blank functions if the DMA engine is not available */ | 1110 | /* Blank functions if the DMA engine is not available */ |
1099 | static inline void pl011_dma_probe(struct uart_amba_port *uap) | 1111 | static inline void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap) |
1100 | { | 1112 | { |
1101 | } | 1113 | } |
1102 | 1114 | ||
@@ -2155,7 +2167,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
2155 | uap->port.ops = &amba_pl011_pops; | 2167 | uap->port.ops = &amba_pl011_pops; |
2156 | uap->port.flags = UPF_BOOT_AUTOCONF; | 2168 | uap->port.flags = UPF_BOOT_AUTOCONF; |
2157 | uap->port.line = i; | 2169 | uap->port.line = i; |
2158 | pl011_dma_probe(uap); | 2170 | pl011_dma_probe(&dev->dev, uap); |
2159 | 2171 | ||
2160 | /* Ensure interrupts from this UART are masked and cleared */ | 2172 | /* Ensure interrupts from this UART are masked and cleared */ |
2161 | writew(0, uap->port.membase + UART011_IMSC); | 2173 | writew(0, uap->port.membase + UART011_IMSC); |