Lines Matching refs:p

285 #define __pr_trace(pr, p, fmt, ...)					\  argument
287 ({ const struct parport *__p = (p); \
290 #define pr_trace(p, fmt, ...) __pr_trace(pr_debug, p, fmt , ##__VA_ARGS__) argument
291 #define pr_trace1(p, fmt, ...) __pr_trace(pr_debug1, p, fmt , ##__VA_ARGS__) argument
303 #define pr_probe(p, fmt, ...) \ argument
304 __pr_probe(KERN_INFO PPIP32 "0x%lx: " fmt, (p)->base , ##__VA_ARGS__)
318 static void parport_ip32_dump_state(struct parport *p, char *str, in parport_ip32_dump_state() argument
321 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_dump_state()
324 printk(KERN_DEBUG PPIP32 "%s: state (%s):\n", p->name, str); in parport_ip32_dump_state()
441 #define CHECK_EXTRA_BITS(p, b, m) \ argument
447 (p)->name, __func__, #b, __b, __m); \
567 static int parport_ip32_dma_start(struct parport *p, in parport_ip32_dma_start() argument
593 parport_ip32_dma.buf = dma_map_single(&p->bus_dev, addr, count, dir); in parport_ip32_dma_start()
622 static void parport_ip32_dma_stop(struct parport *p) in parport_ip32_dma_stop() argument
678 dma_unmap_single(&p->bus_dev, parport_ip32_dma.buf, in parport_ip32_dma_stop()
753 static inline void parport_ip32_wakeup(struct parport *p) in parport_ip32_wakeup() argument
755 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_wakeup()
769 struct parport * const p = dev_id; in parport_ip32_interrupt() local
770 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_interrupt()
778 parport_ip32_wakeup(p); in parport_ip32_interrupt()
791 static inline unsigned int parport_ip32_read_econtrol(struct parport *p) in parport_ip32_read_econtrol() argument
793 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_read_econtrol()
802 static inline void parport_ip32_write_econtrol(struct parport *p, in parport_ip32_write_econtrol() argument
805 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_write_econtrol()
818 static inline void parport_ip32_frob_econtrol(struct parport *p, in parport_ip32_frob_econtrol() argument
823 c = (parport_ip32_read_econtrol(p) & ~mask) ^ val; in parport_ip32_frob_econtrol()
824 parport_ip32_write_econtrol(p, c); in parport_ip32_frob_econtrol()
835 static void parport_ip32_set_mode(struct parport *p, unsigned int mode) in parport_ip32_set_mode() argument
840 omode = parport_ip32_read_econtrol(p) & ECR_MODE_MASK; in parport_ip32_set_mode()
846 parport_ip32_write_econtrol(p, ecr); in parport_ip32_set_mode()
848 parport_ip32_write_econtrol(p, mode | ECR_nERRINTR | ECR_SERVINTR); in parport_ip32_set_mode()
857 static inline unsigned char parport_ip32_read_data(struct parport *p) in parport_ip32_read_data() argument
859 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_read_data()
868 static inline void parport_ip32_write_data(struct parport *p, unsigned char d) in parport_ip32_write_data() argument
870 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_write_data()
878 static inline unsigned char parport_ip32_read_status(struct parport *p) in parport_ip32_read_status() argument
880 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_read_status()
888 static inline unsigned int __parport_ip32_read_control(struct parport *p) in __parport_ip32_read_control() argument
890 struct parport_ip32_private * const priv = p->physport->private_data; in __parport_ip32_read_control()
899 static inline void __parport_ip32_write_control(struct parport *p, in __parport_ip32_write_control() argument
902 struct parport_ip32_private * const priv = p->physport->private_data; in __parport_ip32_write_control()
903 CHECK_EXTRA_BITS(p, c, priv->dcr_writable); in __parport_ip32_write_control()
919 static inline void __parport_ip32_frob_control(struct parport *p, in __parport_ip32_frob_control() argument
924 c = (__parport_ip32_read_control(p) & ~mask) ^ val; in __parport_ip32_frob_control()
925 __parport_ip32_write_control(p, c); in __parport_ip32_frob_control()
935 static inline unsigned char parport_ip32_read_control(struct parport *p) in parport_ip32_read_control() argument
939 return __parport_ip32_read_control(p) & rm; in parport_ip32_read_control()
950 static inline void parport_ip32_write_control(struct parport *p, in parport_ip32_write_control() argument
955 CHECK_EXTRA_BITS(p, c, wm); in parport_ip32_write_control()
956 __parport_ip32_frob_control(p, wm, c & wm); in parport_ip32_write_control()
968 static inline unsigned char parport_ip32_frob_control(struct parport *p, in parport_ip32_frob_control() argument
974 CHECK_EXTRA_BITS(p, mask, wm); in parport_ip32_frob_control()
975 CHECK_EXTRA_BITS(p, val, wm); in parport_ip32_frob_control()
976 __parport_ip32_frob_control(p, mask & wm, val & wm); in parport_ip32_frob_control()
977 return parport_ip32_read_control(p); in parport_ip32_frob_control()
984 static inline void parport_ip32_disable_irq(struct parport *p) in parport_ip32_disable_irq() argument
986 __parport_ip32_frob_control(p, DCR_IRQ, 0); in parport_ip32_disable_irq()
993 static inline void parport_ip32_enable_irq(struct parport *p) in parport_ip32_enable_irq() argument
995 __parport_ip32_frob_control(p, DCR_IRQ, DCR_IRQ); in parport_ip32_enable_irq()
1004 static inline void parport_ip32_data_forward(struct parport *p) in parport_ip32_data_forward() argument
1006 __parport_ip32_frob_control(p, DCR_DIR, 0); in parport_ip32_data_forward()
1016 static inline void parport_ip32_data_reverse(struct parport *p) in parport_ip32_data_reverse() argument
1018 __parport_ip32_frob_control(p, DCR_DIR, DCR_DIR); in parport_ip32_data_reverse()
1038 static void parport_ip32_save_state(struct parport *p, in parport_ip32_save_state() argument
1041 s->u.ip32.dcr = __parport_ip32_read_control(p); in parport_ip32_save_state()
1042 s->u.ip32.ecr = parport_ip32_read_econtrol(p); in parport_ip32_save_state()
1050 static void parport_ip32_restore_state(struct parport *p, in parport_ip32_restore_state() argument
1053 parport_ip32_set_mode(p, s->u.ip32.ecr & ECR_MODE_MASK); in parport_ip32_restore_state()
1054 parport_ip32_write_econtrol(p, s->u.ip32.ecr); in parport_ip32_restore_state()
1055 __parport_ip32_write_control(p, s->u.ip32.dcr); in parport_ip32_restore_state()
1066 static unsigned int parport_ip32_clear_epp_timeout(struct parport *p) in parport_ip32_clear_epp_timeout() argument
1068 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_clear_epp_timeout()
1071 if (!(parport_ip32_read_status(p) & DSR_TIMEOUT)) in parport_ip32_clear_epp_timeout()
1076 parport_ip32_read_status(p); in parport_ip32_clear_epp_timeout()
1077 r = parport_ip32_read_status(p); in parport_ip32_clear_epp_timeout()
1083 r = parport_ip32_read_status(p); in parport_ip32_clear_epp_timeout()
1087 pr_trace(p, "(): %s", cleared ? "cleared" : "failed"); in parport_ip32_clear_epp_timeout()
1100 struct parport *p, void *buf, in parport_ip32_epp_read() argument
1103 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_read()
1105 parport_ip32_set_mode(p, ECR_MODE_EPP); in parport_ip32_epp_read()
1106 parport_ip32_data_reverse(p); in parport_ip32_epp_read()
1107 parport_ip32_write_control(p, DCR_nINIT); in parport_ip32_epp_read()
1111 parport_ip32_clear_epp_timeout(p); in parport_ip32_epp_read()
1120 parport_ip32_clear_epp_timeout(p); in parport_ip32_epp_read()
1125 parport_ip32_data_forward(p); in parport_ip32_epp_read()
1126 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_epp_read()
1139 struct parport *p, const void *buf, in parport_ip32_epp_write() argument
1142 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_write()
1144 parport_ip32_set_mode(p, ECR_MODE_EPP); in parport_ip32_epp_write()
1145 parport_ip32_data_forward(p); in parport_ip32_epp_write()
1146 parport_ip32_write_control(p, DCR_nINIT); in parport_ip32_epp_write()
1150 parport_ip32_clear_epp_timeout(p); in parport_ip32_epp_write()
1159 parport_ip32_clear_epp_timeout(p); in parport_ip32_epp_write()
1164 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_epp_write()
1175 static size_t parport_ip32_epp_read_data(struct parport *p, void *buf, in parport_ip32_epp_read_data() argument
1178 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_read_data()
1179 return parport_ip32_epp_read(priv->regs.eppData0, p, buf, len, flags); in parport_ip32_epp_read_data()
1189 static size_t parport_ip32_epp_write_data(struct parport *p, const void *buf, in parport_ip32_epp_write_data() argument
1192 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_write_data()
1193 return parport_ip32_epp_write(priv->regs.eppData0, p, buf, len, flags); in parport_ip32_epp_write_data()
1203 static size_t parport_ip32_epp_read_addr(struct parport *p, void *buf, in parport_ip32_epp_read_addr() argument
1206 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_read_addr()
1207 return parport_ip32_epp_read(priv->regs.eppAddr, p, buf, len, flags); in parport_ip32_epp_read_addr()
1217 static size_t parport_ip32_epp_write_addr(struct parport *p, const void *buf, in parport_ip32_epp_write_addr() argument
1220 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_epp_write_addr()
1221 return parport_ip32_epp_write(priv->regs.eppAddr, p, buf, len, flags); in parport_ip32_epp_write_addr()
1238 static unsigned int parport_ip32_fifo_wait_break(struct parport *p, in parport_ip32_fifo_wait_break() argument
1243 pr_debug1(PPIP32 "%s: FIFO write timed out\n", p->name); in parport_ip32_fifo_wait_break()
1247 pr_debug1(PPIP32 "%s: Signal pending\n", p->name); in parport_ip32_fifo_wait_break()
1250 if (!(parport_ip32_read_status(p) & DSR_nFAULT)) { in parport_ip32_fifo_wait_break()
1251 pr_debug1(PPIP32 "%s: nFault asserted low\n", p->name); in parport_ip32_fifo_wait_break()
1265 static unsigned int parport_ip32_fwp_wait_polling(struct parport *p) in parport_ip32_fwp_wait_polling() argument
1267 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_fwp_wait_polling()
1268 struct parport * const physport = p->physport; in parport_ip32_fwp_wait_polling()
1276 if (parport_ip32_fifo_wait_break(p, expire)) in parport_ip32_fwp_wait_polling()
1283 ecr = parport_ip32_read_econtrol(p); in parport_ip32_fwp_wait_polling()
1305 static unsigned int parport_ip32_fwp_wait_interrupt(struct parport *p) in parport_ip32_fwp_wait_interrupt() argument
1308 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_fwp_wait_interrupt()
1309 struct parport * const physport = p->physport; in parport_ip32_fwp_wait_interrupt()
1320 if (parport_ip32_fifo_wait_break(p, expire)) in parport_ip32_fwp_wait_interrupt()
1327 parport_ip32_frob_econtrol(p, ECR_SERVINTR, 0); in parport_ip32_fwp_wait_interrupt()
1332 ecr = parport_ip32_read_econtrol(p); in parport_ip32_fwp_wait_interrupt()
1338 ecr = parport_ip32_read_econtrol(p); in parport_ip32_fwp_wait_interrupt()
1342 p->name, __func__); in parport_ip32_fwp_wait_interrupt()
1348 parport_ip32_frob_econtrol(p, ECR_SERVINTR, ECR_SERVINTR); in parport_ip32_fwp_wait_interrupt()
1381 static size_t parport_ip32_fifo_write_block_pio(struct parport *p, in parport_ip32_fifo_write_block_pio() argument
1384 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_fifo_write_block_pio()
1393 count = (p->irq == PARPORT_IRQ_NONE) ? in parport_ip32_fifo_write_block_pio()
1394 parport_ip32_fwp_wait_polling(p) : in parport_ip32_fifo_write_block_pio()
1395 parport_ip32_fwp_wait_interrupt(p); in parport_ip32_fifo_write_block_pio()
1425 static size_t parport_ip32_fifo_write_block_dma(struct parport *p, in parport_ip32_fifo_write_block_dma() argument
1428 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_fifo_write_block_dma()
1429 struct parport * const physport = p->physport; in parport_ip32_fifo_write_block_dma()
1437 parport_ip32_dma_start(p, DMA_TO_DEVICE, (void *)buf, len); in parport_ip32_fifo_write_block_dma()
1439 parport_ip32_frob_econtrol(p, ECR_DMAEN | ECR_SERVINTR, ECR_DMAEN); in parport_ip32_fifo_write_block_dma()
1445 if (parport_ip32_fifo_wait_break(p, expire)) in parport_ip32_fifo_write_block_dma()
1449 ecr = parport_ip32_read_econtrol(p); in parport_ip32_fifo_write_block_dma()
1453 parport_ip32_dma_stop(p); in parport_ip32_fifo_write_block_dma()
1470 static size_t parport_ip32_fifo_write_block(struct parport *p, in parport_ip32_fifo_write_block() argument
1477 written = (p->modes & PARPORT_MODE_DMA) ? in parport_ip32_fifo_write_block()
1478 parport_ip32_fifo_write_block_dma(p, buf, len) : in parport_ip32_fifo_write_block()
1479 parport_ip32_fifo_write_block_pio(p, buf, len); in parport_ip32_fifo_write_block()
1491 static unsigned int parport_ip32_drain_fifo(struct parport *p, in parport_ip32_drain_fifo() argument
1500 if (parport_ip32_read_econtrol(p) & ECR_F_EMPTY) in parport_ip32_drain_fifo()
1511 while (!(parport_ip32_read_econtrol(p) & ECR_F_EMPTY)) { in parport_ip32_drain_fifo()
1521 return !!(parport_ip32_read_econtrol(p) & ECR_F_EMPTY); in parport_ip32_drain_fifo()
1531 static unsigned int parport_ip32_get_fifo_residue(struct parport *p, in parport_ip32_get_fifo_residue() argument
1534 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_get_fifo_residue()
1543 if (parport_ip32_read_econtrol(p) & ECR_F_EMPTY) in parport_ip32_get_fifo_residue()
1546 pr_debug1(PPIP32 "%s: FIFO is stuck\n", p->name); in parport_ip32_get_fifo_residue()
1560 parport_ip32_frob_control(p, DCR_STROBE, 0); in parport_ip32_get_fifo_residue()
1564 if (parport_ip32_read_econtrol(p) & ECR_F_FULL) in parport_ip32_get_fifo_residue()
1571 p->name, residue, in parport_ip32_get_fifo_residue()
1575 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_get_fifo_residue()
1579 parport_ip32_data_reverse(p); in parport_ip32_get_fifo_residue()
1580 parport_ip32_frob_control(p, DCR_nINIT, 0); in parport_ip32_get_fifo_residue()
1581 if (parport_wait_peripheral(p, DSR_PERROR, 0)) in parport_ip32_get_fifo_residue()
1583 p->name, __func__); in parport_ip32_get_fifo_residue()
1584 parport_ip32_frob_control(p, DCR_STROBE, DCR_STROBE); in parport_ip32_get_fifo_residue()
1585 parport_ip32_frob_control(p, DCR_nINIT, DCR_nINIT); in parport_ip32_get_fifo_residue()
1586 if (parport_wait_peripheral(p, DSR_PERROR, DSR_PERROR)) in parport_ip32_get_fifo_residue()
1588 p->name, __func__); in parport_ip32_get_fifo_residue()
1592 parport_ip32_set_mode(p, ECR_MODE_CFG); in parport_ip32_get_fifo_residue()
1596 p->name, cnfga); in parport_ip32_get_fifo_residue()
1598 p->name); in parport_ip32_get_fifo_residue()
1606 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_get_fifo_residue()
1607 parport_ip32_data_forward(p); in parport_ip32_get_fifo_residue()
1619 static size_t parport_ip32_compat_write_data(struct parport *p, in parport_ip32_compat_write_data() argument
1624 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_compat_write_data()
1625 struct parport * const physport = p->physport; in parport_ip32_compat_write_data()
1631 return parport_ieee1284_write_compat(p, buf, len, flags); in parport_ip32_compat_write_data()
1634 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_compat_write_data()
1635 parport_ip32_write_control(p, DCR_SELECT | DCR_nINIT); in parport_ip32_compat_write_data()
1636 parport_ip32_data_forward(p); in parport_ip32_compat_write_data()
1637 parport_ip32_disable_irq(p); in parport_ip32_compat_write_data()
1638 parport_ip32_set_mode(p, ECR_MODE_PPF); in parport_ip32_compat_write_data()
1642 if (parport_wait_peripheral(p, DSR_nBUSY | DSR_nFAULT, in parport_ip32_compat_write_data()
1647 p->name, __func__); in parport_ip32_compat_write_data()
1653 written = parport_ip32_fifo_write_block(p, buf, len); in parport_ip32_compat_write_data()
1656 parport_ip32_drain_fifo(p, physport->cad->timeout * priv->fifo_depth); in parport_ip32_compat_write_data()
1659 written -= parport_ip32_get_fifo_residue(p, ECR_MODE_PPF); in parport_ip32_compat_write_data()
1662 if (parport_wait_peripheral(p, DSR_nBUSY, DSR_nBUSY)) in parport_ip32_compat_write_data()
1664 p->name, __func__); in parport_ip32_compat_write_data()
1668 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_compat_write_data()
1685 static size_t parport_ip32_ecp_write_data(struct parport *p, in parport_ip32_ecp_write_data() argument
1690 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_ecp_write_data()
1691 struct parport * const physport = p->physport; in parport_ip32_ecp_write_data()
1697 return parport_ieee1284_ecp_write_data(p, buf, len, flags); in parport_ip32_ecp_write_data()
1702 parport_ip32_frob_control(p, DCR_nINIT | DCR_AUTOFD, in parport_ip32_ecp_write_data()
1706 if (parport_wait_peripheral(p, DSR_PERROR, DSR_PERROR)) { in parport_ip32_ecp_write_data()
1708 p->name, __func__); in parport_ip32_ecp_write_data()
1715 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_ecp_write_data()
1716 parport_ip32_write_control(p, DCR_SELECT | DCR_nINIT); in parport_ip32_ecp_write_data()
1717 parport_ip32_data_forward(p); in parport_ip32_ecp_write_data()
1718 parport_ip32_disable_irq(p); in parport_ip32_ecp_write_data()
1719 parport_ip32_set_mode(p, ECR_MODE_ECP); in parport_ip32_ecp_write_data()
1723 if (parport_wait_peripheral(p, DSR_nBUSY | DSR_nFAULT, in parport_ip32_ecp_write_data()
1728 p->name, __func__); in parport_ip32_ecp_write_data()
1734 written = parport_ip32_fifo_write_block(p, buf, len); in parport_ip32_ecp_write_data()
1737 parport_ip32_drain_fifo(p, physport->cad->timeout * priv->fifo_depth); in parport_ip32_ecp_write_data()
1740 written -= parport_ip32_get_fifo_residue(p, ECR_MODE_ECP); in parport_ip32_ecp_write_data()
1743 if (parport_wait_peripheral(p, DSR_nBUSY, DSR_nBUSY)) in parport_ip32_ecp_write_data()
1745 p->name, __func__); in parport_ip32_ecp_write_data()
1749 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_ecp_write_data()
1807 static __init unsigned int parport_ip32_ecp_supported(struct parport *p) in parport_ip32_ecp_supported() argument
1809 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_ecp_supported()
1817 pr_probe(p, "Found working ECR register\n"); in parport_ip32_ecp_supported()
1818 parport_ip32_set_mode(p, ECR_MODE_SPP); in parport_ip32_ecp_supported()
1819 parport_ip32_write_control(p, DCR_SELECT | DCR_nINIT); in parport_ip32_ecp_supported()
1823 pr_probe(p, "ECR register not found\n"); in parport_ip32_ecp_supported()
1835 static __init unsigned int parport_ip32_fifo_supported(struct parport *p) in parport_ip32_fifo_supported() argument
1837 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_fifo_supported()
1843 parport_ip32_set_mode(p, ECR_MODE_CFG); in parport_ip32_fifo_supported()
1859 pr_probe(p, "Unknown implementation ID: 0x%0x\n", in parport_ip32_fifo_supported()
1865 pr_probe(p, "Unsupported PWord size: %u\n", pword); in parport_ip32_fifo_supported()
1869 pr_probe(p, "PWord is %u bits\n", 8 * priv->pword); in parport_ip32_fifo_supported()
1874 pr_probe(p, "Hardware compression detected (unsupported)\n"); in parport_ip32_fifo_supported()
1878 parport_ip32_set_mode(p, ECR_MODE_TST); in parport_ip32_fifo_supported()
1882 pr_probe(p, "FIFO not reset\n"); in parport_ip32_fifo_supported()
1897 pr_probe(p, "Can't fill FIFO\n"); in parport_ip32_fifo_supported()
1901 pr_probe(p, "Can't get FIFO depth\n"); in parport_ip32_fifo_supported()
1904 pr_probe(p, "FIFO is %u PWords deep\n", priv->fifo_depth); in parport_ip32_fifo_supported()
1907 parport_ip32_frob_econtrol(p, ECR_SERVINTR, 0); in parport_ip32_fifo_supported()
1914 pr_probe(p, "Invalid data in FIFO\n"); in parport_ip32_fifo_supported()
1924 pr_probe(p, "Data lost in FIFO\n"); in parport_ip32_fifo_supported()
1929 pr_probe(p, "Can't get writeIntrThreshold\n"); in parport_ip32_fifo_supported()
1932 pr_probe(p, "writeIntrThreshold is %u\n", priv->writeIntrThreshold); in parport_ip32_fifo_supported()
1936 pr_probe(p, "Can't empty FIFO\n"); in parport_ip32_fifo_supported()
1941 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_fifo_supported()
1943 parport_ip32_data_reverse(p); in parport_ip32_fifo_supported()
1945 parport_ip32_set_mode(p, ECR_MODE_TST); in parport_ip32_fifo_supported()
1947 parport_ip32_frob_econtrol(p, ECR_SERVINTR, 0); in parport_ip32_fifo_supported()
1961 pr_probe(p, "Can't get readIntrThreshold\n"); in parport_ip32_fifo_supported()
1964 pr_probe(p, "readIntrThreshold is %u\n", priv->readIntrThreshold); in parport_ip32_fifo_supported()
1967 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_fifo_supported()
1968 parport_ip32_data_forward(p); in parport_ip32_fifo_supported()
1969 parport_ip32_set_mode(p, ECR_MODE_SPP); in parport_ip32_fifo_supported()
1974 parport_ip32_set_mode(p, ECR_MODE_SPP); in parport_ip32_fifo_supported()
2028 struct parport *p = NULL; in parport_ip32_probe_port() local
2036 p = parport_register_port(0, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, ops); in parport_ip32_probe_port()
2037 if (ops == NULL || priv == NULL || p == NULL) { in parport_ip32_probe_port()
2041 p->base = MACE_BASE + offsetof(struct sgi_mace, isa.parallel); in parport_ip32_probe_port()
2042 p->base_hi = MACE_BASE + offsetof(struct sgi_mace, isa.ecp1284); in parport_ip32_probe_port()
2043 p->private_data = priv; in parport_ip32_probe_port()
2055 if (!parport_ip32_ecp_supported(p)) { in parport_ip32_probe_port()
2059 parport_ip32_dump_state(p, "begin init", 0); in parport_ip32_probe_port()
2063 p->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT; in parport_ip32_probe_port()
2064 p->modes |= PARPORT_MODE_TRISTATE; in parport_ip32_probe_port()
2066 if (!parport_ip32_fifo_supported(p)) { in parport_ip32_probe_port()
2067 pr_warn(PPIP32 "%s: error: FIFO disabled\n", p->name); in parport_ip32_probe_port()
2078 if (request_irq(irq, parport_ip32_interrupt, 0, p->name, p)) { in parport_ip32_probe_port()
2079 pr_warn(PPIP32 "%s: error: IRQ disabled\n", p->name); in parport_ip32_probe_port()
2083 pr_probe(p, "Interrupt support enabled\n"); in parport_ip32_probe_port()
2084 p->irq = irq; in parport_ip32_probe_port()
2092 pr_warn(PPIP32 "%s: error: DMA disabled\n", p->name); in parport_ip32_probe_port()
2094 pr_probe(p, "DMA support enabled\n"); in parport_ip32_probe_port()
2095 p->dma = 0; /* arbitrary value != PARPORT_DMA_NONE */ in parport_ip32_probe_port()
2096 p->modes |= PARPORT_MODE_DMA; in parport_ip32_probe_port()
2102 p->ops->compat_write_data = parport_ip32_compat_write_data; in parport_ip32_probe_port()
2103 p->modes |= PARPORT_MODE_COMPAT; in parport_ip32_probe_port()
2104 pr_probe(p, "Hardware support for SPP mode enabled\n"); in parport_ip32_probe_port()
2108 p->ops->epp_read_data = parport_ip32_epp_read_data; in parport_ip32_probe_port()
2109 p->ops->epp_write_data = parport_ip32_epp_write_data; in parport_ip32_probe_port()
2110 p->ops->epp_read_addr = parport_ip32_epp_read_addr; in parport_ip32_probe_port()
2111 p->ops->epp_write_addr = parport_ip32_epp_write_addr; in parport_ip32_probe_port()
2112 p->modes |= PARPORT_MODE_EPP; in parport_ip32_probe_port()
2113 pr_probe(p, "Hardware support for EPP mode enabled\n"); in parport_ip32_probe_port()
2117 p->ops->ecp_write_data = parport_ip32_ecp_write_data; in parport_ip32_probe_port()
2121 p->modes |= PARPORT_MODE_ECP; in parport_ip32_probe_port()
2122 pr_probe(p, "Hardware support for ECP mode enabled\n"); in parport_ip32_probe_port()
2126 parport_ip32_set_mode(p, ECR_MODE_PS2); in parport_ip32_probe_port()
2127 parport_ip32_write_control(p, DCR_SELECT | DCR_nINIT); in parport_ip32_probe_port()
2128 parport_ip32_data_forward(p); in parport_ip32_probe_port()
2129 parport_ip32_disable_irq(p); in parport_ip32_probe_port()
2130 parport_ip32_write_data(p, 0x00); in parport_ip32_probe_port()
2131 parport_ip32_dump_state(p, "end init", 0); in parport_ip32_probe_port()
2134 pr_info("%s: SGI IP32 at 0x%lx (0x%lx)", p->name, p->base, p->base_hi); in parport_ip32_probe_port()
2135 if (p->irq != PARPORT_IRQ_NONE) in parport_ip32_probe_port()
2136 pr_cont(", irq %d", p->irq); in parport_ip32_probe_port()
2140 if (p->modes & PARPORT_MODE_##x) \ in parport_ip32_probe_port()
2155 parport_announce_port(p); in parport_ip32_probe_port()
2156 return p; in parport_ip32_probe_port()
2159 if (p) in parport_ip32_probe_port()
2160 parport_put_port(p); in parport_ip32_probe_port()
2173 static __exit void parport_ip32_unregister_port(struct parport *p) in parport_ip32_unregister_port() argument
2175 struct parport_ip32_private * const priv = p->physport->private_data; in parport_ip32_unregister_port()
2176 struct parport_operations *ops = p->ops; in parport_ip32_unregister_port()
2178 parport_remove_port(p); in parport_ip32_unregister_port()
2179 if (p->modes & PARPORT_MODE_DMA) in parport_ip32_unregister_port()
2181 if (p->irq != PARPORT_IRQ_NONE) in parport_ip32_unregister_port()
2182 free_irq(p->irq, p); in parport_ip32_unregister_port()
2183 parport_put_port(p); in parport_ip32_unregister_port()