aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c54
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 c8a8fde777bb..10ddfaf17f3d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -594,43 +594,12 @@ static void ux500_uart0_reset(void)
594 udelay(1); 594 udelay(1);
595} 595}
596 596
597/* This needs to be referenced by callbacks */
598struct pinctrl *u0_p;
599struct pinctrl_state *u0_def;
600struct pinctrl_state *u0_sleep;
601
602static void ux500_uart0_init(void)
603{
604 int ret;
605
606 if (IS_ERR(u0_p) || IS_ERR(u0_def))
607 return;
608
609 ret = pinctrl_select_state(u0_p, u0_def);
610 if (ret)
611 pr_err("could not set UART0 defstate\n");
612}
613
614static void ux500_uart0_exit(void)
615{
616 int ret;
617
618 if (IS_ERR(u0_p) || IS_ERR(u0_sleep))
619 return;
620
621 ret = pinctrl_select_state(u0_p, u0_sleep);
622 if (ret)
623 pr_err("could not set UART0 idlestate\n");
624}
625
626static struct amba_pl011_data uart0_plat = { 597static struct amba_pl011_data uart0_plat = {
627#ifdef CONFIG_STE_DMA40 598#ifdef CONFIG_STE_DMA40
628 .dma_filter = stedma40_filter, 599 .dma_filter = stedma40_filter,
629 .dma_rx_param = &uart0_dma_cfg_rx, 600 .dma_rx_param = &uart0_dma_cfg_rx,
630 .dma_tx_param = &uart0_dma_cfg_tx, 601 .dma_tx_param = &uart0_dma_cfg_tx,
631#endif 602#endif
632 .init = ux500_uart0_init,
633 .exit = ux500_uart0_exit,
634 .reset = ux500_uart0_reset, 603 .reset = ux500_uart0_reset,
635}; 604};
636 605
@@ -652,28 +621,7 @@ static struct amba_pl011_data uart2_plat = {
652 621
653static void __init mop500_uart_init(struct device *parent) 622static void __init mop500_uart_init(struct device *parent)
654{ 623{
655 struct amba_device *uart0_device; 624 db8500_add_uart0(parent, &uart0_plat);
656
657 uart0_device = db8500_add_uart0(parent, &uart0_plat);
658 if (uart0_device) {
659 u0_p = pinctrl_get(&uart0_device->dev);
660 if (IS_ERR(u0_p))
661 dev_err(&uart0_device->dev,
662 "could not get UART0 pinctrl\n");
663 else {
664 u0_def = pinctrl_lookup_state(u0_p,
665 PINCTRL_STATE_DEFAULT);
666 if (IS_ERR(u0_def)) {
667 dev_err(&uart0_device->dev,
668 "could not get UART0 defstate\n");
669 }
670 u0_sleep = pinctrl_lookup_state(u0_p,
671 PINCTRL_STATE_SLEEP);
672 if (IS_ERR(u0_sleep))
673 dev_err(&uart0_device->dev,
674 "could not get UART0 idlestate\n");
675 }
676 }
677 db8500_add_uart1(parent, &uart1_plat); 625 db8500_add_uart1(parent, &uart1_plat);
678 db8500_add_uart2(parent, &uart2_plat); 626 db8500_add_uart2(parent, &uart2_plat);
679} 627}