Commit c9f50ddd authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: use dynamic debug in PCMCIA socket drivers

Make use of the dynamic debug infrastructure in various PCMCIA socket
drivers. By doing so, only the drivers relying on soc_common make use
of CONFIG_PCMCIA_DEBUG. Therefore, update the Kconfig entry accordingly.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent d50dbec3
...@@ -17,24 +17,6 @@ menuconfig PCCARD ...@@ -17,24 +17,6 @@ menuconfig PCCARD
if PCCARD if PCCARD
config PCMCIA_DEBUG
bool "Enable PCCARD debugging"
help
Say Y here to enable PCMCIA subsystem debugging. You
will need to choose the debugging level either via the
kernel command line, or module options depending whether
you build the PCMCIA as modules.
The kernel command line options are:
pcmcia_core.pc_debug=N
pcmcia.pc_debug=N
sa11xx_core.pc_debug=N
The module option is called pc_debug=N
In all the above examples, N is the debugging verbosity
level.
config PCMCIA config PCMCIA
tristate "16-bit PCMCIA support" tristate "16-bit PCMCIA support"
select CRC32 select CRC32
...@@ -225,6 +207,24 @@ config PCMCIA_PXA2XX ...@@ -225,6 +207,24 @@ config PCMCIA_PXA2XX
help help
Say Y here to include support for the PXA2xx PCMCIA controller Say Y here to include support for the PXA2xx PCMCIA controller
config PCMCIA_DEBUG
bool "Enable debugging"
depends on (PCMCIA_SA1111 || PCMCIA_SA1100 || PCMCIA_PXA2XX)
help
Say Y here to enable debugging for the SoC PCMCIA layer.
You will need to choose the debugging level either via the
kernel command line, or module options depending whether
you build the drivers as modules.
The kernel command line options are:
sa11xx_core.pc_debug=N
pxa2xx_core.pc_debug=N
The module option is called pc_debug=N
In all the above examples, N is the debugging verbosity
level.
config PCMCIA_PROBE config PCMCIA_PROBE
bool bool
default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC
......
...@@ -63,21 +63,6 @@ ...@@ -63,21 +63,6 @@
#include "vg468.h" #include "vg468.h"
#include "ricoh.h" #include "ricoh.h"
#ifdef CONFIG_PCMCIA_DEBUG
static const char version[] =
"i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)";
static int pc_debug;
module_param(pc_debug, int, 0644);
#define debug(lvl, fmt, arg...) do { \
if (pc_debug > (lvl)) \
printk(KERN_DEBUG "i82365: " fmt , ## arg); \
} while (0)
#else
#define debug(lvl, fmt, arg...) do { } while (0)
#endif
static irqreturn_t i365_count_irq(int, void *); static irqreturn_t i365_count_irq(int, void *);
static inline int _check_irq(int irq, int flags) static inline int _check_irq(int irq, int flags)
...@@ -501,13 +486,13 @@ static irqreturn_t i365_count_irq(int irq, void *dev) ...@@ -501,13 +486,13 @@ static irqreturn_t i365_count_irq(int irq, void *dev)
{ {
i365_get(irq_sock, I365_CSC); i365_get(irq_sock, I365_CSC);
irq_hits++; irq_hits++;
debug(2, "-> hit on irq %d\n", irq); pr_debug("i82365: -> hit on irq %d\n", irq);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static u_int __init test_irq(u_short sock, int irq) static u_int __init test_irq(u_short sock, int irq)
{ {
debug(2, " testing ISA irq %d\n", irq); pr_debug("i82365: testing ISA irq %d\n", irq);
if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
i365_count_irq) != 0) i365_count_irq) != 0)
return 1; return 1;
...@@ -515,7 +500,7 @@ static u_int __init test_irq(u_short sock, int irq) ...@@ -515,7 +500,7 @@ static u_int __init test_irq(u_short sock, int irq)
msleep(10); msleep(10);
if (irq_hits) { if (irq_hits) {
free_irq(irq, i365_count_irq); free_irq(irq, i365_count_irq);
debug(2, " spurious hit!\n"); pr_debug("i82365: spurious hit!\n");
return 1; return 1;
} }
...@@ -528,7 +513,7 @@ static u_int __init test_irq(u_short sock, int irq) ...@@ -528,7 +513,7 @@ static u_int __init test_irq(u_short sock, int irq)
/* mask all interrupts */ /* mask all interrupts */
i365_set(sock, I365_CSCINT, 0); i365_set(sock, I365_CSCINT, 0);
debug(2, " hits = %d\n", irq_hits); pr_debug("i82365: hits = %d\n", irq_hits);
return (irq_hits != 1); return (irq_hits != 1);
} }
...@@ -854,7 +839,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) ...@@ -854,7 +839,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
u_long flags = 0; u_long flags = 0;
int handled = 0; int handled = 0;
debug(4, "pcic_interrupt(%d)\n", irq); pr_debug("pcic_interrupt(%d)\n", irq);
for (j = 0; j < 20; j++) { for (j = 0; j < 20; j++) {
active = 0; active = 0;
...@@ -878,7 +863,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) ...@@ -878,7 +863,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
events |= (csc & I365_CSC_READY) ? SS_READY : 0; events |= (csc & I365_CSC_READY) ? SS_READY : 0;
} }
ISA_UNLOCK(i, flags); ISA_UNLOCK(i, flags);
debug(2, "socket %d event 0x%02x\n", i, events); pr_debug("socket %d event 0x%02x\n", i, events);
if (events) if (events)
pcmcia_parse_events(&socket[i].socket, events); pcmcia_parse_events(&socket[i].socket, events);
...@@ -890,7 +875,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev) ...@@ -890,7 +875,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
if (j == 20) if (j == 20)
printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n");
debug(4, "interrupt done\n"); pr_debug("pcic_interrupt done\n");
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} /* pcic_interrupt */ } /* pcic_interrupt */
...@@ -932,7 +917,7 @@ static int i365_get_status(u_short sock, u_int *value) ...@@ -932,7 +917,7 @@ static int i365_get_status(u_short sock, u_int *value)
} }
} }
debug(1, "GetStatus(%d) = %#4.4x\n", sock, *value); pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value);
return 0; return 0;
} /* i365_get_status */ } /* i365_get_status */
...@@ -943,7 +928,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state) ...@@ -943,7 +928,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
struct i82365_socket *t = &socket[sock]; struct i82365_socket *t = &socket[sock];
u_char reg; u_char reg;
debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " pr_debug("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask); state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
...@@ -1052,7 +1037,7 @@ static int i365_set_io_map(u_short sock, struct pccard_io_map *io) ...@@ -1052,7 +1037,7 @@ static int i365_set_io_map(u_short sock, struct pccard_io_map *io)
{ {
u_char map, ioctl; u_char map, ioctl;
debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " pr_debug("SetIOMap(%d, %d, %#2.2x, %d ns, "
"%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed,
(unsigned long long)io->start, (unsigned long long)io->stop); (unsigned long long)io->start, (unsigned long long)io->stop);
map = io->map; map = io->map;
...@@ -1082,7 +1067,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -1082,7 +1067,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
u_short base, i; u_short base, i;
u_char map; u_char map;
debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, " pr_debug("SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, "
"%#x)\n", sock, mem->map, mem->flags, mem->speed, "%#x)\n", sock, mem->map, mem->flags, mem->speed,
(unsigned long long)mem->res->start, (unsigned long long)mem->res->start,
(unsigned long long)mem->res->end, mem->card_start); (unsigned long long)mem->res->end, mem->card_start);
......
This diff is collapsed.
...@@ -45,16 +45,6 @@ ...@@ -45,16 +45,6 @@
#define PCC_DEBUG_DBEX #define PCC_DEBUG_DBEX
#ifdef CONFIG_PCMCIA_DEBUG
static int m32r_pcc_debug;
module_param(m32r_pcc_debug, int, 0644);
#define debug(lvl, fmt, arg...) do { \
if (m32r_pcc_debug > (lvl)) \
printk(KERN_DEBUG "m32r_pcc: " fmt , ## arg); \
} while (0)
#else
#define debug(n, args...) do { } while (0)
#endif
/* Poll status interval -- 0 means default to interrupt */ /* Poll status interval -- 0 means default to interrupt */
static int poll_interval = 0; static int poll_interval = 0;
...@@ -358,7 +348,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev) ...@@ -358,7 +348,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
u_int events, active; u_int events, active;
int handled = 0; int handled = 0;
debug(4, "m32r: pcc_interrupt(%d)\n", irq); pr_debug("m32r_pcc: pcc_interrupt(%d)\n", irq);
for (j = 0; j < 20; j++) { for (j = 0; j < 20; j++) {
active = 0; active = 0;
...@@ -369,13 +359,14 @@ static irqreturn_t pcc_interrupt(int irq, void *dev) ...@@ -369,13 +359,14 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
handled = 1; handled = 1;
irc = pcc_get(i, PCIRC); irc = pcc_get(i, PCIRC);
irc >>=16; irc >>=16;
debug(2, "m32r-pcc:interrupt: socket %d pcirc 0x%02x ", i, irc); pr_debug("m32r_pcc: interrupt: socket %d pcirc 0x%02x ",
i, irc);
if (!irc) if (!irc)
continue; continue;
events = (irc) ? SS_DETECT : 0; events = (irc) ? SS_DETECT : 0;
events |= (pcc_get(i,PCCR) & PCCR_PCEN) ? SS_READY : 0; events |= (pcc_get(i,PCCR) & PCCR_PCEN) ? SS_READY : 0;
debug(2, " event 0x%02x\n", events); pr_debug("m32r_pcc: event 0x%02x\n", events);
if (events) if (events)
pcmcia_parse_events(&socket[i].socket, events); pcmcia_parse_events(&socket[i].socket, events);
...@@ -388,7 +379,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev) ...@@ -388,7 +379,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
if (j == 20) if (j == 20)
printk(KERN_NOTICE "m32r-pcc: infinite loop in interrupt handler\n"); printk(KERN_NOTICE "m32r-pcc: infinite loop in interrupt handler\n");
debug(4, "m32r-pcc: interrupt done\n"); pr_debug("m32r_pcc: interrupt done\n");
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} /* pcc_interrupt */ } /* pcc_interrupt */
...@@ -422,7 +413,7 @@ static int _pcc_get_status(u_short sock, u_int *value) ...@@ -422,7 +413,7 @@ static int _pcc_get_status(u_short sock, u_int *value)
status = pcc_get(sock,PCCSIGCR); status = pcc_get(sock,PCCSIGCR);
*value |= (status & PCCSIGCR_VEN) ? SS_POWERON : 0; *value |= (status & PCCSIGCR_VEN) ? SS_POWERON : 0;
debug(3, "m32r-pcc: GetStatus(%d) = %#4.4x\n", sock, *value); pr_debug("m32r_pcc: GetStatus(%d) = %#4.4x\n", sock, *value);
return 0; return 0;
} /* _get_status */ } /* _get_status */
...@@ -432,7 +423,7 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state) ...@@ -432,7 +423,7 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
{ {
u_long reg = 0; u_long reg = 0;
debug(3, "m32r-pcc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " pr_debug("m32r_pcc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x)", sock, state->flags, "io_irq %d, csc_mask %#2.2x)", sock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask); state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
...@@ -448,11 +439,11 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state) ...@@ -448,11 +439,11 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
} }
if (state->flags & SS_RESET) { if (state->flags & SS_RESET) {
debug(3, ":RESET\n"); pr_debug("m32r_pcc: :RESET\n");
reg |= PCCSIGCR_CRST; reg |= PCCSIGCR_CRST;
} }
if (state->flags & SS_OUTPUT_ENA){ if (state->flags & SS_OUTPUT_ENA){
debug(3, ":OUTPUT_ENA\n"); pr_debug("m32r_pcc: :OUTPUT_ENA\n");
/* bit clear */ /* bit clear */
} else { } else {
reg |= PCCSIGCR_SEN; reg |= PCCSIGCR_SEN;
...@@ -460,28 +451,26 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state) ...@@ -460,28 +451,26 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
pcc_set(sock,PCCSIGCR,reg); pcc_set(sock,PCCSIGCR,reg);
#ifdef CONFIG_PCMCIA_DEBUG
if(state->flags & SS_IOCARD){ if(state->flags & SS_IOCARD){
debug(3, ":IOCARD"); pr_debug("m32r_pcc: :IOCARD");
} }
if (state->flags & SS_PWR_AUTO) { if (state->flags & SS_PWR_AUTO) {
debug(3, ":PWR_AUTO"); pr_debug("m32r_pcc: :PWR_AUTO");
} }
if (state->csc_mask & SS_DETECT) if (state->csc_mask & SS_DETECT)
debug(3, ":csc-SS_DETECT"); pr_debug("m32r_pcc: :csc-SS_DETECT");
if (state->flags & SS_IOCARD) { if (state->flags & SS_IOCARD) {
if (state->csc_mask & SS_STSCHG) if (state->csc_mask & SS_STSCHG)
debug(3, ":STSCHG"); pr_debug("m32r_pcc: :STSCHG");
} else { } else {
if (state->csc_mask & SS_BATDEAD) if (state->csc_mask & SS_BATDEAD)
debug(3, ":BATDEAD"); pr_debug("m32r_pcc: :BATDEAD");
if (state->csc_mask & SS_BATWARN) if (state->csc_mask & SS_BATWARN)
debug(3, ":BATWARN"); pr_debug("m32r_pcc: :BATWARN");
if (state->csc_mask & SS_READY) if (state->csc_mask & SS_READY)
debug(3, ":READY"); pr_debug("m32r_pcc: :READY");
} }
debug(3, "\n"); pr_debug("m32r_pcc: \n");
#endif
return 0; return 0;
} /* _set_socket */ } /* _set_socket */
...@@ -491,7 +480,7 @@ static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io) ...@@ -491,7 +480,7 @@ static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io)
{ {
u_char map; u_char map;
debug(3, "m32r-pcc: SetIOMap(%d, %d, %#2.2x, %d ns, " pr_debug("m32r_pcc: SetIOMap(%d, %d, %#2.2x, %d ns, "
"%#llx-%#llx)\n", sock, io->map, io->flags, "%#llx-%#llx)\n", sock, io->map, io->flags,
io->speed, (unsigned long long)io->start, io->speed, (unsigned long long)io->start,
(unsigned long long)io->stop); (unsigned long long)io->stop);
...@@ -515,7 +504,7 @@ static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -515,7 +504,7 @@ static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem)
#endif #endif
#endif #endif
debug(3, "m32r-pcc: SetMemMap(%d, %d, %#2.2x, %d ns, " pr_debug("m32r_pcc: SetMemMap(%d, %d, %#2.2x, %d ns, "
"%#llx, %#x)\n", sock, map, mem->flags, "%#llx, %#x)\n", sock, map, mem->flags,
mem->speed, (unsigned long long)mem->static_start, mem->speed, (unsigned long long)mem->static_start,
mem->card_start); mem->card_start);
...@@ -662,7 +651,7 @@ static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) ...@@ -662,7 +651,7 @@ static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
static int pcc_init(struct pcmcia_socket *s) static int pcc_init(struct pcmcia_socket *s)
{ {
debug(4, "m32r-pcc: init call\n"); pr_debug("m32r_pcc: init call\n");
return 0; return 0;
} }
......
...@@ -64,14 +64,6 @@ ...@@ -64,14 +64,6 @@
#include <pcmcia/cs.h> #include <pcmcia/cs.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
#ifdef CONFIG_PCMCIA_DEBUG
static int pc_debug;
module_param(pc_debug, int, 0);
#define dprintk(args...) printk(KERN_DEBUG "m8xx_pcmcia: " args);
#else
#define dprintk(args...)
#endif
#define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args) #define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args)
#define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args) #define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args)
...@@ -565,7 +557,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev) ...@@ -565,7 +557,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
unsigned int i, events, pscr, pipr, per; unsigned int i, events, pscr, pipr, per;
pcmconf8xx_t *pcmcia = socket[0].pcmcia; pcmconf8xx_t *pcmcia = socket[0].pcmcia;
dprintk("Interrupt!\n"); pr_debug("m8xx_pcmcia: Interrupt!\n");
/* get interrupt sources */ /* get interrupt sources */
pscr = in_be32(&pcmcia->pcmc_pscr); pscr = in_be32(&pcmcia->pcmc_pscr);
...@@ -614,7 +606,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev) ...@@ -614,7 +606,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
/* call the handler */ /* call the handler */
dprintk("slot %u: events = 0x%02x, pscr = 0x%08x, " pr_debug("m8xx_pcmcia: slot %u: events = 0x%02x, pscr = 0x%08x, "
"pipr = 0x%08x\n", i, events, pscr, pipr); "pipr = 0x%08x\n", i, events, pscr, pipr);
if (events) { if (events) {
...@@ -641,7 +633,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev) ...@@ -641,7 +633,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
/* clear the interrupt sources */ /* clear the interrupt sources */
out_be32(&pcmcia->pcmc_pscr, pscr); out_be32(&pcmcia->pcmc_pscr, pscr);
dprintk("Interrupt done.\n"); pr_debug("m8xx_pcmcia: Interrupt done.\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -815,7 +807,7 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value) ...@@ -815,7 +807,7 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
}; };
} }
dprintk("GetStatus(%d) = %#2.2x\n", lsock, *value); pr_debug("m8xx_pcmcia: GetStatus(%d) = %#2.2x\n", lsock, *value);
return 0; return 0;
} }
...@@ -828,7 +820,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state) ...@@ -828,7 +820,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state)
unsigned long flags; unsigned long flags;
pcmconf8xx_t *pcmcia = socket[0].pcmcia; pcmconf8xx_t *pcmcia = socket[0].pcmcia;
dprintk("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " pr_debug("m8xx_pcmcia: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags, "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask); state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
...@@ -974,7 +966,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) ...@@ -974,7 +966,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
#define M8XX_SIZE (io->stop - io->start + 1) #define M8XX_SIZE (io->stop - io->start + 1)
#define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start) #define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
dprintk("SetIOMap(%d, %d, %#2.2x, %d ns, " pr_debug("m8xx_pcmcia: SetIOMap(%d, %d, %#2.2x, %d ns, "
"%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags, "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags,
io->speed, (unsigned long long)io->start, io->speed, (unsigned long long)io->start,
(unsigned long long)io->stop); (unsigned long long)io->stop);
...@@ -988,7 +980,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) ...@@ -988,7 +980,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
if (io->flags & MAP_ACTIVE) { if (io->flags & MAP_ACTIVE) {
dprintk("io->flags & MAP_ACTIVE\n"); pr_debug("m8xx_pcmcia: io->flags & MAP_ACTIVE\n");
winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
+ (lsock * PCMCIA_IO_WIN_NO) + io->map; + (lsock * PCMCIA_IO_WIN_NO) + io->map;
...@@ -1018,8 +1010,8 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) ...@@ -1018,8 +1010,8 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
out_be32(&w->or, reg); out_be32(&w->or, reg);
dprintk("Socket %u: Mapped io window %u at %#8.8x, " pr_debug("m8xx_pcmcia: Socket %u: Mapped io window %u at "
"OR = %#8.8x.\n", lsock, io->map, w->br, w->or); "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
} else { } else {
/* shutdown IO window */ /* shutdown IO window */
winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
...@@ -1033,14 +1025,14 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) ...@@ -1033,14 +1025,14 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
out_be32(&w->or, 0); /* turn off window */ out_be32(&w->or, 0); /* turn off window */
out_be32(&w->br, 0); /* turn off base address */ out_be32(&w->br, 0); /* turn off base address */
dprintk("Socket %u: Unmapped io window %u at %#8.8x, " pr_debug("m8xx_pcmcia: Socket %u: Unmapped io window %u at "
"OR = %#8.8x.\n", lsock, io->map, w->br, w->or); "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
} }
/* copy the struct and modify the copy */ /* copy the struct and modify the copy */
s->io_win[io->map] = *io; s->io_win[io->map] = *io;
s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE); s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE);
dprintk("SetIOMap exit\n"); pr_debug("m8xx_pcmcia: SetIOMap exit\n");
return 0; return 0;
} }
...@@ -1055,7 +1047,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock, ...@@ -1055,7 +1047,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
unsigned int reg, winnr; unsigned int reg, winnr;
pcmconf8xx_t *pcmcia = s->pcmcia; pcmconf8xx_t *pcmcia = s->pcmcia;
dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
"%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
mem->speed, (unsigned long long)mem->static_start, mem->speed, (unsigned long long)mem->static_start,
mem->card_start); mem->card_start);
...@@ -1098,7 +1090,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock, ...@@ -1098,7 +1090,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
out_be32(&w->or, reg); out_be32(&w->or, reg);
dprintk("Socket %u: Mapped memory window %u at %#8.8x, " pr_debug("m8xx_pcmcia: Socket %u: Mapped memory window %u at %#8.8x, "
"OR = %#8.8x.\n", lsock, mem->map, w->br, w->or); "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or);
if (mem->flags & MAP_ACTIVE) { if (mem->flags & MAP_ACTIVE) {
...@@ -1108,7 +1100,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock, ...@@ -1108,7 +1100,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
+ mem->card_start; + mem->card_start;
} }
dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
"%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
mem->speed, (unsigned long long)mem->static_start, mem->speed, (unsigned long long)mem->static_start,
mem->card_start); mem->card_start);
...@@ -1129,7 +1121,7 @@ static int m8xx_sock_init(struct pcmcia_socket *sock) ...@@ -1129,7 +1121,7 @@ static int m8xx_sock_init(struct pcmcia_socket *sock)
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 }; pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
dprintk("sock_init(%d)\n", s); pr_debug("m8xx_pcmcia: sock_init(%d)\n", s);
m8xx_set_socket(sock, &dead_socket); m8xx_set_socket(sock, &dead_socket);
for (i = 0; i < PCMCIA_IO_WIN_NO; i++) { for (i = 0; i < PCMCIA_IO_WIN_NO; i++) {
......
...@@ -55,21 +55,6 @@ ...@@ -55,21 +55,6 @@
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
#include "tcic.h" #include "tcic.h"
#ifdef CONFIG_PCMCIA_DEBUG
static int pc_debug;
module_param(pc_debug, int, 0644);
static const char version[] =
"tcic.c 1.111 2000/02/15 04:13:12 (David Hinds)";
#define debug(lvl, fmt, arg...) do { \
if (pc_debug > (lvl)) \
printk(KERN_DEBUG "tcic: " fmt , ## arg); \
} while (0)
#else
#define debug(lvl, fmt, arg...) do { } while (0)
#endif
MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
MODULE_DESCRIPTION("Databook TCIC-2 PCMCIA socket driver"); MODULE_DESCRIPTION("Databook TCIC-2 PCMCIA socket driver");
MODULE_LICENSE("Dual MPL/GPL"); MODULE_LICENSE("Dual MPL/GPL");
...@@ -574,7 +559,7 @@ static irqreturn_t tcic_interrupt(int irq, void *dev) ...@@ -574,7 +559,7 @@ static irqreturn_t tcic_interrupt(int irq, void *dev)
} else } else
active = 1; active = 1;
debug(2, "tcic_interrupt()\n"); pr_debug("tcic_interrupt()\n");
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
psock = socket_table[i].psock; psock = socket_table[i].psock;
...@@ -611,13 +596,13 @@ static irqreturn_t tcic_interrupt(int irq, void *dev) ...@@ -611,13 +596,13 @@ static irqreturn_t tcic_interrupt(int irq, void *dev)
} }
active = 0; active = 0;
debug(2, "interrupt done\n"); pr_debug("interrupt done\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} /* tcic_interrupt */ } /* tcic_interrupt */
static void tcic_timer(u_long data) static void tcic_timer(u_long data)
{ {
debug(2, "tcic_timer()\n"); pr_debug("tcic_timer()\n");
tcic_timer_pending = 0; tcic_timer_pending = 0;
tcic_interrupt(0, NULL); tcic_interrupt(0, NULL);
} /* tcic_timer */ } /* tcic_timer */
...@@ -644,7 +629,7 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value) ...@@ -644,7 +629,7 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value)
reg = tcic_getb(TCIC_PWR); reg = tcic_getb(TCIC_PWR);
if (reg & (TCIC_PWR_VCC(psock)|TCIC_PWR_VPP(psock))) if (reg & (TCIC_PWR_VCC(psock)|TCIC_PWR_VPP(psock)))
*value |= SS_POWERON; *value |= SS_POWERON;
debug(1, "GetStatus(%d) = %#2.2x\n", psock, *value); dev_dbg(&sock->dev, "GetStatus(%d) = %#2.2x\n", psock, *value);
return 0; return 0;
} /* tcic_get_status */ } /* tcic_get_status */
...@@ -656,7 +641,7 @@ static int tcic_set_socket(struct pcmcia_socket *sock, socket_state_t *state) ...@@ -656,7 +641,7 @@ static int tcic_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
u_char reg; u_char reg;
u_short scf1, scf2; u_short scf1, scf2;
debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " dev_dbg(&sock->dev, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x)\n", psock, state->flags, "io_irq %d, csc_mask %#2.2x)\n", psock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask); state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
tcic_setw(TCIC_ADDR+2, (psock << TCIC_SS_SHFT) | TCIC_ADR2_INDREG); tcic_setw(TCIC_ADDR+2, (psock << TCIC_SS_SHFT) | TCIC_ADR2_INDREG);
...@@ -731,7 +716,7 @@ static int tcic_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) ...@@ -731,7 +716,7 @@ static int tcic_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
u_int addr; u_int addr;
u_short base, len, ioctl; u_short base, len, ioctl;
debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " dev_dbg(&sock->dev, "SetIOMap(%d, %d, %#2.2x, %d ns, "
"%#llx-%#llx)\n", psock, io->map, io->flags, io->speed, "%#llx-%#llx)\n", psock, io->map, io->flags, io->speed,
(unsigned long long)io->start, (unsigned long long)io->stop); (unsigned long long)io->start, (unsigned long long)io->stop);
if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) || if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) ||
...@@ -768,7 +753,7 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m ...@@ -768,7 +753,7 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
u_short addr, ctl; u_short addr, ctl;
u_long base, len, mmap; u_long base, len, mmap;
debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, " dev_dbg(&sock->dev, "SetMemMap(%d, %d, %#2.2x, %d ns, "
"%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags, "%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags,
mem->speed, (unsigned long long)mem->res->start, mem->speed, (unsigned long long)mem->res->start,
(unsigned long long)mem->res->end, mem->card_start); (unsigned long long)mem->res->end, mem->card_start);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment