diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-05-23 15:18:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 18:41:44 -0400 |
commit | 78d80c5a720ea370defa3e3124c0f7f7179bdfe5 (patch) | |
tree | 79821058633366fa9bca66038439dde67673680b /arch | |
parent | f109293f5889dd30477564a3ce2c901f4024a53e (diff) |
serial/amba-pl011: move custom pin control to driver
We had a boot regression in Ux500 in the merge window because
two orthogonal pin control schemes for the PL011 were merged
at the same time:
- One using the .init() and .exit() hooks into the platform
for Ux500 putting the pins into default vs sleep state
respectively as the port was started/stopped.
commit a09806607fd20bed2f8c41fe22793386790a14aa
"ARM: ux500: switch to using pinctrl for uart0"
- One hogging the default setting at PL011 probe()
commit 258e055111d3cde2607e0d04eb91da2f7a59b591
"serial: amba-pl011: adopt pinctrl support"
To get a solution that works for both let's scrap the stuff
in the platform callbacks, instead have the driver itself
select default and sleep states when the port is
started/stopped. Hopefully this works for all clients.
Platform callbacks are bad for device tree migration anyway,
so this rids us of another problem in Ux500.
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Reported-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 54 |
1 files changed, 1 insertions, 53 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 | } |