diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 66 |
1 files changed, 8 insertions, 58 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 9c74ac545849..4fd93f5c49ec 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 | } |
@@ -677,11 +625,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
677 | &ab8500_device, | 625 | &ab8500_device, |
678 | }; | 626 | }; |
679 | 627 | ||
680 | static struct platform_device *snowball_of_platform_devs[] __initdata = { | ||
681 | &snowball_led_dev, | ||
682 | &snowball_key_dev, | ||
683 | }; | ||
684 | |||
685 | static void __init mop500_init_machine(void) | 628 | static void __init mop500_init_machine(void) |
686 | { | 629 | { |
687 | struct device *parent = NULL; | 630 | struct device *parent = NULL; |
@@ -821,6 +764,11 @@ MACHINE_END | |||
821 | 764 | ||
822 | #ifdef CONFIG_MACH_UX500_DT | 765 | #ifdef CONFIG_MACH_UX500_DT |
823 | 766 | ||
767 | static struct platform_device *snowball_of_platform_devs[] __initdata = { | ||
768 | &snowball_led_dev, | ||
769 | &snowball_key_dev, | ||
770 | }; | ||
771 | |||
824 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | 772 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { |
825 | /* Requires DMA and call-back bindings. */ | 773 | /* Requires DMA and call-back bindings. */ |
826 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), | 774 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), |
@@ -838,6 +786,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | |||
838 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), | 786 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), |
839 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), | 787 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), |
840 | OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), | 788 | OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), |
789 | /* Requires device name bindings. */ | ||
790 | OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), | ||
841 | {}, | 791 | {}, |
842 | }; | 792 | }; |
843 | 793 | ||