aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/i82365.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-rw-r--r--drivers/pcmcia/i82365.c49
1 files changed, 11 insertions, 38 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index a4aacb830b80..9e2a15628de5 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -40,7 +40,6 @@
40#include <linux/kernel.h> 40#include <linux/kernel.h>
41#include <linux/errno.h> 41#include <linux/errno.h>
42#include <linux/timer.h> 42#include <linux/timer.h>
43#include <linux/slab.h>
44#include <linux/ioport.h> 43#include <linux/ioport.h>
45#include <linux/delay.h> 44#include <linux/delay.h>
46#include <linux/workqueue.h> 45#include <linux/workqueue.h>
@@ -63,21 +62,6 @@
63#include "vg468.h" 62#include "vg468.h"
64#include "ricoh.h" 63#include "ricoh.h"
65 64
66#ifdef CONFIG_PCMCIA_DEBUG
67static const char version[] =
68"i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)";
69
70static int pc_debug;
71
72module_param(pc_debug, int, 0644);
73
74#define debug(lvl, fmt, arg...) do { \
75 if (pc_debug > (lvl)) \
76 printk(KERN_DEBUG "i82365: " fmt , ## arg); \
77} while (0)
78#else
79#define debug(lvl, fmt, arg...) do { } while (0)
80#endif
81 65
82static irqreturn_t i365_count_irq(int, void *); 66static irqreturn_t i365_count_irq(int, void *);
83static inline int _check_irq(int irq, int flags) 67static inline int _check_irq(int irq, int flags)
@@ -501,13 +485,13 @@ static irqreturn_t i365_count_irq(int irq, void *dev)
501{ 485{
502 i365_get(irq_sock, I365_CSC); 486 i365_get(irq_sock, I365_CSC);
503 irq_hits++; 487 irq_hits++;
504 debug(2, "-> hit on irq %d\n", irq); 488 pr_debug("i82365: -> hit on irq %d\n", irq);
505 return IRQ_HANDLED; 489 return IRQ_HANDLED;
506} 490}
507 491
508static u_int __init test_irq(u_short sock, int irq) 492static u_int __init test_irq(u_short sock, int irq)
509{ 493{
510 debug(2, " testing ISA irq %d\n", irq); 494 pr_debug("i82365: testing ISA irq %d\n", irq);
511 if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", 495 if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
512 i365_count_irq) != 0) 496 i365_count_irq) != 0)
513 return 1; 497 return 1;
@@ -515,7 +499,7 @@ static u_int __init test_irq(u_short sock, int irq)
515 msleep(10); 499 msleep(10);
516 if (irq_hits) { 500 if (irq_hits) {
517 free_irq(irq, i365_count_irq); 501 free_irq(irq, i365_count_irq);
518 debug(2, " spurious hit!\n"); 502 pr_debug("i82365: spurious hit!\n");
519 return 1; 503 return 1;
520 } 504 }
521 505
@@ -528,7 +512,7 @@ static u_int __init test_irq(u_short sock, int irq)
528 512
529 /* mask all interrupts */ 513 /* mask all interrupts */
530 i365_set(sock, I365_CSCINT, 0); 514 i365_set(sock, I365_CSCINT, 0);
531 debug(2, " hits = %d\n", irq_hits); 515 pr_debug("i82365: hits = %d\n", irq_hits);
532 516
533 return (irq_hits != 1); 517 return (irq_hits != 1);
534} 518}
@@ -854,7 +838,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
854 u_long flags = 0; 838 u_long flags = 0;
855 int handled = 0; 839 int handled = 0;
856 840
857 debug(4, "pcic_interrupt(%d)\n", irq); 841 pr_debug("pcic_interrupt(%d)\n", irq);
858 842
859 for (j = 0; j < 20; j++) { 843 for (j = 0; j < 20; j++) {
860 active = 0; 844 active = 0;
@@ -878,7 +862,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
878 events |= (csc & I365_CSC_READY) ? SS_READY : 0; 862 events |= (csc & I365_CSC_READY) ? SS_READY : 0;
879 } 863 }
880 ISA_UNLOCK(i, flags); 864 ISA_UNLOCK(i, flags);
881 debug(2, "socket %d event 0x%02x\n", i, events); 865 pr_debug("socket %d event 0x%02x\n", i, events);
882 866
883 if (events) 867 if (events)
884 pcmcia_parse_events(&socket[i].socket, events); 868 pcmcia_parse_events(&socket[i].socket, events);
@@ -890,7 +874,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
890 if (j == 20) 874 if (j == 20)
891 printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); 875 printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n");
892 876
893 debug(4, "interrupt done\n"); 877 pr_debug("pcic_interrupt done\n");
894 return IRQ_RETVAL(handled); 878 return IRQ_RETVAL(handled);
895} /* pcic_interrupt */ 879} /* pcic_interrupt */
896 880
@@ -932,7 +916,7 @@ static int i365_get_status(u_short sock, u_int *value)
932 } 916 }
933 } 917 }
934 918
935 debug(1, "GetStatus(%d) = %#4.4x\n", sock, *value); 919 pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value);
936 return 0; 920 return 0;
937} /* i365_get_status */ 921} /* i365_get_status */
938 922
@@ -943,7 +927,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
943 struct i82365_socket *t = &socket[sock]; 927 struct i82365_socket *t = &socket[sock];
944 u_char reg; 928 u_char reg;
945 929
946 debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 930 pr_debug("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
947 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, 931 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
948 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 932 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
949 933
@@ -1052,7 +1036,7 @@ static int i365_set_io_map(u_short sock, struct pccard_io_map *io)
1052{ 1036{
1053 u_char map, ioctl; 1037 u_char map, ioctl;
1054 1038
1055 debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " 1039 pr_debug("SetIOMap(%d, %d, %#2.2x, %d ns, "
1056 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, 1040 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed,
1057 (unsigned long long)io->start, (unsigned long long)io->stop); 1041 (unsigned long long)io->start, (unsigned long long)io->stop);
1058 map = io->map; 1042 map = io->map;
@@ -1082,7 +1066,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
1082 u_short base, i; 1066 u_short base, i;
1083 u_char map; 1067 u_char map;
1084 1068
1085 debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, " 1069 pr_debug("SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, "
1086 "%#x)\n", sock, mem->map, mem->flags, mem->speed, 1070 "%#x)\n", sock, mem->map, mem->flags, mem->speed,
1087 (unsigned long long)mem->res->start, 1071 (unsigned long long)mem->res->start,
1088 (unsigned long long)mem->res->end, mem->card_start); 1072 (unsigned long long)mem->res->end, mem->card_start);
@@ -1238,16 +1222,7 @@ static int pcic_init(struct pcmcia_socket *s)
1238 return 0; 1222 return 0;
1239} 1223}
1240 1224
1241static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
1242 pm_message_t state)
1243{
1244 return pcmcia_socket_dev_suspend(&dev->dev);
1245}
1246 1225
1247static int i82365_drv_pcmcia_resume(struct platform_device *dev)
1248{
1249 return pcmcia_socket_dev_resume(&dev->dev);
1250}
1251static struct pccard_operations pcic_operations = { 1226static struct pccard_operations pcic_operations = {
1252 .init = pcic_init, 1227 .init = pcic_init,
1253 .get_status = pcic_get_status, 1228 .get_status = pcic_get_status,
@@ -1263,8 +1238,6 @@ static struct platform_driver i82365_driver = {
1263 .name = "i82365", 1238 .name = "i82365",
1264 .owner = THIS_MODULE, 1239 .owner = THIS_MODULE,
1265 }, 1240 },
1266 .suspend = i82365_drv_pcmcia_suspend,
1267 .resume = i82365_drv_pcmcia_resume,
1268}; 1241};
1269 1242
1270static struct platform_device *i82365_device; 1243static struct platform_device *i82365_device;