aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf609
diff options
context:
space:
mode:
authorSteven Miao <realmz6@gmail.com>2013-11-15 03:28:52 -0500
committerSteven Miao <realmz6@gmail.com>2013-11-15 05:14:21 -0500
commit37035d62a4dfa7b8cba9b0c8ff6317dba56dd62d (patch)
tree28637d68da589117ff5c7250aac7bf1d02b548e3 /arch/blackfin/mach-bf609
parent54e4ff4d402450af5cec599f1cd9ab34997b3149 (diff)
blackfin: pinctrl-adi2: code cleanup after using pinctrl-adi2
Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf609')
-rw-r--r--arch/blackfin/mach-bf609/boards/ezkit.c70
1 files changed, 4 insertions, 66 deletions
diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c
index 9da44b360426..aba6b54489ff 100644
--- a/arch/blackfin/mach-bf609/boards/ezkit.c
+++ b/arch/blackfin/mach-bf609/boards/ezkit.c
@@ -678,14 +678,9 @@ static struct mtd_partition ezkit_partitions[] = {
678int bf609_nor_flash_init(struct platform_device *pdev) 678int bf609_nor_flash_init(struct platform_device *pdev)
679{ 679{
680#define CONFIG_SMC_GCTL_VAL 0x00000010 680#define CONFIG_SMC_GCTL_VAL 0x00000010
681 const unsigned short pins[] = {
682 P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
683 P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
684 P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
685 };
686
687 peripheral_request_list(pins, "smc0");
688 681
682 if (!devm_pinctrl_get_select_default(&pdev->dev))
683 return -EBUSY;
689 bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL); 684 bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL);
690 bfin_write32(SMC_B0CTL, 0x01002011); 685 bfin_write32(SMC_B0CTL, 0x01002011);
691 bfin_write32(SMC_B0TIM, 0x08170977); 686 bfin_write32(SMC_B0TIM, 0x08170977);
@@ -693,16 +688,9 @@ int bf609_nor_flash_init(struct platform_device *pdev)
693 return 0; 688 return 0;
694} 689}
695 690
696void bf609_nor_flash_exit(struct platform_device *dev) 691void bf609_nor_flash_exit(struct platform_device *pdev)
697{ 692{
698 const unsigned short pins[] = { 693 devm_pinctrl_put(pdev->dev.pins->p);
699 P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
700 P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
701 P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
702 };
703
704 peripheral_free_list(pins);
705
706 bfin_write32(SMC_GCTL, 0); 694 bfin_write32(SMC_GCTL, 0);
707} 695}
708 696
@@ -1331,17 +1319,6 @@ static struct platform_device bfin_pinctrl_device = {
1331 .id = 0, 1319 .id = 0,
1332}; 1320};
1333 1321
1334#ifdef CONFIG_PINCTRL_ADI2
1335
1336# define ADI_PINT_DEVNAME "adi-gpio-pint"
1337# define ADI_GPIO_DEVNAME "adi-gpio"
1338# define ADI_PINCTRL_DEVNAME "pinctrl-adi2"
1339
1340static struct platform_device bfin_pinctrl_device = {
1341 .name = ADI_PINCTRL_DEVNAME,
1342 .id = 0,
1343};
1344
1345static struct resource bfin_pint0_resources[] = { 1322static struct resource bfin_pint0_resources[] = {
1346 { 1323 {
1347 .start = PINT0_MASK_SET, 1324 .start = PINT0_MASK_SET,
@@ -2092,45 +2069,6 @@ static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2092 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"), 2069 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"),
2093}; 2070};
2094 2071
2095/* Pin control settings */
2096static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2097 /* per-device maps */
2098 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"),
2099#ifdef CONFIG_BFIN_UART0_CTSRTS
2100 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0_ctsrts"),
2101#endif
2102 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"),
2103#ifdef CONFIG_BFIN_UART1_CTSRTS
2104 PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1_ctsrts"),
2105#endif
2106 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"),
2107 PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"),
2108 PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"),
2109 PIN_MAP_MUX_GROUP_DEFAULT("stmmaceth.0", "pinctrl-adi2.0", NULL, "eth0"),
2110 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.0", "pinctrl-adi2.0", NULL, "spi0"),
2111 PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.1", "pinctrl-adi2.0", NULL, "spi1"),
2112 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"),
2113 PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"),
2114 PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"),
2115 PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"),
2116 PIN_MAP_MUX_GROUP_DEFAULT("physmap-flash.0", "pinctrl-adi2.0", NULL, "smc0"),
2117 PIN_MAP_MUX_GROUP_DEFAULT("bf609_nl8048.2", "pinctrl-adi2.0", NULL, "ppi2_16b"),
2118 PIN_MAP_MUX_GROUP_DEFAULT("bfin_display.0", "pinctrl-adi2.0", NULL, "ppi2_16b"),
2119#if defined(CONFIG_VIDEO_MT9M114) || defined(CONFIG_VIDEO_MT9M114_MODULE)
2120 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_8b"),
2121#elif defined(CONFIG_VIDEO_VS6624) || defined(CONFIG_VIDEO_VS6624_MODULE)
2122 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_16b"),
2123#else
2124 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_24b"),
2125#endif
2126 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"),
2127 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"),
2128 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"),
2129 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"),
2130 PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"),
2131 PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"),
2132};
2133
2134static int __init ezkit_init(void) 2072static int __init ezkit_init(void)
2135{ 2073{
2136 printk(KERN_INFO "%s(): registering device resources\n", __func__); 2074 printk(KERN_INFO "%s(): registering device resources\n", __func__);