diff options
author | Marko Kohtala <marko.kohtala@gmail.com> | 2006-01-06 03:19:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:56 -0500 |
commit | 742ec650e9b63ea61891455bb6f76bac37025c78 (patch) | |
tree | 993a734fc7c412c0a0c37e107bff761e0071cfcf /drivers/media | |
parent | c660629059abbbd0eb56e12f9bb4494f01800bbc (diff) |
[PATCH] parport: phase fixes
Did not move the parport interface properly into IEEE1284_PH_REV_IDLE phase at
end of data due to comparing bytes with nibbles. Internal phase
IEEE1284_PH_HBUSY_DNA became unused, so remove it.
Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cpia_pp.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c index ddf184f95d80..6861d408f1b3 100644 --- a/drivers/media/video/cpia_pp.c +++ b/drivers/media/video/cpia_pp.c | |||
@@ -170,16 +170,9 @@ static size_t cpia_read_nibble (struct parport *port, | |||
170 | /* Does the error line indicate end of data? */ | 170 | /* Does the error line indicate end of data? */ |
171 | if (((i /*& 1*/) == 0) && | 171 | if (((i /*& 1*/) == 0) && |
172 | (parport_read_status(port) & PARPORT_STATUS_ERROR)) { | 172 | (parport_read_status(port) & PARPORT_STATUS_ERROR)) { |
173 | port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DNA; | 173 | DBG("%s: No more nibble data (%d bytes)\n", |
174 | DBG("%s: No more nibble data (%d bytes)\n", | 174 | port->name, i/2); |
175 | port->name, i/2); | 175 | goto end_of_data; |
176 | |||
177 | /* Go to reverse idle phase. */ | ||
178 | parport_frob_control (port, | ||
179 | PARPORT_CONTROL_AUTOFD, | ||
180 | PARPORT_CONTROL_AUTOFD); | ||
181 | port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; | ||
182 | break; | ||
183 | } | 176 | } |
184 | 177 | ||
185 | /* Event 7: Set nAutoFd low. */ | 178 | /* Event 7: Set nAutoFd low. */ |
@@ -227,18 +220,21 @@ static size_t cpia_read_nibble (struct parport *port, | |||
227 | byte = nibble; | 220 | byte = nibble; |
228 | } | 221 | } |
229 | 222 | ||
230 | i /= 2; /* i is now in bytes */ | ||
231 | |||
232 | if (i == len) { | 223 | if (i == len) { |
233 | /* Read the last nibble without checking data avail. */ | 224 | /* Read the last nibble without checking data avail. */ |
234 | port = port->physport; | 225 | if (parport_read_status (port) & PARPORT_STATUS_ERROR) { |
235 | if (parport_read_status (port) & PARPORT_STATUS_ERROR) | 226 | end_of_data: |
236 | port->ieee1284.phase = IEEE1284_PH_HBUSY_DNA; | 227 | /* Go to reverse idle phase. */ |
228 | parport_frob_control (port, | ||
229 | PARPORT_CONTROL_AUTOFD, | ||
230 | PARPORT_CONTROL_AUTOFD); | ||
231 | port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; | ||
232 | } | ||
237 | else | 233 | else |
238 | port->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL; | 234 | port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL; |
239 | } | 235 | } |
240 | 236 | ||
241 | return i; | 237 | return i/2; |
242 | } | 238 | } |
243 | 239 | ||
244 | /* CPiA nonstandard "Nibble Stream" mode (2 nibbles per cycle, instead of 1) | 240 | /* CPiA nonstandard "Nibble Stream" mode (2 nibbles per cycle, instead of 1) |