MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / pcmcia / au1000_generic.c
blob124225edcac80380e3a7949f2766f27fec370c82
1 /*
3 * Alchemy Semi Au1000 pcmcia driver
5 * Copyright 2001 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com
9 * ########################################################################
11 * This program is free software; you can distribute it and/or modify it
12 * under the terms of the GNU General Public License (Version 2) as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 * ########################################################################
28 #include <linux/module.h>
29 #include <linux/moduleparam.h>
30 #include <linux/init.h>
31 #include <linux/config.h>
32 #include <linux/delay.h>
33 #include <linux/ioport.h>
34 #include <linux/kernel.h>
35 #include <linux/tqueue.h>
36 #include <linux/timer.h>
37 #include <linux/mm.h>
38 #include <linux/proc_fs.h>
39 #include <linux/types.h>
40 #include <linux/vmalloc.h>
42 #include <pcmcia/version.h>
43 #include <pcmcia/cs_types.h>
44 #include <pcmcia/cs.h>
45 #include <pcmcia/ss.h>
46 #include <pcmcia/bulkmem.h>
47 #include <pcmcia/cistpl.h>
48 #include <pcmcia/bus_ops.h>
49 #include "cs_internal.h"
51 #include <asm/io.h>
52 #include <asm/irq.h>
53 #include <asm/system.h>
55 #include <asm/au1000.h>
56 #include <asm/au1000_pcmcia.h>
58 #ifdef DEBUG
59 static int pc_debug;
61 module_param(pc_debug, int, 0644);
63 #define debug(lvl,fmt) do { \
64 if (pc_debug > (lvl)) \
65 printk(KERN_DEBUG fmt); \
66 } while (0)
67 #else
68 #define debug(lvl,fmt) do { } while (0)
69 #endif
71 MODULE_LICENSE("GPL");
72 MODULE_AUTHOR("Pete Popov, MontaVista Software <ppopov@mvista.com>");
73 MODULE_DESCRIPTION("Linux PCMCIA Card Services: Au1x00 Socket Controller");
75 #define MAP_SIZE 0x1000000
77 /* This structure maintains housekeeping state for each socket, such
78 * as the last known values of the card detect pins, or the Card Services
79 * callback value associated with the socket:
81 static struct au1000_pcmcia_socket *pcmcia_socket;
82 static int socket_count;
85 /* Returned by the low-level PCMCIA interface: */
86 static struct pcmcia_low_level *pcmcia_low_level;
88 /* Event poll timer structure */
89 static struct timer_list poll_timer;
92 /* Prototypes for routines which are used internally: */
94 static int au1000_pcmcia_driver_init(void);
95 static void au1000_pcmcia_driver_shutdown(void);
96 static void au1000_pcmcia_task_handler(void *data);
97 static void au1000_pcmcia_poll_event(unsigned long data);
98 static void au1000_pcmcia_interrupt(int irq, void *dev, struct pt_regs *regs);
99 static struct tq_struct au1000_pcmcia_task;
101 #ifdef CONFIG_PROC_FS
102 static int au1000_pcmcia_proc_status(char *buf, char **start,
103 off_t pos, int count, int *eof, void *data);
104 #endif
107 /* Prototypes for operations which are exported to the
108 * new-and-impr^H^H^H^H^H^H^H^H^H^H in-kernel PCMCIA core:
111 static int au1000_pcmcia_init(u32 sock);
112 static int au1000_pcmcia_suspend(u32 sock);
113 static int au1000_pcmcia_register_callback(u32 sock,
114 void (*handler)(void *, u32), void *info);
115 static int au1000_pcmcia_inquire_socket(u32 sock, socket_cap_t *cap);
116 static int au1000_pcmcia_get_status(u32 sock, u_int *value);
117 static int au1000_pcmcia_get_socket(u32 sock, socket_state_t *state);
118 static int au1000_pcmcia_set_socket(u32 sock, socket_state_t *state);
119 static int au1000_pcmcia_get_io_map(u32 sock, struct pccard_io_map *io);
120 static int au1000_pcmcia_set_io_map(u32 sock, struct pccard_io_map *io);
121 static int au1000_pcmcia_get_mem_map(u32 sock, struct pccard_mem_map *mem);
122 static int au1000_pcmcia_set_mem_map(u32 sock, struct pccard_mem_map *mem);
123 #ifdef CONFIG_PROC_FS
124 static void au1000_pcmcia_proc_setup(u32 sock, struct proc_dir_entry *base);
125 #endif
127 static struct pccard_operations au1000_pcmcia_operations = {
128 au1000_pcmcia_init,
129 au1000_pcmcia_suspend,
130 au1000_pcmcia_register_callback,
131 au1000_pcmcia_inquire_socket,
132 au1000_pcmcia_get_status,
133 au1000_pcmcia_get_socket,
134 au1000_pcmcia_set_socket,
135 au1000_pcmcia_get_io_map,
136 au1000_pcmcia_set_io_map,
137 au1000_pcmcia_get_mem_map,
138 au1000_pcmcia_set_mem_map,
139 #ifdef CONFIG_PROC_FS
140 au1000_pcmcia_proc_setup
141 #endif
144 static spinlock_t pcmcia_lock = SPIN_LOCK_UNLOCKED;
146 static int __init au1000_pcmcia_driver_init(void)
148 struct pcmcia_init pcmcia_init;
149 struct pcmcia_state state;
150 unsigned int i;
152 printk("\nAu1x00 PCMCIA\n");
154 #ifndef CONFIG_64BIT_PHYS_ADDR
155 printk(KERN_ERR "Au1x00 PCMCIA 36 bit IO support not enabled\n");
156 return -1;
157 #endif
159 #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500)
160 pcmcia_low_level=&pb1x00_pcmcia_ops;
161 #else
162 #error Unsupported AU1000 board.
163 #endif
165 pcmcia_init.handler=au1000_pcmcia_interrupt;
166 if((socket_count=pcmcia_low_level->init(&pcmcia_init))<0) {
167 printk(KERN_ERR "Unable to initialize PCMCIA service.\n");
168 return -EIO;
171 /* NOTE: the chip select must already be setup */
173 pcmcia_socket =
174 kmalloc(sizeof(struct au1000_pcmcia_socket) * socket_count,
175 GFP_KERNEL);
176 if (!pcmcia_socket) {
177 printk(KERN_ERR "Card Services can't get memory \n");
178 return -1;
180 memset(pcmcia_socket, 0,
181 sizeof(struct au1000_pcmcia_socket) * socket_count);
184 * Assuming max of 2 sockets, which the Au1000 supports.
185 * WARNING: the Pb1000 has two sockets, and both work, but you
186 * can't use them both at the same time due to glue logic conflicts.
188 for(i=0; i < socket_count; i++) {
190 if(pcmcia_low_level->socket_state(i, &state)<0){
191 printk(KERN_ERR "Unable to get PCMCIA status\n");
192 return -EIO;
194 pcmcia_socket[i].k_state=state;
195 pcmcia_socket[i].cs_state.csc_mask=SS_DETECT;
197 if (i == 0) {
198 pcmcia_socket[i].virt_io =
199 (u32)ioremap((ioaddr_t)0xF00000000, 0x1000);
200 pcmcia_socket[i].phys_attr = (memaddr_t)0xF40000000;
201 pcmcia_socket[i].phys_mem = (memaddr_t)0xF80000000;
203 else {
204 pcmcia_socket[i].virt_io =
205 (u32)ioremap((ioaddr_t)0xF08000000, 0x1000);
206 pcmcia_socket[i].phys_attr = (memaddr_t)0xF48000000;
207 pcmcia_socket[i].phys_mem = (memaddr_t)0xF88000000;
211 /* Only advertise as many sockets as we can detect: */
212 if(register_ss_entry(socket_count, &au1000_pcmcia_operations)<0){
213 printk(KERN_ERR "Unable to register socket service routine\n");
214 return -ENXIO;
217 /* Start the event poll timer.
218 * It will reschedule by itself afterwards.
220 au1000_pcmcia_poll_event(0);
222 debug(1, "au1000: initialization complete\n");
223 return 0;
225 } /* au1000_pcmcia_driver_init() */
227 module_init(au1000_pcmcia_driver_init);
229 static void __exit au1000_pcmcia_driver_shutdown(void)
231 int i;
233 del_timer_sync(&poll_timer);
234 unregister_ss_entry(&au1000_pcmcia_operations);
235 pcmcia_low_level->shutdown();
236 flush_scheduled_tasks();
237 for(i=0; i < socket_count; i++) {
238 if (pcmcia_socket[i].virt_io)
239 iounmap((void *)pcmcia_socket[i].virt_io);
241 debug(1, "au1000: shutdown complete\n");
244 module_exit(au1000_pcmcia_driver_shutdown);
246 static int au1000_pcmcia_init(unsigned int sock) { return 0; }
248 static int au1000_pcmcia_suspend(unsigned int sock)
250 return 0;
254 static inline unsigned
255 au1000_pcmcia_events(struct pcmcia_state *state,
256 struct pcmcia_state *prev_state,
257 unsigned int mask, unsigned int flags)
259 unsigned int events=0;
261 if(state->detect!=prev_state->detect){
262 debug(2, "%s(): card detect value %u\n",
263 __FUNCTION__, state->detect);
264 events |= mask&SS_DETECT;
268 if(state->ready!=prev_state->ready){
269 debug(2, "%s(): card ready value %u\n",
270 __FUNCTION__, state->ready);
271 events |= mask&((flags&SS_IOCARD)?0:SS_READY);
274 *prev_state=*state;
275 return events;
277 } /* au1000_pcmcia_events() */
281 * Au1000_pcmcia_task_handler()
282 * Processes socket events.
284 static void au1000_pcmcia_task_handler(void *data)
286 struct pcmcia_state state;
287 int i, events, irq_status;
289 for(i=0; i<socket_count; i++) {
290 if((irq_status = pcmcia_low_level->socket_state(i, &state))<0)
291 printk(KERN_ERR "low-level PCMCIA error\n");
293 events = au1000_pcmcia_events(&state,
294 &pcmcia_socket[i].k_state,
295 pcmcia_socket[i].cs_state.csc_mask,
296 pcmcia_socket[i].cs_state.flags);
297 if(pcmcia_socket[i].handler!=NULL) {
298 pcmcia_socket[i].handler(pcmcia_socket[i].handler_info,
299 events);
303 } /* au1000_pcmcia_task_handler() */
305 static struct tq_struct au1000_pcmcia_task = {
306 routine: au1000_pcmcia_task_handler
310 static void au1000_pcmcia_poll_event(unsigned long dummy)
312 poll_timer.function = au1000_pcmcia_poll_event;
313 poll_timer.expires = jiffies + AU1000_PCMCIA_POLL_PERIOD;
314 add_timer(&poll_timer);
315 schedule_task(&au1000_pcmcia_task);
320 * au1000_pcmcia_interrupt()
321 * The actual interrupt work is performed by au1000_pcmcia_task(),
322 * because the Card Services event handling code performs scheduling
323 * operations which cannot be executed from within an interrupt context.
325 static void
326 au1000_pcmcia_interrupt(int irq, void *dev, struct pt_regs *regs)
328 schedule_task(&au1000_pcmcia_task);
332 static int
333 au1000_pcmcia_register_callback(unsigned int sock,
334 void (*handler)(void *, unsigned int), void *info)
336 if(handler==NULL){
337 pcmcia_socket[sock].handler=NULL;
338 MOD_DEC_USE_COUNT;
339 } else {
340 MOD_INC_USE_COUNT;
341 pcmcia_socket[sock].handler=handler;
342 pcmcia_socket[sock].handler_info=info;
344 return 0;
348 /* au1000_pcmcia_inquire_socket()
350 * From the sa1100 socket driver :
352 * Implements the inquire_socket() operation for the in-kernel PCMCIA
353 * service (formerly SS_InquireSocket in Card Services). We set
354 * SS_CAP_STATIC_MAP, which disables the memory resource database check.
355 * (Mapped memory is set up within the socket driver itself.)
357 * In conjunction with the STATIC_MAP capability is a new field,
358 * `io_offset', recommended by David Hinds. Rather than go through
359 * the SetIOMap interface (which is not quite suited for communicating
360 * window locations up from the socket driver), we just pass up
361 * an offset which is applied to client-requested base I/O addresses
362 * in alloc_io_space().
364 * Returns: 0 on success, -1 if no pin has been configured for `sock'
366 static int au1000_pcmcia_inquire_socket(unsigned int sock, socket_cap_t *cap)
368 struct pcmcia_irq_info irq_info;
370 if(sock > socket_count){
371 printk(KERN_ERR "au1000: socket %u not configured\n", sock);
372 return -1;
375 /* from the sa1100_generic driver: */
377 /* SS_CAP_PAGE_REGS: used by setup_cis_mem() in cistpl.c to set the
378 * force_low argument to validate_mem() in rsrc_mgr.c -- since in
379 * general, the mapped * addresses of the PCMCIA memory regions
380 * will not be within 0xffff, setting force_low would be
381 * undesirable.
383 * SS_CAP_STATIC_MAP: don't bother with the (user-configured) memory
384 * resource database; we instead pass up physical address ranges
385 * and allow other parts of Card Services to deal with remapping.
387 * SS_CAP_PCCARD: we can deal with 16-bit PCMCIA & CF cards, but
388 * not 32-bit CardBus devices.
390 cap->features=(SS_CAP_PAGE_REGS | SS_CAP_STATIC_MAP | SS_CAP_PCCARD);
392 irq_info.sock=sock;
393 irq_info.irq=-1;
395 if(pcmcia_low_level->get_irq_info(&irq_info)<0){
396 printk(KERN_ERR "Error obtaining IRQ info socket %u\n", sock);
397 return -1;
400 cap->irq_mask=0;
401 cap->map_size=MAP_SIZE;
402 cap->pci_irq=irq_info.irq;
403 cap->io_offset=pcmcia_socket[sock].virt_io;
405 return 0;
407 } /* au1000_pcmcia_inquire_socket() */
410 static int
411 au1000_pcmcia_get_status(unsigned int sock, unsigned int *status)
413 struct pcmcia_state state;
416 if((pcmcia_low_level->socket_state(sock, &state))<0){
417 printk(KERN_ERR "Unable to get PCMCIA status from kernel.\n");
418 return -1;
421 pcmcia_socket[sock].k_state = state;
423 *status = state.detect?SS_DETECT:0;
425 *status |= state.ready?SS_READY:0;
427 *status |= pcmcia_socket[sock].cs_state.Vcc?SS_POWERON:0;
429 if(pcmcia_socket[sock].cs_state.flags&SS_IOCARD)
430 *status |= state.bvd1?SS_STSCHG:0;
431 else {
432 if(state.bvd1==0)
433 *status |= SS_BATDEAD;
434 else if(state.bvd2 == 0)
435 *status |= SS_BATWARN;
438 *status|=state.vs_3v?SS_3VCARD:0;
440 *status|=state.vs_Xv?SS_XVCARD:0;
442 debug(2, "\tstatus: %s%s%s%s%s%s%s%s\n",
443 (*status&SS_DETECT)?"DETECT ":"",
444 (*status&SS_READY)?"READY ":"",
445 (*status&SS_BATDEAD)?"BATDEAD ":"",
446 (*status&SS_BATWARN)?"BATWARN ":"",
447 (*status&SS_POWERON)?"POWERON ":"",
448 (*status&SS_STSCHG)?"STSCHG ":"",
449 (*status&SS_3VCARD)?"3VCARD ":"",
450 (*status&SS_XVCARD)?"XVCARD ":"");
452 return 0;
454 } /* au1000_pcmcia_get_status() */
457 static int
458 au1000_pcmcia_get_socket(unsigned int sock, socket_state_t *state)
460 *state = pcmcia_socket[sock].cs_state;
461 return 0;
465 static int
466 au1000_pcmcia_set_socket(unsigned int sock, socket_state_t *state)
468 struct pcmcia_configure configure;
470 debug(2, "\tmask: %s%s%s%s%s%s\n\tflags: %s%s%s%s%s%s\n"
471 "\tVcc %d Vpp %d irq %d\n",
472 (state->csc_mask==0)?"<NONE>":"",
473 (state->csc_mask&SS_DETECT)?"DETECT ":"",
474 (state->csc_mask&SS_READY)?"READY ":"",
475 (state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
476 (state->csc_mask&SS_BATWARN)?"BATWARN ":"",
477 (state->csc_mask&SS_STSCHG)?"STSCHG ":"",
478 (state->flags==0)?"<NONE>":"",
479 (state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
480 (state->flags&SS_IOCARD)?"IOCARD ":"",
481 (state->flags&SS_RESET)?"RESET ":"",
482 (state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
483 (state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
484 state->Vcc, state->Vpp, state->io_irq);
486 configure.sock=sock;
487 configure.vcc=state->Vcc;
488 configure.vpp=state->Vpp;
489 configure.output=(state->flags&SS_OUTPUT_ENA)?1:0;
490 configure.speaker=(state->flags&SS_SPKR_ENA)?1:0;
491 configure.reset=(state->flags&SS_RESET)?1:0;
493 if(pcmcia_low_level->configure_socket(&configure)<0){
494 printk(KERN_ERR "Unable to configure socket %u\n", sock);
495 return -1;
498 pcmcia_socket[sock].cs_state = *state;
499 return 0;
501 } /* au1000_pcmcia_set_socket() */
504 static int
505 au1000_pcmcia_get_io_map(unsigned int sock, struct pccard_io_map *map)
507 debug(1, "au1000_pcmcia_get_io_map: sock %d\n", sock);
508 if(map->map>=MAX_IO_WIN){
509 printk(KERN_ERR "%s(): map (%d) out of range\n",
510 __FUNCTION__, map->map);
511 return -1;
513 *map=pcmcia_socket[sock].io_map[map->map];
514 return 0;
518 int
519 au1000_pcmcia_set_io_map(unsigned int sock, struct pccard_io_map *map)
521 unsigned int speed;
522 unsigned long start;
524 if(map->map>=MAX_IO_WIN){
525 printk(KERN_ERR "%s(): map (%d) out of range\n",
526 __FUNCTION__, map->map);
527 return -1;
530 if(map->flags&MAP_ACTIVE){
531 speed=(map->speed>0)?map->speed:AU1000_PCMCIA_IO_SPEED;
532 pcmcia_socket[sock].speed_io=speed;
535 start=map->start;
537 if(map->stop==1) {
538 map->stop=PAGE_SIZE-1;
541 map->start=pcmcia_socket[sock].virt_io;
542 map->stop=map->start+(map->stop-start);
543 pcmcia_socket[sock].io_map[map->map]=*map;
544 debug(3, "set_io_map %d start %x stop %x\n",
545 map->map, map->start, map->stop);
546 return 0;
548 } /* au1000_pcmcia_set_io_map() */
551 static int
552 au1000_pcmcia_get_mem_map(unsigned int sock, struct pccard_mem_map *map)
555 if(map->map>=MAX_WIN) {
556 printk(KERN_ERR "%s(): map (%d) out of range\n",
557 __FUNCTION__, map->map);
558 return -1;
560 *map=pcmcia_socket[sock].mem_map[map->map];
561 return 0;
565 static int
566 au1000_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map)
568 unsigned int speed;
569 u_long flags;
571 if(map->map>=MAX_WIN){
572 printk(KERN_ERR "%s(): map (%d) out of range\n",
573 __FUNCTION__, map->map);
574 return -1;
577 if(map->flags&MAP_ACTIVE){
578 speed=(map->speed>0)?map->speed:AU1000_PCMCIA_MEM_SPEED;
580 /* TBD */
581 if(map->flags&MAP_ATTRIB){
582 pcmcia_socket[sock].speed_attr=speed;
584 else {
585 pcmcia_socket[sock].speed_mem=speed;
589 spin_lock_irqsave(&pcmcia_lock, flags);
590 if (map->flags & MAP_ATTRIB) {
591 map->static_start = pcmcia_socket[sock].phys_attr +
592 map->card_start;
594 else {
595 map->static_start = pcmcia_socket[sock].phys_mem +
596 map->card_start;
599 pcmcia_socket[sock].mem_map[map->map]=*map;
600 spin_unlock_irqrestore(&pcmcia_lock, flags);
601 debug(3, "set_mem_map %d start %x card_start %x\n",
602 map->map, map->static_start,
603 map->card_start);
604 return 0;
606 } /* au1000_pcmcia_set_mem_map() */
609 #if defined(CONFIG_PROC_FS)
611 static void
612 au1000_pcmcia_proc_setup(unsigned int sock, struct proc_dir_entry *base)
614 struct proc_dir_entry *entry;
616 if((entry=create_proc_entry("status", 0, base))==NULL){
617 printk(KERN_ERR "Unable to install \"status\" procfs entry\n");
618 return;
621 entry->read_proc=au1000_pcmcia_proc_status;
622 entry->data=(void *)sock;
626 /* au1000_pcmcia_proc_status()
627 * Implements the /proc/bus/pccard/??/status file.
629 * Returns: the number of characters added to the buffer
631 static int
632 au1000_pcmcia_proc_status(char *buf, char **start, off_t pos,
633 int count, int *eof, void *data)
635 char *p=buf;
636 unsigned int sock=(unsigned int)data;
638 p+=sprintf(p, "k_flags : %s%s%s%s%s%s%s\n",
639 pcmcia_socket[sock].k_state.detect?"detect ":"",
640 pcmcia_socket[sock].k_state.ready?"ready ":"",
641 pcmcia_socket[sock].k_state.bvd1?"bvd1 ":"",
642 pcmcia_socket[sock].k_state.bvd2?"bvd2 ":"",
643 pcmcia_socket[sock].k_state.wrprot?"wrprot ":"",
644 pcmcia_socket[sock].k_state.vs_3v?"vs_3v ":"",
645 pcmcia_socket[sock].k_state.vs_Xv?"vs_Xv ":"");
647 p+=sprintf(p, "status : %s%s%s%s%s%s%s%s%s\n",
648 pcmcia_socket[sock].k_state.detect?"SS_DETECT ":"",
649 pcmcia_socket[sock].k_state.ready?"SS_READY ":"",
650 pcmcia_socket[sock].cs_state.Vcc?"SS_POWERON ":"",
651 pcmcia_socket[sock].cs_state.flags&SS_IOCARD?\
652 "SS_IOCARD ":"",
653 (pcmcia_socket[sock].cs_state.flags&SS_IOCARD &&
654 pcmcia_socket[sock].k_state.bvd1)?"SS_STSCHG ":"",
655 ((pcmcia_socket[sock].cs_state.flags&SS_IOCARD)==0 &&
656 (pcmcia_socket[sock].k_state.bvd1==0))?"SS_BATDEAD ":"",
657 ((pcmcia_socket[sock].cs_state.flags&SS_IOCARD)==0 &&
658 (pcmcia_socket[sock].k_state.bvd2==0))?"SS_BATWARN ":"",
659 pcmcia_socket[sock].k_state.vs_3v?"SS_3VCARD ":"",
660 pcmcia_socket[sock].k_state.vs_Xv?"SS_XVCARD ":"");
662 p+=sprintf(p, "mask : %s%s%s%s%s\n",
663 pcmcia_socket[sock].cs_state.csc_mask&SS_DETECT?\
664 "SS_DETECT ":"",
665 pcmcia_socket[sock].cs_state.csc_mask&SS_READY?\
666 "SS_READY ":"",
667 pcmcia_socket[sock].cs_state.csc_mask&SS_BATDEAD?\
668 "SS_BATDEAD ":"",
669 pcmcia_socket[sock].cs_state.csc_mask&SS_BATWARN?\
670 "SS_BATWARN ":"",
671 pcmcia_socket[sock].cs_state.csc_mask&SS_STSCHG?\
672 "SS_STSCHG ":"");
674 p+=sprintf(p, "cs_flags : %s%s%s%s%s\n",
675 pcmcia_socket[sock].cs_state.flags&SS_PWR_AUTO?\
676 "SS_PWR_AUTO ":"",
677 pcmcia_socket[sock].cs_state.flags&SS_IOCARD?\
678 "SS_IOCARD ":"",
679 pcmcia_socket[sock].cs_state.flags&SS_RESET?\
680 "SS_RESET ":"",
681 pcmcia_socket[sock].cs_state.flags&SS_SPKR_ENA?\
682 "SS_SPKR_ENA ":"",
683 pcmcia_socket[sock].cs_state.flags&SS_OUTPUT_ENA?\
684 "SS_OUTPUT_ENA ":"");
686 p+=sprintf(p, "Vcc : %d\n", pcmcia_socket[sock].cs_state.Vcc);
687 p+=sprintf(p, "Vpp : %d\n", pcmcia_socket[sock].cs_state.Vpp);
688 p+=sprintf(p, "irq : %d\n", pcmcia_socket[sock].cs_state.io_irq);
689 p+=sprintf(p, "I/O : %u\n", pcmcia_socket[sock].speed_io);
690 p+=sprintf(p, "attribute: %u\n", pcmcia_socket[sock].speed_attr);
691 p+=sprintf(p, "common : %u\n", pcmcia_socket[sock].speed_mem);
692 return p-buf;
696 #endif /* defined(CONFIG_PROC_FS) */