.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* Low-level parallel-port routines for 8255-based PC-style hardware. |
---|
2 | 3 | * |
---|
3 | 4 | * Authors: Phil Blundell <philb@gnu.org> |
---|
.. | .. |
---|
86 | 87 | |
---|
87 | 88 | #undef DEBUG |
---|
88 | 89 | |
---|
89 | | -#ifdef DEBUG |
---|
90 | | -#define DPRINTK printk |
---|
91 | | -#else |
---|
92 | | -#define DPRINTK(stuff...) |
---|
93 | | -#endif |
---|
94 | | - |
---|
95 | | - |
---|
96 | 90 | #define NR_SUPERIOS 3 |
---|
97 | 91 | static struct superio_struct { /* For Super-IO chips autodetection */ |
---|
98 | 92 | int io; |
---|
.. | .. |
---|
117 | 111 | if (m != 0xff) |
---|
118 | 112 | ectr = inb(ECONTROL(pb)); |
---|
119 | 113 | |
---|
120 | | - DPRINTK(KERN_DEBUG "frob_econtrol(%02x,%02x): %02x -> %02x\n", |
---|
121 | | - m, v, ectr, (ectr & ~m) ^ v); |
---|
| 114 | + pr_debug("frob_econtrol(%02x,%02x): %02x -> %02x\n", |
---|
| 115 | + m, v, ectr, (ectr & ~m) ^ v); |
---|
122 | 116 | |
---|
123 | 117 | outb((ectr & ~m) ^ v, ECONTROL(pb)); |
---|
124 | 118 | } |
---|
.. | .. |
---|
141 | 135 | unsigned char oecr; |
---|
142 | 136 | int mode; |
---|
143 | 137 | |
---|
144 | | - DPRINTK(KERN_INFO "parport change_mode ECP-ISA to mode 0x%02x\n", m); |
---|
| 138 | + pr_debug("parport change_mode ECP-ISA to mode 0x%02x\n", m); |
---|
145 | 139 | |
---|
146 | 140 | if (!priv->ecr) { |
---|
147 | 141 | printk(KERN_DEBUG "change_mode: but there's no ECR!\n"); |
---|
.. | .. |
---|
297 | 291 | status = inb(STATUS(port)); |
---|
298 | 292 | if (status & 0x01) { |
---|
299 | 293 | /* EPP timeout should never occur... */ |
---|
300 | | - printk(KERN_DEBUG |
---|
301 | | -"%s: EPP timeout occurred while talking to w91284pic (should not have done)\n", port->name); |
---|
| 294 | + printk(KERN_DEBUG "%s: EPP timeout occurred while talking to w91284pic (should not have done)\n", |
---|
| 295 | + port->name); |
---|
302 | 296 | clear_epp_timeout(port); |
---|
303 | 297 | } |
---|
304 | 298 | } |
---|
.. | .. |
---|
474 | 468 | const unsigned char *bufp = buf; |
---|
475 | 469 | size_t left = length; |
---|
476 | 470 | unsigned long expire = jiffies + port->physport->cad->timeout; |
---|
477 | | - const int fifo = FIFO(port); |
---|
| 471 | + const unsigned long fifo = FIFO(port); |
---|
478 | 472 | int poll_for = 8; /* 80 usecs */ |
---|
479 | 473 | const struct parport_pc_private *priv = port->physport->private_data; |
---|
480 | 474 | const int fifo_depth = priv->fifo_depth; |
---|
.. | .. |
---|
726 | 720 | r = change_mode(port, ECR_PPF); /* Parallel port FIFO */ |
---|
727 | 721 | if (r) |
---|
728 | 722 | printk(KERN_DEBUG "%s: Warning change_mode ECR_PPF failed\n", |
---|
729 | | - port->name); |
---|
| 723 | + port->name); |
---|
730 | 724 | |
---|
731 | 725 | port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; |
---|
732 | 726 | |
---|
.. | .. |
---|
769 | 763 | PARPORT_STATUS_BUSY, |
---|
770 | 764 | PARPORT_STATUS_BUSY); |
---|
771 | 765 | if (r) |
---|
772 | | - printk(KERN_DEBUG |
---|
773 | | - "%s: BUSY timeout (%d) in compat_write_block_pio\n", |
---|
774 | | - port->name, r); |
---|
| 766 | + printk(KERN_DEBUG "%s: BUSY timeout (%d) in compat_write_block_pio\n", |
---|
| 767 | + port->name, r); |
---|
775 | 768 | |
---|
776 | 769 | port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE; |
---|
777 | 770 | |
---|
.. | .. |
---|
809 | 802 | PARPORT_STATUS_PAPEROUT, |
---|
810 | 803 | PARPORT_STATUS_PAPEROUT); |
---|
811 | 804 | if (r) { |
---|
812 | | - printk(KERN_DEBUG "%s: PError timeout (%d) " |
---|
813 | | - "in ecp_write_block_pio\n", port->name, r); |
---|
| 805 | + printk(KERN_DEBUG "%s: PError timeout (%d) in ecp_write_block_pio\n", |
---|
| 806 | + port->name, r); |
---|
814 | 807 | } |
---|
815 | 808 | } |
---|
816 | 809 | |
---|
.. | .. |
---|
823 | 816 | r = change_mode(port, ECR_ECP); /* ECP FIFO */ |
---|
824 | 817 | if (r) |
---|
825 | 818 | printk(KERN_DEBUG "%s: Warning change_mode ECR_ECP failed\n", |
---|
826 | | - port->name); |
---|
| 819 | + port->name); |
---|
827 | 820 | port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; |
---|
828 | 821 | |
---|
829 | 822 | /* Write the data to the FIFO. */ |
---|
.. | .. |
---|
866 | 859 | parport_frob_control(port, PARPORT_CONTROL_INIT, 0); |
---|
867 | 860 | r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, 0); |
---|
868 | 861 | if (r) |
---|
869 | | - printk(KERN_DEBUG "%s: PE,1 timeout (%d) " |
---|
870 | | - "in ecp_write_block_pio\n", port->name, r); |
---|
| 862 | + printk(KERN_DEBUG "%s: PE,1 timeout (%d) in ecp_write_block_pio\n", |
---|
| 863 | + port->name, r); |
---|
871 | 864 | |
---|
872 | 865 | parport_frob_control(port, |
---|
873 | 866 | PARPORT_CONTROL_INIT, |
---|
.. | .. |
---|
876 | 869 | PARPORT_STATUS_PAPEROUT, |
---|
877 | 870 | PARPORT_STATUS_PAPEROUT); |
---|
878 | 871 | if (r) |
---|
879 | | - printk(KERN_DEBUG "%s: PE,2 timeout (%d) " |
---|
880 | | - "in ecp_write_block_pio\n", port->name, r); |
---|
| 872 | + printk(KERN_DEBUG "%s: PE,2 timeout (%d) in ecp_write_block_pio\n", |
---|
| 873 | + port->name, r); |
---|
881 | 874 | } |
---|
882 | 875 | |
---|
883 | 876 | r = parport_wait_peripheral(port, |
---|
884 | 877 | PARPORT_STATUS_BUSY, |
---|
885 | 878 | PARPORT_STATUS_BUSY); |
---|
886 | 879 | if (r) |
---|
887 | | - printk(KERN_DEBUG |
---|
888 | | - "%s: BUSY timeout (%d) in ecp_write_block_pio\n", |
---|
889 | | - port->name, r); |
---|
| 880 | + printk(KERN_DEBUG "%s: BUSY timeout (%d) in ecp_write_block_pio\n", |
---|
| 881 | + port->name, r); |
---|
890 | 882 | |
---|
891 | 883 | port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE; |
---|
892 | 884 | |
---|
.. | .. |
---|
981 | 973 | outb(0xaa, io); |
---|
982 | 974 | |
---|
983 | 975 | if (verbose_probing) { |
---|
984 | | - printk(KERN_INFO |
---|
985 | | - "SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, " |
---|
986 | | - "A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n", |
---|
| 976 | + pr_info("SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n", |
---|
987 | 977 | cr1, cr4, cra, cr23, cr26, cr27); |
---|
988 | 978 | |
---|
989 | 979 | /* The documentation calls DMA and IRQ-Lines by letters, so |
---|
990 | 980 | the board maker can/will wire them |
---|
991 | 981 | appropriately/randomly... G=reserved H=IDE-irq, */ |
---|
992 | | - printk(KERN_INFO |
---|
993 | | - "SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n", |
---|
994 | | - cr23 * 4, |
---|
995 | | - (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-', |
---|
996 | | - (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-', |
---|
997 | | - cra & 0x0f); |
---|
998 | | - printk(KERN_INFO "SMSC LPT Config: enabled=%s power=%s\n", |
---|
999 | | - (cr23 * 4 >= 0x100) ? "yes" : "no", |
---|
1000 | | - (cr1 & 4) ? "yes" : "no"); |
---|
1001 | | - printk(KERN_INFO |
---|
1002 | | - "SMSC LPT Config: Port mode=%s, EPP version =%s\n", |
---|
1003 | | - (cr1 & 0x08) ? "Standard mode only (SPP)" |
---|
1004 | | - : modes[cr4 & 0x03], |
---|
1005 | | - (cr4 & 0x40) ? "1.7" : "1.9"); |
---|
| 982 | + pr_info("SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n", |
---|
| 983 | + cr23 * 4, |
---|
| 984 | + (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-', |
---|
| 985 | + (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-', |
---|
| 986 | + cra & 0x0f); |
---|
| 987 | + pr_info("SMSC LPT Config: enabled=%s power=%s\n", |
---|
| 988 | + (cr23 * 4 >= 0x100) ? "yes" : "no", |
---|
| 989 | + (cr1 & 4) ? "yes" : "no"); |
---|
| 990 | + pr_info("SMSC LPT Config: Port mode=%s, EPP version =%s\n", |
---|
| 991 | + (cr1 & 0x08) ? "Standard mode only (SPP)" |
---|
| 992 | + : modes[cr4 & 0x03], |
---|
| 993 | + (cr4 & 0x40) ? "1.7" : "1.9"); |
---|
1006 | 994 | } |
---|
1007 | 995 | |
---|
1008 | 996 | /* Heuristics ! BIOS setup for this mainboard device limits |
---|
.. | .. |
---|
1012 | 1000 | if (cr23 * 4 >= 0x100) { /* if active */ |
---|
1013 | 1001 | s = find_free_superio(); |
---|
1014 | 1002 | if (s == NULL) |
---|
1015 | | - printk(KERN_INFO "Super-IO: too many chips!\n"); |
---|
| 1003 | + pr_info("Super-IO: too many chips!\n"); |
---|
1016 | 1004 | else { |
---|
1017 | 1005 | int d; |
---|
1018 | 1006 | switch (cr23 * 4) { |
---|
.. | .. |
---|
1077 | 1065 | outb(0xaa, io); |
---|
1078 | 1066 | |
---|
1079 | 1067 | if (verbose_probing) { |
---|
1080 | | - printk(KERN_INFO |
---|
1081 | | - "Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n", |
---|
1082 | | - cr30, cr60, cr61, cr70, cr74, crf0); |
---|
1083 | | - printk(KERN_INFO "Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ", |
---|
1084 | | - (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f); |
---|
| 1068 | + pr_info("Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n", |
---|
| 1069 | + cr30, cr60, cr61, cr70, cr74, crf0); |
---|
| 1070 | + pr_info("Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ", |
---|
| 1071 | + (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f); |
---|
1085 | 1072 | if ((cr74 & 0x07) > 3) |
---|
1086 | 1073 | pr_cont("dma=none\n"); |
---|
1087 | 1074 | else |
---|
1088 | 1075 | pr_cont("dma=%d\n", cr74 & 0x07); |
---|
1089 | | - printk(KERN_INFO |
---|
1090 | | - "Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n", |
---|
1091 | | - irqtypes[crf0>>7], (crf0>>3)&0x0f); |
---|
1092 | | - printk(KERN_INFO "Winbond LPT Config: Port mode=%s\n", |
---|
1093 | | - modes[crf0 & 0x07]); |
---|
| 1076 | + pr_info("Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n", |
---|
| 1077 | + irqtypes[crf0 >> 7], (crf0 >> 3) & 0x0f); |
---|
| 1078 | + pr_info("Winbond LPT Config: Port mode=%s\n", |
---|
| 1079 | + modes[crf0 & 0x07]); |
---|
1094 | 1080 | } |
---|
1095 | 1081 | |
---|
1096 | 1082 | if (cr30 & 0x01) { /* the settings can be interrogated later ... */ |
---|
1097 | 1083 | s = find_free_superio(); |
---|
1098 | 1084 | if (s == NULL) |
---|
1099 | | - printk(KERN_INFO "Super-IO: too many chips!\n"); |
---|
| 1085 | + pr_info("Super-IO: too many chips!\n"); |
---|
1100 | 1086 | else { |
---|
1101 | 1087 | s->io = (cr60 << 8) | cr61; |
---|
1102 | 1088 | s->irq = cr70 & 0x0f; |
---|
.. | .. |
---|
1150 | 1136 | progif = 0; |
---|
1151 | 1137 | |
---|
1152 | 1138 | if (verbose_probing) |
---|
1153 | | - printk(KERN_INFO "Winbond chip at EFER=0x%x key=0x%02x " |
---|
1154 | | - "devid=%02x devrev=%02x oldid=%02x type=%s\n", |
---|
1155 | | - efer, key, devid, devrev, oldid, type); |
---|
| 1139 | + pr_info("Winbond chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x oldid=%02x type=%s\n", |
---|
| 1140 | + efer, key, devid, devrev, oldid, type); |
---|
1156 | 1141 | |
---|
1157 | 1142 | if (progif == 2) |
---|
1158 | 1143 | show_parconfig_winbond(efer, key); |
---|
.. | .. |
---|
1183 | 1168 | type = "37c666GT"; |
---|
1184 | 1169 | |
---|
1185 | 1170 | if (verbose_probing) |
---|
1186 | | - printk(KERN_INFO "SMSC chip at EFER=0x%x " |
---|
1187 | | - "key=0x%02x devid=%02x devrev=%02x type=%s\n", |
---|
1188 | | - efer, key, devid, devrev, type); |
---|
| 1171 | + pr_info("SMSC chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x type=%s\n", |
---|
| 1172 | + efer, key, devid, devrev, type); |
---|
1189 | 1173 | |
---|
1190 | 1174 | if (func) |
---|
1191 | 1175 | func(efer, key); |
---|
.. | .. |
---|
1357 | 1341 | dev |= inb(0x2f); |
---|
1358 | 1342 | if (dev == 0x8712 || dev == 0x8705 || dev == 0x8715 || |
---|
1359 | 1343 | dev == 0x8716 || dev == 0x8718 || dev == 0x8726) { |
---|
1360 | | - printk(KERN_INFO "IT%04X SuperIO detected.\n", dev); |
---|
| 1344 | + pr_info("IT%04X SuperIO detected\n", dev); |
---|
1361 | 1345 | outb(0x07, 0x2E); /* Parallel Port */ |
---|
1362 | 1346 | outb(0x03, 0x2F); |
---|
1363 | 1347 | outb(0xF0, 0x2E); /* BOOT 0x80 off */ |
---|
.. | .. |
---|
1444 | 1428 | if (user_specified) |
---|
1445 | 1429 | /* That didn't work, but the user thinks there's a |
---|
1446 | 1430 | * port here. */ |
---|
1447 | | - printk(KERN_INFO "parport 0x%lx (WARNING): CTR: " |
---|
1448 | | - "wrote 0x%02x, read 0x%02x\n", pb->base, w, r); |
---|
| 1431 | + pr_info("parport 0x%lx (WARNING): CTR: wrote 0x%02x, read 0x%02x\n", |
---|
| 1432 | + pb->base, w, r); |
---|
1449 | 1433 | |
---|
1450 | 1434 | /* Try the data register. The data lines aren't tri-stated at |
---|
1451 | 1435 | * this stage, so we expect back what we wrote. */ |
---|
.. | .. |
---|
1463 | 1447 | if (user_specified) { |
---|
1464 | 1448 | /* Didn't work, but the user is convinced this is the |
---|
1465 | 1449 | * place. */ |
---|
1466 | | - printk(KERN_INFO "parport 0x%lx (WARNING): DATA: " |
---|
1467 | | - "wrote 0x%02x, read 0x%02x\n", pb->base, w, r); |
---|
1468 | | - printk(KERN_INFO "parport 0x%lx: You gave this address, " |
---|
1469 | | - "but there is probably no parallel port there!\n", |
---|
| 1450 | + pr_info("parport 0x%lx (WARNING): DATA: wrote 0x%02x, read 0x%02x\n", |
---|
| 1451 | + pb->base, w, r); |
---|
| 1452 | + pr_info("parport 0x%lx: You gave this address, but there is probably no parallel port there!\n", |
---|
1470 | 1453 | pb->base); |
---|
1471 | 1454 | } |
---|
1472 | 1455 | |
---|
.. | .. |
---|
1619 | 1602 | if (i <= priv->fifo_depth) { |
---|
1620 | 1603 | if (verbose_probing) |
---|
1621 | 1604 | printk(KERN_DEBUG "0x%lx: writeIntrThreshold is %d\n", |
---|
1622 | | - pb->base, i); |
---|
| 1605 | + pb->base, i); |
---|
1623 | 1606 | } else |
---|
1624 | 1607 | /* Number of bytes we know we can write if we get an |
---|
1625 | 1608 | interrupt. */ |
---|
.. | .. |
---|
1641 | 1624 | |
---|
1642 | 1625 | if (i <= priv->fifo_depth) { |
---|
1643 | 1626 | if (verbose_probing) |
---|
1644 | | - printk(KERN_INFO "0x%lx: readIntrThreshold is %d\n", |
---|
| 1627 | + pr_info("0x%lx: readIntrThreshold is %d\n", |
---|
1645 | 1628 | pb->base, i); |
---|
1646 | 1629 | } else |
---|
1647 | 1630 | /* Number of bytes we can read if we get an interrupt. */ |
---|
.. | .. |
---|
1656 | 1639 | switch (pword) { |
---|
1657 | 1640 | case 0: |
---|
1658 | 1641 | pword = 2; |
---|
1659 | | - printk(KERN_WARNING "0x%lx: Unsupported pword size!\n", |
---|
1660 | | - pb->base); |
---|
| 1642 | + pr_warn("0x%lx: Unsupported pword size!\n", pb->base); |
---|
1661 | 1643 | break; |
---|
1662 | 1644 | case 2: |
---|
1663 | 1645 | pword = 4; |
---|
1664 | | - printk(KERN_WARNING "0x%lx: Unsupported pword size!\n", |
---|
1665 | | - pb->base); |
---|
| 1646 | + pr_warn("0x%lx: Unsupported pword size!\n", pb->base); |
---|
1666 | 1647 | break; |
---|
1667 | 1648 | default: |
---|
1668 | | - printk(KERN_WARNING "0x%lx: Unknown implementation ID\n", |
---|
1669 | | - pb->base); |
---|
1670 | | - /* Assume 1 */ |
---|
| 1649 | + pr_warn("0x%lx: Unknown implementation ID\n", pb->base); |
---|
| 1650 | + fallthrough; /* Assume 1 */ |
---|
1671 | 1651 | case 1: |
---|
1672 | 1652 | pword = 1; |
---|
1673 | 1653 | } |
---|
.. | .. |
---|
1675 | 1655 | |
---|
1676 | 1656 | if (verbose_probing) { |
---|
1677 | 1657 | printk(KERN_DEBUG "0x%lx: PWord is %d bits\n", |
---|
1678 | | - pb->base, 8 * pword); |
---|
| 1658 | + pb->base, 8 * pword); |
---|
1679 | 1659 | |
---|
1680 | | - printk(KERN_DEBUG "0x%lx: Interrupts are ISA-%s\n", pb->base, |
---|
1681 | | - config & 0x80 ? "Level" : "Pulses"); |
---|
| 1660 | + printk(KERN_DEBUG "0x%lx: Interrupts are ISA-%s\n", |
---|
| 1661 | + pb->base, config & 0x80 ? "Level" : "Pulses"); |
---|
1682 | 1662 | |
---|
1683 | 1663 | configb = inb(CONFIGB(pb)); |
---|
1684 | 1664 | printk(KERN_DEBUG "0x%lx: ECP port cfgA=0x%02x cfgB=0x%02x\n", |
---|
1685 | | - pb->base, config, configb); |
---|
| 1665 | + pb->base, config, configb); |
---|
1686 | 1666 | printk(KERN_DEBUG "0x%lx: ECP settings irq=", pb->base); |
---|
1687 | 1667 | if ((configb >> 3) & 0x07) |
---|
1688 | 1668 | pr_cont("%d", intrline[(configb >> 3) & 0x07]); |
---|
.. | .. |
---|
2106 | 2086 | |
---|
2107 | 2087 | p->size = (p->modes & PARPORT_MODE_EPP) ? 8 : 3; |
---|
2108 | 2088 | |
---|
2109 | | - printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); |
---|
| 2089 | + pr_info("%s: PC-style at 0x%lx", p->name, p->base); |
---|
2110 | 2090 | if (p->base_hi && priv->ecr) |
---|
2111 | | - printk(KERN_CONT " (0x%lx)", p->base_hi); |
---|
| 2091 | + pr_cont(" (0x%lx)", p->base_hi); |
---|
2112 | 2092 | if (p->irq == PARPORT_IRQ_AUTO) { |
---|
2113 | 2093 | p->irq = PARPORT_IRQ_NONE; |
---|
2114 | 2094 | parport_irq_probe(p); |
---|
.. | .. |
---|
2119 | 2099 | p->irq = PARPORT_IRQ_NONE; |
---|
2120 | 2100 | } |
---|
2121 | 2101 | if (p->irq != PARPORT_IRQ_NONE) { |
---|
2122 | | - printk(KERN_CONT ", irq %d", p->irq); |
---|
| 2102 | + pr_cont(", irq %d", p->irq); |
---|
2123 | 2103 | priv->ctr_writable |= 0x10; |
---|
2124 | 2104 | |
---|
2125 | 2105 | if (p->dma == PARPORT_DMA_AUTO) { |
---|
.. | .. |
---|
2143 | 2123 | /* p->ops->ecp_read_data = parport_pc_ecp_read_block_pio; */ |
---|
2144 | 2124 | #endif /* IEEE 1284 support */ |
---|
2145 | 2125 | if (p->dma != PARPORT_DMA_NONE) { |
---|
2146 | | - printk(KERN_CONT ", dma %d", p->dma); |
---|
| 2126 | + pr_cont(", dma %d", p->dma); |
---|
2147 | 2127 | p->modes |= PARPORT_MODE_DMA; |
---|
2148 | 2128 | } else |
---|
2149 | | - printk(KERN_CONT ", using FIFO"); |
---|
| 2129 | + pr_cont(", using FIFO"); |
---|
2150 | 2130 | } else |
---|
2151 | 2131 | /* We can't use the DMA channel after all. */ |
---|
2152 | 2132 | p->dma = PARPORT_DMA_NONE; |
---|
2153 | 2133 | #endif /* Allowed to use FIFO/DMA */ |
---|
2154 | 2134 | |
---|
2155 | | - printk(KERN_CONT " ["); |
---|
| 2135 | + pr_cont(" ["); |
---|
2156 | 2136 | |
---|
2157 | | -#define printmode(x) \ |
---|
2158 | | - {\ |
---|
2159 | | - if (p->modes & PARPORT_MODE_##x) {\ |
---|
2160 | | - printk(KERN_CONT "%s%s", f ? "," : "", #x);\ |
---|
2161 | | - f++;\ |
---|
2162 | | - } \ |
---|
2163 | | - } |
---|
| 2137 | +#define printmode(x) \ |
---|
| 2138 | +do { \ |
---|
| 2139 | + if (p->modes & PARPORT_MODE_##x) \ |
---|
| 2140 | + pr_cont("%s%s", f++ ? "," : "", #x); \ |
---|
| 2141 | +} while (0) |
---|
2164 | 2142 | |
---|
2165 | 2143 | { |
---|
2166 | 2144 | int f = 0; |
---|
2167 | 2145 | printmode(PCSPP); |
---|
2168 | 2146 | printmode(TRISTATE); |
---|
2169 | | - printmode(COMPAT) |
---|
| 2147 | + printmode(COMPAT); |
---|
2170 | 2148 | printmode(EPP); |
---|
2171 | 2149 | printmode(ECP); |
---|
2172 | 2150 | printmode(DMA); |
---|
2173 | 2151 | } |
---|
2174 | 2152 | #undef printmode |
---|
2175 | 2153 | #ifndef CONFIG_PARPORT_1284 |
---|
2176 | | - printk(KERN_CONT "(,...)"); |
---|
| 2154 | + pr_cont("(,...)"); |
---|
2177 | 2155 | #endif /* CONFIG_PARPORT_1284 */ |
---|
2178 | | - printk(KERN_CONT "]\n"); |
---|
| 2156 | + pr_cont("]\n"); |
---|
2179 | 2157 | if (probedirq != PARPORT_IRQ_NONE) |
---|
2180 | | - printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq); |
---|
| 2158 | + pr_info("%s: irq %d detected\n", p->name, probedirq); |
---|
2181 | 2159 | |
---|
2182 | 2160 | /* If No ECP release the ports grabbed above. */ |
---|
2183 | 2161 | if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) { |
---|
.. | .. |
---|
2192 | 2170 | if (p->irq != PARPORT_IRQ_NONE) { |
---|
2193 | 2171 | if (request_irq(p->irq, parport_irq_handler, |
---|
2194 | 2172 | irqflags, p->name, p)) { |
---|
2195 | | - printk(KERN_WARNING "%s: irq %d in use, " |
---|
2196 | | - "resorting to polled operation\n", |
---|
| 2173 | + pr_warn("%s: irq %d in use, resorting to polled operation\n", |
---|
2197 | 2174 | p->name, p->irq); |
---|
2198 | 2175 | p->irq = PARPORT_IRQ_NONE; |
---|
2199 | 2176 | p->dma = PARPORT_DMA_NONE; |
---|
.. | .. |
---|
2203 | 2180 | #ifdef HAS_DMA |
---|
2204 | 2181 | if (p->dma != PARPORT_DMA_NONE) { |
---|
2205 | 2182 | if (request_dma(p->dma, p->name)) { |
---|
2206 | | - printk(KERN_WARNING "%s: dma %d in use, " |
---|
2207 | | - "resorting to PIO operation\n", |
---|
| 2183 | + pr_warn("%s: dma %d in use, resorting to PIO operation\n", |
---|
2208 | 2184 | p->name, p->dma); |
---|
2209 | 2185 | p->dma = PARPORT_DMA_NONE; |
---|
2210 | 2186 | } else { |
---|
.. | .. |
---|
2214 | 2190 | &priv->dma_handle, |
---|
2215 | 2191 | GFP_KERNEL); |
---|
2216 | 2192 | if (!priv->dma_buf) { |
---|
2217 | | - printk(KERN_WARNING "%s: " |
---|
2218 | | - "cannot get buffer for DMA, " |
---|
2219 | | - "resorting to PIO operation\n", |
---|
| 2193 | + pr_warn("%s: cannot get buffer for DMA, resorting to PIO operation\n", |
---|
2220 | 2194 | p->name); |
---|
2221 | 2195 | free_dma(p->dma); |
---|
2222 | 2196 | p->dma = PARPORT_DMA_NONE; |
---|
.. | .. |
---|
2312 | 2286 | int irq; |
---|
2313 | 2287 | int i; |
---|
2314 | 2288 | |
---|
2315 | | - DPRINTK(KERN_DEBUG "sio_ite_8872_probe()\n"); |
---|
| 2289 | + pr_debug("sio_ite_8872_probe()\n"); |
---|
2316 | 2290 | |
---|
2317 | 2291 | /* make sure which one chip */ |
---|
2318 | 2292 | for (i = 0; i < 5; i++) { |
---|
.. | .. |
---|
2329 | 2303 | } |
---|
2330 | 2304 | } |
---|
2331 | 2305 | if (i >= 5) { |
---|
2332 | | - printk(KERN_INFO "parport_pc: cannot find ITE8872 INTA\n"); |
---|
| 2306 | + pr_info("parport_pc: cannot find ITE8872 INTA\n"); |
---|
2333 | 2307 | return 0; |
---|
2334 | 2308 | } |
---|
2335 | 2309 | |
---|
.. | .. |
---|
2338 | 2312 | |
---|
2339 | 2313 | switch (type) { |
---|
2340 | 2314 | case 0x2: |
---|
2341 | | - printk(KERN_INFO "parport_pc: ITE8871 found (1P)\n"); |
---|
| 2315 | + pr_info("parport_pc: ITE8871 found (1P)\n"); |
---|
2342 | 2316 | ite8872set = 0x64200000; |
---|
2343 | 2317 | break; |
---|
2344 | 2318 | case 0xa: |
---|
2345 | | - printk(KERN_INFO "parport_pc: ITE8875 found (1P)\n"); |
---|
| 2319 | + pr_info("parport_pc: ITE8875 found (1P)\n"); |
---|
2346 | 2320 | ite8872set = 0x64200000; |
---|
2347 | 2321 | break; |
---|
2348 | 2322 | case 0xe: |
---|
2349 | | - printk(KERN_INFO "parport_pc: ITE8872 found (2S1P)\n"); |
---|
| 2323 | + pr_info("parport_pc: ITE8872 found (2S1P)\n"); |
---|
2350 | 2324 | ite8872set = 0x64e00000; |
---|
2351 | 2325 | break; |
---|
2352 | 2326 | case 0x6: |
---|
2353 | | - printk(KERN_INFO "parport_pc: ITE8873 found (1S)\n"); |
---|
| 2327 | + pr_info("parport_pc: ITE8873 found (1S)\n"); |
---|
2354 | 2328 | release_region(inta_addr[i], 32); |
---|
2355 | 2329 | return 0; |
---|
2356 | 2330 | case 0x8: |
---|
2357 | | - printk(KERN_INFO "parport_pc: ITE8874 found (2S)\n"); |
---|
| 2331 | + pr_info("parport_pc: ITE8874 found (2S)\n"); |
---|
2358 | 2332 | release_region(inta_addr[i], 32); |
---|
2359 | 2333 | return 0; |
---|
2360 | 2334 | default: |
---|
2361 | | - printk(KERN_INFO "parport_pc: unknown ITE887x\n"); |
---|
2362 | | - printk(KERN_INFO "parport_pc: please mail 'lspci -nvv' " |
---|
2363 | | - "output to Rich.Liu@ite.com.tw\n"); |
---|
| 2335 | + pr_info("parport_pc: unknown ITE887x\n"); |
---|
| 2336 | + pr_info("parport_pc: please mail 'lspci -nvv' output to Rich.Liu@ite.com.tw\n"); |
---|
2364 | 2337 | release_region(inta_addr[i], 32); |
---|
2365 | 2338 | return 0; |
---|
2366 | 2339 | } |
---|
.. | .. |
---|
2378 | 2351 | pci_write_config_dword(pdev, 0x9c, |
---|
2379 | 2352 | ite8872set | (ite8872_irq * 0x11111)); |
---|
2380 | 2353 | |
---|
2381 | | - DPRINTK(KERN_DEBUG "ITE887x: The IRQ is %d.\n", ite8872_irq); |
---|
2382 | | - DPRINTK(KERN_DEBUG "ITE887x: The PARALLEL I/O port is 0x%x.\n", |
---|
2383 | | - ite8872_lpt); |
---|
2384 | | - DPRINTK(KERN_DEBUG "ITE887x: The PARALLEL I/O porthi is 0x%x.\n", |
---|
2385 | | - ite8872_lpthi); |
---|
| 2354 | + pr_debug("ITE887x: The IRQ is %d\n", ite8872_irq); |
---|
| 2355 | + pr_debug("ITE887x: The PARALLEL I/O port is 0x%x\n", ite8872_lpt); |
---|
| 2356 | + pr_debug("ITE887x: The PARALLEL I/O porthi is 0x%x\n", ite8872_lpthi); |
---|
2386 | 2357 | |
---|
2387 | 2358 | /* Let the user (or defaults) steer us away from interrupts */ |
---|
2388 | 2359 | irq = ite8872_irq; |
---|
.. | .. |
---|
2395 | 2366 | release_region(inta_addr[i], 32); |
---|
2396 | 2367 | if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi, |
---|
2397 | 2368 | irq, PARPORT_DMA_NONE, &pdev->dev, 0)) { |
---|
2398 | | - printk(KERN_INFO |
---|
2399 | | - "parport_pc: ITE 8872 parallel port: io=0x%X", |
---|
2400 | | - ite8872_lpt); |
---|
| 2369 | + pr_info("parport_pc: ITE 8872 parallel port: io=0x%X", |
---|
| 2370 | + ite8872_lpt); |
---|
2401 | 2371 | if (irq != PARPORT_IRQ_NONE) |
---|
2402 | 2372 | pr_cont(", irq=%d", irq); |
---|
2403 | 2373 | pr_cont("\n"); |
---|
.. | .. |
---|
2470 | 2440 | have_epp = 1; |
---|
2471 | 2441 | break; |
---|
2472 | 2442 | default: |
---|
2473 | | - printk(KERN_DEBUG |
---|
2474 | | - "parport_pc: probing current configuration\n"); |
---|
| 2443 | + printk(KERN_DEBUG "parport_pc: probing current configuration\n"); |
---|
2475 | 2444 | siofunc = VIA_FUNCTION_PROBE; |
---|
2476 | 2445 | break; |
---|
2477 | 2446 | } |
---|
.. | .. |
---|
2507 | 2476 | port1 = inb(VIA_CONFIG_DATA) << 2; |
---|
2508 | 2477 | |
---|
2509 | 2478 | printk(KERN_DEBUG "parport_pc: Current parallel port base: 0x%X\n", |
---|
2510 | | - port1); |
---|
| 2479 | + port1); |
---|
2511 | 2480 | if (port1 == 0x3BC && have_epp) { |
---|
2512 | 2481 | outb(via->viacfg_parport_base, VIA_CONFIG_INDEX); |
---|
2513 | 2482 | outb((0x378 >> 2), VIA_CONFIG_DATA); |
---|
2514 | | - printk(KERN_DEBUG |
---|
2515 | | - "parport_pc: Parallel port base changed to 0x378\n"); |
---|
| 2483 | + printk(KERN_DEBUG "parport_pc: Parallel port base changed to 0x378\n"); |
---|
2516 | 2484 | port1 = 0x378; |
---|
2517 | 2485 | } |
---|
2518 | 2486 | |
---|
.. | .. |
---|
2524 | 2492 | pci_write_config_byte(pdev, via->via_pci_superio_config_reg, tmp); |
---|
2525 | 2493 | |
---|
2526 | 2494 | if (siofunc == VIA_FUNCTION_PARPORT_DISABLE) { |
---|
2527 | | - printk(KERN_INFO "parport_pc: VIA parallel port disabled in BIOS\n"); |
---|
| 2495 | + pr_info("parport_pc: VIA parallel port disabled in BIOS\n"); |
---|
2528 | 2496 | return 0; |
---|
2529 | 2497 | } |
---|
2530 | 2498 | |
---|
.. | .. |
---|
2557 | 2525 | case 0x278: |
---|
2558 | 2526 | port2 = 0x678; break; |
---|
2559 | 2527 | default: |
---|
2560 | | - printk(KERN_INFO |
---|
2561 | | - "parport_pc: Weird VIA parport base 0x%X, ignoring\n", |
---|
2562 | | - port1); |
---|
| 2528 | + pr_info("parport_pc: Weird VIA parport base 0x%X, ignoring\n", |
---|
| 2529 | + port1); |
---|
2563 | 2530 | return 0; |
---|
2564 | 2531 | } |
---|
2565 | 2532 | |
---|
.. | .. |
---|
2578 | 2545 | |
---|
2579 | 2546 | /* finally, do the probe with values obtained */ |
---|
2580 | 2547 | if (parport_pc_probe_port(port1, port2, irq, dma, &pdev->dev, 0)) { |
---|
2581 | | - printk(KERN_INFO |
---|
2582 | | - "parport_pc: VIA parallel port: io=0x%X", port1); |
---|
| 2548 | + pr_info("parport_pc: VIA parallel port: io=0x%X", port1); |
---|
2583 | 2549 | if (irq != PARPORT_IRQ_NONE) |
---|
2584 | 2550 | pr_cont(", irq=%d", irq); |
---|
2585 | 2551 | if (dma != PARPORT_DMA_NONE) |
---|
.. | .. |
---|
2588 | 2554 | return 1; |
---|
2589 | 2555 | } |
---|
2590 | 2556 | |
---|
2591 | | - printk(KERN_WARNING "parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n", |
---|
| 2557 | + pr_warn("parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n", |
---|
2592 | 2558 | port1, irq, dma); |
---|
2593 | 2559 | return 0; |
---|
2594 | 2560 | } |
---|
.. | .. |
---|
2853 | 2819 | /* TODO: test if sharing interrupts works */ |
---|
2854 | 2820 | irq = dev->irq; |
---|
2855 | 2821 | if (irq == IRQ_NONE) { |
---|
2856 | | - printk(KERN_DEBUG |
---|
2857 | | - "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx)\n", |
---|
2858 | | - id->vendor, id->device, io_lo, io_hi); |
---|
| 2822 | + printk(KERN_DEBUG "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx)\n", |
---|
| 2823 | + id->vendor, id->device, io_lo, io_hi); |
---|
2859 | 2824 | irq = PARPORT_IRQ_NONE; |
---|
2860 | 2825 | } else { |
---|
2861 | | - printk(KERN_DEBUG |
---|
2862 | | - "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx), IRQ %d\n", |
---|
2863 | | - id->vendor, id->device, io_lo, io_hi, irq); |
---|
| 2826 | + printk(KERN_DEBUG "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx), IRQ %d\n", |
---|
| 2827 | + id->vendor, id->device, io_lo, io_hi, irq); |
---|
2864 | 2828 | } |
---|
2865 | 2829 | data->ports[count] = |
---|
2866 | 2830 | parport_pc_probe_port(io_lo, io_hi, irq, |
---|
.. | .. |
---|
3110 | 3074 | if (ep != s) |
---|
3111 | 3075 | *val = r; |
---|
3112 | 3076 | else { |
---|
3113 | | - printk(KERN_ERR "parport: bad specifier `%s'\n", s); |
---|
| 3077 | + pr_err("parport: bad specifier `%s'\n", s); |
---|
3114 | 3078 | return -1; |
---|
3115 | 3079 | } |
---|
3116 | 3080 | } |
---|
.. | .. |
---|
3132 | 3096 | #ifdef CONFIG_PCI |
---|
3133 | 3097 | static int __init parport_init_mode_setup(char *str) |
---|
3134 | 3098 | { |
---|
3135 | | - printk(KERN_DEBUG |
---|
3136 | | - "parport_pc.c: Specified parameter parport_init_mode=%s\n", str); |
---|
| 3099 | + printk(KERN_DEBUG "parport_pc.c: Specified parameter parport_init_mode=%s\n", |
---|
| 3100 | + str); |
---|
3137 | 3101 | |
---|
3138 | 3102 | if (!strcmp(str, "spp")) |
---|
3139 | 3103 | parport_init_mode = 1; |
---|
.. | .. |
---|
3200 | 3164 | irqval[0] = val; |
---|
3201 | 3165 | break; |
---|
3202 | 3166 | default: |
---|
3203 | | - printk(KERN_WARNING |
---|
3204 | | - "parport_pc: irq specified " |
---|
3205 | | - "without base address. Use 'io=' " |
---|
3206 | | - "to specify one\n"); |
---|
| 3167 | + pr_warn("parport_pc: irq specified without base address. Use 'io=' to specify one\n"); |
---|
3207 | 3168 | } |
---|
3208 | 3169 | |
---|
3209 | 3170 | if (dma[0] && !parport_parse_dma(dma[0], &val)) |
---|
.. | .. |
---|
3213 | 3174 | dmaval[0] = val; |
---|
3214 | 3175 | break; |
---|
3215 | 3176 | default: |
---|
3216 | | - printk(KERN_WARNING |
---|
3217 | | - "parport_pc: dma specified " |
---|
3218 | | - "without base address. Use 'io=' " |
---|
3219 | | - "to specify one\n"); |
---|
| 3177 | + pr_warn("parport_pc: dma specified without base address. Use 'io=' to specify one\n"); |
---|
3220 | 3178 | } |
---|
3221 | 3179 | } |
---|
3222 | 3180 | return 0; |
---|
.. | .. |
---|
3255 | 3213 | |
---|
3256 | 3214 | val = simple_strtoul(str, &endptr, 0); |
---|
3257 | 3215 | if (endptr == str) { |
---|
3258 | | - printk(KERN_WARNING "parport=%s not understood\n", str); |
---|
| 3216 | + pr_warn("parport=%s not understood\n", str); |
---|
3259 | 3217 | return 1; |
---|
3260 | 3218 | } |
---|
3261 | 3219 | |
---|
3262 | 3220 | if (parport_setup_ptr == PARPORT_PC_MAX_PORTS) { |
---|
3263 | | - printk(KERN_ERR "parport=%s ignored, too many ports\n", str); |
---|
| 3221 | + pr_err("parport=%s ignored, too many ports\n", str); |
---|
3264 | 3222 | return 1; |
---|
3265 | 3223 | } |
---|
3266 | 3224 | |
---|