Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139895
b: refs/heads/master
c: 172ef27
h: refs/heads/master
i:
  139893: 4b12a8b
  139891: 13312e6
  139887: 35828be
v: v3
  • Loading branch information
Steve Sakoman authored and Steve Glendinning committed Apr 2, 2009
1 parent c0801c2 commit 35d722b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 162e8a415f4e6900f1f157c4a2ad68147b0a899c
refs/heads/master: 172ef275444efa12d834fb9d1b1acdac92db47f7
65 changes: 65 additions & 0 deletions trunk/arch/arm/mach-omap2/board-overo.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
#define GPMC_CS0_BASE 0x60
#define GPMC_CS_SIZE 0x30

#define OVERO_SMSC911X_CS 5
#define OVERO_SMSC911X_GPIO 176

#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)

Expand Down Expand Up @@ -116,6 +119,67 @@ static void __init overo_ads7846_init(void)
static inline void __init overo_ads7846_init(void) { return; }
#endif

#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)

#include <linux/smsc911x.h>

static struct resource overo_smsc911x_resources[] = {
{
.name = "smsc911x-memory",
.flags = IORESOURCE_MEM,
},
{
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
},
};

static struct smsc911x_platform_config overo_smsc911x_config = {
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
.flags = SMSC911X_USE_32BIT ,
.phy_interface = PHY_INTERFACE_MODE_MII,
};

static struct platform_device overo_smsc911x_device = {
.name = "smsc911x",
.id = -1,
.num_resources = ARRAY_SIZE(overo_smsc911x_resources),
.resource = &overo_smsc911x_resources,
.dev = {
.platform_data = &overo_smsc911x_config,
},
};

static inline void __init overo_init_smsc911x(void)
{
unsigned long cs_mem_base;

if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
return;
}

overo_smsc911x_resources[0].start = cs_mem_base + 0x0;
overo_smsc911x_resources[0].end = cs_mem_base + 0xff;

if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
(gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) {
gpio_export(OVERO_SMSC911X_GPIO, 0);
} else {
printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n");
return;
}

overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
overo_smsc911x_resources[1].end = 0;

platform_device_register(&overo_smsc911x_device);
}

#else
static inline void __init overo_init_smsc911x(void) { return; }
#endif

static struct mtd_partition overo_nand_partitions[] = {
{
.name = "xloader",
Expand Down Expand Up @@ -290,6 +354,7 @@ static void __init overo_init(void)
overo_flash_init();
usb_musb_init();
overo_ads7846_init();
overo_init_smsc911x();

if ((gpio_request(OVERO_GPIO_W2W_NRESET,
"OVERO_GPIO_W2W_NRESET") == 0) &&
Expand Down

0 comments on commit 35d722b

Please sign in to comment.