diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2013-09-03 04:29:01 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-09-23 05:04:44 -0400 |
commit | 741ecef62a37bcc368ff8c7282f810327edc3d94 (patch) | |
tree | 89d07df54b7e427bab46da43a3ada0e615dccc1e /arch/blackfin | |
parent | 7330e345eefedce7675aa5974dd5e79ef1e4fa32 (diff) |
blackfin: pinctrl-adi2: Enable PINCTRL framework for BF54x and BF60x.
- Remove unused macro MAX_RESOURCES
- Override blackfin legacy peripheral pinmux request and free APIs by
devm_pinctrl_get_select_default() to init the peripheral portmux setting.
v3-chagnes:
- Move pinctrl soc data out of blackfin arch folder.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/Kconfig | 4 | ||||
-rw-r--r-- | arch/blackfin/include/asm/portmux.h | 19 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/portmux.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf609/include/mach/portmux.h | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index a1199b2e9d2b..74314bd8be39 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -324,6 +324,10 @@ config GPIO_ADI | |||
324 | def_bool y | 324 | def_bool y |
325 | depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561) | 325 | depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561) |
326 | 326 | ||
327 | config PINCTRL | ||
328 | def_bool y | ||
329 | depends on BF54x || BF60x | ||
330 | |||
327 | config MEM_MT48LC64M4A2FB_7E | 331 | config MEM_MT48LC64M4A2FB_7E |
328 | bool | 332 | bool |
329 | depends on (BFIN533_STAMP) | 333 | depends on (BFIN533_STAMP) |
diff --git a/arch/blackfin/include/asm/portmux.h b/arch/blackfin/include/asm/portmux.h index 9b1e2c37b324..7aa20436e799 100644 --- a/arch/blackfin/include/asm/portmux.h +++ b/arch/blackfin/include/asm/portmux.h | |||
@@ -17,14 +17,29 @@ | |||
17 | #define P_MAYSHARE 0x2000 | 17 | #define P_MAYSHARE 0x2000 |
18 | #define P_DONTCARE 0x1000 | 18 | #define P_DONTCARE 0x1000 |
19 | 19 | ||
20 | 20 | #ifdef CONFIG_PINCTRL | |
21 | #include <asm/irq_handler.h> | ||
22 | |||
23 | #define gpio_pint_regs bfin_pint_regs | ||
24 | #define adi_internal_set_wake bfin_internal_set_wake | ||
25 | |||
26 | #define peripheral_request(per, label) 0 | ||
27 | #define peripheral_free(per) | ||
28 | #define peripheral_request_list(per, label) \ | ||
29 | (pdev ? (IS_ERR(devm_pinctrl_get_select_default(&pdev->dev)) \ | ||
30 | ? -EINVAL : 0) : 0) | ||
31 | #define peripheral_free_list(per) | ||
32 | #else | ||
21 | int peripheral_request(unsigned short per, const char *label); | 33 | int peripheral_request(unsigned short per, const char *label); |
22 | void peripheral_free(unsigned short per); | 34 | void peripheral_free(unsigned short per); |
23 | int peripheral_request_list(const unsigned short per[], const char *label); | 35 | int peripheral_request_list(const unsigned short per[], const char *label); |
24 | void peripheral_free_list(const unsigned short per[]); | 36 | void peripheral_free_list(const unsigned short per[]); |
37 | #endif | ||
25 | 38 | ||
26 | #include <asm/gpio.h> | 39 | #include <linux/err.h> |
40 | #include <linux/pinctrl/pinctrl.h> | ||
27 | #include <mach/portmux.h> | 41 | #include <mach/portmux.h> |
42 | #include <linux/gpio.h> | ||
28 | 43 | ||
29 | #ifndef P_SPORT2_TFS | 44 | #ifndef P_SPORT2_TFS |
30 | #define P_SPORT2_TFS P_UNDEF | 45 | #define P_SPORT2_TFS P_UNDEF |
diff --git a/arch/blackfin/mach-bf548/include/mach/portmux.h b/arch/blackfin/mach-bf548/include/mach/portmux.h index e22246202730..d9f8632d7d09 100644 --- a/arch/blackfin/mach-bf548/include/mach/portmux.h +++ b/arch/blackfin/mach-bf548/include/mach/portmux.h | |||
@@ -7,8 +7,6 @@ | |||
7 | #ifndef _MACH_PORTMUX_H_ | 7 | #ifndef _MACH_PORTMUX_H_ |
8 | #define _MACH_PORTMUX_H_ | 8 | #define _MACH_PORTMUX_H_ |
9 | 9 | ||
10 | #define MAX_RESOURCES MAX_BLACKFIN_GPIOS | ||
11 | |||
12 | #define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0)) | 10 | #define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0)) |
13 | #define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0)) | 11 | #define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0)) |
14 | #define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0)) | 12 | #define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0)) |
diff --git a/arch/blackfin/mach-bf609/include/mach/portmux.h b/arch/blackfin/mach-bf609/include/mach/portmux.h index 2e1a51c25098..fe34191eef0b 100644 --- a/arch/blackfin/mach-bf609/include/mach/portmux.h +++ b/arch/blackfin/mach-bf609/include/mach/portmux.h | |||
@@ -7,8 +7,6 @@ | |||
7 | #ifndef _MACH_PORTMUX_H_ | 7 | #ifndef _MACH_PORTMUX_H_ |
8 | #define _MACH_PORTMUX_H_ | 8 | #define _MACH_PORTMUX_H_ |
9 | 9 | ||
10 | #define MAX_RESOURCES MAX_BLACKFIN_GPIOS | ||
11 | |||
12 | /* EMAC RMII Port Mux */ | 10 | /* EMAC RMII Port Mux */ |
13 | #define P_MII0_MDC (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0)) | 11 | #define P_MII0_MDC (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0)) |
14 | #define P_MII0_MDIO (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0)) | 12 | #define P_MII0_MDIO (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0)) |