aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Porter <mporter@ti.com>2012-04-20 11:28:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-20 12:48:27 -0400
commit991214386dee8a3cd9adc743778f472ac8a12bbc (patch)
tree206e223e020176c4c6cc8cb6e7d4e01912d08a2a
parent1790625feb3904f54c82e469a2e5997c3a01f4fa (diff)
parport: remove unused dead code from lowlevel drivers
This unused code has been untouched for over 7 years and must go. Signed-off-by: Matt Porter <mporter@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/parport/parport_amiga.c36
-rw-r--r--drivers/parport/parport_atari.c9
-rw-r--r--drivers/parport/parport_mfc3.c35
-rw-r--r--drivers/parport/parport_pc.c276
-rw-r--r--drivers/parport/parport_sunbpp.c21
5 files changed, 0 insertions, 377 deletions
diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c
index 8bef6d60f88b..ee78e0ee6e05 100644
--- a/drivers/parport/parport_amiga.c
+++ b/drivers/parport/parport_amiga.c
@@ -48,23 +48,6 @@ static unsigned char amiga_read_data(struct parport *p)
48 return ciaa.prb; 48 return ciaa.prb;
49} 49}
50 50
51#if 0
52static unsigned char control_pc_to_amiga(unsigned char control)
53{
54 unsigned char ret = 0;
55
56 if (control & PARPORT_CONTROL_SELECT) /* XXX: What is SELECP? */
57 ;
58 if (control & PARPORT_CONTROL_INIT) /* INITP */
59 /* reset connected to cpu reset pin */;
60 if (control & PARPORT_CONTROL_AUTOFD) /* AUTOLF */
61 /* Not connected */;
62 if (control & PARPORT_CONTROL_STROBE) /* Strobe */
63 /* Handled only directly by hardware */;
64 return ret;
65}
66#endif
67
68static unsigned char control_amiga_to_pc(unsigned char control) 51static unsigned char control_amiga_to_pc(unsigned char control)
69{ 52{
70 return PARPORT_CONTROL_SELECT | 53 return PARPORT_CONTROL_SELECT |
@@ -95,25 +78,6 @@ static unsigned char amiga_frob_control( struct parport *p, unsigned char mask,
95 return old; 78 return old;
96} 79}
97 80
98#if 0 /* currently unused */
99static unsigned char status_pc_to_amiga(unsigned char status)
100{
101 unsigned char ret = 1;
102
103 if (status & PARPORT_STATUS_BUSY) /* Busy */
104 ret &= ~1;
105 if (status & PARPORT_STATUS_ACK) /* Ack */
106 /* handled in hardware */;
107 if (status & PARPORT_STATUS_PAPEROUT) /* PaperOut */
108 ret |= 2;
109 if (status & PARPORT_STATUS_SELECT) /* select */
110 ret |= 4;
111 if (status & PARPORT_STATUS_ERROR) /* error */
112 /* not connected */;
113 return ret;
114}
115#endif
116
117static unsigned char status_amiga_to_pc(unsigned char status) 81static unsigned char status_amiga_to_pc(unsigned char status)
118{ 82{
119 unsigned char ret = PARPORT_STATUS_BUSY | PARPORT_STATUS_ACK | PARPORT_STATUS_ERROR; 83 unsigned char ret = PARPORT_STATUS_BUSY | PARPORT_STATUS_ACK | PARPORT_STATUS_ERROR;
diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c
index 0b28fccec03f..7ad59ac68cf6 100644
--- a/drivers/parport/parport_atari.c
+++ b/drivers/parport/parport_atari.c
@@ -130,15 +130,6 @@ parport_atari_data_forward(struct parport *p)
130static void 130static void
131parport_atari_data_reverse(struct parport *p) 131parport_atari_data_reverse(struct parport *p)
132{ 132{
133#if 0 /* too dangerous, can kill sound chip */
134 unsigned long flags;
135
136 local_irq_save(flags);
137 /* Soundchip port B as input. */
138 sound_ym.rd_data_reg_sel = 7;
139 sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~0x40;
140 local_irq_restore(flags);
141#endif
142} 133}
143 134
144static struct parport_operations parport_atari_ops = { 135static struct parport_operations parport_atari_ops = {
diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c
index 1c0c642b3e23..7578d79b3688 100644
--- a/drivers/parport/parport_mfc3.c
+++ b/drivers/parport/parport_mfc3.c
@@ -147,25 +147,6 @@ DPRINTK(KERN_DEBUG "frob_control mask %02x, value %02x\n",mask,val);
147 return old; 147 return old;
148} 148}
149 149
150#if 0 /* currently unused */
151static unsigned char status_pc_to_mfc3(unsigned char status)
152{
153 unsigned char ret = 1;
154
155 if (status & PARPORT_STATUS_BUSY) /* Busy */
156 ret &= ~1;
157 if (status & PARPORT_STATUS_ACK) /* Ack */
158 ret |= 8;
159 if (status & PARPORT_STATUS_PAPEROUT) /* PaperOut */
160 ret |= 2;
161 if (status & PARPORT_STATUS_SELECT) /* select */
162 ret |= 4;
163 if (status & PARPORT_STATUS_ERROR) /* error */
164 ret |= 16;
165 return ret;
166}
167#endif
168
169static unsigned char status_mfc3_to_pc(unsigned char status) 150static unsigned char status_mfc3_to_pc(unsigned char status)
170{ 151{
171 unsigned char ret = PARPORT_STATUS_BUSY; 152 unsigned char ret = PARPORT_STATUS_BUSY;
@@ -184,14 +165,6 @@ static unsigned char status_mfc3_to_pc(unsigned char status)
184 return ret; 165 return ret;
185} 166}
186 167
187#if 0 /* currently unused */
188static void mfc3_write_status( struct parport *p, unsigned char status)
189{
190DPRINTK(KERN_DEBUG "write_status %02x\n",status);
191 pia(p)->ppra = (pia(p)->ppra & 0xe0) | status_pc_to_mfc3(status);
192}
193#endif
194
195static unsigned char mfc3_read_status(struct parport *p) 168static unsigned char mfc3_read_status(struct parport *p)
196{ 169{
197 unsigned char status; 170 unsigned char status;
@@ -201,14 +174,6 @@ DPRINTK(KERN_DEBUG "read_status %02x\n", status);
201 return status; 174 return status;
202} 175}
203 176
204#if 0 /* currently unused */
205static void mfc3_change_mode( struct parport *p, int m)
206{
207 /* XXX: This port only has one mode, and I am
208 not sure about the corresponding PC-style mode*/
209}
210#endif
211
212static int use_cnt = 0; 177static int use_cnt = 0;
213 178
214static irqreturn_t mfc3_interrupt(int irq, void *dev_id) 179static irqreturn_t mfc3_interrupt(int irq, void *dev_id)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 0cb64f50cecd..402956321d33 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -197,54 +197,6 @@ static int change_mode(struct parport *p, int m)
197 ECR_WRITE(p, oecr); 197 ECR_WRITE(p, oecr);
198 return 0; 198 return 0;
199} 199}
200
201#ifdef CONFIG_PARPORT_1284
202/* Find FIFO lossage; FIFO is reset */
203#if 0
204static int get_fifo_residue(struct parport *p)
205{
206 int residue;
207 int cnfga;
208 const struct parport_pc_private *priv = p->physport->private_data;
209
210 /* Adjust for the contents of the FIFO. */
211 for (residue = priv->fifo_depth; ; residue--) {
212 if (inb(ECONTROL(p)) & 0x2)
213 /* Full up. */
214 break;
215
216 outb(0, FIFO(p));
217 }
218
219 printk(KERN_DEBUG "%s: %d PWords were left in FIFO\n", p->name,
220 residue);
221
222 /* Reset the FIFO. */
223 frob_set_mode(p, ECR_PS2);
224
225 /* Now change to config mode and clean up. FIXME */
226 frob_set_mode(p, ECR_CNF);
227 cnfga = inb(CONFIGA(p));
228 printk(KERN_DEBUG "%s: cnfgA contains 0x%02x\n", p->name, cnfga);
229
230 if (!(cnfga & (1<<2))) {
231 printk(KERN_DEBUG "%s: Accounting for extra byte\n", p->name);
232 residue++;
233 }
234
235 /* Don't care about partial PWords until support is added for
236 * PWord != 1 byte. */
237
238 /* Back to PS2 mode. */
239 frob_set_mode(p, ECR_PS2);
240
241 DPRINTK(KERN_DEBUG
242 "*** get_fifo_residue: done residue collecting (ecr = 0x%2.2x)\n",
243 inb(ECONTROL(p)));
244 return residue;
245}
246#endif /* 0 */
247#endif /* IEEE 1284 support */
248#endif /* FIFO support */ 200#endif /* FIFO support */
249 201
250/* 202/*
@@ -940,234 +892,6 @@ static size_t parport_pc_ecp_write_block_pio(struct parport *port,
940 892
941 return written; 893 return written;
942} 894}
943
944#if 0
945static size_t parport_pc_ecp_read_block_pio(struct parport *port,
946 void *buf, size_t length,
947 int flags)
948{
949 size_t left = length;
950 size_t fifofull;
951 int r;
952 const int fifo = FIFO(port);
953 const struct parport_pc_private *priv = port->physport->private_data;
954 const int fifo_depth = priv->fifo_depth;
955 char *bufp = buf;
956
957 port = port->physport;
958 DPRINTK(KERN_DEBUG "parport_pc: parport_pc_ecp_read_block_pio\n");
959 dump_parport_state("enter fcn", port);
960
961 /* Special case: a timeout of zero means we cannot call schedule().
962 * Also if O_NONBLOCK is set then use the default implementation. */
963 if (port->cad->timeout <= PARPORT_INACTIVITY_O_NONBLOCK)
964 return parport_ieee1284_ecp_read_data(port, buf,
965 length, flags);
966
967 if (port->ieee1284.mode == IEEE1284_MODE_ECPRLE) {
968 /* If the peripheral is allowed to send RLE compressed
969 * data, it is possible for a byte to expand to 128
970 * bytes in the FIFO. */
971 fifofull = 128;
972 } else {
973 fifofull = fifo_depth;
974 }
975
976 /* If the caller wants less than a full FIFO's worth of data,
977 * go through software emulation. Otherwise we may have to throw
978 * away data. */
979 if (length < fifofull)
980 return parport_ieee1284_ecp_read_data(port, buf,
981 length, flags);
982
983 if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE) {
984 /* change to reverse-idle phase (must be in forward-idle) */
985
986 /* Event 38: Set nAutoFd low (also make sure nStrobe is high) */
987 parport_frob_control(port,
988 PARPORT_CONTROL_AUTOFD
989 | PARPORT_CONTROL_STROBE,
990 PARPORT_CONTROL_AUTOFD);
991 parport_pc_data_reverse(port); /* Must be in PS2 mode */
992 udelay(5);
993 /* Event 39: Set nInit low to initiate bus reversal */
994 parport_frob_control(port,
995 PARPORT_CONTROL_INIT,
996 0);
997 /* Event 40: Wait for nAckReverse (PError) to go low */
998 r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, 0);
999 if (r) {
1000 printk(KERN_DEBUG "%s: PE timeout Event 40 (%d) "
1001 "in ecp_read_block_pio\n", port->name, r);
1002 return 0;
1003 }
1004 }
1005
1006 /* Set up ECP FIFO mode.*/
1007/* parport_pc_frob_control(port,
1008 PARPORT_CONTROL_STROBE |
1009 PARPORT_CONTROL_AUTOFD,
1010 PARPORT_CONTROL_AUTOFD); */
1011 r = change_mode(port, ECR_ECP); /* ECP FIFO */
1012 if (r)
1013 printk(KERN_DEBUG "%s: Warning change_mode ECR_ECP failed\n",
1014 port->name);
1015
1016 port->ieee1284.phase = IEEE1284_PH_REV_DATA;
1017
1018 /* the first byte must be collected manually */
1019 dump_parport_state("pre 43", port);
1020 /* Event 43: Wait for nAck to go low */
1021 r = parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0);
1022 if (r) {
1023 /* timed out while reading -- no data */
1024 printk(KERN_DEBUG "PIO read timed out (initial byte)\n");
1025 goto out_no_data;
1026 }
1027 /* read byte */
1028 *bufp++ = inb(DATA(port));
1029 left--;
1030 dump_parport_state("43-44", port);
1031 /* Event 44: nAutoFd (HostAck) goes high to acknowledge */
1032 parport_pc_frob_control(port,
1033 PARPORT_CONTROL_AUTOFD,
1034 0);
1035 dump_parport_state("pre 45", port);
1036 /* Event 45: Wait for nAck to go high */
1037 /* r = parport_wait_peripheral(port, PARPORT_STATUS_ACK,
1038 PARPORT_STATUS_ACK); */
1039 dump_parport_state("post 45", port);
1040 r = 0;
1041 if (r) {
1042 /* timed out while waiting for peripheral to respond to ack */
1043 printk(KERN_DEBUG "ECP PIO read timed out (waiting for nAck)\n");
1044
1045 /* keep hold of the byte we've got already */
1046 goto out_no_data;
1047 }
1048 /* Event 46: nAutoFd (HostAck) goes low to accept more data */
1049 parport_pc_frob_control(port,
1050 PARPORT_CONTROL_AUTOFD,
1051 PARPORT_CONTROL_AUTOFD);
1052
1053
1054 dump_parport_state("rev idle", port);
1055 /* Do the transfer. */
1056 while (left > fifofull) {
1057 int ret;
1058 unsigned long expire = jiffies + port->cad->timeout;
1059 unsigned char ecrval = inb(ECONTROL(port));
1060
1061 if (need_resched() && time_before(jiffies, expire))
1062 /* Can't yield the port. */
1063 schedule();
1064
1065 /* At this point, the FIFO may already be full. In
1066 * that case ECP is already holding back the
1067 * peripheral (assuming proper design) with a delayed
1068 * handshake. Work fast to avoid a peripheral
1069 * timeout. */
1070
1071 if (ecrval & 0x01) {
1072 /* FIFO is empty. Wait for interrupt. */
1073 dump_parport_state("FIFO empty", port);
1074
1075 /* Anyone else waiting for the port? */
1076 if (port->waithead) {
1077 printk(KERN_DEBUG "Somebody wants the port\n");
1078 break;
1079 }
1080
1081 /* Clear serviceIntr */
1082 ECR_WRITE(port, ecrval & ~(1<<2));
1083false_alarm:
1084 dump_parport_state("waiting", port);
1085 ret = parport_wait_event(port, HZ);
1086 DPRINTK(KERN_DEBUG "parport_wait_event returned %d\n",
1087 ret);
1088 if (ret < 0)
1089 break;
1090 ret = 0;
1091 if (!time_before(jiffies, expire)) {
1092 /* Timed out. */
1093 dump_parport_state("timeout", port);
1094 printk(KERN_DEBUG "PIO read timed out\n");
1095 break;
1096 }
1097 ecrval = inb(ECONTROL(port));
1098 if (!(ecrval & (1<<2))) {
1099 if (need_resched() &&
1100 time_before(jiffies, expire)) {
1101 schedule();
1102 }
1103 goto false_alarm;
1104 }
1105
1106 /* Depending on how the FIFO threshold was
1107 * set, how long interrupt service took, and
1108 * how fast the peripheral is, we might be
1109 * lucky and have a just filled FIFO. */
1110 continue;
1111 }
1112
1113 if (ecrval & 0x02) {
1114 /* FIFO is full. */
1115 dump_parport_state("FIFO full", port);
1116 insb(fifo, bufp, fifo_depth);
1117 bufp += fifo_depth;
1118 left -= fifo_depth;
1119 continue;
1120 }
1121
1122 DPRINTK(KERN_DEBUG
1123 "*** ecp_read_block_pio: reading one byte from the FIFO\n");
1124
1125 /* FIFO not filled. We will cycle this loop for a while
1126 * and either the peripheral will fill it faster,
1127 * tripping a fast empty with insb, or we empty it. */
1128 *bufp++ = inb(fifo);
1129 left--;
1130 }
1131
1132 /* scoop up anything left in the FIFO */
1133 while (left && !(inb(ECONTROL(port) & 0x01))) {
1134 *bufp++ = inb(fifo);
1135 left--;
1136 }
1137
1138 port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
1139 dump_parport_state("rev idle2", port);
1140
1141out_no_data:
1142
1143 /* Go to forward idle mode to shut the peripheral up (event 47). */
1144 parport_frob_control(port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT);
1145
1146 /* event 49: PError goes high */
1147 r = parport_wait_peripheral(port,
1148 PARPORT_STATUS_PAPEROUT,
1149 PARPORT_STATUS_PAPEROUT);
1150 if (r) {
1151 printk(KERN_DEBUG
1152 "%s: PE timeout FWDIDLE (%d) in ecp_read_block_pio\n",
1153 port->name, r);
1154 }
1155
1156 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
1157
1158 /* Finish up. */
1159 {
1160 int lost = get_fifo_residue(port);
1161 if (lost)
1162 /* Shouldn't happen with compliant peripherals. */
1163 printk(KERN_DEBUG "%s: DATA LOSS (%d bytes)!\n",
1164 port->name, lost);
1165 }
1166
1167 dump_parport_state("fwd idle", port);
1168 return length - left;
1169}
1170#endif /* 0 */
1171#endif /* IEEE 1284 support */ 895#endif /* IEEE 1284 support */
1172#endif /* Allowed to use FIFO/DMA */ 896#endif /* Allowed to use FIFO/DMA */
1173 897
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index 9390a534a2b2..983a2d2df659 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -82,27 +82,6 @@ static unsigned char parport_sunbpp_read_data(struct parport *p)
82 return sbus_readb(&regs->p_dr); 82 return sbus_readb(&regs->p_dr);
83} 83}
84 84
85#if 0
86static void control_pc_to_sunbpp(struct parport *p, unsigned char status)
87{
88 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base;
89 unsigned char value_tcr = sbus_readb(&regs->p_tcr);
90 unsigned char value_or = sbus_readb(&regs->p_or);
91
92 if (status & PARPORT_CONTROL_STROBE)
93 value_tcr |= P_TCR_DS;
94 if (status & PARPORT_CONTROL_AUTOFD)
95 value_or |= P_OR_AFXN;
96 if (status & PARPORT_CONTROL_INIT)
97 value_or |= P_OR_INIT;
98 if (status & PARPORT_CONTROL_SELECT)
99 value_or |= P_OR_SLCT_IN;
100
101 sbus_writeb(value_or, &regs->p_or);
102 sbus_writeb(value_tcr, &regs->p_tcr);
103}
104#endif
105
106static unsigned char status_sunbpp_to_pc(struct parport *p) 85static unsigned char status_sunbpp_to_pc(struct parport *p)
107{ 86{
108 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; 87 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base;