Skip to content

Commit

Permalink
pcmcia: use dev_printk and dev_dbg in yenta_socket
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Aug 22, 2008
1 parent 6e86841 commit dd797d8
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 77 deletions.
10 changes: 7 additions & 3 deletions drivers/pcmcia/o2micro.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ static int o2micro_override(struct yenta_socket *socket)
a = config_readb(socket, O2_RESERVED1);
b = config_readb(socket, O2_RESERVED2);

printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b);
dev_printk(KERN_INFO, &socket->dev->dev,
"O2: res at 0x94/0xD4: %02x/%02x\n", a, b);

switch (socket->dev->device) {
/*
Expand All @@ -153,15 +154,18 @@ static int o2micro_override(struct yenta_socket *socket)
case PCI_DEVICE_ID_O2_6812:
case PCI_DEVICE_ID_O2_6832:
case PCI_DEVICE_ID_O2_6836:
printk(KERN_INFO "Yenta O2: old bridge, disabling read prefetch/write burst\n");
dev_printk(KERN_INFO, &socket->dev->dev,
"Yenta O2: old bridge, disabling read "
"prefetch/write burst\n");
config_writeb(socket, O2_RESERVED1,
a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
config_writeb(socket, O2_RESERVED2,
b & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
break;

default:
printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n");
dev_printk(KERN_INFO , &socket->dev->dev,
"O2: enabling read prefetch/write burst\n");
config_writeb(socket, O2_RESERVED1,
a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST);
config_writeb(socket, O2_RESERVED2,
Expand Down
78 changes: 43 additions & 35 deletions drivers/pcmcia/ti113x.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)

mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n",
pci_name(socket->dev), mfunc, devctl);
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: mfunc 0x%08x, devctl 0x%02x\n", mfunc, devctl);

/* make sure PCI interrupts are enabled before probing */
ti_init(socket);
Expand All @@ -354,8 +354,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
* We're here which means PCI interrupts are _not_ delivered. try to
* find the right setting (all serial or parallel)
*/
printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: probing PCI interrupt failed, trying to fix\n");

/* for serial PCI make sure MFUNC3 is set to IRQSER */
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
Expand All @@ -379,8 +379,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)

pci_irq_status = yenta_probe_cb_irq(socket);
if (pci_irq_status == 1) {
printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts ok\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: all-serial interrupts ok\n");
mfunc_old = mfunc;
goto out;
}
Expand All @@ -395,8 +395,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
}

/* serial PCI interrupts not working fall back to parallel */
printk(KERN_INFO "Yenta TI: socket %s falling back to parallel PCI interrupts\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: falling back to parallel PCI interrupts\n");
devctl &= ~TI113X_DCR_IMODE_MASK;
devctl |= TI113X_DCR_IMODE_SERIAL; /* serial ISA could be right */
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
Expand Down Expand Up @@ -427,8 +427,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
pci_irq_status = yenta_probe_cb_irq(socket);
if (pci_irq_status == 1) {
mfunc_old = mfunc;
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: parallel PCI interrupts ok\n");
} else {
/* not working, back to old value */
mfunc = mfunc_old;
Expand All @@ -440,8 +440,9 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket)
out:
if (pci_irq_status < 1) {
socket->cb_irq = 0;
printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"Yenta TI: no PCI interrupts. Fish. "
"Please report.\n");
}
}

Expand Down Expand Up @@ -513,8 +514,9 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)

mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC);
devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n",
pci_name(socket->dev), mfunc, devctl);
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: mfunc 0x%08x, devctl 0x%02x\n",
mfunc, devctl);

/* if IRQs are configured as tied, align irq of func1 with func0 */
sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL);
Expand All @@ -533,9 +535,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
* We're here which means PCI interrupts are _not_ delivered. try to
* find the right setting
*/
printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n",
pci_name(socket->dev));

dev_printk(KERN_INFO, &socket->dev->dev,
"TI: probing PCI interrupt failed, trying to fix\n");

/* if all serial: set INTRTIE, probe again */
if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) {
Expand All @@ -544,8 +545,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
if (ti12xx_tie_interrupts(socket, &old_irq)) {
pci_irq_status = yenta_probe_cb_irq(socket);
if (pci_irq_status == 1) {
printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts, tied ok\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: all-serial interrupts, tied ok\n");
goto out;
}

Expand Down Expand Up @@ -582,8 +583,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)

pci_irq_status = yenta_probe_cb_irq(socket);
if (pci_irq_status == 1) {
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: parallel PCI interrupts ok\n");
goto out;
}

Expand All @@ -593,13 +594,13 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
if (pci_irq_status == -1)
goto out;
}

/* still nothing: set INTRTIE */
if (ti12xx_tie_interrupts(socket, &old_irq)) {
pci_irq_status = yenta_probe_cb_irq(socket);
if (pci_irq_status == 1) {
printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts, tied ok\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: parallel PCI interrupts, tied ok\n");
goto out;
}

Expand All @@ -610,8 +611,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket)
out:
if (pci_irq_status < 1) {
socket->cb_irq = 0;
printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n",
pci_name(socket->dev));
dev_printk(KERN_INFO, &socket->dev->dev,
"TI: no PCI interrupts. Fish. Please report.\n");
}
}

Expand Down Expand Up @@ -815,11 +816,13 @@ static int ti12xx_override(struct yenta_socket *socket)
/* make sure that memory burst is active */
val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL);
if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) {
printk(KERN_INFO "Yenta: Disabling CLKRUN feature\n");
dev_printk(KERN_INFO, &socket->dev->dev,
"Disabling CLKRUN feature\n");
val |= TI113X_SCR_KEEPCLK;
}
if (!(val & TI122X_SCR_MRBURSTUP)) {
printk(KERN_INFO "Yenta: Enabling burst memory read transactions\n");
dev_printk(KERN_INFO, &socket->dev->dev,
"Enabling burst memory read transactions\n");
val |= TI122X_SCR_MRBURSTUP;
}
if (val_orig != val)
Expand All @@ -830,10 +833,12 @@ static int ti12xx_override(struct yenta_socket *socket)
* CSC interrupts to PCI rather than INTVAL.
*/
val = config_readb(socket, TI1250_DIAGNOSTIC);
printk(KERN_INFO "Yenta: Using %s to route CSC interrupts to PCI\n",
(val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL");
printk(KERN_INFO "Yenta: Routing CardBus interrupts to %s\n",
(val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA");
dev_printk(KERN_INFO, &socket->dev->dev,
"Using %s to route CSC interrupts to PCI\n",
(val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL");
dev_printk(KERN_INFO, &socket->dev->dev,
"Routing CardBus interrupts to %s\n",
(val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA");

/* do irqrouting, depending on function */
if (PCI_FUNC(socket->dev->devfn) == 0)
Expand All @@ -858,8 +863,9 @@ static int ti1250_override(struct yenta_socket *socket)
diag |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ;

if (diag != old) {
printk(KERN_INFO "Yenta: adjusting diagnostic: %02x -> %02x\n",
old, diag);
dev_printk(KERN_INFO, &socket->dev->dev,
"adjusting diagnostic: %02x -> %02x\n",
old, diag);
config_writeb(socket, TI1250_DIAGNOSTIC, diag);
}

Expand Down Expand Up @@ -924,7 +930,9 @@ static void ene_tune_bridge(struct pcmcia_socket *sock, struct pci_bus *bus)
/* default to clear TLTEnable bit, old behaviour */
test_c9 &= ~ENE_TEST_C9_TLTENABLE;

printk(KERN_INFO "yenta EnE: chaning testregister 0xC9, %02x -> %02x\n", old_c9, test_c9);
dev_printk(KERN_INFO, &socket->dev->dev,
"EnE: chaning testregister 0xC9, %02x -> %02x\n",
old_c9, test_c9);
config_writeb(socket, ENE_TEST_C9, test_c9);
}

Expand Down
Loading

0 comments on commit dd797d8

Please sign in to comment.