diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/o2micro.h | 10 | ||||
-rw-r--r-- | drivers/pcmcia/ti113x.h | 78 | ||||
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 86 |
3 files changed, 97 insertions, 77 deletions
diff --git a/drivers/pcmcia/o2micro.h b/drivers/pcmcia/o2micro.h index a234ce1967a3..5554015a7813 100644 --- a/drivers/pcmcia/o2micro.h +++ b/drivers/pcmcia/o2micro.h | |||
@@ -140,7 +140,8 @@ static int o2micro_override(struct yenta_socket *socket) | |||
140 | a = config_readb(socket, O2_RESERVED1); | 140 | a = config_readb(socket, O2_RESERVED1); |
141 | b = config_readb(socket, O2_RESERVED2); | 141 | b = config_readb(socket, O2_RESERVED2); |
142 | 142 | ||
143 | printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b); | 143 | dev_printk(KERN_INFO, &socket->dev->dev, |
144 | "O2: res at 0x94/0xD4: %02x/%02x\n", a, b); | ||
144 | 145 | ||
145 | switch (socket->dev->device) { | 146 | switch (socket->dev->device) { |
146 | /* | 147 | /* |
@@ -153,7 +154,9 @@ static int o2micro_override(struct yenta_socket *socket) | |||
153 | case PCI_DEVICE_ID_O2_6812: | 154 | case PCI_DEVICE_ID_O2_6812: |
154 | case PCI_DEVICE_ID_O2_6832: | 155 | case PCI_DEVICE_ID_O2_6832: |
155 | case PCI_DEVICE_ID_O2_6836: | 156 | case PCI_DEVICE_ID_O2_6836: |
156 | printk(KERN_INFO "Yenta O2: old bridge, disabling read prefetch/write burst\n"); | 157 | dev_printk(KERN_INFO, &socket->dev->dev, |
158 | "Yenta O2: old bridge, disabling read " | ||
159 | "prefetch/write burst\n"); | ||
157 | config_writeb(socket, O2_RESERVED1, | 160 | config_writeb(socket, O2_RESERVED1, |
158 | a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST)); | 161 | a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST)); |
159 | config_writeb(socket, O2_RESERVED2, | 162 | config_writeb(socket, O2_RESERVED2, |
@@ -161,7 +164,8 @@ static int o2micro_override(struct yenta_socket *socket) | |||
161 | break; | 164 | break; |
162 | 165 | ||
163 | default: | 166 | default: |
164 | printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n"); | 167 | dev_printk(KERN_INFO , &socket->dev->dev, |
168 | "O2: enabling read prefetch/write burst\n"); | ||
165 | config_writeb(socket, O2_RESERVED1, | 169 | config_writeb(socket, O2_RESERVED1, |
166 | a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST); | 170 | a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST); |
167 | config_writeb(socket, O2_RESERVED2, | 171 | config_writeb(socket, O2_RESERVED2, |
diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h index 129db7bd06c3..aaa70227bfb0 100644 --- a/drivers/pcmcia/ti113x.h +++ b/drivers/pcmcia/ti113x.h | |||
@@ -339,8 +339,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
339 | 339 | ||
340 | mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); | 340 | mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); |
341 | devctl = config_readb(socket, TI113X_DEVICE_CONTROL); | 341 | devctl = config_readb(socket, TI113X_DEVICE_CONTROL); |
342 | printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n", | 342 | dev_printk(KERN_INFO, &socket->dev->dev, |
343 | pci_name(socket->dev), mfunc, devctl); | 343 | "TI: mfunc 0x%08x, devctl 0x%02x\n", mfunc, devctl); |
344 | 344 | ||
345 | /* make sure PCI interrupts are enabled before probing */ | 345 | /* make sure PCI interrupts are enabled before probing */ |
346 | ti_init(socket); | 346 | ti_init(socket); |
@@ -354,8 +354,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
354 | * We're here which means PCI interrupts are _not_ delivered. try to | 354 | * We're here which means PCI interrupts are _not_ delivered. try to |
355 | * find the right setting (all serial or parallel) | 355 | * find the right setting (all serial or parallel) |
356 | */ | 356 | */ |
357 | printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n", | 357 | dev_printk(KERN_INFO, &socket->dev->dev, |
358 | pci_name(socket->dev)); | 358 | "TI: probing PCI interrupt failed, trying to fix\n"); |
359 | 359 | ||
360 | /* for serial PCI make sure MFUNC3 is set to IRQSER */ | 360 | /* for serial PCI make sure MFUNC3 is set to IRQSER */ |
361 | if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) { | 361 | if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) { |
@@ -379,8 +379,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
379 | 379 | ||
380 | pci_irq_status = yenta_probe_cb_irq(socket); | 380 | pci_irq_status = yenta_probe_cb_irq(socket); |
381 | if (pci_irq_status == 1) { | 381 | if (pci_irq_status == 1) { |
382 | printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts ok\n", | 382 | dev_printk(KERN_INFO, &socket->dev->dev, |
383 | pci_name(socket->dev)); | 383 | "TI: all-serial interrupts ok\n"); |
384 | mfunc_old = mfunc; | 384 | mfunc_old = mfunc; |
385 | goto out; | 385 | goto out; |
386 | } | 386 | } |
@@ -395,8 +395,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
395 | } | 395 | } |
396 | 396 | ||
397 | /* serial PCI interrupts not working fall back to parallel */ | 397 | /* serial PCI interrupts not working fall back to parallel */ |
398 | printk(KERN_INFO "Yenta TI: socket %s falling back to parallel PCI interrupts\n", | 398 | dev_printk(KERN_INFO, &socket->dev->dev, |
399 | pci_name(socket->dev)); | 399 | "TI: falling back to parallel PCI interrupts\n"); |
400 | devctl &= ~TI113X_DCR_IMODE_MASK; | 400 | devctl &= ~TI113X_DCR_IMODE_MASK; |
401 | devctl |= TI113X_DCR_IMODE_SERIAL; /* serial ISA could be right */ | 401 | devctl |= TI113X_DCR_IMODE_SERIAL; /* serial ISA could be right */ |
402 | config_writeb(socket, TI113X_DEVICE_CONTROL, devctl); | 402 | config_writeb(socket, TI113X_DEVICE_CONTROL, devctl); |
@@ -427,8 +427,8 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
427 | pci_irq_status = yenta_probe_cb_irq(socket); | 427 | pci_irq_status = yenta_probe_cb_irq(socket); |
428 | if (pci_irq_status == 1) { | 428 | if (pci_irq_status == 1) { |
429 | mfunc_old = mfunc; | 429 | mfunc_old = mfunc; |
430 | printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n", | 430 | dev_printk(KERN_INFO, &socket->dev->dev, |
431 | pci_name(socket->dev)); | 431 | "TI: parallel PCI interrupts ok\n"); |
432 | } else { | 432 | } else { |
433 | /* not working, back to old value */ | 433 | /* not working, back to old value */ |
434 | mfunc = mfunc_old; | 434 | mfunc = mfunc_old; |
@@ -440,8 +440,9 @@ static void ti12xx_irqroute_func0(struct yenta_socket *socket) | |||
440 | out: | 440 | out: |
441 | if (pci_irq_status < 1) { | 441 | if (pci_irq_status < 1) { |
442 | socket->cb_irq = 0; | 442 | socket->cb_irq = 0; |
443 | printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n", | 443 | dev_printk(KERN_INFO, &socket->dev->dev, |
444 | pci_name(socket->dev)); | 444 | "Yenta TI: no PCI interrupts. Fish. " |
445 | "Please report.\n"); | ||
445 | } | 446 | } |
446 | } | 447 | } |
447 | 448 | ||
@@ -513,8 +514,9 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
513 | 514 | ||
514 | mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); | 515 | mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); |
515 | devctl = config_readb(socket, TI113X_DEVICE_CONTROL); | 516 | devctl = config_readb(socket, TI113X_DEVICE_CONTROL); |
516 | printk(KERN_INFO "Yenta TI: socket %s, mfunc 0x%08x, devctl 0x%02x\n", | 517 | dev_printk(KERN_INFO, &socket->dev->dev, |
517 | pci_name(socket->dev), mfunc, devctl); | 518 | "TI: mfunc 0x%08x, devctl 0x%02x\n", |
519 | mfunc, devctl); | ||
518 | 520 | ||
519 | /* if IRQs are configured as tied, align irq of func1 with func0 */ | 521 | /* if IRQs are configured as tied, align irq of func1 with func0 */ |
520 | sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); | 522 | sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); |
@@ -533,9 +535,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
533 | * We're here which means PCI interrupts are _not_ delivered. try to | 535 | * We're here which means PCI interrupts are _not_ delivered. try to |
534 | * find the right setting | 536 | * find the right setting |
535 | */ | 537 | */ |
536 | printk(KERN_INFO "Yenta TI: socket %s probing PCI interrupt failed, trying to fix\n", | 538 | dev_printk(KERN_INFO, &socket->dev->dev, |
537 | pci_name(socket->dev)); | 539 | "TI: probing PCI interrupt failed, trying to fix\n"); |
538 | |||
539 | 540 | ||
540 | /* if all serial: set INTRTIE, probe again */ | 541 | /* if all serial: set INTRTIE, probe again */ |
541 | if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) { | 542 | if ((devctl & TI113X_DCR_IMODE_MASK) == TI12XX_DCR_IMODE_ALL_SERIAL) { |
@@ -544,8 +545,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
544 | if (ti12xx_tie_interrupts(socket, &old_irq)) { | 545 | if (ti12xx_tie_interrupts(socket, &old_irq)) { |
545 | pci_irq_status = yenta_probe_cb_irq(socket); | 546 | pci_irq_status = yenta_probe_cb_irq(socket); |
546 | if (pci_irq_status == 1) { | 547 | if (pci_irq_status == 1) { |
547 | printk(KERN_INFO "Yenta TI: socket %s all-serial interrupts, tied ok\n", | 548 | dev_printk(KERN_INFO, &socket->dev->dev, |
548 | pci_name(socket->dev)); | 549 | "TI: all-serial interrupts, tied ok\n"); |
549 | goto out; | 550 | goto out; |
550 | } | 551 | } |
551 | 552 | ||
@@ -582,8 +583,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
582 | 583 | ||
583 | pci_irq_status = yenta_probe_cb_irq(socket); | 584 | pci_irq_status = yenta_probe_cb_irq(socket); |
584 | if (pci_irq_status == 1) { | 585 | if (pci_irq_status == 1) { |
585 | printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts ok\n", | 586 | dev_printk(KERN_INFO, &socket->dev->dev, |
586 | pci_name(socket->dev)); | 587 | "TI: parallel PCI interrupts ok\n"); |
587 | goto out; | 588 | goto out; |
588 | } | 589 | } |
589 | 590 | ||
@@ -593,13 +594,13 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
593 | if (pci_irq_status == -1) | 594 | if (pci_irq_status == -1) |
594 | goto out; | 595 | goto out; |
595 | } | 596 | } |
596 | 597 | ||
597 | /* still nothing: set INTRTIE */ | 598 | /* still nothing: set INTRTIE */ |
598 | if (ti12xx_tie_interrupts(socket, &old_irq)) { | 599 | if (ti12xx_tie_interrupts(socket, &old_irq)) { |
599 | pci_irq_status = yenta_probe_cb_irq(socket); | 600 | pci_irq_status = yenta_probe_cb_irq(socket); |
600 | if (pci_irq_status == 1) { | 601 | if (pci_irq_status == 1) { |
601 | printk(KERN_INFO "Yenta TI: socket %s parallel PCI interrupts, tied ok\n", | 602 | dev_printk(KERN_INFO, &socket->dev->dev, |
602 | pci_name(socket->dev)); | 603 | "TI: parallel PCI interrupts, tied ok\n"); |
603 | goto out; | 604 | goto out; |
604 | } | 605 | } |
605 | 606 | ||
@@ -610,8 +611,8 @@ static void ti12xx_irqroute_func1(struct yenta_socket *socket) | |||
610 | out: | 611 | out: |
611 | if (pci_irq_status < 1) { | 612 | if (pci_irq_status < 1) { |
612 | socket->cb_irq = 0; | 613 | socket->cb_irq = 0; |
613 | printk(KERN_INFO "Yenta TI: socket %s no PCI interrupts. Fish. Please report.\n", | 614 | dev_printk(KERN_INFO, &socket->dev->dev, |
614 | pci_name(socket->dev)); | 615 | "TI: no PCI interrupts. Fish. Please report.\n"); |
615 | } | 616 | } |
616 | } | 617 | } |
617 | 618 | ||
@@ -815,11 +816,13 @@ static int ti12xx_override(struct yenta_socket *socket) | |||
815 | /* make sure that memory burst is active */ | 816 | /* make sure that memory burst is active */ |
816 | val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL); | 817 | val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL); |
817 | if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) { | 818 | if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) { |
818 | printk(KERN_INFO "Yenta: Disabling CLKRUN feature\n"); | 819 | dev_printk(KERN_INFO, &socket->dev->dev, |
820 | "Disabling CLKRUN feature\n"); | ||
819 | val |= TI113X_SCR_KEEPCLK; | 821 | val |= TI113X_SCR_KEEPCLK; |
820 | } | 822 | } |
821 | if (!(val & TI122X_SCR_MRBURSTUP)) { | 823 | if (!(val & TI122X_SCR_MRBURSTUP)) { |
822 | printk(KERN_INFO "Yenta: Enabling burst memory read transactions\n"); | 824 | dev_printk(KERN_INFO, &socket->dev->dev, |
825 | "Enabling burst memory read transactions\n"); | ||
823 | val |= TI122X_SCR_MRBURSTUP; | 826 | val |= TI122X_SCR_MRBURSTUP; |
824 | } | 827 | } |
825 | if (val_orig != val) | 828 | if (val_orig != val) |
@@ -830,10 +833,12 @@ static int ti12xx_override(struct yenta_socket *socket) | |||
830 | * CSC interrupts to PCI rather than INTVAL. | 833 | * CSC interrupts to PCI rather than INTVAL. |
831 | */ | 834 | */ |
832 | val = config_readb(socket, TI1250_DIAGNOSTIC); | 835 | val = config_readb(socket, TI1250_DIAGNOSTIC); |
833 | printk(KERN_INFO "Yenta: Using %s to route CSC interrupts to PCI\n", | 836 | dev_printk(KERN_INFO, &socket->dev->dev, |
834 | (val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL"); | 837 | "Using %s to route CSC interrupts to PCI\n", |
835 | printk(KERN_INFO "Yenta: Routing CardBus interrupts to %s\n", | 838 | (val & TI1250_DIAG_PCI_CSC) ? "CSCINT" : "INTVAL"); |
836 | (val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA"); | 839 | dev_printk(KERN_INFO, &socket->dev->dev, |
840 | "Routing CardBus interrupts to %s\n", | ||
841 | (val & TI1250_DIAG_PCI_IREQ) ? "PCI" : "ISA"); | ||
837 | 842 | ||
838 | /* do irqrouting, depending on function */ | 843 | /* do irqrouting, depending on function */ |
839 | if (PCI_FUNC(socket->dev->devfn) == 0) | 844 | if (PCI_FUNC(socket->dev->devfn) == 0) |
@@ -858,8 +863,9 @@ static int ti1250_override(struct yenta_socket *socket) | |||
858 | diag |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ; | 863 | diag |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ; |
859 | 864 | ||
860 | if (diag != old) { | 865 | if (diag != old) { |
861 | printk(KERN_INFO "Yenta: adjusting diagnostic: %02x -> %02x\n", | 866 | dev_printk(KERN_INFO, &socket->dev->dev, |
862 | old, diag); | 867 | "adjusting diagnostic: %02x -> %02x\n", |
868 | old, diag); | ||
863 | config_writeb(socket, TI1250_DIAGNOSTIC, diag); | 869 | config_writeb(socket, TI1250_DIAGNOSTIC, diag); |
864 | } | 870 | } |
865 | 871 | ||
@@ -924,7 +930,9 @@ static void ene_tune_bridge(struct pcmcia_socket *sock, struct pci_bus *bus) | |||
924 | /* default to clear TLTEnable bit, old behaviour */ | 930 | /* default to clear TLTEnable bit, old behaviour */ |
925 | test_c9 &= ~ENE_TEST_C9_TLTENABLE; | 931 | test_c9 &= ~ENE_TEST_C9_TLTENABLE; |
926 | 932 | ||
927 | printk(KERN_INFO "yenta EnE: chaning testregister 0xC9, %02x -> %02x\n", old_c9, test_c9); | 933 | dev_printk(KERN_INFO, &socket->dev->dev, |
934 | "EnE: chaning testregister 0xC9, %02x -> %02x\n", | ||
935 | old_c9, test_c9); | ||
928 | config_writeb(socket, ENE_TEST_C9, test_c9); | 936 | config_writeb(socket, ENE_TEST_C9, test_c9); |
929 | } | 937 | } |
930 | 938 | ||
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 0ab1fb65cdc3..3ecd7c99d8eb 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -38,11 +38,7 @@ static int pwr_irqs_off; | |||
38 | module_param(pwr_irqs_off, bool, 0644); | 38 | module_param(pwr_irqs_off, bool, 0644); |
39 | MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!"); | 39 | MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!"); |
40 | 40 | ||
41 | #if 0 | 41 | #define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args) |
42 | #define debug(x,args...) printk(KERN_DEBUG "%s: " x, __func__ , ##args) | ||
43 | #else | ||
44 | #define debug(x,args...) | ||
45 | #endif | ||
46 | 42 | ||
47 | /* Don't ask.. */ | 43 | /* Don't ask.. */ |
48 | #define to_cycles(ns) ((ns)/120) | 44 | #define to_cycles(ns) ((ns)/120) |
@@ -69,13 +65,13 @@ MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation"); | |||
69 | static inline u32 cb_readl(struct yenta_socket *socket, unsigned reg) | 65 | static inline u32 cb_readl(struct yenta_socket *socket, unsigned reg) |
70 | { | 66 | { |
71 | u32 val = readl(socket->base + reg); | 67 | u32 val = readl(socket->base + reg); |
72 | debug("%p %04x %08x\n", socket, reg, val); | 68 | debug("%04x %08x\n", socket, reg, val); |
73 | return val; | 69 | return val; |
74 | } | 70 | } |
75 | 71 | ||
76 | static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val) | 72 | static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val) |
77 | { | 73 | { |
78 | debug("%p %04x %08x\n", socket, reg, val); | 74 | debug("%04x %08x\n", socket, reg, val); |
79 | writel(val, socket->base + reg); | 75 | writel(val, socket->base + reg); |
80 | readl(socket->base + reg); /* avoid problems with PCI write posting */ | 76 | readl(socket->base + reg); /* avoid problems with PCI write posting */ |
81 | } | 77 | } |
@@ -84,7 +80,7 @@ static inline u8 config_readb(struct yenta_socket *socket, unsigned offset) | |||
84 | { | 80 | { |
85 | u8 val; | 81 | u8 val; |
86 | pci_read_config_byte(socket->dev, offset, &val); | 82 | pci_read_config_byte(socket->dev, offset, &val); |
87 | debug("%p %04x %02x\n", socket, offset, val); | 83 | debug("%04x %02x\n", socket, offset, val); |
88 | return val; | 84 | return val; |
89 | } | 85 | } |
90 | 86 | ||
@@ -92,7 +88,7 @@ static inline u16 config_readw(struct yenta_socket *socket, unsigned offset) | |||
92 | { | 88 | { |
93 | u16 val; | 89 | u16 val; |
94 | pci_read_config_word(socket->dev, offset, &val); | 90 | pci_read_config_word(socket->dev, offset, &val); |
95 | debug("%p %04x %04x\n", socket, offset, val); | 91 | debug("%04x %04x\n", socket, offset, val); |
96 | return val; | 92 | return val; |
97 | } | 93 | } |
98 | 94 | ||
@@ -100,32 +96,32 @@ static inline u32 config_readl(struct yenta_socket *socket, unsigned offset) | |||
100 | { | 96 | { |
101 | u32 val; | 97 | u32 val; |
102 | pci_read_config_dword(socket->dev, offset, &val); | 98 | pci_read_config_dword(socket->dev, offset, &val); |
103 | debug("%p %04x %08x\n", socket, offset, val); | 99 | debug("%04x %08x\n", socket, offset, val); |
104 | return val; | 100 | return val; |
105 | } | 101 | } |
106 | 102 | ||
107 | static inline void config_writeb(struct yenta_socket *socket, unsigned offset, u8 val) | 103 | static inline void config_writeb(struct yenta_socket *socket, unsigned offset, u8 val) |
108 | { | 104 | { |
109 | debug("%p %04x %02x\n", socket, offset, val); | 105 | debug("%04x %02x\n", socket, offset, val); |
110 | pci_write_config_byte(socket->dev, offset, val); | 106 | pci_write_config_byte(socket->dev, offset, val); |
111 | } | 107 | } |
112 | 108 | ||
113 | static inline void config_writew(struct yenta_socket *socket, unsigned offset, u16 val) | 109 | static inline void config_writew(struct yenta_socket *socket, unsigned offset, u16 val) |
114 | { | 110 | { |
115 | debug("%p %04x %04x\n", socket, offset, val); | 111 | debug("%04x %04x\n", socket, offset, val); |
116 | pci_write_config_word(socket->dev, offset, val); | 112 | pci_write_config_word(socket->dev, offset, val); |
117 | } | 113 | } |
118 | 114 | ||
119 | static inline void config_writel(struct yenta_socket *socket, unsigned offset, u32 val) | 115 | static inline void config_writel(struct yenta_socket *socket, unsigned offset, u32 val) |
120 | { | 116 | { |
121 | debug("%p %04x %08x\n", socket, offset, val); | 117 | debug("%04x %08x\n", socket, offset, val); |
122 | pci_write_config_dword(socket->dev, offset, val); | 118 | pci_write_config_dword(socket->dev, offset, val); |
123 | } | 119 | } |
124 | 120 | ||
125 | static inline u8 exca_readb(struct yenta_socket *socket, unsigned reg) | 121 | static inline u8 exca_readb(struct yenta_socket *socket, unsigned reg) |
126 | { | 122 | { |
127 | u8 val = readb(socket->base + 0x800 + reg); | 123 | u8 val = readb(socket->base + 0x800 + reg); |
128 | debug("%p %04x %02x\n", socket, reg, val); | 124 | debug("%04x %02x\n", socket, reg, val); |
129 | return val; | 125 | return val; |
130 | } | 126 | } |
131 | 127 | ||
@@ -134,20 +130,20 @@ static inline u8 exca_readw(struct yenta_socket *socket, unsigned reg) | |||
134 | u16 val; | 130 | u16 val; |
135 | val = readb(socket->base + 0x800 + reg); | 131 | val = readb(socket->base + 0x800 + reg); |
136 | val |= readb(socket->base + 0x800 + reg + 1) << 8; | 132 | val |= readb(socket->base + 0x800 + reg + 1) << 8; |
137 | debug("%p %04x %04x\n", socket, reg, val); | 133 | debug("%04x %04x\n", socket, reg, val); |
138 | return val; | 134 | return val; |
139 | } | 135 | } |
140 | 136 | ||
141 | static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val) | 137 | static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val) |
142 | { | 138 | { |
143 | debug("%p %04x %02x\n", socket, reg, val); | 139 | debug("%04x %02x\n", socket, reg, val); |
144 | writeb(val, socket->base + 0x800 + reg); | 140 | writeb(val, socket->base + 0x800 + reg); |
145 | readb(socket->base + 0x800 + reg); /* PCI write posting... */ | 141 | readb(socket->base + 0x800 + reg); /* PCI write posting... */ |
146 | } | 142 | } |
147 | 143 | ||
148 | static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) | 144 | static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) |
149 | { | 145 | { |
150 | debug("%p %04x %04x\n", socket, reg, val); | 146 | debug("%04x %04x\n", socket, reg, val); |
151 | writeb(val, socket->base + 0x800 + reg); | 147 | writeb(val, socket->base + 0x800 + reg); |
152 | writeb(val >> 8, socket->base + 0x800 + reg + 1); | 148 | writeb(val >> 8, socket->base + 0x800 + reg + 1); |
153 | 149 | ||
@@ -207,7 +203,7 @@ static int yenta_get_status(struct pcmcia_socket *sock, unsigned int *value) | |||
207 | 203 | ||
208 | 204 | ||
209 | if (state & CB_CBCARD) { | 205 | if (state & CB_CBCARD) { |
210 | val |= SS_CARDBUS; | 206 | val |= SS_CARDBUS; |
211 | val |= (state & CB_CARDSTS) ? SS_STSCHG : 0; | 207 | val |= (state & CB_CARDSTS) ? SS_STSCHG : 0; |
212 | val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? 0 : SS_DETECT; | 208 | val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? 0 : SS_DETECT; |
213 | val |= (state & CB_PWRCYCLE) ? SS_POWERON | SS_READY : 0; | 209 | val |= (state & CB_PWRCYCLE) ? SS_POWERON | SS_READY : 0; |
@@ -650,8 +646,10 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type | |||
650 | root = pci_find_parent_resource(socket->dev, res); | 646 | root = pci_find_parent_resource(socket->dev, res); |
651 | if (root && (request_resource(root, res) == 0)) | 647 | if (root && (request_resource(root, res) == 0)) |
652 | return 0; | 648 | return 0; |
653 | printk(KERN_INFO "yenta %s: Preassigned resource %d busy or not available, reconfiguring...\n", | 649 | dev_printk(KERN_INFO, &socket->dev->dev, |
654 | pci_name(socket->dev), nr); | 650 | "Preassigned resource %d busy or not available, " |
651 | "reconfiguring...\n", | ||
652 | nr); | ||
655 | } | 653 | } |
656 | 654 | ||
657 | if (type & IORESOURCE_IO) { | 655 | if (type & IORESOURCE_IO) { |
@@ -674,8 +672,9 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type | |||
674 | return 1; | 672 | return 1; |
675 | } | 673 | } |
676 | 674 | ||
677 | printk(KERN_INFO "yenta %s: no resource of type %x available, trying to continue...\n", | 675 | dev_printk(KERN_INFO, &socket->dev->dev, |
678 | pci_name(socket->dev), type); | 676 | "no resource of type %x available, trying to continue...\n", |
677 | type); | ||
679 | res->start = res->end = res->flags = 0; | 678 | res->start = res->end = res->flags = 0; |
680 | return 0; | 679 | return 0; |
681 | } | 680 | } |
@@ -923,7 +922,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) | |||
923 | socket->probe_status = 0; | 922 | socket->probe_status = 0; |
924 | 923 | ||
925 | if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) { | 924 | if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) { |
926 | printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n"); | 925 | dev_printk(KERN_WARNING, &socket->dev->dev, |
926 | "request_irq() in yenta_probe_cb_irq() failed!\n"); | ||
927 | return -1; | 927 | return -1; |
928 | } | 928 | } |
929 | 929 | ||
@@ -960,8 +960,9 @@ static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_i | |||
960 | else | 960 | else |
961 | socket->socket.irq_mask = 0; | 961 | socket->socket.irq_mask = 0; |
962 | 962 | ||
963 | printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n", | 963 | dev_printk(KERN_INFO, &socket->dev->dev, |
964 | socket->socket.irq_mask, socket->cb_irq); | 964 | "ISA IRQ mask 0x%04x, PCI irq %d\n", |
965 | socket->socket.irq_mask, socket->cb_irq); | ||
965 | } | 966 | } |
966 | 967 | ||
967 | /* | 968 | /* |
@@ -1051,8 +1052,9 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) | |||
1051 | 1052 | ||
1052 | /* Show that the wanted subordinate number is not possible: */ | 1053 | /* Show that the wanted subordinate number is not possible: */ |
1053 | if (cardbus_bridge->subordinate > upper_limit) | 1054 | if (cardbus_bridge->subordinate > upper_limit) |
1054 | printk(KERN_WARNING "Yenta: Upper limit for fixing this " | 1055 | dev_printk(KERN_WARNING, &cardbus_bridge->dev, |
1055 | "bridge's parent bridge: #%02x\n", upper_limit); | 1056 | "Upper limit for fixing this " |
1057 | "bridge's parent bridge: #%02x\n", upper_limit); | ||
1056 | 1058 | ||
1057 | /* If we have room to increase the bridge's subordinate number, */ | 1059 | /* If we have room to increase the bridge's subordinate number, */ |
1058 | if (bridge_to_fix->subordinate < upper_limit) { | 1060 | if (bridge_to_fix->subordinate < upper_limit) { |
@@ -1061,10 +1063,11 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) | |||
1061 | unsigned char subordinate_to_assign = | 1063 | unsigned char subordinate_to_assign = |
1062 | min(cardbus_bridge->subordinate, upper_limit); | 1064 | min(cardbus_bridge->subordinate, upper_limit); |
1063 | 1065 | ||
1064 | printk(KERN_INFO "Yenta: Raising subordinate bus# of parent " | 1066 | dev_printk(KERN_INFO, &bridge_to_fix->dev, |
1065 | "bus (#%02x) from #%02x to #%02x\n", | 1067 | "Raising subordinate bus# of parent " |
1066 | bridge_to_fix->number, | 1068 | "bus (#%02x) from #%02x to #%02x\n", |
1067 | bridge_to_fix->subordinate, subordinate_to_assign); | 1069 | bridge_to_fix->number, |
1070 | bridge_to_fix->subordinate, subordinate_to_assign); | ||
1068 | 1071 | ||
1069 | /* Save the new subordinate in the bus struct of the bridge */ | 1072 | /* Save the new subordinate in the bus struct of the bridge */ |
1070 | bridge_to_fix->subordinate = subordinate_to_assign; | 1073 | bridge_to_fix->subordinate = subordinate_to_assign; |
@@ -1091,8 +1094,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1091 | * Bail out if so. | 1094 | * Bail out if so. |
1092 | */ | 1095 | */ |
1093 | if (!dev->subordinate) { | 1096 | if (!dev->subordinate) { |
1094 | printk(KERN_ERR "Yenta: no bus associated with %s! " | 1097 | dev_printk(KERN_ERR, &dev->dev, "no bus associated! " |
1095 | "(try 'pci=assign-busses')\n", pci_name(dev)); | 1098 | "(try 'pci=assign-busses')\n"); |
1096 | return -ENODEV; | 1099 | return -ENODEV; |
1097 | } | 1100 | } |
1098 | 1101 | ||
@@ -1127,7 +1130,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1127 | goto disable; | 1130 | goto disable; |
1128 | 1131 | ||
1129 | if (!pci_resource_start(dev, 0)) { | 1132 | if (!pci_resource_start(dev, 0)) { |
1130 | printk(KERN_ERR "No cardbus resource!\n"); | 1133 | dev_printk(KERN_ERR, &dev->dev, "No cardbus resource!\n"); |
1131 | ret = -ENODEV; | 1134 | ret = -ENODEV; |
1132 | goto release; | 1135 | goto release; |
1133 | } | 1136 | } |
@@ -1146,8 +1149,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1146 | * report the subsystem vendor and device for help debugging | 1149 | * report the subsystem vendor and device for help debugging |
1147 | * the irq stuff... | 1150 | * the irq stuff... |
1148 | */ | 1151 | */ |
1149 | printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n", | 1152 | dev_printk(KERN_INFO, &dev->dev, "CardBus bridge found [%04x:%04x]\n", |
1150 | pci_name(dev), dev->subsystem_vendor, dev->subsystem_device); | 1153 | dev->subsystem_vendor, dev->subsystem_device); |
1151 | 1154 | ||
1152 | yenta_config_init(socket); | 1155 | yenta_config_init(socket); |
1153 | 1156 | ||
@@ -1179,8 +1182,12 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1179 | socket->poll_timer.data = (unsigned long)socket; | 1182 | socket->poll_timer.data = (unsigned long)socket; |
1180 | socket->poll_timer.expires = jiffies + HZ; | 1183 | socket->poll_timer.expires = jiffies + HZ; |
1181 | add_timer(&socket->poll_timer); | 1184 | add_timer(&socket->poll_timer); |
1182 | printk(KERN_INFO "Yenta: no PCI IRQ, CardBus support disabled for this socket.\n" | 1185 | dev_printk(KERN_INFO, &dev->dev, |
1183 | KERN_INFO "Yenta: check your BIOS CardBus, BIOS IRQ or ACPI settings.\n"); | 1186 | "no PCI IRQ, CardBus support disabled for this " |
1187 | "socket.\n"); | ||
1188 | dev_printk(KERN_INFO, &dev->dev, | ||
1189 | "check your BIOS CardBus, BIOS IRQ or ACPI " | ||
1190 | "settings.\n"); | ||
1184 | } else { | 1191 | } else { |
1185 | socket->socket.features |= SS_CAP_CARDBUS; | 1192 | socket->socket.features |= SS_CAP_CARDBUS; |
1186 | } | 1193 | } |
@@ -1188,7 +1195,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1188 | /* Figure out what the dang thing can do for the PCMCIA layer... */ | 1195 | /* Figure out what the dang thing can do for the PCMCIA layer... */ |
1189 | yenta_interrogate(socket); | 1196 | yenta_interrogate(socket); |
1190 | yenta_get_socket_capabilities(socket, isa_interrupts); | 1197 | yenta_get_socket_capabilities(socket, isa_interrupts); |
1191 | printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); | 1198 | dev_printk(KERN_INFO, &dev->dev, |
1199 | "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); | ||
1192 | 1200 | ||
1193 | yenta_fixup_parent_bridge(dev->subordinate); | 1201 | yenta_fixup_parent_bridge(dev->subordinate); |
1194 | 1202 | ||