diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-12-20 15:31:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-22 16:40:33 +0100 |
commit | 99bb1fbd6da2f3545c21f8148c679d52a543af18 (patch) | |
tree | 1f44d8c18635235b1248fcd65fed779bf92999a4 /arch/arm/mach-at91/at91sam9260.c | |
parent | 521f3a53b32839078259addeb26c280c0a76e64c (diff) | |
download | barebox-99bb1fbd6da2f3545c21f8148c679d52a543af18.tar.gz barebox-99bb1fbd6da2f3545c21f8148c679d52a543af18.tar.xz |
at91: gpio: switch to device driver
this is the first step to prepare the switch to the gpiolib
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index cf9e51191c..6c741f81b2 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c @@ -172,6 +172,9 @@ static struct clk *periph_clocks[] = { static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi1", &spi1_clk), + CLKDEV_DEV_ID("at91rm9200-gpio0", &pioA_clk), + CLKDEV_DEV_ID("at91rm9200-gpio1", &pioB_clk), + CLKDEV_DEV_ID("at91rm9200-gpio2", &pioC_clk), }; static struct clk_lookup usart_clocks_lookups[] = { @@ -217,23 +220,6 @@ static void __init at91sam9260_register_clocks(void) clk_register(&pck1); } -/* -------------------------------------------------------------------- - * GPIO - * -------------------------------------------------------------------- */ - -static struct at91_gpio_bank at91sam9260_gpio[] = { - { - .regbase = IOMEM(AT91_BASE_PIOA), - .clock = &pioA_clk, - }, { - .regbase = IOMEM(AT91_BASE_PIOB), - .clock = &pioB_clk, - }, { - .regbase = IOMEM(AT91_BASE_PIOC), - .clock = &pioC_clk, - } -}; - static int at91sam9260_initialize(void) { /* Init clock subsystem */ @@ -242,9 +228,17 @@ static int at91sam9260_initialize(void) /* Register the processor-specific clocks */ at91sam9260_register_clocks(); - /* Register GPIO subsystem */ - at91_gpio_init(at91sam9260_gpio, 3); return 0; } - core_initcall(at91sam9260_initialize); + +static int at91sam9260_gpio_init(void) +{ + /* Register GPIO subsystem */ + at91_add_rm9200_gpio(0, AT91_BASE_PIOA); + at91_add_rm9200_gpio(1, AT91_BASE_PIOB); + at91_add_rm9200_gpio(2, AT91_BASE_PIOC); + + return 0; +} +postcore_initcall(at91sam9260_gpio_init); |