ARM: AT91: update gpio implementation
Subsystems (9)
v3 cover ARM: AT91: update gpio implementation
HI,
Today on at91 we use gpio != 0 as non valid gpio instead of the -EINVAL as define on the gpiolib so we can not use gpio_is_valid to check if a gpio is valid
This patch series update the GPIO base addr to besoc independant and the gpio implemetation to start the first gpio as 0 and set -EINVAL for a non valid gpio
So we will be complatible with the other implemenation as the AVR32
we also update all the drivers
v3:
update against at91-next which contains Thomas Petazzoni USB support overcurrent notification
Best Regards,
J.
PATCH v3 1/11 ARM: at91/gpio: make gpio register base soc independant
--- arch/arm/mach-at91/at91cap9.c | 8 ++++---- arch/arm/mach-at91/at91rm9200.c | 8 ++++---- arch/arm/mach-at91/at91sam9260.c | 6 +++--- arch/arm/mach-at91/at91sam9261.c | 6 +++--- arch/arm/mach-at91/at91sam9263.c | 10 +++++----- arch/arm/mach-at91/at91sam9g45.c | 10 +++++----- arch/arm/mach-at91/at91sam9rl.c | 8 ++++---- arch/arm/mach-at91/generic.h | 2 +- arch/arm/mach-at91/gpio.c | 8 ++++++-- arch/arm/mach-at91/include/mach/at91cap9.h | 9 +++++---- arch/arm/mach-at91/include/mach/at91rm9200.h | 9 +++++---- arch/arm/mach-at91/include/mach/at91sam9260.h | 7 ++++--- arch/arm/mach-at91/include/mach/at91sam9261.h | 7 ++++--- arch/arm/mach-at91/include/mach/at91sam9263.h | 11 ++++++----- arch/arm/mach-at91/include/mach/at91sam9g45.h | 11 ++++++----- arch/arm/mach-at91/include/mach/at91sam9rl.h | 9 +++++---- 16 files changed, 70 insertions(+), 59 deletions(-)
arch/arm/mach-at91/at91cap9.c +4 -4
@@ -296,19 +296,19 @@ void __init at91cap9_set_console_clock(int id)static struct at91_gpio_bank at91cap9_gpio[] = { { .id =AT91CAP9_ID_PIOABCD , - .offset =AT91_PIOA , + .regbase =AT91CAP9_BASE_PIOA , .clock = &pioABCD_clk, }, { .id =AT91CAP9_ID_PIOABCD , - .offset =AT91_PIOB , + .regbase =AT91CAP9_BASE_PIOB , .clock = &pioABCD_clk, }, { .id =AT91CAP9_ID_PIOABCD , - .offset =AT91_PIOC , + .regbase =AT91CAP9_BASE_PIOC , .clock = &pioABCD_clk, }, { .id =AT91CAP9_ID_PIOABCD , - .offset =AT91_PIOD , + .regbase =AT91CAP9_BASE_PIOD , .clock = &pioABCD_clk, } };
arch/arm/mach-at91/at91rm9200.c +4 -4
@@ -271,19 +271,19 @@ void __init at91rm9200_set_console_clock(int id)static struct at91_gpio_bank at91rm9200_gpio[] = { { .id =AT91RM9200_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91RM9200_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91RM9200_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91RM9200_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91RM9200_ID_PIOC , - .offset =AT91_PIOC , + .regbase =AT91RM9200_BASE_PIOC , .clock = &pioC_clk, }, { .id =AT91RM9200_ID_PIOD , - .offset =AT91_PIOD , + .regbase =AT91RM9200_BASE_PIOD , .clock = &pioD_clk, } };
arch/arm/mach-at91/at91sam9260.c +3 -3
@@ -265,15 +265,15 @@ void __init at91sam9260_set_console_clock(int id)static struct at91_gpio_bank at91sam9260_gpio[] = { { .id =AT91SAM9260_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91SAM9260_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91SAM9260_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91SAM9260_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91SAM9260_ID_PIOC , - .offset =AT91_PIOC , + .regbase =AT91SAM9260_BASE_PIOC , .clock = &pioC_clk, } };
arch/arm/mach-at91/at91sam9261.c +3 -3
@@ -254,15 +254,15 @@ void __init at91sam9261_set_console_clock(int id)static struct at91_gpio_bank at91sam9261_gpio[] = { { .id =AT91SAM9261_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91SAM9261_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91SAM9261_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91SAM9261_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91SAM9261_ID_PIOC , - .offset =AT91_PIOC , + .regbase =AT91SAM9261_BASE_PIOC , .clock = &pioC_clk, } };
arch/arm/mach-at91/at91sam9263.c +5 -5
@@ -266,23 +266,23 @@ void __init at91sam9263_set_console_clock(int id)static struct at91_gpio_bank at91sam9263_gpio[] = { { .id =AT91SAM9263_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91SAM9263_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91SAM9263_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91SAM9263_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91SAM9263_ID_PIOCDE , - .offset =AT91_PIOC , + .regbase =AT91SAM9263_BASE_PIOC , .clock = &pioCDE_clk, }, { .id =AT91SAM9263_ID_PIOCDE , - .offset =AT91_PIOD , + .regbase =AT91SAM9263_BASE_PIOD , .clock = &pioCDE_clk, }, { .id =AT91SAM9263_ID_PIOCDE , - .offset =AT91_PIOE , + .regbase =AT91SAM9263_BASE_PIOE , .clock = &pioCDE_clk, } };
arch/arm/mach-at91/at91sam9g45.c +5 -5
@@ -282,23 +282,23 @@ void __init at91sam9g45_set_console_clock(int id)static struct at91_gpio_bank at91sam9g45_gpio[] = { { .id =AT91SAM9G45_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91SAM9G45_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91SAM9G45_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91SAM9G45_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91SAM9G45_ID_PIOC , - .offset =AT91_PIOC , + .regbase =AT91SAM9G45_BASE_PIOC , .clock = &pioC_clk, }, { .id =AT91SAM9G45_ID_PIODE , - .offset =AT91_PIOD , + .regbase =AT91SAM9G45_BASE_PIOD , .clock = &pioDE_clk, }, { .id =AT91SAM9G45_ID_PIODE , - .offset =AT91_PIOE , + .regbase =AT91SAM9G45_BASE_PIOE , .clock = &pioDE_clk, } };
arch/arm/mach-at91/at91sam9rl.c +4 -4
@@ -246,19 +246,19 @@ void __init at91sam9rl_set_console_clock(int id)static struct at91_gpio_bank at91sam9rl_gpio[] = { { .id =AT91SAM9RL_ID_PIOA , - .offset =AT91_PIOA , + .regbase =AT91SAM9RL_BASE_PIOA , .clock = &pioA_clk, }, { .id =AT91SAM9RL_ID_PIOB , - .offset =AT91_PIOB , + .regbase =AT91SAM9RL_BASE_PIOB , .clock = &pioB_clk, }, { .id =AT91SAM9RL_ID_PIOC , - .offset =AT91_PIOC , + .regbase =AT91SAM9RL_BASE_PIOC , .clock = &pioC_clk, }, { .id =AT91SAM9RL_ID_PIOD , - .offset =AT91_PIOD , + .regbase =AT91SAM9RL_BASE_PIOD , .clock = &pioD_clk, } };
arch/arm/mach-at91/generic.h +1 -1
@@ -65,7 +65,7 @@ extern void at91sam9_alt_reset(void);struct at91_gpio_bank {unsigned short id;/* peripheral ID */ -unsigned long offset;/* offset from system peripheral base */ +unsigned long regbase;/* offset from system peripheral base */ struct clk *clock;/* associated clock */ };extern void __init at91_gpio_init (struct at91_gpio_bank *,int nr_banks);
arch/arm/mach-at91/gpio.c +6 -2
@@ -616,8 +616,12 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) at91_gpio->bank = &data[i]; at91_gpio->chip.base =PIN_BASE + i *32 ; - at91_gpio->regbase = at91_gpio->bank->offset + - (void __iomem *)AT91_VA_BASE_SYS ; + + at91_gpio->regbase =ioremap (at91_gpio->bank->regbase,512 ); +if (!at91_gpio->regbase) { +pr_err ("at91_gpio.%d, failed to map registers, ignoring.\n" , i); +continue ; + }/* enable PIO controller's clock */ clk_enable (at91_gpio->bank->clock);
arch/arm/mach-at91/include/mach/at91cap9.h +5 -4
@@ -88,10 +88,6 @@#define AT91_DMA (0xffffec00 - AT91_BASE_SYS)#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOD (0xfffff800 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -102,6 +98,11 @@ (0xfffffd50 - AT91_BASE_SYS) : \ (0xfffffd60 - AT91_BASE_SYS)) +#define AT91CAP9_BASE_PIOA 0xfffff200 +#define AT91CAP9_BASE_PIOB 0xfffff400 +#define AT91CAP9_BASE_PIOC 0xfffff600 +#define AT91CAP9_BASE_PIOD 0xfffff800 +#define AT91_USART0 AT91CAP9_BASE_US0#define AT91_USART1 AT91CAP9_BASE_US1#define AT91_USART2 AT91CAP9_BASE_US2
arch/arm/mach-at91/include/mach/at91rm9200.h +5 -4
@@ -81,15 +81,16 @@*/ #define AT91_AIC (0xfffff000 - AT91_BASE_SYS)/* Advanced Interrupt Controller */ #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)/* Debug Unit */ -#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS)/* PIO Controller A */ -#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS)/* PIO Controller B */ -#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)/* PIO Controller C */ -#define AT91_PIOD (0xfffffa00 - AT91_BASE_SYS)/* PIO Controller D */ #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)/* Power Management Controller */ #define AT91_ST (0xfffffd00 - AT91_BASE_SYS)/* System Timer */ #define AT91_RTC (0xfffffe00 - AT91_BASE_SYS)/* Real-Time Clock */ #define AT91_MC (0xffffff00 - AT91_BASE_SYS)/* Memory Controllers */ +#define AT91RM9200_BASE_PIOA 0xfffff400/* PIO Controller A */ +#define AT91RM9200_BASE_PIOB 0xfffff600/* PIO Controller B */ +#define AT91RM9200_BASE_PIOC 0xfffff800/* PIO Controller C */ +#define AT91RM9200_BASE_PIOD 0xfffffa00/* PIO Controller D */ +#define AT91_USART0 AT91RM9200_BASE_US0#define AT91_USART1 AT91RM9200_BASE_US1#define AT91_USART2 AT91RM9200_BASE_US2
arch/arm/mach-at91/include/mach/at91sam9260.h +4 -3
@@ -87,9 +87,6 @@#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -98,6 +95,10 @@#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) +#define AT91SAM9260_BASE_PIOA 0xfffff400 +#define AT91SAM9260_BASE_PIOB 0xfffff600 +#define AT91SAM9260_BASE_PIOC 0xfffff800 +#define AT91_USART0 AT91SAM9260_BASE_US0#define AT91_USART1 AT91SAM9260_BASE_US1#define AT91_USART2 AT91SAM9260_BASE_US2
arch/arm/mach-at91/include/mach/at91sam9261.h +4 -3
@@ -70,9 +70,6 @@#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -81,6 +78,10 @@#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) +#define AT91SAM9261_BASE_PIOA 0xfffff400 +#define AT91SAM9261_BASE_PIOB 0xfffff600 +#define AT91SAM9261_BASE_PIOC 0xfffff800 +#define AT91_USART0 AT91SAM9261_BASE_US0#define AT91_USART1 AT91SAM9261_BASE_US1#define AT91_USART2 AT91SAM9261_BASE_US2
arch/arm/mach-at91/include/mach/at91sam9263.h +6 -5
@@ -84,11 +84,6 @@#define AT91_CCFG (0xffffed10 - AT91_BASE_SYS)#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) -#define AT91_PIOE (0xfffffa00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -98,6 +93,12 @@#define AT91_RTT1 (0xfffffd50 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) +#define AT91SAM9263_BASE_PIOA 0xfffff200 +#define AT91SAM9263_BASE_PIOB 0xfffff400 +#define AT91SAM9263_BASE_PIOC 0xfffff600 +#define AT91SAM9263_BASE_PIOD 0xfffff800 +#define AT91SAM9263_BASE_PIOE 0xfffffa00 +#define AT91_USART0 AT91SAM9263_BASE_US0#define AT91_USART1 AT91SAM9263_BASE_US1#define AT91_USART2 AT91SAM9263_BASE_US2
arch/arm/mach-at91/include/mach/at91sam9g45.h +6 -5
@@ -94,11 +94,6 @@#define AT91_DMA (0xffffec00 - AT91_BASE_SYS)#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) -#define AT91_PIOE (0xfffffa00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -108,6 +103,12 @@#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)#define AT91_RTC (0xfffffdb0 - AT91_BASE_SYS) +#define AT91SAM9G45_BASE_PIOA 0xfffff200 +#define AT91SAM9G45_BASE_PIOB 0xfffff400 +#define AT91SAM9G45_BASE_PIOC 0xfffff600 +#define AT91SAM9G45_BASE_PIOD 0xfffff800 +#define AT91SAM9G45_BASE_PIOE 0xfffffa00 +#define AT91_USART0 AT91SAM9G45_BASE_US0#define AT91_USART1 AT91SAM9G45_BASE_US1#define AT91_USART2 AT91SAM9G45_BASE_US2
arch/arm/mach-at91/include/mach/at91sam9rl.h +5 -4
@@ -77,10 +77,6 @@#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) -#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS) -#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS) -#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS) -#define AT91_PIOD (0xfffffa00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS)
@@ -91,6 +87,11 @@#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)#define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) +#define AT91SAM9RL_BASE_PIOA 0xfffff400 +#define AT91SAM9RL_BASE_PIOB 0xfffff600 +#define AT91SAM9RL_BASE_PIOC 0xfffff800 +#define AT91SAM9RL_BASE_PIOD 0xfffffa00 +#define AT91_USART0 AT91SAM9RL_BASE_US0#define AT91_USART1 AT91SAM9RL_BASE_US1#define AT91_USART2 AT91SAM9RL_BASE_US2
Signature · 1 line
1.7.7
PATCH v3 2/11 ARM: at91/boards: use -EINVAL for invalid gpio
In reply to Jean-Christophe PLAGNIOL-VILLARDthis will allow to use gpio_is_valid
--- arch/arm/mach-at91/board-1arm.c | 1 + arch/arm/mach-at91/board-afeb-9260v1.c | 7 ++++++- arch/arm/mach-at91/board-cam60.c | 3 ++- arch/arm/mach-at91/board-cap9adk.c | 14 ++++++++------ arch/arm/mach-at91/board-carmeva.c | 6 ++++-- arch/arm/mach-at91/board-cpu9krea.c | 7 ++++++- arch/arm/mach-at91/board-cpuat91.c | 4 ++++ arch/arm/mach-at91/board-csb337.c | 4 +++- arch/arm/mach-at91/board-csb637.c | 1 + arch/arm/mach-at91/board-eb9200.c | 8 ++++++-- arch/arm/mach-at91/board-ecbat91.c | 4 ++++ arch/arm/mach-at91/board-eco920.c | 4 ++++ arch/arm/mach-at91/board-flexibity.c | 4 +++- arch/arm/mach-at91/board-foxg20.c | 6 +++++- arch/arm/mach-at91/board-gsia18s.c | 4 +++- arch/arm/mach-at91/board-kafa.c | 1 + arch/arm/mach-at91/board-kb9202.c | 5 ++++- arch/arm/mach-at91/board-neocore926.c | 4 +++- arch/arm/mach-at91/board-pcontrol-g20.c | 1 + arch/arm/mach-at91/board-picotux200.c | 2 ++ arch/arm/mach-at91/board-qil-a9260.c | 11 ++++++----- arch/arm/mach-at91/board-rm9200dk.c | 10 +++++++--- arch/arm/mach-at91/board-rm9200ek.c | 2 ++ arch/arm/mach-at91/board-sam9-l9260.c | 7 ++++--- arch/arm/mach-at91/board-sam9260ek.c | 11 ++++++----- arch/arm/mach-at91/board-sam9261ek.c | 8 ++++++-- arch/arm/mach-at91/board-sam9263ek.c | 7 ++++--- arch/arm/mach-at91/board-sam9g20ek.c | 8 +++++++- arch/arm/mach-at91/board-sam9m10g45ek.c | 3 +++ arch/arm/mach-at91/board-sam9rlek.c | 7 ++++--- arch/arm/mach-at91/board-snapper9260.c | 5 +++++ arch/arm/mach-at91/board-stamp9g20.c | 11 +++++++++-- arch/arm/mach-at91/board-usb-a926x.c | 5 +++-- arch/arm/mach-at91/board-yl-9200.c | 6 ++++-- 34 files changed, 141 insertions(+), 50 deletions(-)
arch/arm/mach-at91/board-1arm.c +1 -0
@@ -70,6 +70,7 @@ static struct at91_eth_data __initdata onearm_eth_data = {static struct at91_usbh_data __initdata onearm_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata onearm_udc_data = {
arch/arm/mach-at91/board-afeb-9260v1.c +6 -1
@@ -75,6 +75,7 @@ static void __init afeb9260_init_early(void)*/ static struct at91_usbh_data __initdata afeb9260_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -82,7 +83,7 @@ static struct at91_usbh_data __initdata afeb9260_usbh_data = {*/ static struct at91_udc_data __initdata afeb9260_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -143,6 +144,7 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = { .enable_pin = AT91_PIN_PC14, .partition_info = nand_partitions, .bus_width_16 = 0, + .det_pin = -EINVAL, };
@@ -154,6 +156,7 @@ static struct at91_mmc_data __initdata afeb9260_mmc_data = { .wp_pin = AT91_PIN_PC4, .slot_b = 1, .wire4 = 1, + .vcc_pin = -EINVAL, };
@@ -174,6 +177,8 @@ static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {static struct at91_cf_data afeb9260_cf_data = { .chipselect =4 , .irq_pin =AT91_PIN_PA6 , + .det_pin = -EINVAL , + .vcc_pin = -EINVAL , .rst_pin =AT91_PIN_PA7 , .flags =AT91_CF_TRUE_IDE , };
arch/arm/mach-at91/board-cam60.c +2 -1
@@ -62,6 +62,7 @@ static void __init cam60_init_early(void)*/ static struct at91_usbh_data __initdata cam60_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };
@@ -141,7 +142,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata cam60_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not there + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PA9 , .enable_pin =AT91_PIN_PA7 , .partition_info = nand_partitions,
arch/arm/mach-at91/board-cap9adk.c +8 -6
@@ -70,6 +70,7 @@ static void __init cap9adk_init_early(void)*/ static struct at91_usbh_data __initdata cap9adk_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -144,9 +145,9 @@ static struct spi_board_info cap9adk_spi_devices[] = {*/ static struct at91_mmc_data __initdata cap9adk_mmc_data = { .wire4 =1 , -// .det_pin = ... not connected -// .wp_pin = ... not connected -// .vcc_pin = ... not connected + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };
@@ -154,6 +155,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = {* MACB Ethernet device */ static struct at91_eth_data __initdata cap9adk_macb_data = { + .phy_irq_pin = -EINVAL , .is_rmii =1 , };
@@ -178,8 +180,8 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata cap9adk_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected -// .rdy_pin = ... not connected + .det_pin = -EINVAL , + .rdy_pin = -EINVAL , .enable_pin =AT91_PIN_PD15 , .partition_info = nand_partitions, };
@@ -356,7 +358,7 @@ static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data;* AC97 */ static struct ac97c_platform_data cap9adk_ac97_data = { -// .reset_pin = ... not connected + .reset_pin = -EINVAL , };
arch/arm/mach-at91/board-carmeva.c +4 -2
@@ -64,6 +64,7 @@ static struct at91_eth_data __initdata carmeva_eth_data = {static struct at91_usbh_data __initdata carmeva_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata carmeva_udc_data = {
@@ -75,8 +76,8 @@ static struct at91_udc_data __initdata carmeva_udc_data = {// static struct at91_cf_data __initdata carmeva_cf_data = { // .det_pin = AT91_PIN_PB0, // .rst_pin = AT91_PIN_PC5, -// .irq_pin = ... not connected -// .vcc_pin = ... always powered +// .irq_pin = -EINVAL, +// .vcc_pin = -EINVAL, // }; static struct at91_mmc_data __initdata carmeva_mmc_data = {
@@ -84,6 +85,7 @@ static struct at91_mmc_data __initdata carmeva_mmc_data = { .wire4 = 1, .det_pin = AT91_PIN_PB10, .wp_pin = AT91_PIN_PC14, + .vcc_pin = -EINVAL, };static struct spi_board_info carmeva_spi_devices[] = {
arch/arm/mach-at91/board-cpu9krea.c +6 -1
@@ -86,6 +86,7 @@ static void __init cpu9krea_init_early(void)*/ static struct at91_usbh_data __initdata cpu9krea_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -93,13 +94,14 @@ static struct at91_usbh_data __initdata cpu9krea_usbh_data = {*/ static struct at91_udc_data __initdata cpu9krea_udc_data = { .vbus_pin =AT91_PIN_PC8 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };/* * MACB Ethernet device */ static struct at91_eth_data __initdata cpu9krea_macb_data = { + .phy_irq_pin = -EINVAL , .is_rmii =1 , };
@@ -112,6 +114,7 @@ static struct atmel_nand_data __initdata cpu9krea_nand_data = { .rdy_pin = AT91_PIN_PC13, .enable_pin = AT91_PIN_PC14, .bus_width_16 = 0, + .det_pin = -EINVAL, };#ifdef CONFIG_MACH_CPU9260
@@ -337,6 +340,8 @@ static struct at91_mmc_data __initdata cpu9krea_mmc_data = { .slot_b = 0, .wire4 = 1, .det_pin = AT91_PIN_PA29, + .wp_pin = -EINVAL, + .vcc_pin = -EINVAL, };static void __init cpu9krea_board_init (void )
arch/arm/mach-at91/board-cpuat91.c +4 -0
@@ -83,11 +83,13 @@ static void __init cpuat91_init_early(void) }static struct at91_eth_data __initdata cpuat91_eth_data = { + .phy_irq_pin = -EINVAL , .is_rmii =1 , };static struct at91_usbh_data __initdata cpuat91_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata cpuat91_udc_data = {
@@ -98,6 +100,8 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {static struct at91_mmc_data __initdata cpuat91_mmc_data = { .det_pin =AT91_PIN_PC2 , .wire4 =1 , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };static struct physmap_flash_data cpuat91_flash_data = {
arch/arm/mach-at91/board-csb337.c +3 -1
@@ -65,11 +65,12 @@ static struct at91_eth_data __initdata csb337_eth_data = {static struct at91_usbh_data __initdata csb337_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata csb337_udc_data = { -// this has no VBUS sensing pin .pullup_pin =AT91_PIN_PA24 , + .vbus_pin = -EINVAL , };static struct i2c_board_info __initdata csb337_i2c_devices[] = {
@@ -98,6 +99,7 @@ static struct at91_mmc_data __initdata csb337_mmc_data = { .slot_b = 0, .wire4 = 1, .wp_pin = AT91_PIN_PD6, + .vcc_pin = -EINVAL, };static struct spi_board_info csb337_spi_devices[] = {
arch/arm/mach-at91/board-csb637.c +1 -0
@@ -59,6 +59,7 @@ static struct at91_eth_data __initdata csb637_eth_data = {static struct at91_usbh_data __initdata csb637_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata csb637_udc_data = {
arch/arm/mach-at91/board-eb9200.c +6 -2
@@ -67,6 +67,7 @@ static struct at91_eth_data __initdata eb9200_eth_data = {static struct at91_usbh_data __initdata eb9200_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata eb9200_udc_data = {
@@ -75,15 +76,18 @@ static struct at91_udc_data __initdata eb9200_udc_data = { };static struct at91_cf_data __initdata eb9200_cf_data = { + .irq_pin = -EINVAL , .det_pin =AT91_PIN_PB0 , + .vcc_pin = -EINVAL , .rst_pin =AT91_PIN_PC5 , -// .irq_pin = ... not connected -// .vcc_pin = ... always powered };static struct at91_mmc_data __initdata eb9200_mmc_data = { .slot_b =0 , .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
arch/arm/mach-at91/board-ecbat91.c +4 -0
@@ -71,11 +71,15 @@ static struct at91_eth_data __initdata ecb_at91eth_data = {static struct at91_usbh_data __initdata ecb_at91usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_mmc_data __initdata ecb_at91mmc_data = { .slot_b =0 , .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };
arch/arm/mach-at91/board-eco920.c +4 -0
@@ -54,6 +54,7 @@ static struct at91_eth_data __initdata eco920_eth_data = {static struct at91_usbh_data __initdata eco920_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata eco920_udc_data = {
@@ -64,6 +65,9 @@ static struct at91_udc_data __initdata eco920_udc_data = {static struct at91_mmc_data __initdata eco920_mmc_data = { .slot_b =0 , .wire4 =0 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };static struct physmap_flash_data eco920_flash_data = {
arch/arm/mach-at91/board-flexibity.c +3 -1
@@ -52,12 +52,13 @@ static void __init flexibity_init_early(void)/* USB Host port */ static struct at91_usbh_data __initdata flexibity_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/* USB Device port */ static struct at91_udc_data __initdata flexibity_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };/* SPI devices */
@@ -76,6 +77,7 @@ static struct at91_mmc_data __initdata flexibity_mmc_data = { .wire4 = 1, .det_pin = AT91_PIN_PC9, .wp_pin = AT91_PIN_PC4, + .vcc_pin = -EINVAL, };/* LEDs */
arch/arm/mach-at91/board-foxg20.c +5 -1
@@ -106,6 +106,7 @@ static void __init foxg20_init_early(void)*/ static struct at91_usbh_data __initdata foxg20_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -113,7 +114,7 @@ static struct at91_usbh_data __initdata foxg20_usbh_data = {*/ static struct at91_udc_data __initdata foxg20_udc_data = { .vbus_pin =AT91_PIN_PC6 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -147,6 +148,9 @@ static struct at91_eth_data __initdata foxg20_macb_data = {static struct at91_mmc_data __initdata foxg20_mmc_data = { .slot_b =1 , .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };
arch/arm/mach-at91/board-gsia18s.c +3 -1
@@ -80,6 +80,7 @@ static void __init gsia18s_init_early(void)*/ static struct at91_usbh_data __initdata usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -87,7 +88,7 @@ static struct at91_usbh_data __initdata usbh_data = {*/ static struct at91_udc_data __initdata udc_data = { .vbus_pin =AT91_PIN_PA22 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };/*
@@ -530,6 +531,7 @@ static struct i2c_board_info __initdata gsia18s_i2c_devices[] = {static struct at91_cf_data __initdata gsia18s_cf1_data = { .irq_pin =AT91_PIN_PA27 , .det_pin =AT91_PIN_PB30 , + .vcc_pin = -EINVAL , .rst_pin =AT91_PIN_PB31 , .chipselect =5 , .flags =AT91_CF_TRUE_IDE ,
arch/arm/mach-at91/board-kafa.c +1 -0
@@ -68,6 +68,7 @@ static struct at91_eth_data __initdata kafa_eth_data = {static struct at91_usbh_data __initdata kafa_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata kafa_udc_data = {
arch/arm/mach-at91/board-kb9202.c +4 -1
@@ -76,6 +76,7 @@ static struct at91_eth_data __initdata kb9202_eth_data = {static struct at91_usbh_data __initdata kb9202_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata kb9202_udc_data = {
@@ -87,6 +88,8 @@ static struct at91_mmc_data __initdata kb9202_mmc_data = { .det_pin = AT91_PIN_PB2, .slot_b = 0, .wire4 = 1, + .wp_pin = -EINVAL, + .vcc_pin = -EINVAL, };static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -106,7 +109,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata kb9202_nand_data = { .ale =22 , .cle =21 , -// .det_pin = ... not there + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC29 , .enable_pin =AT91_PIN_PC28 , .partition_info = nand_partitions,
arch/arm/mach-at91/board-neocore926.c +3 -1
@@ -79,7 +79,7 @@ static struct at91_usbh_data __initdata neocore926_usbh_data = {*/ static struct at91_udc_data __initdata neocore926_udc_data = { .vbus_pin =AT91_PIN_PA25 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -149,6 +149,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = { .wire4 = 1, .det_pin = AT91_PIN_PE18, .wp_pin = AT91_PIN_PE19, + .vcc_pin = -EINVAL, };
@@ -195,6 +196,7 @@ static struct atmel_nand_data __initdata neocore926_nand_data = { .rdy_pin_active_low = 1, .enable_pin = AT91_PIN_PD15, .partition_info = nand_partitions, + .det_pin = -EINVAL, };static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
arch/arm/mach-at91/board-pcontrol-g20.c +1 -0
@@ -107,6 +107,7 @@ static void __init add_device_pcontrol(void)*/ static struct at91_usbh_data __initdata usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };
arch/arm/mach-at91/board-picotux200.c +2 -0
@@ -67,6 +67,7 @@ static struct at91_eth_data __initdata picotux200_eth_data = {static struct at91_usbh_data __initdata picotux200_usbh_data = { .ports =1 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_mmc_data __initdata picotux200_mmc_data = {
@@ -74,6 +75,7 @@ static struct at91_mmc_data __initdata picotux200_mmc_data = { .slot_b = 0, .wire4 = 1, .wp_pin = AT91_PIN_PA17, + .vcc_pin = -EINVAL, };#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
arch/arm/mach-at91/board-qil-a9260.c +6 -5
@@ -77,6 +77,7 @@ static void __init ek_init_early(void)*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -84,7 +85,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };/*
@@ -139,7 +140,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC13 , .enable_pin =AT91_PIN_PC14 , .partition_info = nand_partitions,
@@ -177,9 +178,9 @@ static void __init ek_add_device_nand(void)static struct at91_mmc_data __initdata ek_mmc_data = { .slot_b =0 , .wire4 =1 , -// .det_pin = ... not connected -// .wp_pin = ... not connected -// .vcc_pin = ... not connected + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };/*
arch/arm/mach-at91/board-rm9200dk.c +7 -3
@@ -72,6 +72,7 @@ static struct at91_eth_data __initdata dk_eth_data = {static struct at91_usbh_data __initdata dk_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata dk_udc_data = {
@@ -80,16 +81,19 @@ static struct at91_udc_data __initdata dk_udc_data = { };static struct at91_cf_data __initdata dk_cf_data = { + .irq_pin = -EINVAL , .det_pin =AT91_PIN_PB0 , + .vcc_pin = -EINVAL , .rst_pin =AT91_PIN_PC5 , -// .irq_pin = ... not connected -// .vcc_pin = ... always powered };#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD static struct at91_mmc_data __initdata dk_mmc_data = { .slot_b =0 , .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };#endif
@@ -149,7 +153,7 @@ static struct atmel_nand_data __initdata dk_nand_data = { .cle = 21, .det_pin = AT91_PIN_PB1, .rdy_pin = AT91_PIN_PC2, - // .enable_pin = ... not there + .enable_pin = -EINVAL, .partition_info = nand_partitions, };
arch/arm/mach-at91/board-rm9200ek.c +2 -0
@@ -72,6 +72,7 @@ static struct at91_eth_data __initdata ek_eth_data = {static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata ek_udc_data = {
@@ -85,6 +86,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = { .slot_b = 0, .wire4 = 1, .wp_pin = AT91_PIN_PA17, + .vcc_pin = -EINVAL, };#endif
arch/arm/mach-at91/board-sam9-l9260.c +4 -3
@@ -72,6 +72,7 @@ static void __init ek_init_early(void)*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -79,7 +80,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -140,7 +141,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC13 , .enable_pin =AT91_PIN_PC14 , .partition_info = nand_partitions,
@@ -181,7 +182,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = { .wire4 = 1, .det_pin = AT91_PIN_PC8, .wp_pin = AT91_PIN_PC4, -// .vcc_pin = ... not connected + .vcc_pin = -EINVAL, };static void __init ek_board_init (void )
arch/arm/mach-at91/board-sam9260ek.c +6 -5
@@ -75,6 +75,7 @@ static void __init ek_init_early(void)*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -82,7 +83,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -182,7 +183,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC13 , .enable_pin =AT91_PIN_PC14 , .partition_info = nand_partitions,
@@ -228,9 +229,9 @@ static void __init ek_add_device_nand(void)static struct at91_mmc_data __initdata ek_mmc_data = { .slot_b =1 , .wire4 =1 , -// .det_pin = ... not connected -// .wp_pin = ... not connected -// .vcc_pin = ... not connected + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };
arch/arm/mach-at91/board-sam9261ek.c +6 -2
@@ -151,6 +151,7 @@ static void __init ek_add_device_dm9000(void) {}*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };
@@ -159,7 +160,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PB29 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -188,7 +189,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =22 , .cle =21 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC15 , .enable_pin =AT91_PIN_PC14 , .partition_info = nand_partitions,
@@ -350,6 +351,9 @@ static struct spi_board_info ek_spi_devices[] = {*/ static struct at91_mmc_data __initdata ek_mmc_data = { .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };#endif /* CONFIG_SPI_ATMEL_* */
arch/arm/mach-at91/board-sam9263ek.c +4 -3
@@ -81,7 +81,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PA25 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -151,7 +151,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = { .wire4 = 1, .det_pin = AT91_PIN_PE18, .wp_pin = AT91_PIN_PE19, -// .vcc_pin = ... not connected + .vcc_pin = -EINVAL, };
@@ -189,7 +189,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PA22 , .enable_pin =AT91_PIN_PD15 , .partition_info = nand_partitions,
@@ -358,6 +358,7 @@ static void __init ek_add_device_buttons(void) {}* reset_pin is not connected: NRST */ static struct ac97c_platform_data ek_ac97_data = { + .reset_pin = -EINVAL , };
arch/arm/mach-at91/board-sam9g20ek.c +7 -1
@@ -86,6 +86,7 @@ static void __init ek_init_early(void)*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -93,7 +94,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PC5 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
@@ -170,6 +171,7 @@ static struct atmel_nand_data __initdata ek_nand_data = { .rdy_pin = AT91_PIN_PC13, .enable_pin = AT91_PIN_PC14, .partition_info = nand_partitions, + .det_pin = -EINVAL, };static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -215,6 +217,7 @@ static struct mci_platform_data __initdata ek_mmc_data = { .slot[1] = { .bus_width = 4, .detect_pin = AT91_PIN_PC9, + .wp_pin = -EINVAL, }, };
@@ -223,6 +226,8 @@ static struct at91_mmc_data __initdata ek_mmc_data = { .slot_b = 1, /* Only one slot so use slot B */ .wire4 = 1, .det_pin = AT91_PIN_PC9, + .wp_pin = -EINVAL, + .vcc_pin = -EINVAL, };#endif
@@ -232,6 +237,7 @@ static void __init ek_add_device_mmc(void) if (ek_have_2mmc()) { ek_mmc_data.slot[0].bus_width = 4; ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; + ek_mmc_data.slot[0].wp_pin = -EINVAL, } at91_add_device_mci(0, &ek_mmc_data); #else
arch/arm/mach-at91/board-sam9m10g45ek.c +3 -0
@@ -100,6 +100,7 @@ static struct mci_platform_data __initdata mci0_data = { .slot[0] = { .bus_width = 4, .detect_pin = AT91_PIN_PD10, + .wp_pin = -EINVAL, }, };
@@ -150,6 +151,7 @@ static struct atmel_nand_data __initdata ek_nand_data = { .rdy_pin = AT91_PIN_PC8, .enable_pin = AT91_PIN_PC14, .partition_info = nand_partitions, + .det_pin = -EINVAL, };static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -335,6 +337,7 @@ static void __init ek_add_device_buttons(void) {}* reset_pin is not connected: NRST */ static struct ac97c_platform_data ek_ac97_data = { + .reset_pin = -EINVAL , };
arch/arm/mach-at91/board-sam9rlek.c +4 -3
@@ -67,8 +67,8 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {static struct at91_mmc_data __initdata ek_mmc_data = { .wire4 =1 , .det_pin =AT91_PIN_PA15 , -// .wp_pin = ... not connected -// .vcc_pin = ... not connected + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };
@@ -97,7 +97,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PD17 , .enable_pin =AT91_PIN_PB6 , .partition_info = nand_partitions,
@@ -209,6 +209,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data;* reset_pin is not connected: NRST */ static struct ac97c_platform_data ek_ac97_data = { + .reset_pin = -EINVAL , };
arch/arm/mach-at91/board-snapper9260.c +5 -0
@@ -57,15 +57,18 @@ static void __init snapper9260_init_early(void)static struct at91_usbh_data __initdata snapper9260_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };static struct at91_udc_data __initdata snapper9260_udc_data = { .vbus_pin =SNAPPER9260_IO_EXP_GPIO (5 ), .vbus_active_low =1 , .vbus_polled =1 , + .pullup_pin = -EINVAL , };static struct at91_eth_data snapper9260_macb_data = { + .phy_irq_pin = -EINVAL , .is_rmii =1 , };
@@ -110,6 +113,8 @@ static struct atmel_nand_data __initdata snapper9260_nand_data = { .rdy_pin = AT91_PIN_PC13, .partition_info = snapper9260_nand_partition_info, .bus_width_16 = 0, + .enable_pin = -EINVAL, + .det_pin = -EINVAL, };static struct sam9_smc_config __initdata snapper9260_nand_smc_config = {
arch/arm/mach-at91/board-stamp9g20.c +9 -2
@@ -85,6 +85,7 @@ static struct atmel_nand_data __initdata nand_data = { .rdy_pin = AT91_PIN_PC13, .enable_pin = AT91_PIN_PC14, .bus_width_16 = 0, + .det_pin = -EINVAL, };static struct sam9_smc_config __initdata nand_smc_config = {
@@ -122,12 +123,17 @@ static void __init add_device_nand(void)static struct mci_platform_data __initdata mmc_data = { .slot[0 ] = { .bus_width =4 , + .detect_pin = -EINVAL , + .wp_pin = -EINVAL , }, };#else static struct at91_mmc_data __initdata mmc_data = { .slot_b =0 , .wire4 =1 , + .det_pin = -EINVAL , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };#endif
@@ -137,6 +143,7 @@ static struct at91_mmc_data __initdata mmc_data = {*/ static struct at91_usbh_data __initdata usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };
@@ -145,12 +152,12 @@ static struct at91_usbh_data __initdata usbh_data = {*/ static struct at91_udc_data __initdata portuxg20_udc_data = { .vbus_pin =AT91_PIN_PC7 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };static struct at91_udc_data __initdata stamp9g20evb_udc_data = { .vbus_pin =AT91_PIN_PA22 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };
arch/arm/mach-at91/board-usb-a926x.c +3 -2
@@ -66,6 +66,7 @@ static void __init ek_init_early(void)*/ static struct at91_usbh_data __initdata ek_usbh_data = { .ports =2 , + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -73,7 +74,7 @@ static struct at91_usbh_data __initdata ek_usbh_data = {*/ static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin =AT91_PIN_PB11 , - .pullup_pin =0 ,/* pull-up driven by UDC */ + .pullup_pin = -EINVAL ,/* pull-up driven by UDC */ };static void __init ek_add_device_udc (void )
@@ -199,7 +200,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata ek_nand_data = { .ale =21 , .cle =22 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PA22 , .enable_pin =AT91_PIN_PD15 , .partition_info = nand_partitions,
arch/arm/mach-at91/board-yl-9200.c +4 -2
@@ -120,6 +120,7 @@ static struct at91_eth_data __initdata yl9200_eth_data = {*/ static struct at91_usbh_data __initdata yl9200_usbh_data = { .ports =1 ,/* PQFP version of AT91RM9200 */ + .vbus_pin = {-EINVAL , -EINVAL }, };/*
@@ -137,8 +138,9 @@ static struct at91_udc_data __initdata yl9200_udc_data = {*/ static struct at91_mmc_data __initdata yl9200_mmc_data = { .det_pin =AT91_PIN_PB9 , -// .wp_pin = ... not connected .wire4 =1 , + .wp_pin = -EINVAL , + .vcc_pin = -EINVAL , };/*
@@ -181,7 +183,7 @@ static struct mtd_partition * __init nand_partitions(int size, int *num_partitiostatic struct atmel_nand_data __initdata yl9200_nand_data = { .ale =6 , .cle =7 , -// .det_pin = ... not connected + .det_pin = -EINVAL , .rdy_pin =AT91_PIN_PC14 ,/* R/!B (Sheet10) */ .enable_pin =AT91_PIN_PC15 ,/* !CE (Sheet10) */ .partition_info = nand_partitions,
Signature · 1 line
1.7.7
PATCH v3 3/11 ARM: at91/soc: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91cap9_devices.c | 20 ++++++++++---------- arch/arm/mach-at91/at91rm9200_devices.c | 22 +++++++++++----------- arch/arm/mach-at91/at91sam9260_devices.c | 26 +++++++++++++------------- arch/arm/mach-at91/at91sam9261_devices.c | 14 +++++++------- arch/arm/mach-at91/at91sam9263_devices.c | 26 +++++++++++++------------- arch/arm/mach-at91/at91sam9g45_devices.c | 20 ++++++++++---------- arch/arm/mach-at91/at91sam9rl_devices.c | 16 ++++++++-------- 7 files changed, 72 insertions(+), 72 deletions(-)
arch/arm/mach-at91/at91cap9_devices.c +10 -10
@@ -76,7 +76,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)/* Enable VBus control for UHP ports */ for (i =0 ; i < data->ports; i++) { -if (data->vbus_pin[i]) +if (gpio_is_valid (data->vbus_pin[i]))at91_set_gpio_output (data->vbus_pin[i],0 ); }
@@ -179,7 +179,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) usba_udc_data.pdata.num_ep =ARRAY_SIZE (usba_udc_ep);memcpy (usba_udc_data.ep, usba_udc_ep,sizeof (usba_udc_ep)); -if (data && data->vbus_pin >0 ) { +if (data &&gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -232,7 +232,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)if (!data)return ; -if (data->phy_irq_pin) { +if (gpio_is_valid (data->phy_irq_pin)) {at91_set_gpio_input (data->phy_irq_pin,0 );at91_set_deglitch (data->phy_irq_pin,1 ); }
@@ -332,13 +332,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );if (mmc_id ==0 ) {/* MCI0 */
@@ -425,15 +425,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa |AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 ); nand_data = *data;
@@ -807,7 +807,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)at91_set_A_periph (AT91_PIN_PA9 ,0 );/* AC97RX */ /* reset */ -if (data->reset_pin) +if (gpio_is_valid (data->reset_pin))at91_set_gpio_output (data->reset_pin,0 ); ac97_data = *data;
arch/arm/mach-at91/at91rm9200_devices.c +11 -11
@@ -114,11 +114,11 @@ void __init at91_add_device_udc(struct at91_udc_data *data)if (!data)return ; -if (data->vbus_pin) { +if (gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); } -if (data->pullup_pin) +if (gpio_is_valid (data->pullup_pin))at91_set_gpio_output (data->pullup_pin,0 ); udc_data = *data;
@@ -167,7 +167,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)if (!data)return ; -if (data->phy_irq_pin) { +if (gpio_is_valid (data->phy_irq_pin)) {at91_set_gpio_input (data->phy_irq_pin,0 );at91_set_deglitch (data->phy_irq_pin,1 ); }
@@ -260,7 +260,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) );/* input/irq */ -if (data->irq_pin) { +if (gpio_is_valid (data->irq_pin)) {at91_set_gpio_input (data->irq_pin,1 );at91_set_deglitch (data->irq_pin,1 ); }
@@ -268,7 +268,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)at91_set_deglitch (data->det_pin,1 );/* outputs, initially off */ -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );at91_set_gpio_output (data->rst_pin,0 );
@@ -328,13 +328,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );/* CLK */
@@ -419,15 +419,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 );at91_set_A_periph (AT91_PIN_PC1 ,0 );/* SMOE */
arch/arm/mach-at91/at91sam9260_devices.c +13 -13
@@ -115,7 +115,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)if (!data)return ; -if (data->vbus_pin) { +if (gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); }
@@ -168,7 +168,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)if (!data)return ; -if (data->phy_irq_pin) { +if (gpio_is_valid (data->phy_irq_pin)) {at91_set_gpio_input (data->phy_irq_pin,0 );at91_set_deglitch (data->phy_irq_pin,1 ); }
@@ -243,13 +243,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );/* CLK */
@@ -330,11 +330,11 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)for (i =0 ; i <ATMEL_MCI_MAX_NR_SLOTS ; i++) {if (data->slot[i].bus_width) {/* input/irq */ -if (data->slot[i].detect_pin) { +if (gpio_is_valid (data->slot[i].detect_pin)) {at91_set_gpio_input (data->slot[i].detect_pin,1 );at91_set_deglitch (data->slot[i].detect_pin,1 ); } -if (data->slot[i].wp_pin) +if (gpio_is_valid (data->slot[i].wp_pin))at91_set_gpio_input (data->slot[i].wp_pin,1 );switch (i) {
@@ -426,15 +426,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa |AT91_MATRIX_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 ); nand_data = *data;
@@ -1282,17 +1282,17 @@ void __init at91_add_device_cf(struct at91_cf_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa); -if (data->rst_pin) { +if (gpio_is_valid (data->rst_pin)) {at91_set_multi_drive (data->rst_pin,0 );at91_set_gpio_output (data->rst_pin,1 ); } -if (data->irq_pin) { +if (gpio_is_valid (data->irq_pin)) {at91_set_gpio_input (data->irq_pin,0 );at91_set_deglitch (data->irq_pin,1 ); } -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,0 );at91_set_deglitch (data->det_pin,1 ); }
arch/arm/mach-at91/at91sam9261_devices.c +7 -7
@@ -118,7 +118,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)if (!data)return ; -if (data->vbus_pin) { +if (gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); }
@@ -171,13 +171,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );/* CLK */
@@ -240,15 +240,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa |AT91_MATRIX_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 );at91_set_A_periph (AT91_PIN_PC0 ,0 );/* NANDOE */
arch/arm/mach-at91/at91sam9263_devices.c +13 -13
@@ -70,7 +70,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)/* Enable VBus control for UHP ports */ for (i =0 ; i < data->ports; i++) { -if (data->vbus_pin[i]) +if (gpio_is_valid (data->vbus_pin[i]))at91_set_gpio_output (data->vbus_pin[i],0 ); }
@@ -123,7 +123,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)if (!data)return ; -if (data->vbus_pin) { +if (gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); }
@@ -176,7 +176,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)if (!data)return ; -if (data->phy_irq_pin) { +if (gpio_is_valid (data->phy_irq_pin)) {at91_set_gpio_input (data->phy_irq_pin,0 );at91_set_deglitch (data->phy_irq_pin,1 ); }
@@ -276,13 +276,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );if (mmc_id ==0 ) {/* MCI0 */
@@ -430,17 +430,17 @@ void __init at91_add_device_cf(struct at91_cf_data *data) }at91_sys_write (AT91_MATRIX_EBI0CSA , ebi0_csa); -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->irq_pin) { +if (gpio_is_valid (data->irq_pin)) {at91_set_gpio_input (data->irq_pin,1 );at91_set_deglitch (data->irq_pin,1 ); } -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))/* initially off */ at91_set_gpio_output (data->vcc_pin,0 );
@@ -500,15 +500,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBI0CSA , csa |AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 ); nand_data = *data;
@@ -749,7 +749,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)at91_set_A_periph (AT91_PIN_PB3 ,0 );/* AC97RX */ /* reset */ -if (data->reset_pin) +if (gpio_is_valid (data->reset_pin))at91_set_gpio_output (data->reset_pin,0 ); ac97_data = *data;
arch/arm/mach-at91/at91sam9g45_devices.c +10 -10
@@ -120,7 +120,7 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)/* Enable VBus control for UHP ports */ for (i =0 ; i < data->ports; i++) { -if (data->vbus_pin[i]) +if (gpio_is_valid (data->vbus_pin[i]))at91_set_gpio_output (data->vbus_pin[i],0 ); }
@@ -181,7 +181,7 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)/* Enable VBus control for UHP ports */ for (i =0 ; i < data->ports; i++) { -if (data->vbus_pin[i]) +if (gpio_is_valid (data->vbus_pin[i]))at91_set_gpio_output (data->vbus_pin[i],0 ); }
@@ -263,7 +263,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) usba_udc_data.pdata.num_ep =ARRAY_SIZE (usba_udc_ep);memcpy (usba_udc_data.ep, usba_udc_ep,sizeof (usba_udc_ep)); -if (data && data->vbus_pin >0 ) { +if (data &&gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -316,7 +316,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)if (!data)return ; -if (data->phy_irq_pin) { +if (gpio_is_valid (data->phy_irq_pin)) {at91_set_gpio_input (data->phy_irq_pin,0 );at91_set_deglitch (data->phy_irq_pin,1 ); }
@@ -449,11 +449,11 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)/* input/irq */ -if (data->slot[0 ].detect_pin) { +if (gpio_is_valid (data->slot[0 ].detect_pin)) {at91_set_gpio_input (data->slot[0 ].detect_pin,1 );at91_set_deglitch (data->slot[0 ].detect_pin,1 ); } -if (data->slot[0 ].wp_pin) +if (gpio_is_valid (data->slot[0 ].wp_pin))at91_set_gpio_input (data->slot[0 ].wp_pin,1 );if (mmc_id ==0 ) {/* MCI0 */
@@ -556,15 +556,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa |AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 ); nand_data = *data;
@@ -859,7 +859,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)at91_set_A_periph (AT91_PIN_PD6 ,0 );/* AC97RX */ /* reset */ -if (data->reset_pin) +if (gpio_is_valid (data->reset_pin))at91_set_gpio_output (data->reset_pin,0 ); ac97_data = *data;
arch/arm/mach-at91/at91sam9rl_devices.c +8 -8
@@ -147,7 +147,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) usba_udc_data.pdata.num_ep =ARRAY_SIZE (usba_udc_ep);memcpy (usba_udc_data.ep, usba_udc_ep,sizeof (usba_udc_ep)); -if (data && data->vbus_pin >0 ) { +if (data &&gpio_is_valid (data->vbus_pin)) {at91_set_gpio_input (data->vbus_pin,0 );at91_set_deglitch (data->vbus_pin,1 ); usba_udc_data.pdata.vbus_pin = data->vbus_pin;
@@ -201,13 +201,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)return ;/* input/irq */ -if (data->det_pin) { +if (gpio_is_valid (data->det_pin)) {at91_set_gpio_input (data->det_pin,1 );at91_set_deglitch (data->det_pin,1 ); } -if (data->wp_pin) +if (gpio_is_valid (data->wp_pin))at91_set_gpio_input (data->wp_pin,1 ); -if (data->vcc_pin) +if (gpio_is_valid (data->vcc_pin))at91_set_gpio_output (data->vcc_pin,0 );/* CLK */
@@ -275,15 +275,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)at91_sys_write (AT91_MATRIX_EBICSA , csa |AT91_MATRIX_CS3A_SMC_SMARTMEDIA );/* enable pin */ -if (data->enable_pin) +if (gpio_is_valid (data->enable_pin))at91_set_gpio_output (data->enable_pin,1 );/* ready/busy pin */ -if (data->rdy_pin) +if (gpio_is_valid (data->rdy_pin))at91_set_gpio_input (data->rdy_pin,1 );/* card detect pin */ -if (data->det_pin) +if (gpio_is_valid (data->det_pin))at91_set_gpio_input (data->det_pin,1 );at91_set_A_periph (AT91_PIN_PB4 ,0 );/* NANDOE */
@@ -483,7 +483,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data)at91_set_A_periph (AT91_PIN_PD4 ,0 );/* AC97RX */ /* reset */ -if (data->reset_pin) +if (gpio_is_valid (data->reset_pin))at91_set_gpio_output (data->reset_pin,0 ); ac97_data = *data;
Signature · 1 line
1.7.7
PATCH v3 4/11 ARM: at91/pata: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/ata/pata_at91.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/ata/pata_at91.c +3 -3
@@ -360,7 +360,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) ap->flags |=ATA_FLAG_SLAVE_POSS ; ap->pio_mask =ATA_PIO4 ; -if (!irq) { +if (!gpio_is_valid (irq)) { ap->flags |=ATA_FLAG_PIO_POLLING ;ata_port_desc (ap,"no IRQ, using PIO polling" ); }
@@ -414,8 +414,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) host->private_data = info; -return ata_host_activate (host, irq ?gpio_to_irq (irq) :0 , - irq ? ata_sff_interrupt :NULL , +return ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , +gpio_is_valid (irq) ? ata_sff_interrupt :NULL , irq_flags, &pata_at91_sht); err_put:
Signature · 1 line
1.7.7
PATCH 4/11 ARM: at91/pata: use gpio_is_valid to check the gpio
Hello.
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Acked-by Nicolas Ferre <[email protected]>--- drivers/ata/pata_at91.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
You should post this patch to linux-ide at vger.kernel.org...
Quoted 14 lines
drivers/ata/pata_at91.c +1
-1@@ -360,7 +360,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) ap->flags |=ATA_FLAG_SLAVE_POSS ; ap->pio_mask =ATA_PIO4 ; -if (!irq) { +if (!gpio_is_valid (irq)) { ap->flags |=ATA_FLAG_PIO_POLLING ;ata_port_desc (ap,"no IRQ, using PIO polling" ); }
drivers/ata/pata_at91.c static int __devinit pata_at91_probe(struct platform_device *pdev) · line 420
Quoted 9 lines
drivers/ata/pata_at91.c +2
-2@@ -414,8 +414,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) host->private_data = info; -return ata_host_activate (host, irq ?gpio_to_irq (irq) :0 , - irq ? ata_sff_interrupt :NULL , +return ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , +gpio_is_valid (irq) ? ata_sff_interrupt :NULL , irq_flags,&pata_at91_sht); err_put:
BTW, the driver forgets to call clk_put() iff ata_host_activate() fails;
I've already posted a patch to fix this -- it conflicts with this one.
WBR, Sergei
PATCH v3 4/11 ARM: at91/pata: use gpio_is_valid to check the gpio
Quoted 11 lines · Sergei Shtylyov
Hello.
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Acked-by Nicolas Ferre <[email protected]>--- drivers/ata/pata_at91.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)You should post this patch to linux-ide at vger.kernel.org...
already done it's just a resend of the same one send weeks ago
Quoted 18 lines
Quoted 18 lines
drivers/ata/pata_at91.c +1
-1@@ -360,7 +360,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) ap->flags |=ATA_FLAG_SLAVE_POSS ; ap->pio_mask =ATA_PIO4 ; -if (!irq) { +if (!gpio_is_valid (irq)) { ap->flags |=ATA_FLAG_PIO_POLLING ;ata_port_desc (ap,"no IRQ, using PIO polling" ); }@@ -414,8 +414,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) host->private_data = info;
Quoted 10 lines
drivers/ata/pata_at91.c static int __devinit pata_at91_probe(struct platform_device *pdev) · line 421
Quoted 6 lines
drivers/ata/pata_at91.c +2
-2-return ata_host_activate (host, irq ?gpio_to_irq (irq) :0 , - irq ? ata_sff_interrupt :NULL , +return ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , +gpio_is_valid (irq) ? ata_sff_interrupt :NULL , irq_flags,&pata_at91_sht); err_put:BTW, the driver forgets to call
clk_put()iffata_host_activate()
fails; I've already posted a patch to fix this -- it conflicts with this one.
Didn't receive it
Best Regards,
J.
PATCH 4/11 ARM: at91/pata: use gpio_is_valid to check the gpio
Hello.
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines
Quoted 5 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD<[email protected]>Acked-by Nicolas Ferre<[email protected]>--- drivers/ata/pata_at91.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)You should post this patch to linux-ide at vger.kernel.org...
already done it's just a resend of the same one send weeks ago
I haven't seen this patch on linux-ide...
Quoted 28 lines
Quoted 17 lines
Quoted 17 lines
drivers/ata/pata_at91.c +1
-1@@ -360,7 +360,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) ap->flags |=ATA_FLAG_SLAVE_POSS ; ap->pio_mask =ATA_PIO4 ; -if (!irq) { +if (!gpio_is_valid (irq)) { ap->flags |=ATA_FLAG_PIO_POLLING ;ata_port_desc (ap,"no IRQ, using PIO polling" ); }@@ -414,8 +414,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) host->private_data = info;Quoted 10 lines
drivers/ata/pata_at91.c static int __devinit pata_at91_probe(struct platform_device *pdev) · line 421
Quoted 6 lines
drivers/ata/pata_at91.c +2
-2-return ata_host_activate (host, irq ?gpio_to_irq (irq) :0 , - irq ? ata_sff_interrupt :NULL , +return ata_host_activate (host,gpio_is_valid (irq) ?gpio_to_irq (irq) :0 , +gpio_is_valid (irq) ? ata_sff_interrupt :NULL , irq_flags,&pata_at91_sht); err_put:BTW, the driver forgets to call
clk_put()iffata_host_activate()
fails; I've already posted a patch to fix this -- it conflicts with this one.
Quoted 1 line
Didn't receive it
http://marc.info/?l=linux-ide&m=131825944706266
Quoted 2 lines
Best Regards,
J.
WBR, Sergei
PATCH 4/11 ARM: at91/pata: use gpio_is_valid to check the gpio
hello.
Quoted 11 lines · Sergei Shtylyov
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD<[email protected]>Acked-by Nicolas Ferre<[email protected]>---
drivers/ata/pata_at91.c| 6 +++---1 files changed, 3 insertions(+), 3 deletions(-)You should post this patch to linux-ide at vger.kernel.org...
already done it's just a resend of the same one send weeks ago
I haven't seen this patch on linux-ide...
Sorry, actually I have seen it. :-)
WBR, Sergei
PATCH v3 5/11 ARM: at91/ide: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/ide/at91_ide.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ide/at91_ide.c +1 -1
@@ -314,7 +314,7 @@ static int __init at91_ide_probe(struct platform_device *pdev)apply_timings (board->chipselect,0 ,ide_timing_find_mode (XFER_PIO_0 ),0 );/* with GPIO interrupt we have to do quirks in handler */ -if (board->irq_pin >=PIN_BASE ) +if (gpio_is_valid (board->irq_pin)) host->irq_handler = at91_irq_handler; host->ports[0 ]->select_data = board->chipselect;
Signature · 1 line
1.7.7
PATCH v3 6/11 ARM: at91/mmc: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/mmc/host/at91_mci.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
drivers/mmc/host/at91_mci.c +15 -15
@@ -741,7 +741,7 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)at91_mci_write (host,AT91_MCI_MR , (at91_mci_read (host,AT91_MCI_MR ) & ~AT91_MCI_CLKDIV ) | clkdiv);/* maybe switch power to the card */ -if (host->board->vcc_pin) { +if (gpio_is_valid (host->board->vcc_pin)) {switch (ios->power_mode) {case MMC_POWER_OFF :gpio_set_value (host->board->vcc_pin,0 );
@@ -893,7 +893,7 @@ static int at91_mci_get_ro(struct mmc_host *mmc) {struct at91mci_host *host =mmc_priv (mmc); -if (host->board->wp_pin) +if (gpio_is_valid (host->board->wp_pin))return !!gpio_get_value (host->board->wp_pin);/* * Board doesn't support read only detection; let the mmc core
@@ -987,21 +987,21 @@ static int __init at91_mci_probe(struct platform_device *pdev)* Reserve GPIOs ... board init code makes sure these pins are set * up as GPIOs with the right direction (input, except for vcc) */ -if (host->board->det_pin) { +if (gpio_is_valid (host->board->det_pin)) { ret =gpio_request (host->board->det_pin,"mmc_detect" );if (ret <0 ) {dev_dbg (&pdev->dev,"couldn't claim card detect pin\n" ); goto fail4b; } } -if (host->board->wp_pin) { +if (gpio_is_valid (host->board->wp_pin)) { ret =gpio_request (host->board->wp_pin,"mmc_wp" );if (ret <0 ) {dev_dbg (&pdev->dev,"couldn't claim wp sense pin\n" ); goto fail4; } } -if (host->board->vcc_pin) { +if (gpio_is_valid (host->board->vcc_pin)) { ret =gpio_request (host->board->vcc_pin,"mmc_vcc" );if (ret <0 ) {dev_dbg (&pdev->dev,"couldn't claim vcc switch pin\n" );
@@ -1053,7 +1053,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)/* * Add host to MMC layer */ -if (host->board->det_pin) { +if (gpio_is_valid (host->board->det_pin)) { host->present = !gpio_get_value (host->board->det_pin); }else
@@ -1064,7 +1064,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)/* * monitor card insertion/removal if we can */ -if (host->board->det_pin) { +if (gpio_is_valid (host->board->det_pin)) { ret =request_irq (gpio_to_irq (host->board->det_pin), at91_mmc_det_irq,0 ,mmc_hostname (mmc), host);if (ret)
@@ -1083,13 +1083,13 @@ fail0: fail1:clk_put (host->mci_clk); fail2: -if (host->board->vcc_pin) +if (gpio_is_valid (host->board->vcc_pin))gpio_free (host->board->vcc_pin); fail3: -if (host->board->wp_pin) +if (gpio_is_valid (host->board->wp_pin))gpio_free (host->board->wp_pin); fail4: -if (host->board->det_pin) +if (gpio_is_valid (host->board->det_pin))gpio_free (host->board->det_pin); fail4b:if (host->buffer)
@@ -1121,7 +1121,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)dma_free_coherent (&pdev->dev,MCI_BUFSIZE , host->buffer, host->physical_address); -if (host->board->det_pin) { +if (gpio_is_valid (host->board->det_pin)) {if (device_can_wakeup (&pdev->dev))free_irq (gpio_to_irq (host->board->det_pin), host);device_init_wakeup (&pdev->dev,0 );
@@ -1136,9 +1136,9 @@ static int __exit at91_mci_remove(struct platform_device *pdev)clk_disable (host->mci_clk);/* Disable the peripheral clock */ clk_put (host->mci_clk); -if (host->board->vcc_pin) +if (gpio_is_valid (host->board->vcc_pin))gpio_free (host->board->vcc_pin); -if (host->board->wp_pin) +if (gpio_is_valid (host->board->wp_pin))gpio_free (host->board->wp_pin);iounmap (host->baseaddr);
@@ -1159,7 +1159,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)struct at91mci_host *host =mmc_priv (mmc);int ret =0 ; -if (host->board->det_pin &&device_may_wakeup (&pdev->dev)) +if (gpio_is_valid (host->board->det_pin) &&device_may_wakeup (&pdev->dev))enable_irq_wake (host->board->det_pin);if (mmc)
@@ -1174,7 +1174,7 @@ static int at91_mci_resume(struct platform_device *pdev)struct at91mci_host *host =mmc_priv (mmc);int ret =0 ; -if (host->board->det_pin &&device_may_wakeup (&pdev->dev)) +if (gpio_is_valid (host->board->det_pin) &&device_may_wakeup (&pdev->dev))disable_irq_wake (host->board->det_pin);if (mmc)
Signature · 1 line
1.7.7
PATCH v3 7/11 ARM: at92/nand: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/mtd/nand/atmel_nand.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/nand/atmel_nand.c +4 -4
@@ -113,7 +113,7 @@ static int cpu_has_dma(void)*/ static void atmel_nand_enable (struct atmel_nand_host *host) { -if (host->board->enable_pin) +if (gpio_is_valid (host->board->enable_pin))gpio_set_value (host->board->enable_pin,0 ); }
@@ -122,7 +122,7 @@ static void atmel_nand_enable(struct atmel_nand_host *host)*/ static void atmel_nand_disable (struct atmel_nand_host *host) { -if (host->board->enable_pin) +if (gpio_is_valid (host->board->enable_pin))gpio_set_value (host->board->enable_pin,1 ); }
@@ -535,7 +535,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) nand_chip->IO_ADDR_W = host->io_base; nand_chip->cmd_ctrl = atmel_nand_cmd_ctrl; -if (host->board->rdy_pin) +if (gpio_is_valid (host->board->rdy_pin)) nand_chip->dev_ready = atmel_nand_device_ready; regs =platform_get_resource (pdev,IORESOURCE_MEM ,1 );
@@ -573,7 +573,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)platform_set_drvdata (pdev, host);atmel_nand_enable (host); -if (host->board->det_pin) { +if (gpio_is_valid (host->board->det_pin)) {if (gpio_get_value (host->board->det_pin)) {printk (KERN_INFO "No SmartMedia card inserted.\n" ); res = -ENXIO ;
Signature · 1 line
1.7.7
PATCH v3 8/11 ARM: at92/udc: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/usb/gadget/at91_udc.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
drivers/usb/gadget/at91_udc.c +7 -7
@@ -1758,7 +1758,7 @@ static int __init at91udc_probe(struct platform_device *pdev)/* rm9200 needs manual D+ pullup; off by default */ if (cpu_is_at91rm9200 ()) { -if (udc->board.pullup_pin <=0 ) { +if (gpio_is_valid (udc->board.pullup_pin)) {DBG ("no D+ pullup?\n" ); retval = -ENODEV ; goto fail0;
@@ -1825,7 +1825,7 @@ static int __init at91udc_probe(struct platform_device *pdev)DBG ("request irq %d failed\n" , udc->udp_irq); goto fail1; } -if (udc->board.vbus_pin >0 ) { +if (gpio_is_valid (udc->board.vbus_pin)) { retval =gpio_request (udc->board.vbus_pin,"udc_vbus" );if (retval <0 ) {DBG ("request vbus pin failed\n" );
@@ -1869,10 +1869,10 @@ static int __init at91udc_probe(struct platform_device *pdev)INFO ("%s version %s\n" , driver_name,DRIVER_VERSION );return 0 ; fail4: -if (udc->board.vbus_pin >0 && !udc->board.vbus_polled) +if (gpio_is_valid (udc->board.vbus_pin) && !udc->board.vbus_polled)free_irq (udc->board.vbus_pin, udc); fail3: -if (udc->board.vbus_pin >0 ) +if (gpio_is_valid (udc->board.vbus_pin))gpio_free (udc->board.vbus_pin); fail2:free_irq (udc->udp_irq, udc);
@@ -1907,7 +1907,7 @@ static int __exit at91udc_remove(struct platform_device *pdev)device_init_wakeup (&pdev->dev,0 );remove_debug_file (udc); -if (udc->board.vbus_pin >0 ) { +if (gpio_is_valid (udc->board.vbus_pin)) {free_irq (udc->board.vbus_pin, udc);gpio_free (udc->board.vbus_pin); }
@@ -1951,7 +1951,7 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)enable_irq_wake (udc->udp_irq); udc->active_suspend = wake; -if (udc->board.vbus_pin >0 && !udc->board.vbus_polled && wake) +if (gpio_is_valid (udc->board.vbus_pin) && !udc->board.vbus_polled && wake)enable_irq_wake (udc->board.vbus_pin);return 0 ; }
@@ -1961,7 +1961,7 @@ static int at91udc_resume(struct platform_device *pdev)struct at91_udc *udc =platform_get_drvdata (pdev);unsigned long flags; -if (udc->board.vbus_pin >0 && !udc->board.vbus_polled && +if (gpio_is_valid (udc->board.vbus_pin) && !udc->board.vbus_polled && udc->active_suspend)disable_irq_wake (udc->board.vbus_pin);
Signature · 1 line
1.7.7
PATCH v3 9/11 ARM: at92/ohci: use gpio_is_valid to check the gpio
In reply to Jean-Christophe PLAGNIOL-VILLARD--- drivers/usb/host/ohci-at91.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +2 -2
@@ -459,7 +459,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)if (pdata) {for (i =0 ; i <ARRAY_SIZE (pdata->vbus_pin); i++) { -if (pdata->vbus_pin[i] <=0 ) +if (!gpio_is_valid (pdata->vbus_pin[i]))continue ;gpio_request (pdata->vbus_pin[i],"ohci_vbus" );ohci_at91_usb_set_power (pdata, i,1 );
@@ -493,7 +493,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)if (pdata) {for (i =0 ; i <ARRAY_SIZE (pdata->vbus_pin); i++) { -if (pdata->vbus_pin[i] <=0 ) +if (!gpio_is_valid (pdata->vbus_pin[i]))continue ;ohci_at91_usb_set_power (pdata, i,0 );gpio_free (pdata->vbus_pin[i]);
Signature · 1 line
1.7.7
PATCH v3 10/11 ARM: at91/gpio: drop PIN_BASE
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/gpio.c | 54 ++-- arch/arm/mach-at91/include/mach/gpio.h | 454 ++++++++++++++++---------------- 2 files changed, 254 insertions(+), 254 deletions(-)
rewrite arch/arm/mach-at91/include/mach/gpio.h (78%)
arch/arm/mach-at91/gpio.c +28 -26
@@ -60,18 +60,17 @@ static int at91_gpiolib_direction_input(struct gpio_chip *chip, }static struct at91_gpio_chip gpio_chip[] = { -AT91_GPIO_CHIP ("A" ,0x00 +PIN_BASE ,32 ), -AT91_GPIO_CHIP ("B" ,0x20 +PIN_BASE ,32 ), -AT91_GPIO_CHIP ("C" ,0x40 +PIN_BASE ,32 ), -AT91_GPIO_CHIP ("D" ,0x60 +PIN_BASE ,32 ), -AT91_GPIO_CHIP ("E" ,0x80 +PIN_BASE ,32 ), +AT91_GPIO_CHIP ("A" ,0x00 ,32 ), +AT91_GPIO_CHIP ("B" ,0x20 ,32 ), +AT91_GPIO_CHIP ("C" ,0x40 ,32 ), +AT91_GPIO_CHIP ("D" ,0x60 ,32 ), +AT91_GPIO_CHIP ("E" ,0x80 ,32 ), };static int gpio_banks;static inline void __iomem *pin_to_controller (unsigned pin) { - pin -=PIN_BASE ; pin /=32 ;if (likely (pin < gpio_banks))return gpio_chip[pin].regbase;
@@ -81,7 +80,6 @@ static inline void __iomem *pin_to_controller(unsigned pin)static inline unsigned pin_to_mask (unsigned pin) { - pin -=PIN_BASE ;return 1 << (pin %32 ); }
@@ -276,8 +274,9 @@ static u32 backups[MAX_GPIO_BANKS];static int gpio_irq_set_wake (struct irq_data *d,unsigned state) { -unsigned mask =pin_to_mask (d->irq); -unsigned bank = (d->irq -PIN_BASE ) /32 ; +unsigned pin =irq_to_gpio (d->irq); +unsigned mask =pin_to_mask (pin); +unsigned bank = pin /32 ;if (unlikely (bank >=MAX_GPIO_BANKS ))return -EINVAL ;
@@ -346,8 +345,9 @@ void at91_gpio_resume(void)static void gpio_irq_mask (struct irq_data *d) { -void __iomem *pio =pin_to_controller (d->irq); -unsigned mask =pin_to_mask (d->irq); +unsigned pin =irq_to_gpio (d->irq); +void __iomem *pio =pin_to_controller (pin); +unsigned mask =pin_to_mask (pin);if (pio)__raw_writel (mask, pio +PIO_IDR );
@@ -355,8 +355,9 @@ static void gpio_irq_mask(struct irq_data *d)static void gpio_irq_unmask (struct irq_data *d) { -void __iomem *pio =pin_to_controller (d->irq); -unsigned mask =pin_to_mask (d->irq); +unsigned pin =irq_to_gpio (d->irq); +void __iomem *pio =pin_to_controller (pin); +unsigned mask =pin_to_mask (pin);if (pio)__raw_writel (mask, pio +PIO_IER );
@@ -384,7 +385,7 @@ static struct irq_chip gpio_irqchip = {static void gpio_irq_handler (unsigned irq,struct irq_desc *desc) { -unsigned pin; +unsigned irq_pin;struct irq_data *idata =irq_desc_get_irq_data (desc);struct irq_chip *chip =irq_data_get_irq_chip (idata);struct at91_gpio_chip *at91_gpio =irq_data_get_irq_chip_data (idata);
@@ -407,12 +408,12 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)continue ; } - pin = at91_gpio->chip.base; + irq_pin =gpio_to_irq (at91_gpio->chip.base);while (isr) {if (isr &1 ) -generic_handle_irq (pin); - pin++; +generic_handle_irq (irq_pin); + irq_pin++; isr >>=1 ; } }
@@ -440,7 +441,7 @@ static int at91_gpio_show(struct seq_file *s, void *unused)seq_printf (s,"%i:\t" , j);for (bank =0 ; bank < gpio_banks; bank++) { -unsigned pin =PIN_BASE + (32 * bank) + j; +unsigned pin = (32 * bank) + j;void __iomem *pio =pin_to_controller (pin);unsigned mask =pin_to_mask (pin);
@@ -493,10 +494,10 @@ static struct lock_class_key gpio_lock_class;*/ void __init at91_gpio_irq_setup (void ) { -unsigned pioc, pin; +unsigned pioc, irq =gpio_to_irq (0 );struct at91_gpio_chip *this, *prev; -for (pioc =0 , pin =PIN_BASE , this = gpio_chip, prev =NULL ; +for (pioc =0 , this = gpio_chip, prev =NULL ; pioc++ < gpio_banks; prev = this, this++) {unsigned id = this->bank->id;
@@ -504,16 +505,17 @@ void __init at91_gpio_irq_setup(void)__raw_writel (~0 , this->regbase +PIO_IDR ); -for (i =0 , pin = this->chip.base; i <32 ; i++, pin++) { -irq_set_lockdep_class (pin, &gpio_lock_class); +for (i =0 , irq =gpio_to_irq (this->chip.base); i <32 ; + i++, irq++) { +irq_set_lockdep_class (irq, &gpio_lock_class);/* * Can use the "simple" and not "edge" handler since it's * shorter, and the AIC handles interrupts sanely. */ -irq_set_chip_and_handler (pin, &gpio_irqchip, +irq_set_chip_and_handler (irq, &gpio_irqchip, handle_simple_irq); -set_irq_flags (pin,IRQF_VALID ); +set_irq_flags (irq,IRQF_VALID ); }/* The toplevel handler handles one bank of GPIOs, except
@@ -526,7 +528,7 @@ void __init at91_gpio_irq_setup(void)irq_set_chip_data (id, this);irq_set_chained_handler (id, gpio_irq_handler); } -pr_info ("AT91: %d gpio irqs in %d banks\n" , pin -PIN_BASE , gpio_banks); +pr_info ("AT91: %d gpio irqs in %d banks\n" , irq, gpio_banks); }/* gpiolib support */
@@ -615,7 +617,7 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) at91_gpio = &gpio_chip[i]; at91_gpio->bank = &data[i]; - at91_gpio->chip.base =PIN_BASE + i *32 ; + at91_gpio->chip.base = i *32 ; at91_gpio->regbase =ioremap (at91_gpio->bank->regbase,512 );if (!at91_gpio->regbase) {
arch/arm/mach-at91/include/mach/gpio.h +226 -228
454 lines not on this page · raw message
Signature · 1 line
1.7.7
PATCH v3 11/11 ARM: at91/gpio: fix display of number of irq setuped
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/gpio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-at91/gpio.c +1 -1
@@ -528,7 +528,7 @@ void __init at91_gpio_irq_setup(void)irq_set_chip_data (id, this);irq_set_chained_handler (id, gpio_irq_handler); } -pr_info ("AT91: %d gpio irqs in %d banks\n" , irq, gpio_banks); +pr_info ("AT91: %d gpio irqs in %d banks\n" , irq -gpio_to_irq (0 ), gpio_banks); }/* gpiolib support */
Signature · 1 line
1.7.7