diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-20 18:13:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-20 18:13:13 -0400 |
commit | a1821f774d4600727edf71005f259a9fdb73981e (patch) | |
tree | cc2d33e9217d6105cf9a9f2cbd2703b1e109132d | |
parent | a2a2609c97c1e21996b9d87d10d2c9ff07277524 (diff) | |
parent | 78d80c5a720ea370defa3e3124c0f7f7179bdfe5 (diff) |
Merge tag 'tty-3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull serial driver fixes from Greg Kroah-Hartman:
"Here are 3 patches resolving a boot regression (the mop500 fix), a
build warning fix, and a kernel-doc fix. All tiny, but should go into
the final 3.5 release.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'tty-3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial/amba-pl011: move custom pin control to driver
serial: fix serial_txx9.c build warning/typo
serial: fix kernel-doc warnings in 8250.c
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 54 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 45 | ||||
-rw-r--r-- | drivers/tty/serial/serial_txx9.c | 2 |
4 files changed, 44 insertions, 59 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 9c74ac545849..1509a3cb5833 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -580,43 +580,12 @@ static void ux500_uart0_reset(void) | |||
580 | udelay(1); | 580 | udelay(1); |
581 | } | 581 | } |
582 | 582 | ||
583 | /* This needs to be referenced by callbacks */ | ||
584 | struct pinctrl *u0_p; | ||
585 | struct pinctrl_state *u0_def; | ||
586 | struct pinctrl_state *u0_sleep; | ||
587 | |||
588 | static void ux500_uart0_init(void) | ||
589 | { | ||
590 | int ret; | ||
591 | |||
592 | if (IS_ERR(u0_p) || IS_ERR(u0_def)) | ||
593 | return; | ||
594 | |||
595 | ret = pinctrl_select_state(u0_p, u0_def); | ||
596 | if (ret) | ||
597 | pr_err("could not set UART0 defstate\n"); | ||
598 | } | ||
599 | |||
600 | static void ux500_uart0_exit(void) | ||
601 | { | ||
602 | int ret; | ||
603 | |||
604 | if (IS_ERR(u0_p) || IS_ERR(u0_sleep)) | ||
605 | return; | ||
606 | |||
607 | ret = pinctrl_select_state(u0_p, u0_sleep); | ||
608 | if (ret) | ||
609 | pr_err("could not set UART0 idlestate\n"); | ||
610 | } | ||
611 | |||
612 | static struct amba_pl011_data uart0_plat = { | 583 | static struct amba_pl011_data uart0_plat = { |
613 | #ifdef CONFIG_STE_DMA40 | 584 | #ifdef CONFIG_STE_DMA40 |
614 | .dma_filter = stedma40_filter, | 585 | .dma_filter = stedma40_filter, |
615 | .dma_rx_param = &uart0_dma_cfg_rx, | 586 | .dma_rx_param = &uart0_dma_cfg_rx, |
616 | .dma_tx_param = &uart0_dma_cfg_tx, | 587 | .dma_tx_param = &uart0_dma_cfg_tx, |
617 | #endif | 588 | #endif |
618 | .init = ux500_uart0_init, | ||
619 | .exit = ux500_uart0_exit, | ||
620 | .reset = ux500_uart0_reset, | 589 | .reset = ux500_uart0_reset, |
621 | }; | 590 | }; |
622 | 591 | ||
@@ -638,28 +607,7 @@ static struct amba_pl011_data uart2_plat = { | |||
638 | 607 | ||
639 | static void __init mop500_uart_init(struct device *parent) | 608 | static void __init mop500_uart_init(struct device *parent) |
640 | { | 609 | { |
641 | struct amba_device *uart0_device; | 610 | db8500_add_uart0(parent, &uart0_plat); |
642 | |||
643 | uart0_device = db8500_add_uart0(parent, &uart0_plat); | ||
644 | if (uart0_device) { | ||
645 | u0_p = pinctrl_get(&uart0_device->dev); | ||
646 | if (IS_ERR(u0_p)) | ||
647 | dev_err(&uart0_device->dev, | ||
648 | "could not get UART0 pinctrl\n"); | ||
649 | else { | ||
650 | u0_def = pinctrl_lookup_state(u0_p, | ||
651 | PINCTRL_STATE_DEFAULT); | ||
652 | if (IS_ERR(u0_def)) { | ||
653 | dev_err(&uart0_device->dev, | ||
654 | "could not get UART0 defstate\n"); | ||
655 | } | ||
656 | u0_sleep = pinctrl_lookup_state(u0_p, | ||
657 | PINCTRL_STATE_SLEEP); | ||
658 | if (IS_ERR(u0_sleep)) | ||
659 | dev_err(&uart0_device->dev, | ||
660 | "could not get UART0 idlestate\n"); | ||
661 | } | ||
662 | } | ||
663 | db8500_add_uart1(parent, &uart1_plat); | 611 | db8500_add_uart1(parent, &uart1_plat); |
664 | db8500_add_uart2(parent, &uart2_plat); | 612 | db8500_add_uart2(parent, &uart2_plat); |
665 | } | 613 | } |
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 47d061b9ad4d..6e1958a325bd 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
@@ -3113,7 +3113,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * | |||
3113 | 3113 | ||
3114 | /** | 3114 | /** |
3115 | * serial8250_register_8250_port - register a serial port | 3115 | * serial8250_register_8250_port - register a serial port |
3116 | * @port: serial port template | 3116 | * @up: serial port template |
3117 | * | 3117 | * |
3118 | * Configure the serial port specified by the request. If the | 3118 | * Configure the serial port specified by the request. If the |
3119 | * port exists and is in use, it is hung up and unregistered | 3119 | * port exists and is in use, it is hung up and unregistered |
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 4ad721fb8405..c17923ec6e95 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -133,6 +133,10 @@ struct pl011_dmatx_data { | |||
133 | struct uart_amba_port { | 133 | struct uart_amba_port { |
134 | struct uart_port port; | 134 | struct uart_port port; |
135 | struct clk *clk; | 135 | struct clk *clk; |
136 | /* Two optional pin states - default & sleep */ | ||
137 | struct pinctrl *pinctrl; | ||
138 | struct pinctrl_state *pins_default; | ||
139 | struct pinctrl_state *pins_sleep; | ||
136 | const struct vendor_data *vendor; | 140 | const struct vendor_data *vendor; |
137 | unsigned int dmacr; /* dma control reg */ | 141 | unsigned int dmacr; /* dma control reg */ |
138 | unsigned int im; /* interrupt mask */ | 142 | unsigned int im; /* interrupt mask */ |
@@ -1312,6 +1316,14 @@ static int pl011_startup(struct uart_port *port) | |||
1312 | unsigned int cr; | 1316 | unsigned int cr; |
1313 | int retval; | 1317 | int retval; |
1314 | 1318 | ||
1319 | /* Optionaly enable pins to be muxed in and configured */ | ||
1320 | if (!IS_ERR(uap->pins_default)) { | ||
1321 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
1322 | if (retval) | ||
1323 | dev_err(port->dev, | ||
1324 | "could not set default pins\n"); | ||
1325 | } | ||
1326 | |||
1315 | retval = clk_prepare(uap->clk); | 1327 | retval = clk_prepare(uap->clk); |
1316 | if (retval) | 1328 | if (retval) |
1317 | goto out; | 1329 | goto out; |
@@ -1420,6 +1432,7 @@ static void pl011_shutdown(struct uart_port *port) | |||
1420 | { | 1432 | { |
1421 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 1433 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
1422 | unsigned int cr; | 1434 | unsigned int cr; |
1435 | int retval; | ||
1423 | 1436 | ||
1424 | /* | 1437 | /* |
1425 | * disable all interrupts | 1438 | * disable all interrupts |
@@ -1462,6 +1475,14 @@ static void pl011_shutdown(struct uart_port *port) | |||
1462 | */ | 1475 | */ |
1463 | clk_disable(uap->clk); | 1476 | clk_disable(uap->clk); |
1464 | clk_unprepare(uap->clk); | 1477 | clk_unprepare(uap->clk); |
1478 | /* Optionally let pins go into sleep states */ | ||
1479 | if (!IS_ERR(uap->pins_sleep)) { | ||
1480 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep); | ||
1481 | if (retval) | ||
1482 | dev_err(port->dev, | ||
1483 | "could not set pins to sleep state\n"); | ||
1484 | } | ||
1485 | |||
1465 | 1486 | ||
1466 | if (uap->port.dev->platform_data) { | 1487 | if (uap->port.dev->platform_data) { |
1467 | struct amba_pl011_data *plat; | 1488 | struct amba_pl011_data *plat; |
@@ -1792,6 +1813,14 @@ static int __init pl011_console_setup(struct console *co, char *options) | |||
1792 | if (!uap) | 1813 | if (!uap) |
1793 | return -ENODEV; | 1814 | return -ENODEV; |
1794 | 1815 | ||
1816 | /* Allow pins to be muxed in and configured */ | ||
1817 | if (!IS_ERR(uap->pins_default)) { | ||
1818 | ret = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
1819 | if (ret) | ||
1820 | dev_err(uap->port.dev, | ||
1821 | "could not set default pins\n"); | ||
1822 | } | ||
1823 | |||
1795 | ret = clk_prepare(uap->clk); | 1824 | ret = clk_prepare(uap->clk); |
1796 | if (ret) | 1825 | if (ret) |
1797 | return ret; | 1826 | return ret; |
@@ -1844,7 +1873,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1844 | { | 1873 | { |
1845 | struct uart_amba_port *uap; | 1874 | struct uart_amba_port *uap; |
1846 | struct vendor_data *vendor = id->data; | 1875 | struct vendor_data *vendor = id->data; |
1847 | struct pinctrl *pinctrl; | ||
1848 | void __iomem *base; | 1876 | void __iomem *base; |
1849 | int i, ret; | 1877 | int i, ret; |
1850 | 1878 | ||
@@ -1869,11 +1897,20 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1869 | goto free; | 1897 | goto free; |
1870 | } | 1898 | } |
1871 | 1899 | ||
1872 | pinctrl = devm_pinctrl_get_select_default(&dev->dev); | 1900 | uap->pinctrl = devm_pinctrl_get(&dev->dev); |
1873 | if (IS_ERR(pinctrl)) { | 1901 | if (IS_ERR(uap->pinctrl)) { |
1874 | ret = PTR_ERR(pinctrl); | 1902 | ret = PTR_ERR(uap->pinctrl); |
1875 | goto unmap; | 1903 | goto unmap; |
1876 | } | 1904 | } |
1905 | uap->pins_default = pinctrl_lookup_state(uap->pinctrl, | ||
1906 | PINCTRL_STATE_DEFAULT); | ||
1907 | if (IS_ERR(uap->pins_default)) | ||
1908 | dev_err(&dev->dev, "could not get default pinstate\n"); | ||
1909 | |||
1910 | uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl, | ||
1911 | PINCTRL_STATE_SLEEP); | ||
1912 | if (IS_ERR(uap->pins_sleep)) | ||
1913 | dev_dbg(&dev->dev, "could not get sleep pinstate\n"); | ||
1877 | 1914 | ||
1878 | uap->clk = clk_get(&dev->dev, NULL); | 1915 | uap->clk = clk_get(&dev->dev, NULL); |
1879 | if (IS_ERR(uap->clk)) { | 1916 | if (IS_ERR(uap->clk)) { |
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index 34bd345da775..6ae2a58d62f2 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c | |||
@@ -466,7 +466,7 @@ static void serial_txx9_break_ctl(struct uart_port *port, int break_state) | |||
466 | spin_unlock_irqrestore(&up->port.lock, flags); | 466 | spin_unlock_irqrestore(&up->port.lock, flags); |
467 | } | 467 | } |
468 | 468 | ||
469 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) || (CONFIG_CONSOLE_POLL) | 469 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) || defined(CONFIG_CONSOLE_POLL) |
470 | /* | 470 | /* |
471 | * Wait for transmitter & holding register to empty | 471 | * Wait for transmitter & holding register to empty |
472 | */ | 472 | */ |