]> git.hungrycats.org Git - linux/commitdiff
[PATCH] 2.5.3-pre6: mode
authorTim Waugh <twaugh@redhat.com>
Tue, 5 Feb 2002 08:36:49 +0000 (00:36 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 08:36:49 +0000 (00:36 -0800)
This patch paves the way for a new driver which needs the
functionality.  Now parport_daisy_select actually _uses_ its mode
parameter.

* drivers/parport/daisy.c: Make parport_daisy_select aware of
its 'mode' parameter.
* drivers/parport/ChangeLog: Updated.

drivers/parport/ChangeLog
drivers/parport/daisy.c

index cd003f3b3feeb33ebb47a2fedd7e4d29f0599f04..9a3d73fd7616688df8ff79cfc77582d4c4b5bff8 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-21  Tim Waugh  <twaugh@redhat.com>
+
+       * daisy.c: Apply patch from Max Vorobiev to make parport_daisy_select
+       work for ECP/EPP modes.
+
 2002-01-04  Tim Waugh  <twaugh@redhat.com>
 
        * share.c (parport_claim_or_block): Sleep interruptibly to prevent
index 573c5ef200a567fcc69d0a53d5ce530cccdc7322..dddba9713e9b80bf2c08f2fd5b38e2eda5d07225 100644 (file)
@@ -406,8 +406,33 @@ void parport_daisy_deselect_all (struct parport *port)
 
 int parport_daisy_select (struct parport *port, int daisy, int mode)
 {
-       /* mode is currently ignored. FIXME? */
-       return cpp_daisy (port, 0xe0 + daisy) & PARPORT_STATUS_ERROR;
+       switch (mode)
+       {
+               // For these modes we should switch to EPP mode:
+               case IEEE1284_MODE_EPP:
+               case IEEE1284_MODE_EPPSL:
+               case IEEE1284_MODE_EPPSWE:
+                       return (cpp_daisy (port, 0x20 + daisy) &
+                               PARPORT_STATUS_ERROR);
+
+               // For these modes we should switch to ECP mode:
+               case IEEE1284_MODE_ECP:
+               case IEEE1284_MODE_ECPRLE:
+               case IEEE1284_MODE_ECPSWE: 
+                       return (cpp_daisy (port, 0xd0 + daisy) &
+                               PARPORT_STATUS_ERROR);
+
+               // Nothing was told for BECP in Daisy chain specification.
+               // May be it's wise to use ECP?
+               case IEEE1284_MODE_BECP:
+               // Others use compat mode
+               case IEEE1284_MODE_NIBBLE:
+               case IEEE1284_MODE_BYTE:
+               case IEEE1284_MODE_COMPAT:
+               default:
+                       return (cpp_daisy (port, 0xe0 + daisy) &
+                               PARPORT_STATUS_ERROR);
+       }
 }
 
 static int mux_present (struct parport *port)