From: Russell King Date: Fri, 13 Mar 2009 21:44:51 +0000 (+0000) Subject: Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel X-Git-Url: http://pilppa.org/gitweb/?a=commitdiff_plain;h=97fb44eb6bc01f4ffed4300e475aa15e44877375;p=linux-2.6-omap-h63xx.git Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel Conflicts: arch/arm/mach-at91/gpio.c --- 97fb44eb6bc01f4ffed4300e475aa15e44877375 diff --cc arch/arm/mach-at91/gpio.c index 028e4f7a88b,2f7d4977dce..f2236f0e101 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c @@@ -448,20 -502,17 +509,17 @@@ static struct lock_class_key gpio_lock_ void __init at91_gpio_irq_setup(void) { unsigned pioc, pin; - struct at91_gpio_bank *this, *prev; + struct at91_gpio_chip *this, *prev; - for (pioc = 0, pin = PIN_BASE, this = gpio, prev = NULL; + for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL; pioc++ < gpio_banks; prev = this, this++) { - unsigned id = this->id; + unsigned id = this->bank->id; unsigned i; - /* enable PIO controller's clock */ - clk_enable(this->bank->clock); - __raw_writel(~0, this->regbase + PIO_IDR); - for (i = 0, pin = this->chipbase; i < 32; i++, pin++) { + for (i = 0, pin = this->chip.base; i < 32; i++, pin++) { lockdep_set_class(&irq_desc[pin].lock, &gpio_lock_class); /* @@@ -579,21 -547,22 +637,24 @@@ void __init at91_gpio_init(struct at91_ BUG_ON(nr_banks > MAX_GPIO_BANKS); - gpio = data; gpio_banks = nr_banks; - for (i = 0, last = NULL; i < nr_banks; i++, last = data, data++) { - data->chipbase = PIN_BASE + i * 32; - data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS; + for (i = 0; i < nr_banks; i++) { + at91_gpio = &gpio_chip[i]; + + 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; + /* enable PIO controller's clock */ - clk_enable(data->clock); ++ clk_enable(at91_gpio->bank->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; + /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ + if (last && last->bank->id == at91_gpio->bank->id) + last->next = at91_gpio; + last = at91_gpio; + + gpiochip_add(&at91_gpio->chip); } }