From be2591fd2858855cf58831348adc46271da27005 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Thu, 2 Jul 2009 15:29:32 +0100 Subject: [PATCH] --- yaml --- r: 160971 b: refs/heads/master c: 725b1f9d86822246e5a1237bf97d2783857d8a3a h: refs/heads/master i: 160969: 920a14370007b7950bab910ff26c37c6de418e29 160967: c29b6c376befb01a46563a0fb46219f877df1d28 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-nomadik/board-nhk8815.c | 38 ++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e9c254cb20af..232a510b4fe0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 63796b740b888b396eb0cc78917d755693cc224c +refs/heads/master: 725b1f9d86822246e5a1237bf97d2783857d8a3a diff --git a/trunk/arch/arm/mach-nomadik/board-nhk8815.c b/trunk/arch/arm/mach-nomadik/board-nhk8815.c index eebca614d36b..79bdea943eb4 100644 --- a/trunk/arch/arm/mach-nomadik/board-nhk8815.c +++ b/trunk/arch/arm/mach-nomadik/board-nhk8815.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include #include @@ -45,8 +47,42 @@ static struct clk nhk8815_clk_48 = { .rate = 48*1000*1000, }; +static struct resource nhk8815_eth_resources[] = { + { + .name = "smc91x-regs", + .start = 0x34000000 + 0x300, + .end = 0x34000000 + SZ_64K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = NOMADIK_GPIO_TO_IRQ(115), + .end = NOMADIK_GPIO_TO_IRQ(115), + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, + } +}; + +static struct platform_device nhk8815_eth_device = { + .name = "smc91x", + .resource = nhk8815_eth_resources, + .num_resources = ARRAY_SIZE(nhk8815_eth_resources), +}; + +static int __init nhk8815_eth_init(void) +{ + int gpio_nr = 115; /* hardwired in the board */ + int err; + + err = gpio_request(gpio_nr, "eth_irq"); + if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO); + if (!err) err = gpio_direction_input(gpio_nr); + if (err) + pr_err("Error %i in %s\n", err, __func__); + return err; +} +device_initcall(nhk8815_eth_init); + static struct platform_device *nhk8815_platform_devices[] __initdata = { - /* currently empty, will add keypad, touchscreen etc */ + &nhk8815_eth_device, + /* will add more devices */ }; static void __init nhk8815_platform_init(void)