aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 19:06:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 19:06:58 -0400
commit85082fd7cbe3173198aac0eb5e85ab1edcc6352c (patch)
treeedbc09b7945994f78668d218fa02e991c3b3b365 /drivers/pcmcia
parent666484f0250db2e016948d63b3ef33e202e3b8d0 (diff)
parent53ffe3b440aa85af6fc4eda09b2d44bcdd312d4d (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (241 commits) [ARM] 5171/1: ep93xx: fix compilation of modules using clocks [ARM] 5133/2: at91sam9g20 defconfig file [ARM] 5130/4: Support for the at91sam9g20 [ARM] 5160/1: IOP3XX: gpio/gpiolib support [ARM] at91: Fix NAND FLASH timings for at91sam9x evaluation kits. [ARM] 5084/1: zylonite: Register AC97 device [ARM] 5085/2: PXA: Move AC97 over to the new central device declaration model [ARM] 5120/1: pxa: correct platform driver names for PXA25x and PXA27x UDC drivers [ARM] 5147/1: pxaficp_ir: drop pxa_gpio_mode calls, as pin setting [ARM] 5145/1: PXA2xx: provide api to control IrDA pins state [ARM] 5144/1: pxaficp_ir: cleanup includes [ARM] pxa: remove pxa_set_cken() [ARM] pxa: allow clk aliases [ARM] Feroceon: don't disable BPU on boot [ARM] Orion: LED support for HP mv2120 [ARM] Orion: add RD88F5181L-FXO support [ARM] Orion: add RD88F5181L-GE support [ARM] Orion: add Netgear WNR854T support [ARM] s3c2410_defconfig: update for current build [ARM] Acer n30: Minor style and indentation fixes. ...
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/omap_cf.c25
-rw-r--r--drivers/pcmcia/pxa2xx_cm_x270.c15
-rw-r--r--drivers/pcmcia/pxa2xx_mainstone.c13
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c12
4 files changed, 40 insertions, 25 deletions
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 46314b420765..569b746b5731 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -38,19 +38,19 @@
38#define CF_BASE 0xfffe2800 38#define CF_BASE 0xfffe2800
39 39
40/* status; read after IRQ */ 40/* status; read after IRQ */
41#define CF_STATUS_REG __REG16(CF_BASE + 0x00) 41#define CF_STATUS (CF_BASE + 0x00)
42# define CF_STATUS_BAD_READ (1 << 2) 42# define CF_STATUS_BAD_READ (1 << 2)
43# define CF_STATUS_BAD_WRITE (1 << 1) 43# define CF_STATUS_BAD_WRITE (1 << 1)
44# define CF_STATUS_CARD_DETECT (1 << 0) 44# define CF_STATUS_CARD_DETECT (1 << 0)
45 45
46/* which chipselect (CS0..CS3) is used for CF (active low) */ 46/* which chipselect (CS0..CS3) is used for CF (active low) */
47#define CF_CFG_REG __REG16(CF_BASE + 0x02) 47#define CF_CFG (CF_BASE + 0x02)
48 48
49/* card reset */ 49/* card reset */
50#define CF_CONTROL_REG __REG16(CF_BASE + 0x04) 50#define CF_CONTROL (CF_BASE + 0x04)
51# define CF_CONTROL_RESET (1 << 0) 51# define CF_CONTROL_RESET (1 << 0)
52 52
53#define omap_cf_present() (!(CF_STATUS_REG & CF_STATUS_CARD_DETECT)) 53#define omap_cf_present() (!(omap_readw(CF_STATUS) & CF_STATUS_CARD_DETECT))
54 54
55/*--------------------------------------------------------------------------*/ 55/*--------------------------------------------------------------------------*/
56 56
@@ -139,11 +139,11 @@ omap_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s)
139 return -EINVAL; 139 return -EINVAL;
140 } 140 }
141 141
142 control = CF_CONTROL_REG; 142 control = omap_readw(CF_CONTROL);
143 if (s->flags & SS_RESET) 143 if (s->flags & SS_RESET)
144 CF_CONTROL_REG = CF_CONTROL_RESET; 144 omap_writew(CF_CONTROL_RESET, CF_CONTROL);
145 else 145 else
146 CF_CONTROL_REG = 0; 146 omap_writew(0, CF_CONTROL);
147 147
148 pr_debug("%s: Vcc %d, io_irq %d, flags %04x csc %04x\n", 148 pr_debug("%s: Vcc %d, io_irq %d, flags %04x csc %04x\n",
149 driver_name, s->Vcc, s->io_irq, s->flags, s->csc_mask); 149 driver_name, s->Vcc, s->io_irq, s->flags, s->csc_mask);
@@ -270,7 +270,7 @@ static int __init omap_cf_probe(struct platform_device *pdev)
270 omap_cfg_reg(V10_1610_CF_IREQ); 270 omap_cfg_reg(V10_1610_CF_IREQ);
271 omap_cfg_reg(W10_1610_CF_RESET); 271 omap_cfg_reg(W10_1610_CF_RESET);
272 272
273 CF_CFG_REG = ~(1 << seg); 273 omap_writew(~(1 << seg), CF_CFG);
274 274
275 pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq); 275 pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq);
276 276
@@ -279,14 +279,15 @@ static int __init omap_cf_probe(struct platform_device *pdev)
279 * CF/PCMCIA variants... 279 * CF/PCMCIA variants...
280 */ 280 */
281 pr_debug("%s: cs%d, previous ccs %08x acs %08x\n", driver_name, 281 pr_debug("%s: cs%d, previous ccs %08x acs %08x\n", driver_name,
282 seg, EMIFS_CCS(seg), EMIFS_ACS(seg)); 282 seg, omap_readl(EMIFS_CCS(seg)), omap_readl(EMIFS_ACS(seg)));
283 EMIFS_CCS(seg) = 0x0004a1b3; /* synch mode 4 etc */ 283 omap_writel(0x0004a1b3, EMIFS_CCS(seg)); /* synch mode 4 etc */
284 EMIFS_ACS(seg) = 0x00000000; /* OE hold/setup */ 284 omap_writel(0x00000000, EMIFS_ACS(seg)); /* OE hold/setup */
285 285
286 /* CF uses armxor_ck, which is "always" available */ 286 /* CF uses armxor_ck, which is "always" available */
287 287
288 pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name, 288 pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name,
289 CF_STATUS_REG, CF_CFG_REG, CF_CONTROL_REG, 289 omap_readw(CF_STATUS), omap_readw(CF_CFG),
290 omap_readw(CF_CONTROL),
290 omap_cf_present() ? "present" : "(not present)"); 291 omap_cf_present() ? "present" : "(not present)");
291 292
292 cf->socket.owner = THIS_MODULE; 293 cf->socket.owner = THIS_MODULE;
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
index e7ab060ff118..f123fce65f2e 100644
--- a/drivers/pcmcia/pxa2xx_cm_x270.c
+++ b/drivers/pcmcia/pxa2xx_cm_x270.c
@@ -18,6 +18,7 @@
18 18
19#include <pcmcia/ss.h> 19#include <pcmcia/ss.h>
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/mach-types.h>
21 22
22#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
23#include <asm/arch/pxa2xx-gpio.h> 24#include <asm/arch/pxa2xx-gpio.h>
@@ -130,7 +131,7 @@ static void cmx270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
130} 131}
131 132
132 133
133static struct pcmcia_low_level cmx270_pcmcia_ops = { 134static struct pcmcia_low_level cmx270_pcmcia_ops __initdata = {
134 .owner = THIS_MODULE, 135 .owner = THIS_MODULE,
135 .hw_init = cmx270_pcmcia_hw_init, 136 .hw_init = cmx270_pcmcia_hw_init,
136 .hw_shutdown = cmx270_pcmcia_shutdown, 137 .hw_shutdown = cmx270_pcmcia_shutdown,
@@ -147,15 +148,21 @@ static int __init cmx270_pcmcia_init(void)
147{ 148{
148 int ret; 149 int ret;
149 150
151 if (!machine_is_armcore())
152 return -ENODEV;
153
150 cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); 154 cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
151 155
152 if (!cmx270_pcmcia_device) 156 if (!cmx270_pcmcia_device)
153 return -ENOMEM; 157 return -ENOMEM;
154 158
155 cmx270_pcmcia_device->dev.platform_data = &cmx270_pcmcia_ops; 159 ret = platform_device_add_data(cmx270_pcmcia_device, &cmx270_pcmcia_ops,
160 sizeof(cmx270_pcmcia_ops));
156 161
157 printk(KERN_INFO "Registering cm-x270 PCMCIA interface.\n"); 162 if (ret == 0) {
158 ret = platform_device_add(cmx270_pcmcia_device); 163 printk(KERN_INFO "Registering cm-x270 PCMCIA interface.\n");
164 ret = platform_device_add(cmx270_pcmcia_device);
165 }
159 166
160 if (ret) 167 if (ret)
161 platform_device_put(cmx270_pcmcia_device); 168 platform_device_put(cmx270_pcmcia_device);
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index 145b85e0f02c..92d1cc33808c 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -22,6 +22,7 @@
22#include <pcmcia/ss.h> 22#include <pcmcia/ss.h>
23 23
24#include <asm/hardware.h> 24#include <asm/hardware.h>
25#include <asm/mach-types.h>
25#include <asm/irq.h> 26#include <asm/irq.h>
26 27
27#include <asm/arch/pxa-regs.h> 28#include <asm/arch/pxa-regs.h>
@@ -136,7 +137,7 @@ static void mst_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
136{ 137{
137} 138}
138 139
139static struct pcmcia_low_level mst_pcmcia_ops = { 140static struct pcmcia_low_level mst_pcmcia_ops __initdata = {
140 .owner = THIS_MODULE, 141 .owner = THIS_MODULE,
141 .hw_init = mst_pcmcia_hw_init, 142 .hw_init = mst_pcmcia_hw_init,
142 .hw_shutdown = mst_pcmcia_hw_shutdown, 143 .hw_shutdown = mst_pcmcia_hw_shutdown,
@@ -153,13 +154,17 @@ static int __init mst_pcmcia_init(void)
153{ 154{
154 int ret; 155 int ret;
155 156
157 if (!machine_is_mainstone())
158 return -ENODEV;
159
156 mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); 160 mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
157 if (!mst_pcmcia_device) 161 if (!mst_pcmcia_device)
158 return -ENOMEM; 162 return -ENOMEM;
159 163
160 mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops; 164 ret = platform_device_add_data(mst_pcmcia_device, &mst_pcmcia_ops,
161 165 sizeof(mst_pcmcia_ops));
162 ret = platform_device_add(mst_pcmcia_device); 166 if (ret == 0)
167 ret = platform_device_add(mst_pcmcia_device);
163 168
164 if (ret) 169 if (ret)
165 platform_device_put(mst_pcmcia_device); 170 platform_device_put(mst_pcmcia_device);
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index d5c33bd78d68..d71f93d45833 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -222,7 +222,7 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
222 sharpsl_pcmcia_init_reset(skt); 222 sharpsl_pcmcia_init_reset(skt);
223} 223}
224 224
225static struct pcmcia_low_level sharpsl_pcmcia_ops = { 225static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = {
226 .owner = THIS_MODULE, 226 .owner = THIS_MODULE,
227 .hw_init = sharpsl_pcmcia_hw_init, 227 .hw_init = sharpsl_pcmcia_hw_init,
228 .hw_shutdown = sharpsl_pcmcia_hw_shutdown, 228 .hw_shutdown = sharpsl_pcmcia_hw_shutdown,
@@ -261,10 +261,12 @@ static int __init sharpsl_pcmcia_init(void)
261 if (!sharpsl_pcmcia_device) 261 if (!sharpsl_pcmcia_device)
262 return -ENOMEM; 262 return -ENOMEM;
263 263
264 sharpsl_pcmcia_device->dev.platform_data = &sharpsl_pcmcia_ops; 264 ret = platform_device_add_data(sharpsl_pcmcia_device,
265 sharpsl_pcmcia_device->dev.parent = platform_scoop_config->devs[0].dev; 265 &sharpsl_pcmcia_ops, sizeof(sharpsl_pcmcia_ops));
266 266 if (ret == 0) {
267 ret = platform_device_add(sharpsl_pcmcia_device); 267 sharpsl_pcmcia_device->dev.parent = platform_scoop_config->devs[0].dev;
268 ret = platform_device_add(sharpsl_pcmcia_device);
269 }
268 270
269 if (ret) 271 if (ret)
270 platform_device_put(sharpsl_pcmcia_device); 272 platform_device_put(sharpsl_pcmcia_device);