]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
blackfin: pinctrl-adi2: Enable PINCTRL framework for BF54x and BF60x.
authorSonic Zhang <sonic.zhang@analog.com>
Tue, 3 Sep 2013 08:29:01 +0000 (16:29 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 23 Sep 2013 09:04:44 +0000 (11:04 +0200)
- 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>
arch/blackfin/Kconfig
arch/blackfin/include/asm/portmux.h
arch/blackfin/mach-bf548/include/mach/portmux.h
arch/blackfin/mach-bf609/include/mach/portmux.h

index a1199b2e9d2bbc8585396e9849d0e079d9543479..74314bd8be39b5327ff305801903719be5acf4a1 100644 (file)
@@ -324,6 +324,10 @@ config GPIO_ADI
        def_bool y
        depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561)
 
+config PINCTRL
+       def_bool y
+       depends on BF54x || BF60x
+
 config MEM_MT48LC64M4A2FB_7E
        bool
        depends on (BFIN533_STAMP)
index 9b1e2c37b324da406aa6587e65c5281deca522a6..7aa20436e7998a283a95e1a3a1a82351ce8ff9d6 100644 (file)
 #define P_MAYSHARE     0x2000
 #define P_DONTCARE     0x1000
 
-
+#ifdef CONFIG_PINCTRL
+#include <asm/irq_handler.h>
+
+#define gpio_pint_regs bfin_pint_regs
+#define adi_internal_set_wake bfin_internal_set_wake
+
+#define peripheral_request(per, label) 0
+#define peripheral_free(per)
+#define peripheral_request_list(per, label) \
+       (pdev ? (IS_ERR(devm_pinctrl_get_select_default(&pdev->dev)) \
+       ? -EINVAL : 0) : 0)
+#define peripheral_free_list(per)
+#else
 int peripheral_request(unsigned short per, const char *label);
 void peripheral_free(unsigned short per);
 int peripheral_request_list(const unsigned short per[], const char *label);
 void peripheral_free_list(const unsigned short per[]);
+#endif
 
-#include <asm/gpio.h>
+#include <linux/err.h>
+#include <linux/pinctrl/pinctrl.h>
 #include <mach/portmux.h>
+#include <linux/gpio.h>
 
 #ifndef P_SPORT2_TFS
 #define P_SPORT2_TFS P_UNDEF
index e22246202730b26e11f39910f4d387ab67c88c74..d9f8632d7d09dea4f4daaaae11910ba50f30a38a 100644 (file)
@@ -7,8 +7,6 @@
 #ifndef _MACH_PORTMUX_H_
 #define _MACH_PORTMUX_H_
 
-#define MAX_RESOURCES  MAX_BLACKFIN_GPIOS
-
 #define P_SPORT2_TFS   (P_DEFINED | P_IDENT(GPIO_PA0) | P_FUNCT(0))
 #define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PA1) | P_FUNCT(0))
 #define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PA2) | P_FUNCT(0))
index 2e1a51c2509829ac293d1df6ffe0d09a9f11e458..fe34191eef0bb00cfac8c9c9338144eb5bdbc804 100644 (file)
@@ -7,8 +7,6 @@
 #ifndef _MACH_PORTMUX_H_
 #define _MACH_PORTMUX_H_
 
-#define MAX_RESOURCES  MAX_BLACKFIN_GPIOS
-
 /* EMAC RMII Port Mux */
 #define P_MII0_MDC     (P_DEFINED | P_IDENT(GPIO_PC6) | P_FUNCT(0))
 #define P_MII0_MDIO    (P_DEFINED | P_IDENT(GPIO_PC7) | P_FUNCT(0))