aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acorn/char/pcf8583.c80
-rw-r--r--drivers/mfd/ucb1x00-ts.c74
-rw-r--r--drivers/net/irda/pxaficp_ir.c14
-rw-r--r--drivers/pcmcia/Makefile1
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c31
-rw-r--r--drivers/pcmcia/sa1100_generic.c7
6 files changed, 158 insertions, 49 deletions
diff --git a/drivers/acorn/char/pcf8583.c b/drivers/acorn/char/pcf8583.c
index 2b850e5860a0..e26f007a1417 100644
--- a/drivers/acorn/char/pcf8583.c
+++ b/drivers/acorn/char/pcf8583.c
@@ -9,6 +9,7 @@
9 * 9 *
10 * Driver for PCF8583 RTC & RAM chip 10 * Driver for PCF8583 RTC & RAM chip
11 */ 11 */
12#include <linux/module.h>
12#include <linux/i2c.h> 13#include <linux/i2c.h>
13#include <linux/slab.h> 14#include <linux/slab.h>
14#include <linux/string.h> 15#include <linux/string.h>
@@ -32,7 +33,8 @@ static struct i2c_client_address_data addr_data = {
32 .forces = forces, 33 .forces = forces,
33}; 34};
34 35
35#define DAT(x) ((unsigned int)(x->dev.driver_data)) 36#define set_ctrl(x, v) i2c_set_clientdata(x, (void *)(unsigned int)(v))
37#define get_ctrl(x) ((unsigned int)i2c_get_clientdata(x))
36 38
37static int 39static int
38pcf8583_attach(struct i2c_adapter *adap, int addr, int kind) 40pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
@@ -40,8 +42,17 @@ pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
40 struct i2c_client *c; 42 struct i2c_client *c;
41 unsigned char buf[1], ad[1] = { 0 }; 43 unsigned char buf[1], ad[1] = { 0 };
42 struct i2c_msg msgs[2] = { 44 struct i2c_msg msgs[2] = {
43 { addr, 0, 1, ad }, 45 {
44 { addr, I2C_M_RD, 1, buf } 46 .addr = addr,
47 .flags = 0,
48 .len = 1,
49 .buf = ad,
50 }, {
51 .addr = addr,
52 .flags = I2C_M_RD,
53 .len = 1,
54 .buf = buf,
55 }
45 }; 56 };
46 57
47 c = kmalloc(sizeof(*c), GFP_KERNEL); 58 c = kmalloc(sizeof(*c), GFP_KERNEL);
@@ -54,7 +65,7 @@ pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
54 c->driver = &pcf8583_driver; 65 c->driver = &pcf8583_driver;
55 66
56 if (i2c_transfer(c->adapter, msgs, 2) == 2) 67 if (i2c_transfer(c->adapter, msgs, 2) == 2)
57 DAT(c) = buf[0]; 68 set_ctrl(c, buf[0]);
58 69
59 return i2c_attach_client(c); 70 return i2c_attach_client(c);
60} 71}
@@ -78,8 +89,17 @@ pcf8583_get_datetime(struct i2c_client *client, struct rtc_tm *dt)
78{ 89{
79 unsigned char buf[8], addr[1] = { 1 }; 90 unsigned char buf[8], addr[1] = { 1 };
80 struct i2c_msg msgs[2] = { 91 struct i2c_msg msgs[2] = {
81 { client->addr, 0, 1, addr }, 92 {
82 { client->addr, I2C_M_RD, 6, buf } 93 .addr = client->addr,
94 .flags = 0,
95 .len = 1,
96 .buf = addr,
97 }, {
98 .addr = client->addr,
99 .flags = I2C_M_RD,
100 .len = 6,
101 .buf = buf,
102 }
83 }; 103 };
84 int ret = -EIO; 104 int ret = -EIO;
85 105
@@ -113,7 +133,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
113 int ret, len = 6; 133 int ret, len = 6;
114 134
115 buf[0] = 0; 135 buf[0] = 0;
116 buf[1] = DAT(client) | 0x80; 136 buf[1] = get_ctrl(client) | 0x80;
117 buf[2] = BIN_TO_BCD(dt->cs); 137 buf[2] = BIN_TO_BCD(dt->cs);
118 buf[3] = BIN_TO_BCD(dt->secs); 138 buf[3] = BIN_TO_BCD(dt->secs);
119 buf[4] = BIN_TO_BCD(dt->mins); 139 buf[4] = BIN_TO_BCD(dt->mins);
@@ -129,7 +149,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
129 if (ret == len) 149 if (ret == len)
130 ret = 0; 150 ret = 0;
131 151
132 buf[1] = DAT(client); 152 buf[1] = get_ctrl(client);
133 i2c_master_send(client, (char *)buf, 2); 153 i2c_master_send(client, (char *)buf, 2);
134 154
135 return ret; 155 return ret;
@@ -138,7 +158,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
138static int 158static int
139pcf8583_get_ctrl(struct i2c_client *client, unsigned char *ctrl) 159pcf8583_get_ctrl(struct i2c_client *client, unsigned char *ctrl)
140{ 160{
141 *ctrl = DAT(client); 161 *ctrl = get_ctrl(client);
142 return 0; 162 return 0;
143} 163}
144 164
@@ -149,7 +169,7 @@ pcf8583_set_ctrl(struct i2c_client *client, unsigned char *ctrl)
149 169
150 buf[0] = 0; 170 buf[0] = 0;
151 buf[1] = *ctrl; 171 buf[1] = *ctrl;
152 DAT(client) = *ctrl; 172 set_ctrl(client, *ctrl);
153 173
154 return i2c_master_send(client, (char *)buf, 2); 174 return i2c_master_send(client, (char *)buf, 2);
155} 175}
@@ -159,15 +179,23 @@ pcf8583_read_mem(struct i2c_client *client, struct mem *mem)
159{ 179{
160 unsigned char addr[1]; 180 unsigned char addr[1];
161 struct i2c_msg msgs[2] = { 181 struct i2c_msg msgs[2] = {
162 { client->addr, 0, 1, addr }, 182 {
163 { client->addr, I2C_M_RD, 0, mem->data } 183 .addr = client->addr,
184 .flags = 0,
185 .len = 1,
186 .buf = addr,
187 }, {
188 .addr = client->addr,
189 .flags = I2C_M_RD,
190 .len = mem->nr,
191 .buf = mem->data,
192 }
164 }; 193 };
165 194
166 if (mem->loc < 8) 195 if (mem->loc < 8)
167 return -EINVAL; 196 return -EINVAL;
168 197
169 addr[0] = mem->loc; 198 addr[0] = mem->loc;
170 msgs[1].len = mem->nr;
171 199
172 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO; 200 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
173} 201}
@@ -177,15 +205,23 @@ pcf8583_write_mem(struct i2c_client *client, struct mem *mem)
177{ 205{
178 unsigned char addr[1]; 206 unsigned char addr[1];
179 struct i2c_msg msgs[2] = { 207 struct i2c_msg msgs[2] = {
180 { client->addr, 0, 1, addr }, 208 {
181 { client->addr, 0, 0, mem->data } 209 .addr = client->addr,
210 .flags = 0,
211 .len = 1,
212 .buf = addr,
213 }, {
214 .addr = client->addr,
215 .flags = I2C_M_NOSTART,
216 .len = mem->nr,
217 .buf = mem->data,
218 }
182 }; 219 };
183 220
184 if (mem->loc < 8) 221 if (mem->loc < 8)
185 return -EINVAL; 222 return -EINVAL;
186 223
187 addr[0] = mem->loc; 224 addr[0] = mem->loc;
188 msgs[1].len = mem->nr;
189 225
190 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO; 226 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
191} 227}
@@ -234,4 +270,14 @@ static __init int pcf8583_init(void)
234 return i2c_add_driver(&pcf8583_driver); 270 return i2c_add_driver(&pcf8583_driver);
235} 271}
236 272
237__initcall(pcf8583_init); 273static __exit void pcf8583_exit(void)
274{
275 i2c_del_driver(&pcf8583_driver);
276}
277
278module_init(pcf8583_init);
279module_exit(pcf8583_exit);
280
281MODULE_AUTHOR("Russell King");
282MODULE_DESCRIPTION("PCF8583 I2C RTC driver");
283MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 585cded3d365..a984c0efabf0 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -32,9 +32,12 @@
32#include <linux/suspend.h> 32#include <linux/suspend.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/kthread.h> 34#include <linux/kthread.h>
35#include <linux/delay.h>
35 36
36#include <asm/dma.h> 37#include <asm/dma.h>
37#include <asm/semaphore.h> 38#include <asm/semaphore.h>
39#include <asm/arch/collie.h>
40#include <asm/mach-types.h>
38 41
39#include "ucb1x00.h" 42#include "ucb1x00.h"
40 43
@@ -85,12 +88,23 @@ static inline void ucb1x00_ts_mode_int(struct ucb1x00_ts *ts)
85 */ 88 */
86static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts) 89static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts)
87{ 90{
88 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 91 if (machine_is_collie()) {
89 UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW | 92 ucb1x00_io_write(ts->ucb, COLLIE_TC35143_GPIO_TBL_CHK, 0);
90 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND | 93 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
91 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 94 UCB_TS_CR_TSPX_POW | UCB_TS_CR_TSMX_POW |
95 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
92 96
93 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync); 97 udelay(55);
98
99 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_AD2, ts->adcsync);
100 } else {
101 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
102 UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW |
103 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND |
104 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
105
106 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync);
107 }
94} 108}
95 109
96/* 110/*
@@ -101,12 +115,16 @@ static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts)
101 */ 115 */
102static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts) 116static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts)
103{ 117{
104 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 118 if (machine_is_collie())
105 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 119 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK);
106 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 120 else {
107 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 121 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
108 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 122 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
109 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 123 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
124 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
125 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
126 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
127 }
110 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 128 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
111 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 129 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
112 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); 130 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
@@ -124,12 +142,17 @@ static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts)
124 */ 142 */
125static inline unsigned int ucb1x00_ts_read_ypos(struct ucb1x00_ts *ts) 143static inline unsigned int ucb1x00_ts_read_ypos(struct ucb1x00_ts *ts)
126{ 144{
127 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 145 if (machine_is_collie())
128 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 146 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK);
129 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 147 else {
130 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 148 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
131 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 149 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
132 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 150 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
151 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
152 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
153 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
154 }
155
133 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 156 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
134 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 157 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
135 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); 158 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
@@ -163,6 +186,15 @@ static inline unsigned int ucb1x00_ts_read_yres(struct ucb1x00_ts *ts)
163 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync); 186 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync);
164} 187}
165 188
189static inline int ucb1x00_ts_pen_down(struct ucb1x00_ts *ts)
190{
191 unsigned int val = ucb1x00_reg_read(ts->ucb, UCB_TS_CR);
192 if (machine_is_collie())
193 return (!(val & (UCB_TS_CR_TSPX_LOW)));
194 else
195 return (val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW));
196}
197
166/* 198/*
167 * This is a RT kernel thread that handles the ADC accesses 199 * This is a RT kernel thread that handles the ADC accesses
168 * (mainly so we can use semaphores in the UCB1200 core code 200 * (mainly so we can use semaphores in the UCB1200 core code
@@ -186,7 +218,7 @@ static int ucb1x00_thread(void *_ts)
186 218
187 add_wait_queue(&ts->irq_wait, &wait); 219 add_wait_queue(&ts->irq_wait, &wait);
188 while (!kthread_should_stop()) { 220 while (!kthread_should_stop()) {
189 unsigned int x, y, p, val; 221 unsigned int x, y, p;
190 signed long timeout; 222 signed long timeout;
191 223
192 ts->restart = 0; 224 ts->restart = 0;
@@ -206,12 +238,12 @@ static int ucb1x00_thread(void *_ts)
206 msleep(10); 238 msleep(10);
207 239
208 ucb1x00_enable(ts->ucb); 240 ucb1x00_enable(ts->ucb);
209 val = ucb1x00_reg_read(ts->ucb, UCB_TS_CR);
210 241
211 if (val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW)) { 242
243 if (ucb1x00_ts_pen_down(ts)) {
212 set_task_state(tsk, TASK_INTERRUPTIBLE); 244 set_task_state(tsk, TASK_INTERRUPTIBLE);
213 245
214 ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, UCB_FALLING); 246 ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, machine_is_collie() ? UCB_RISING : UCB_FALLING);
215 ucb1x00_disable(ts->ucb); 247 ucb1x00_disable(ts->ucb);
216 248
217 /* 249 /*
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index aef80f5e7c9c..b886b07412a6 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -704,15 +704,12 @@ static int pxa_irda_stop(struct net_device *dev)
704 return 0; 704 return 0;
705} 705}
706 706
707static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level) 707static int pxa_irda_suspend(struct device *_dev, pm_message_t state)
708{ 708{
709 struct net_device *dev = dev_get_drvdata(_dev); 709 struct net_device *dev = dev_get_drvdata(_dev);
710 struct pxa_irda *si; 710 struct pxa_irda *si;
711 711
712 if (!dev || level != SUSPEND_DISABLE) 712 if (dev && netif_running(dev)) {
713 return 0;
714
715 if (netif_running(dev)) {
716 si = netdev_priv(dev); 713 si = netdev_priv(dev);
717 netif_device_detach(dev); 714 netif_device_detach(dev);
718 pxa_irda_shutdown(si); 715 pxa_irda_shutdown(si);
@@ -721,15 +718,12 @@ static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level)
721 return 0; 718 return 0;
722} 719}
723 720
724static int pxa_irda_resume(struct device *_dev, u32 level) 721static int pxa_irda_resume(struct device *_dev)
725{ 722{
726 struct net_device *dev = dev_get_drvdata(_dev); 723 struct net_device *dev = dev_get_drvdata(_dev);
727 struct pxa_irda *si; 724 struct pxa_irda *si;
728 725
729 if (!dev || level != RESUME_ENABLE) 726 if (dev && netif_running(dev)) {
730 return 0;
731
732 if (netif_running(dev)) {
733 si = netdev_priv(dev); 727 si = netdev_priv(dev);
734 pxa_irda_startup(si); 728 pxa_irda_startup(si);
735 netif_device_attach(dev); 729 netif_device_attach(dev);
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 77ecee7f987b..da7a8f2dab24 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -59,6 +59,7 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o
59sa1100_cs-y += sa1100_generic.o 59sa1100_cs-y += sa1100_generic.o
60sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o 60sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o
61sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o 61sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o
62sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o
62sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o 63sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o
63sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o 64sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o
64sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o 65sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index a1178a600e3c..bd924336a49f 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -18,10 +18,15 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/device.h> 19#include <linux/device.h>
20 20
21#include <asm/mach-types.h>
21#include <asm/hardware.h> 22#include <asm/hardware.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/hardware/scoop.h> 24#include <asm/hardware/scoop.h>
24#include <asm/arch/pxa-regs.h> 25#ifdef CONFIG_SA1100_COLLIE
26#include <asm/arch-sa1100/collie.h>
27#else
28#include <asm/arch-pxa/pxa-regs.h>
29#endif
25 30
26#include "soc_common.h" 31#include "soc_common.h"
27 32
@@ -38,6 +43,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
38{ 43{
39 int ret; 44 int ret;
40 45
46#ifndef CONFIG_SA1100_COLLIE
41 /* 47 /*
42 * Setup default state of GPIO outputs 48 * Setup default state of GPIO outputs
43 * before we enable them as outputs. 49 * before we enable them as outputs.
@@ -60,6 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
60 pxa_gpio_mode(GPIO55_nPREG_MD); 66 pxa_gpio_mode(GPIO55_nPREG_MD);
61 pxa_gpio_mode(GPIO56_nPWAIT_MD); 67 pxa_gpio_mode(GPIO56_nPWAIT_MD);
62 pxa_gpio_mode(GPIO57_nIOIS16_MD); 68 pxa_gpio_mode(GPIO57_nIOIS16_MD);
69#endif
63 70
64 /* Register interrupts */ 71 /* Register interrupts */
65 if (scoop_devs[skt->nr].cd_irq >= 0) { 72 if (scoop_devs[skt->nr].cd_irq >= 0) {
@@ -213,12 +220,20 @@ static void sharpsl_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
213 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); 220 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0);
214 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); 221 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101);
215 scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; 222 scoop_devs[skt->nr].keep_vs = NO_KEEP_VS;
223
224 if (machine_is_collie())
225 /* We need to disable SS_OUTPUT_ENA here. */
226 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080);
216} 227}
217 228
218static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) 229static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
219{ 230{
220 /* CF_BUS_OFF */ 231 /* CF_BUS_OFF */
221 sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); 232 sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]);
233
234 if (machine_is_collie())
235 /* We need to disable SS_OUTPUT_ENA here. */
236 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080);
222} 237}
223 238
224static struct pcmcia_low_level sharpsl_pcmcia_ops = { 239static struct pcmcia_low_level sharpsl_pcmcia_ops = {
@@ -235,6 +250,19 @@ static struct pcmcia_low_level sharpsl_pcmcia_ops = {
235 250
236static struct platform_device *sharpsl_pcmcia_device; 251static struct platform_device *sharpsl_pcmcia_device;
237 252
253#ifdef CONFIG_SA1100_COLLIE
254int __init pcmcia_collie_init(struct device *dev)
255{
256 int ret = -ENODEV;
257
258 if (machine_is_collie())
259 ret = sa11xx_drv_pcmcia_probe(dev, &sharpsl_pcmcia_ops, 0, 1);
260
261 return ret;
262}
263
264#else
265
238static int __init sharpsl_pcmcia_init(void) 266static int __init sharpsl_pcmcia_init(void)
239{ 267{
240 int ret; 268 int ret;
@@ -269,6 +297,7 @@ static void __exit sharpsl_pcmcia_exit(void)
269 297
270fs_initcall(sharpsl_pcmcia_init); 298fs_initcall(sharpsl_pcmcia_init);
271module_exit(sharpsl_pcmcia_exit); 299module_exit(sharpsl_pcmcia_exit);
300#endif
272 301
273MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); 302MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support");
274MODULE_LICENSE("GPL"); 303MODULE_LICENSE("GPL");
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index b768fa81f043..acf60ffc8a12 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -38,8 +38,12 @@
38#include <pcmcia/cs.h> 38#include <pcmcia/cs.h>
39#include <pcmcia/ss.h> 39#include <pcmcia/ss.h>
40 40
41#include <asm/hardware/scoop.h>
42
41#include "sa1100_generic.h" 43#include "sa1100_generic.h"
42 44
45int __init pcmcia_collie_init(struct device *dev);
46
43static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { 47static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
44#ifdef CONFIG_SA1100_ASSABET 48#ifdef CONFIG_SA1100_ASSABET
45 pcmcia_assabet_init, 49 pcmcia_assabet_init,
@@ -56,6 +60,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
56#ifdef CONFIG_SA1100_SIMPAD 60#ifdef CONFIG_SA1100_SIMPAD
57 pcmcia_simpad_init, 61 pcmcia_simpad_init,
58#endif 62#endif
63#ifdef CONFIG_SA1100_COLLIE
64 pcmcia_collie_init,
65#endif
59}; 66};
60 67
61static int sa11x0_drv_pcmcia_probe(struct device *dev) 68static int sa11x0_drv_pcmcia_probe(struct device *dev)