2 * drivers/pcmcia/m32r_cfc.c
4 * Device driver for the CFC functionality of M32R.
6 * Copyright (c) 2001, 2002, 2003, 2004
7 * Hiroyuki Kondo, Naoto Sugai, Hayato Fujiwara
10 #include <linux/module.h>
11 #include <linux/moduleparam.h>
12 #include <linux/init.h>
13 #include <linux/types.h>
14 #include <linux/fcntl.h>
15 #include <linux/string.h>
16 #include <linux/kernel.h>
17 #include <linux/errno.h>
18 #include <linux/timer.h>
19 #include <linux/ioport.h>
20 #include <linux/delay.h>
21 #include <linux/workqueue.h>
22 #include <linux/interrupt.h>
23 #include <linux/platform_device.h>
24 #include <linux/bitops.h>
28 #include <pcmcia/ss.h>
30 #undef MAX_IO_WIN /* FIXME */
32 #undef MAX_WIN /* FIXME */
37 /* Poll status interval -- 0 means default to interrupt */
38 static int poll_interval
= 0;
40 typedef enum pcc_space
{ as_none
= 0, as_comm
, as_attr
, as_io
} pcc_as_t
;
42 typedef struct pcc_socket
{
44 struct pcmcia_socket socket
;
48 u_long base
; /* PCC register base */
49 u_char cs_irq1
, cs_irq2
, intr
;
50 pccard_io_map io_map
[MAX_IO_WIN
];
51 pccard_mem_map mem_map
[MAX_WIN
];
54 pcc_as_t current_space
;
57 struct proc_dir_entry
*proc
;
61 static int pcc_sockets
= 0;
62 static pcc_socket_t socket
[M32R_MAX_PCC
] = {
66 /*====================================================================*/
68 static unsigned int pcc_get(u_short
, unsigned int);
69 static void pcc_set(u_short
, unsigned int , unsigned int );
71 static DEFINE_SPINLOCK(pcc_lock
);
73 #if !defined(CONFIG_PLAT_USRV)
74 static inline u_long
pcc_port2addr(unsigned long port
, int size
) {
78 if (size
== 1) { /* byte access */
81 addr
= CFC_IO_MAPBASE_BYTE
- CFC_IOPORT_BASE
+ odd
+ port
;
83 addr
= CFC_IO_MAPBASE_WORD
- CFC_IOPORT_BASE
+ port
;
87 #else /* CONFIG_PLAT_USRV */
88 static inline u_long
pcc_port2addr(unsigned long port
, int size
) {
90 u_long addr
= ((port
- CFC_IOPORT_BASE
) & 0xf000) << 8;
92 if (size
== 1) { /* byte access */
96 addr
= (addr
| CFC_IO_MAPBASE_BYTE
) + odd
+ (port
& 0xfff);
97 } else if (size
== 2) /* word access */
98 addr
= (addr
| CFC_IO_MAPBASE_WORD
) + (port
& 0xfff);
102 #endif /* CONFIG_PLAT_USRV */
104 void pcc_ioread_byte(int sock
, unsigned long port
, void *buf
, size_t size
,
105 size_t nmemb
, int flag
)
108 unsigned char *bp
= (unsigned char *)buf
;
111 pr_debug("m32r_cfc: pcc_ioread_byte: sock=%d, port=%#lx, buf=%p, "
112 "size=%u, nmemb=%d, flag=%d\n",
113 sock
, port
, buf
, size
, nmemb
, flag
);
115 addr
= pcc_port2addr(port
, 1);
117 printk("m32r_cfc:ioread_byte null port :%#lx\n",port
);
120 pr_debug("m32r_cfc: pcc_ioread_byte: addr=%#lx\n", addr
);
122 spin_lock_irqsave(&pcc_lock
, flags
);
126 spin_unlock_irqrestore(&pcc_lock
, flags
);
129 void pcc_ioread_word(int sock
, unsigned long port
, void *buf
, size_t size
,
130 size_t nmemb
, int flag
)
133 unsigned short *bp
= (unsigned short *)buf
;
136 pr_debug("m32r_cfc: pcc_ioread_word: sock=%d, port=%#lx, "
137 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
138 sock
, port
, buf
, size
, nmemb
, flag
);
141 printk("m32r_cfc: ioread_word :illigal size %u : %#lx\n", size
,
144 printk("m32r_cfc: ioread_word :insw \n");
146 addr
= pcc_port2addr(port
, 2);
148 printk("m32r_cfc:ioread_word null port :%#lx\n",port
);
151 pr_debug("m32r_cfc: pcc_ioread_word: addr=%#lx\n", addr
);
153 spin_lock_irqsave(&pcc_lock
, flags
);
157 spin_unlock_irqrestore(&pcc_lock
, flags
);
160 void pcc_iowrite_byte(int sock
, unsigned long port
, void *buf
, size_t size
,
161 size_t nmemb
, int flag
)
164 unsigned char *bp
= (unsigned char *)buf
;
167 pr_debug("m32r_cfc: pcc_iowrite_byte: sock=%d, port=%#lx, "
168 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
169 sock
, port
, buf
, size
, nmemb
, flag
);
172 addr
= pcc_port2addr(port
, 1);
174 printk("m32r_cfc:iowrite_byte null port:%#lx\n",port
);
177 pr_debug("m32r_cfc: pcc_iowrite_byte: addr=%#lx\n", addr
);
179 spin_lock_irqsave(&pcc_lock
, flags
);
182 spin_unlock_irqrestore(&pcc_lock
, flags
);
185 void pcc_iowrite_word(int sock
, unsigned long port
, void *buf
, size_t size
,
186 size_t nmemb
, int flag
)
189 unsigned short *bp
= (unsigned short *)buf
;
192 pr_debug("m32r_cfc: pcc_iowrite_word: sock=%d, port=%#lx, "
193 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
194 sock
, port
, buf
, size
, nmemb
, flag
);
197 printk("m32r_cfc: iowrite_word :illigal size %u : %#lx\n",
200 printk("m32r_cfc: iowrite_word :outsw \n");
202 addr
= pcc_port2addr(port
, 2);
204 printk("m32r_cfc:iowrite_word null addr :%#lx\n",port
);
209 printk("m32r_cfc:iowrite_word port addr (%#lx):%#lx\n", port
,
214 pr_debug("m32r_cfc: pcc_iowrite_word: addr=%#lx\n", addr
);
216 spin_lock_irqsave(&pcc_lock
, flags
);
219 spin_unlock_irqrestore(&pcc_lock
, flags
);
222 /*====================================================================*/
224 #define IS_REGISTERED 0x2000
225 #define IS_ALIVE 0x8000
227 typedef struct pcc_t
{
232 static pcc_t pcc
[] = {
233 #if !defined(CONFIG_PLAT_USRV)
234 { "m32r_cfc", 0 }, { "", 0 },
235 #else /* CONFIG_PLAT_USRV */
236 { "m32r_cfc", 0 }, { "m32r_cfc", 0 }, { "m32r_cfc", 0 },
237 { "m32r_cfc", 0 }, { "m32r_cfc", 0 }, { "", 0 },
238 #endif /* CONFIG_PLAT_USRV */
241 static irqreturn_t
pcc_interrupt(int, void *);
243 /*====================================================================*/
245 static struct timer_list poll_timer
;
247 static unsigned int pcc_get(u_short sock
, unsigned int reg
)
249 unsigned int val
= inw(reg
);
250 pr_debug("m32r_cfc: pcc_get: reg(0x%08x)=0x%04x\n", reg
, val
);
255 static void pcc_set(u_short sock
, unsigned int reg
, unsigned int data
)
258 pr_debug("m32r_cfc: pcc_set: reg(0x%08x)=0x%04x\n", reg
, data
);
261 /*======================================================================
263 See if a card is present, powered up, in IO mode, and already
264 bound to a (non PC Card) Linux driver. We leave these alone.
266 We make an exception for cards that seem to be serial devices.
268 ======================================================================*/
270 static int __init
is_alive(u_short sock
)
274 pr_debug("m32r_cfc: is_alive:\n");
277 stat
= pcc_get(sock
, (unsigned int)PLD_CFSTS
);
280 printk("Card is detected at socket %d : stat = 0x%08x\n", sock
, stat
);
281 pr_debug("m32r_cfc: is_alive: sock stat is 0x%04x\n", stat
);
286 static void add_pcc_socket(ulong base
, int irq
, ulong mapaddr
,
289 pcc_socket_t
*t
= &socket
[pcc_sockets
];
291 pr_debug("m32r_cfc: add_pcc_socket: base=%#lx, irq=%d, "
292 "mapaddr=%#lx, ioaddr=%08x\n",
293 base
, irq
, mapaddr
, ioaddr
);
297 t
->mapaddr
= mapaddr
;
298 #if !defined(CONFIG_PLAT_USRV)
301 t
->cs_irq1
= irq
; // insert irq
302 t
->cs_irq2
= irq
+ 1; // eject irq
303 #else /* CONFIG_PLAT_USRV */
306 t
->cs_irq1
= 0; // insert irq
307 t
->cs_irq2
= 0; // eject irq
308 #endif /* CONFIG_PLAT_USRV */
310 if (is_alive(pcc_sockets
))
311 t
->flags
|= IS_ALIVE
;
314 #if !defined(CONFIG_PLAT_USRV)
315 request_region((unsigned int)PLD_CFRSTCR
, 0x20, "m32r_cfc");
316 #else /* CONFIG_PLAT_USRV */
318 unsigned int reg_base
;
320 reg_base
= (unsigned int)PLD_CFRSTCR
;
321 reg_base
|= pcc_sockets
<< 8;
322 request_region(reg_base
, 0x20, "m32r_cfc");
324 #endif /* CONFIG_PLAT_USRV */
325 printk(KERN_INFO
" %s ", pcc
[pcc_sockets
].name
);
326 printk("pcc at 0x%08lx\n", t
->base
);
328 /* Update socket interrupt information, capabilities */
329 t
->socket
.features
|= (SS_CAP_PCCARD
| SS_CAP_STATIC_MAP
);
330 t
->socket
.map_size
= M32R_PCC_MAPSIZE
;
331 t
->socket
.io_offset
= ioaddr
; /* use for io access offset */
332 t
->socket
.irq_mask
= 0;
333 #if !defined(CONFIG_PLAT_USRV)
334 t
->socket
.pci_irq
= PLD_IRQ_CFIREQ
; /* card interrupt */
335 #else /* CONFIG_PLAT_USRV */
336 t
->socket
.pci_irq
= PLD_IRQ_CF0
+ pcc_sockets
;
337 #endif /* CONFIG_PLAT_USRV */
339 #ifndef CONFIG_PLAT_USRV
340 /* insert interrupt */
341 request_irq(irq
, pcc_interrupt
, 0, "m32r_cfc", pcc_interrupt
);
342 #ifndef CONFIG_PLAT_MAPPI3
343 /* eject interrupt */
344 request_irq(irq
+1, pcc_interrupt
, 0, "m32r_cfc", pcc_interrupt
);
346 pr_debug("m32r_cfc: enable CFMSK, RDYSEL\n");
347 pcc_set(pcc_sockets
, (unsigned int)PLD_CFIMASK
, 0x01);
348 #endif /* CONFIG_PLAT_USRV */
349 #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)
350 pcc_set(pcc_sockets
, (unsigned int)PLD_CFCR1
, 0x0200);
358 /*====================================================================*/
360 static irqreturn_t
pcc_interrupt(int irq
, void *dev
)
366 pr_debug("m32r_cfc: pcc_interrupt: irq=%d, dev=%p\n", irq
, dev
);
367 for (i
= 0; i
< pcc_sockets
; i
++) {
368 if (socket
[i
].cs_irq1
!= irq
&& socket
[i
].cs_irq2
!= irq
)
372 pr_debug("m32r_cfc: pcc_interrupt: socket %d irq 0x%02x ",
374 events
|= SS_DETECT
; /* insert or eject */
376 pcmcia_parse_events(&socket
[i
].socket
, events
);
378 pr_debug("m32r_cfc: pcc_interrupt: done\n");
380 return IRQ_RETVAL(handled
);
381 } /* pcc_interrupt */
383 static void pcc_interrupt_wrapper(struct timer_list
*unused
)
385 pr_debug("m32r_cfc: pcc_interrupt_wrapper:\n");
386 pcc_interrupt(0, NULL
);
387 poll_timer
.expires
= jiffies
+ poll_interval
;
388 add_timer(&poll_timer
);
391 /*====================================================================*/
393 static int _pcc_get_status(u_short sock
, u_int
*value
)
397 pr_debug("m32r_cfc: _pcc_get_status:\n");
398 status
= pcc_get(sock
, (unsigned int)PLD_CFSTS
);
399 *value
= (status
) ? SS_DETECT
: 0;
400 pr_debug("m32r_cfc: _pcc_get_status: status=0x%08x\n", status
);
402 #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)
404 /* enable CF power */
405 status
= inw((unsigned int)PLD_CPCR
);
406 if (!(status
& PLD_CPCR_CF
)) {
407 pr_debug("m32r_cfc: _pcc_get_status: "
408 "power on (CPCR=0x%08x)\n", status
);
409 status
|= PLD_CPCR_CF
;
410 outw(status
, (unsigned int)PLD_CPCR
);
413 *value
|= SS_POWERON
;
415 pcc_set(sock
, (unsigned int)PLD_CFBUFCR
,0);/* enable buffer */
418 *value
|= SS_READY
; /* always ready */
421 /* disable CF power */
422 status
= inw((unsigned int)PLD_CPCR
);
423 status
&= ~PLD_CPCR_CF
;
424 outw(status
, (unsigned int)PLD_CPCR
);
426 pr_debug("m32r_cfc: _pcc_get_status: "
427 "power off (CPCR=0x%08x)\n", status
);
429 #elif defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
431 status
= pcc_get(sock
, (unsigned int)PLD_CPCR
);
432 if (status
== 0) { /* power off */
433 pcc_set(sock
, (unsigned int)PLD_CPCR
, 1);
434 pcc_set(sock
, (unsigned int)PLD_CFBUFCR
,0); /* force buffer off for ZA-36 */
437 *value
|= SS_POWERON
;
439 pcc_set(sock
, (unsigned int)PLD_CFBUFCR
,0);
441 pcc_set(sock
, (unsigned int)PLD_CFRSTCR
, 0x0101);
442 udelay(25); /* for IDE reset */
443 pcc_set(sock
, (unsigned int)PLD_CFRSTCR
, 0x0100);
444 mdelay(2); /* for IDE reset */
449 /* disable CF power */
450 pcc_set(sock
, (unsigned int)PLD_CPCR
, 0);
452 pr_debug("m32r_cfc: _pcc_get_status: "
453 "power off (CPCR=0x%08x)\n", status
);
456 #error no platform configuration
458 pr_debug("m32r_cfc: _pcc_get_status: GetStatus(%d) = %#4.4x\n",
463 /*====================================================================*/
465 static int _pcc_set_socket(u_short sock
, socket_state_t
*state
)
467 pr_debug("m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
468 "io_irq %d, csc_mask %#2.2x)\n", sock
, state
->flags
,
469 state
->Vcc
, state
->Vpp
, state
->io_irq
, state
->csc_mask
);
471 #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
473 if ((state
->Vcc
!= 50) && (state
->Vcc
!= 33))
475 /* accept 5V and 3.3V */
478 if (state
->flags
& SS_RESET
) {
479 pr_debug(":RESET\n");
480 pcc_set(sock
,(unsigned int)PLD_CFRSTCR
,0x101);
482 pcc_set(sock
,(unsigned int)PLD_CFRSTCR
,0x100);
484 if (state
->flags
& SS_OUTPUT_ENA
){
485 pr_debug(":OUTPUT_ENA\n");
487 pcc_set(sock
,(unsigned int)PLD_CFBUFCR
,0);
489 pcc_set(sock
,(unsigned int)PLD_CFBUFCR
,1);
492 if(state
->flags
& SS_IOCARD
){
495 if (state
->flags
& SS_PWR_AUTO
) {
496 pr_debug(":PWR_AUTO");
498 if (state
->csc_mask
& SS_DETECT
)
499 pr_debug(":csc-SS_DETECT");
500 if (state
->flags
& SS_IOCARD
) {
501 if (state
->csc_mask
& SS_STSCHG
)
504 if (state
->csc_mask
& SS_BATDEAD
)
505 pr_debug(":BATDEAD");
506 if (state
->csc_mask
& SS_BATWARN
)
507 pr_debug(":BATWARN");
508 if (state
->csc_mask
& SS_READY
)
515 /*====================================================================*/
517 static int _pcc_set_io_map(u_short sock
, struct pccard_io_map
*io
)
521 pr_debug("m32r_cfc: SetIOMap(%d, %d, %#2.2x, %d ns, "
522 "%#llx-%#llx)\n", sock
, io
->map
, io
->flags
,
523 io
->speed
, (unsigned long long)io
->start
,
524 (unsigned long long)io
->stop
);
530 /*====================================================================*/
532 static int _pcc_set_mem_map(u_short sock
, struct pccard_mem_map
*mem
)
535 u_char map
= mem
->map
;
537 pcc_socket_t
*t
= &socket
[sock
];
539 pr_debug("m32r_cfc: SetMemMap(%d, %d, %#2.2x, %d ns, "
540 "%#llx, %#x)\n", sock
, map
, mem
->flags
,
541 mem
->speed
, (unsigned long long)mem
->static_start
,
547 if ((map
> MAX_WIN
) || (mem
->card_start
> 0x3ffffff)){
554 if ((mem
->flags
& MAP_ACTIVE
) == 0) {
555 t
->current_space
= as_none
;
562 if (mem
->flags
& MAP_ATTRIB
) {
563 t
->current_space
= as_attr
;
565 t
->current_space
= as_comm
;
571 addr
= t
->mapaddr
+ (mem
->card_start
& M32R_PCC_MAPMASK
);
572 mem
->static_start
= addr
+ mem
->card_start
;
578 #if 0 /* driver model ordering issue */
579 /*======================================================================
581 Routines for accessing socket information and register dumps via
584 ======================================================================*/
586 static ssize_t
show_info(struct class_device
*class_dev
, char *buf
)
588 pcc_socket_t
*s
= container_of(class_dev
, struct pcc_socket
,
591 return sprintf(buf
, "type: %s\nbase addr: 0x%08lx\n",
592 pcc
[s
->type
].name
, s
->base
);
595 static ssize_t
show_exca(struct class_device
*class_dev
, char *buf
)
602 static CLASS_DEVICE_ATTR(info
, S_IRUGO
, show_info
, NULL
);
603 static CLASS_DEVICE_ATTR(exca
, S_IRUGO
, show_exca
, NULL
);
606 /*====================================================================*/
608 /* this is horribly ugly... proper locking needs to be done here at
610 #define LOCKED(x) do { \
612 unsigned long flags; \
613 spin_lock_irqsave(&pcc_lock, flags); \
615 spin_unlock_irqrestore(&pcc_lock, flags); \
620 static int pcc_get_status(struct pcmcia_socket
*s
, u_int
*value
)
622 unsigned int sock
= container_of(s
, struct pcc_socket
, socket
)->number
;
624 if (socket
[sock
].flags
& IS_ALIVE
) {
625 dev_dbg(&s
->dev
, "pcc_get_status: sock(%d) -EINVAL\n", sock
);
629 dev_dbg(&s
->dev
, "pcc_get_status: sock(%d)\n", sock
);
630 LOCKED(_pcc_get_status(sock
, value
));
633 static int pcc_set_socket(struct pcmcia_socket
*s
, socket_state_t
*state
)
635 unsigned int sock
= container_of(s
, struct pcc_socket
, socket
)->number
;
637 if (socket
[sock
].flags
& IS_ALIVE
) {
638 dev_dbg(&s
->dev
, "pcc_set_socket: sock(%d) -EINVAL\n", sock
);
641 dev_dbg(&s
->dev
, "pcc_set_socket: sock(%d)\n", sock
);
642 LOCKED(_pcc_set_socket(sock
, state
));
645 static int pcc_set_io_map(struct pcmcia_socket
*s
, struct pccard_io_map
*io
)
647 unsigned int sock
= container_of(s
, struct pcc_socket
, socket
)->number
;
649 if (socket
[sock
].flags
& IS_ALIVE
) {
650 dev_dbg(&s
->dev
, "pcc_set_io_map: sock(%d) -EINVAL\n", sock
);
653 dev_dbg(&s
->dev
, "pcc_set_io_map: sock(%d)\n", sock
);
654 LOCKED(_pcc_set_io_map(sock
, io
));
657 static int pcc_set_mem_map(struct pcmcia_socket
*s
, struct pccard_mem_map
*mem
)
659 unsigned int sock
= container_of(s
, struct pcc_socket
, socket
)->number
;
661 if (socket
[sock
].flags
& IS_ALIVE
) {
662 dev_dbg(&s
->dev
, "pcc_set_mem_map: sock(%d) -EINVAL\n", sock
);
665 dev_dbg(&s
->dev
, "pcc_set_mem_map: sock(%d)\n", sock
);
666 LOCKED(_pcc_set_mem_map(sock
, mem
));
669 static int pcc_init(struct pcmcia_socket
*s
)
671 dev_dbg(&s
->dev
, "pcc_init()\n");
675 static struct pccard_operations pcc_operations
= {
677 .get_status
= pcc_get_status
,
678 .set_socket
= pcc_set_socket
,
679 .set_io_map
= pcc_set_io_map
,
680 .set_mem_map
= pcc_set_mem_map
,
684 /*====================================================================*/
686 static struct platform_driver pcc_driver
= {
692 static struct platform_device pcc_device
= {
697 /*====================================================================*/
699 static int __init
init_m32r_pcc(void)
703 ret
= platform_driver_register(&pcc_driver
);
707 ret
= platform_device_register(&pcc_device
);
709 platform_driver_unregister(&pcc_driver
);
713 #if defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
714 pcc_set(0, (unsigned int)PLD_CFCR0
, 0x0f0f);
715 pcc_set(0, (unsigned int)PLD_CFCR1
, 0x0200);
720 #if !defined(CONFIG_PLAT_USRV)
721 add_pcc_socket(M32R_PCC0_BASE
, PLD_IRQ_CFC_INSERT
, CFC_ATTR_MAPBASE
,
723 #else /* CONFIG_PLAT_USRV */
728 for (i
= 0 ; i
< M32R_MAX_PCC
; i
++) {
729 base
= (ulong
)PLD_CFRSTCR
;
730 base
= base
| (i
<< 8);
731 ioaddr
= (i
+ 1) << 12;
732 mapaddr
= CFC_ATTR_MAPBASE
| (i
<< 20);
733 add_pcc_socket(base
, 0, mapaddr
, ioaddr
);
736 #endif /* CONFIG_PLAT_USRV */
738 if (pcc_sockets
== 0) {
739 printk("socket is not found.\n");
740 platform_device_unregister(&pcc_device
);
741 platform_driver_unregister(&pcc_driver
);
745 /* Set up interrupt handler(s) */
747 for (i
= 0 ; i
< pcc_sockets
; i
++) {
748 socket
[i
].socket
.dev
.parent
= &pcc_device
.dev
;
749 socket
[i
].socket
.ops
= &pcc_operations
;
750 socket
[i
].socket
.resource_ops
= &pccard_static_ops
;
751 socket
[i
].socket
.owner
= THIS_MODULE
;
752 socket
[i
].number
= i
;
753 ret
= pcmcia_register_socket(&socket
[i
].socket
);
755 socket
[i
].flags
|= IS_REGISTERED
;
758 /* Finally, schedule a polling interrupt */
759 if (poll_interval
!= 0) {
760 timer_setup(&poll_timer
, pcc_interrupt_wrapper
, 0);
761 poll_timer
.expires
= jiffies
+ poll_interval
;
762 add_timer(&poll_timer
);
766 } /* init_m32r_pcc */
768 static void __exit
exit_m32r_pcc(void)
772 for (i
= 0; i
< pcc_sockets
; i
++)
773 if (socket
[i
].flags
& IS_REGISTERED
)
774 pcmcia_unregister_socket(&socket
[i
].socket
);
776 platform_device_unregister(&pcc_device
);
777 if (poll_interval
!= 0)
778 del_timer_sync(&poll_timer
);
780 platform_driver_unregister(&pcc_driver
);
781 } /* exit_m32r_pcc */
783 module_init(init_m32r_pcc
);
784 module_exit(exit_m32r_pcc
);
785 MODULE_LICENSE("Dual MPL/GPL");
786 /*====================================================================*/