Skip to content

Commit

Permalink
[ARM] 5391/1: AT91: Enable GPIO clocks earlier
Browse files Browse the repository at this point in the history
Enable the GPIO clocks earlier in the initialization sequence.  This
allow the board-setup code to read and set GPIO pins.

Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Andrew Victor authored and Russell King committed Feb 14, 2009
1 parent 2af29b7 commit 2b768b6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions arch/arm/mach-at91/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ postcore_initcall(at91_gpio_debugfs_init);

/*--------------------------------------------------------------------------*/

/* This lock class tells lockdep that GPIO irqs are in a different
/*
* This lock class tells lockdep that GPIO irqs are in a different
* category than their parents, so it won't report false recursion.
*/
static struct lock_class_key gpio_lock_class;
Expand All @@ -509,9 +510,6 @@ void __init at91_gpio_irq_setup(void)
unsigned id = this->id;
unsigned i;

/* enable PIO controller's clock */
clk_enable(this->clock);

__raw_writel(~0, this->regbase + PIO_IDR);

for (i = 0, pin = this->chipbase; i < 32; i++, pin++) {
Expand Down Expand Up @@ -556,7 +554,14 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
data->chipbase = PIN_BASE + i * 32;
data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS;

/* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
/* enable PIO controller's clock */
clk_enable(data->clock);

/*
* Some processors share peripheral ID between multiple GPIO banks.
* SAM9263 (PIOC, PIOD, PIOE)
* CAP9 (PIOA, PIOB, PIOC, PIOD)
*/
if (last && last->id == data->id)
last->next = data;
}
Expand Down

0 comments on commit 2b768b6

Please sign in to comment.