diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-04-16 18:29:30 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-04-20 11:54:09 -0400 |
commit | 21b42731e6ab1ccbbe9ad1b639c5d78eecad8432 (patch) | |
tree | c5ce62ea21eafb712c8d20fa0b683b1ec2e4e737 /arch/arm/mach-omap2/board-omap3stalker.c | |
parent | f0949f73a75093fb86d6554101bd79046633a297 (diff) |
omap: convert boards that use SMSC911x to use gpmc-smsc911x
Convert boards that use SMSC911x to use gpmc-smsc911x.
Also allocate struct platform_device dynamically.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
[tony@atomide.com: folded in a fix from Igor Grindberg]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3stalker.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3stalker.c | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index a6e0b9161c99..848016c6a245 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -56,50 +56,25 @@ | |||
56 | #include "timer-gp.h" | 56 | #include "timer-gp.h" |
57 | 57 | ||
58 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 58 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
59 | #include <plat/gpmc-smsc911x.h> | ||
60 | |||
59 | #define OMAP3STALKER_ETHR_START 0x2c000000 | 61 | #define OMAP3STALKER_ETHR_START 0x2c000000 |
60 | #define OMAP3STALKER_ETHR_SIZE 1024 | 62 | #define OMAP3STALKER_ETHR_SIZE 1024 |
61 | #define OMAP3STALKER_ETHR_GPIO_IRQ 19 | 63 | #define OMAP3STALKER_ETHR_GPIO_IRQ 19 |
62 | #define OMAP3STALKER_SMC911X_CS 5 | 64 | #define OMAP3STALKER_SMC911X_CS 5 |
63 | 65 | ||
64 | static struct resource omap3stalker_smsc911x_resources[] = { | 66 | static struct omap_smsc911x_platform_data smsc911x_cfg = { |
65 | [0] = { | 67 | .cs = OMAP3STALKER_SMC911X_CS, |
66 | .start = OMAP3STALKER_ETHR_START, | 68 | .gpio_irq = OMAP3STALKER_ETHR_GPIO_IRQ, |
67 | .end = | 69 | .gpio_reset = -EINVAL, |
68 | (OMAP3STALKER_ETHR_START + OMAP3STALKER_ETHR_SIZE - 1), | ||
69 | .flags = IORESOURCE_MEM, | ||
70 | }, | ||
71 | [1] = { | ||
72 | .start = OMAP_GPIO_IRQ(OMAP3STALKER_ETHR_GPIO_IRQ), | ||
73 | .end = OMAP_GPIO_IRQ(OMAP3STALKER_ETHR_GPIO_IRQ), | ||
74 | .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW), | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | static struct smsc911x_platform_config smsc911x_config = { | ||
79 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
80 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
81 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
82 | .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS), | 70 | .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS), |
83 | }; | 71 | }; |
84 | 72 | ||
85 | static struct platform_device omap3stalker_smsc911x_device = { | ||
86 | .name = "smsc911x", | ||
87 | .id = -1, | ||
88 | .num_resources = ARRAY_SIZE(omap3stalker_smsc911x_resources), | ||
89 | .resource = &omap3stalker_smsc911x_resources[0], | ||
90 | .dev = { | ||
91 | .platform_data = &smsc911x_config, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | static inline void __init omap3stalker_init_eth(void) | 73 | static inline void __init omap3stalker_init_eth(void) |
96 | { | 74 | { |
97 | int eth_cs; | ||
98 | struct clk *l3ck; | 75 | struct clk *l3ck; |
99 | unsigned int rate; | 76 | unsigned int rate; |
100 | 77 | ||
101 | eth_cs = OMAP3STALKER_SMC911X_CS; | ||
102 | |||
103 | l3ck = clk_get(NULL, "l3_ck"); | 78 | l3ck = clk_get(NULL, "l3_ck"); |
104 | if (IS_ERR(l3ck)) | 79 | if (IS_ERR(l3ck)) |
105 | rate = 100000000; | 80 | rate = 100000000; |
@@ -107,16 +82,7 @@ static inline void __init omap3stalker_init_eth(void) | |||
107 | rate = clk_get_rate(l3ck); | 82 | rate = clk_get_rate(l3ck); |
108 | 83 | ||
109 | omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); | 84 | omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); |
110 | if (gpio_request(OMAP3STALKER_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { | 85 | gpmc_smsc911x_init(&smsc911x_cfg); |
111 | printk(KERN_ERR | ||
112 | "Failed to request GPIO%d for smc911x IRQ\n", | ||
113 | OMAP3STALKER_ETHR_GPIO_IRQ); | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | gpio_direction_input(OMAP3STALKER_ETHR_GPIO_IRQ); | ||
118 | |||
119 | platform_device_register(&omap3stalker_smsc911x_device); | ||
120 | } | 86 | } |
121 | 87 | ||
122 | #else | 88 | #else |