Commit 1a2d9156 authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD Committed by Arnd Bergmann

ARM: at91: gpio make struct at91_gpio_bank an initdata

this will simplify the switch to the DT and later to the platform_device
Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
parent 619d4a4b
...@@ -298,7 +298,7 @@ void __init at91cap9_set_console_clock(int id) ...@@ -298,7 +298,7 @@ void __init at91cap9_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91cap9_gpio[] = { static struct at91_gpio_bank at91cap9_gpio[] __initdata = {
{ {
.id = AT91CAP9_ID_PIOABCD, .id = AT91CAP9_ID_PIOABCD,
.regbase = AT91CAP9_BASE_PIOA, .regbase = AT91CAP9_BASE_PIOA,
......
...@@ -273,7 +273,7 @@ void __init at91rm9200_set_console_clock(int id) ...@@ -273,7 +273,7 @@ void __init at91rm9200_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91rm9200_gpio[] = { static struct at91_gpio_bank at91rm9200_gpio[] __initdata = {
{ {
.id = AT91RM9200_ID_PIOA, .id = AT91RM9200_ID_PIOA,
.regbase = AT91RM9200_BASE_PIOA, .regbase = AT91RM9200_BASE_PIOA,
......
...@@ -274,7 +274,7 @@ void __init at91sam9260_set_console_clock(int id) ...@@ -274,7 +274,7 @@ void __init at91sam9260_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91sam9260_gpio[] = { static struct at91_gpio_bank at91sam9260_gpio[] __initdata = {
{ {
.id = AT91SAM9260_ID_PIOA, .id = AT91SAM9260_ID_PIOA,
.regbase = AT91SAM9260_BASE_PIOA, .regbase = AT91SAM9260_BASE_PIOA,
......
...@@ -253,7 +253,7 @@ void __init at91sam9261_set_console_clock(int id) ...@@ -253,7 +253,7 @@ void __init at91sam9261_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91sam9261_gpio[] = { static struct at91_gpio_bank at91sam9261_gpio[] __initdata = {
{ {
.id = AT91SAM9261_ID_PIOA, .id = AT91SAM9261_ID_PIOA,
.regbase = AT91SAM9261_BASE_PIOA, .regbase = AT91SAM9261_BASE_PIOA,
......
...@@ -269,7 +269,7 @@ void __init at91sam9263_set_console_clock(int id) ...@@ -269,7 +269,7 @@ void __init at91sam9263_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91sam9263_gpio[] = { static struct at91_gpio_bank at91sam9263_gpio[] __initdata = {
{ {
.id = AT91SAM9263_ID_PIOA, .id = AT91SAM9263_ID_PIOA,
.regbase = AT91SAM9263_BASE_PIOA, .regbase = AT91SAM9263_BASE_PIOA,
......
...@@ -299,7 +299,7 @@ void __init at91sam9g45_set_console_clock(int id) ...@@ -299,7 +299,7 @@ void __init at91sam9g45_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91sam9g45_gpio[] = { static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
{ {
.id = AT91SAM9G45_ID_PIOA, .id = AT91SAM9G45_ID_PIOA,
.regbase = AT91SAM9G45_BASE_PIOA, .regbase = AT91SAM9G45_BASE_PIOA,
......
...@@ -246,7 +246,7 @@ void __init at91sam9rl_set_console_clock(int id) ...@@ -246,7 +246,7 @@ void __init at91sam9rl_set_console_clock(int id)
* GPIO * GPIO
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
static struct at91_gpio_bank at91sam9rl_gpio[] = { static struct at91_gpio_bank at91sam9rl_gpio[] __initdata = {
{ {
.id = AT91SAM9RL_ID_PIOA, .id = AT91SAM9RL_ID_PIOA,
.regbase = AT91SAM9RL_BASE_PIOA, .regbase = AT91SAM9RL_BASE_PIOA,
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
struct at91_gpio_chip { struct at91_gpio_chip {
struct gpio_chip chip; struct gpio_chip chip;
struct at91_gpio_chip *next; /* Bank sharing same clock */ struct at91_gpio_chip *next; /* Bank sharing same clock */
struct at91_gpio_bank *bank; /* Bank definition */ int id; /* ID of register bank */
void __iomem *regbase; /* Base of register bank */ void __iomem *regbase; /* Base of register bank */
struct clk *clock; /* associated clock */ struct clk *clock; /* associated clock */
}; };
...@@ -286,7 +286,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state) ...@@ -286,7 +286,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
else else
wakeups[bank] &= ~mask; wakeups[bank] &= ~mask;
irq_set_irq_wake(gpio_chip[bank].bank->id, state); irq_set_irq_wake(gpio_chip[bank].id, state);
return 0; return 0;
} }
...@@ -498,7 +498,7 @@ void __init at91_gpio_irq_setup(void) ...@@ -498,7 +498,7 @@ void __init at91_gpio_irq_setup(void)
for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL; for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL;
pioc++ < gpio_banks; pioc++ < gpio_banks;
prev = this, this++) { prev = this, this++) {
unsigned id = this->bank->id; unsigned id = this->id;
unsigned i; unsigned i;
__raw_writel(~0, this->regbase + PIO_IDR); __raw_writel(~0, this->regbase + PIO_IDR);
...@@ -613,10 +613,10 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) ...@@ -613,10 +613,10 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
for (i = 0; i < nr_banks; i++) { for (i = 0; i < nr_banks; i++) {
at91_gpio = &gpio_chip[i]; at91_gpio = &gpio_chip[i];
at91_gpio->bank = &data[i]; at91_gpio->id = data[i].id;
at91_gpio->chip.base = PIN_BASE + i * 32; at91_gpio->chip.base = PIN_BASE + i * 32;
at91_gpio->regbase = ioremap(at91_gpio->bank->regbase, 512); at91_gpio->regbase = ioremap(data[i].regbase, 512);
if (!at91_gpio->regbase) { if (!at91_gpio->regbase) {
pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i); pr_err("at91_gpio.%d, failed to map registers, ignoring.\n", i);
continue; continue;
...@@ -632,7 +632,7 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) ...@@ -632,7 +632,7 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
clk_enable(at91_gpio->clock); clk_enable(at91_gpio->clock);
/* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
if (last && last->bank->id == at91_gpio->bank->id) if (last && last->id == at91_gpio->id)
last->next = at91_gpio; last->next = at91_gpio;
last = at91_gpio; last = at91_gpio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment