aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-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 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 */
584struct pinctrl *u0_p;
585struct pinctrl_state *u0_def;
586struct pinctrl_state *u0_sleep;
587
588static 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
600static 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
612static struct amba_pl011_data uart0_plat = { 583static 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
639static void __init mop500_uart_init(struct device *parent) 608static 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}