aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-pxa/mainstone.c9
-rw-r--r--drivers/net/smc91x.h33
2 files changed, 36 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 14eac2287e3f..851ec2d9b699 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -26,6 +26,7 @@
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
29#include <linux/smc91x.h>
29 30
30#include <asm/types.h> 31#include <asm/types.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
@@ -240,11 +241,19 @@ static struct resource smc91x_resources[] = {
240 } 241 }
241}; 242};
242 243
244static struct smc91x_platdata mainstone_smc91x_info = {
245 .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
246 SMC91X_NOWAIT | SMC91X_USE_DMA,
247};
248
243static struct platform_device smc91x_device = { 249static struct platform_device smc91x_device = {
244 .name = "smc91x", 250 .name = "smc91x",
245 .id = 0, 251 .id = 0,
246 .num_resources = ARRAY_SIZE(smc91x_resources), 252 .num_resources = ARRAY_SIZE(smc91x_resources),
247 .resource = smc91x_resources, 253 .resource = smc91x_resources,
254 .dev = {
255 .platform_data = &mainstone_smc91x_info,
256 },
248}; 257};
249 258
250static int mst_audio_startup(struct snd_pcm_substream *substream, void *priv) 259static int mst_audio_startup(struct snd_pcm_substream *substream, void *priv)
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index a9c41d421c37..5518c51bfd81 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -40,22 +40,44 @@
40 * Define your architecture specific bus configuration parameters here. 40 * Define your architecture specific bus configuration parameters here.
41 */ 41 */
42 42
43#if defined(CONFIG_ARCH_LUBBOCK) 43#if defined(CONFIG_ARCH_LUBBOCK) ||\
44 defined(CONFIG_MACH_MAINSTONE)
44 45
45/* We can only do 16-bit reads and writes in the static memory space. */ 46#include <asm/mach-types.h>
46#define SMC_CAN_USE_8BIT 0 47
48/* Now the bus width is specified in the platform data
49 * pretend here to support all I/O access types
50 */
51#define SMC_CAN_USE_8BIT 1
47#define SMC_CAN_USE_16BIT 1 52#define SMC_CAN_USE_16BIT 1
48#define SMC_CAN_USE_32BIT 0 53#define SMC_CAN_USE_32BIT 1
49#define SMC_NOWAIT 1 54#define SMC_NOWAIT 1
50 55
51#define SMC_IO_SHIFT (lp->io_shift) 56#define SMC_IO_SHIFT (lp->io_shift)
52 57
58#define SMC_inb(a, r) readb((a) + (r))
53#define SMC_inw(a, r) readw((a) + (r)) 59#define SMC_inw(a, r) readw((a) + (r))
54#define SMC_outw(v, a, r) writew(v, (a) + (r)) 60#define SMC_inl(a, r) readl((a) + (r))
61#define SMC_outb(v, a, r) writeb(v, (a) + (r))
62#define SMC_outl(v, a, r) writel(v, (a) + (r))
55#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) 63#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l)
56#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) 64#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l)
65#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l)
66#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l)
57#define SMC_IRQ_FLAGS (-1) /* from resource */ 67#define SMC_IRQ_FLAGS (-1) /* from resource */
58 68
69/* We actually can't write halfwords properly if not word aligned */
70static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
71{
72 if (machine_is_mainstone() && reg & 2) {
73 unsigned int v = val << 16;
74 v |= readl(ioaddr + (reg & ~2)) & 0xffff;
75 writel(v, ioaddr + (reg & ~2));
76 } else {
77 writew(val, ioaddr + reg);
78 }
79}
80
59#elif defined(CONFIG_BLACKFIN) 81#elif defined(CONFIG_BLACKFIN)
60 82
61#define SMC_IRQ_FLAGS IRQF_TRIGGER_HIGH 83#define SMC_IRQ_FLAGS IRQF_TRIGGER_HIGH
@@ -194,7 +216,6 @@
194#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) 216#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l)
195 217
196#elif defined(CONFIG_ARCH_INNOKOM) || \ 218#elif defined(CONFIG_ARCH_INNOKOM) || \
197 defined(CONFIG_MACH_MAINSTONE) || \
198 defined(CONFIG_ARCH_PXA_IDP) || \ 219 defined(CONFIG_ARCH_PXA_IDP) || \
199 defined(CONFIG_ARCH_RAMSES) || \ 220 defined(CONFIG_ARCH_RAMSES) || \
200 defined(CONFIG_ARCH_PCM027) 221 defined(CONFIG_ARCH_PCM027)