summaryrefslogtreecommitdiff
path: root/openwrt/package/lcd4linux/patches/patch-drv_generic_parport_c
blob: f029ffb17e82d374e74bd8bfd656e2798ec130dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
--- lcd4linux-0.10.0-RC1/drv_generic_parport.c	2005-01-06 17:54:54.000000000 +0100
+++ lcd/drv_generic_parport.c	2005-03-20 01:20:48.052255953 +0100
@@ -359,13 +359,12 @@
 #ifdef WITH_PPDEV
   if (PPdev) {
     ioctl (PPfd, PPDATADIR, &direction);
-  } else
+  } 
+#else
+	/* code stolen from linux/parport_pc.h */
+	ctr = (ctr & ~0x20) ^ (direction?0x20:0x00);
+	outb (ctr, Port+2);
 #endif
-    {
-      /* code stolen from linux/parport_pc.h */
-      ctr = (ctr & ~0x20) ^ (direction?0x20:0x00);
-      outb (ctr, Port+2);
-    }
 }
 
 
@@ -383,11 +382,10 @@
 #ifdef WITH_PPDEV
   if (PPdev) {
     ioctl (PPfd, PPRSTATUS, &data);
-  } else
+  } 
+#else
+  data = inb (Port+1);
 #endif
-    {
-      data = inb (Port+1);
-    }
   
   /* clear unused bits */
   data &= mask;
@@ -413,13 +411,12 @@
     frob.mask=mask;
     frob.val=val;
     ioctl (PPfd, PPFCONTROL, &frob);
-  } else
+  } 
+#else
+  /* code stolen from linux/parport_pc.h */
+  ctr = (ctr & ~mask) ^ val;
+  outb (ctr, Port+2);
 #endif
-    {
-      /* code stolen from linux/parport_pc.h */
-      ctr = (ctr & ~mask) ^ val;
-      outb (ctr, Port+2);
-    }
 }
 
 
@@ -456,9 +453,9 @@
     frob.val = value2;
     ioctl (PPfd, PPFCONTROL, &frob);
 
-  } else
-#endif
-    {
+  } 
+#else
+    
       /* rise */
       ctr = (ctr & ~bits) ^ value1;
       outb (ctr, Port+2);
@@ -469,7 +466,8 @@
       /* lower */
       ctr = (ctr & ~bits) ^ value2;
       outb (ctr, Port+2);
-    }
+    
+#endif
 }
 
 
@@ -478,11 +476,11 @@
 #ifdef WITH_PPDEV
   if (PPdev) {
     ioctl(PPfd, PPWDATA, &data);
-  } else
+  } 
+#else    
+  outb (data, Port);
 #endif
-    {
-      outb (data, Port);
-    }
+    
 }
 
 unsigned char drv_generic_parport_read (void)
@@ -492,11 +490,10 @@
 #ifdef WITH_PPDEV
   if (PPdev) {
     ioctl (PPfd, PPRDATA, &data);
-  } else
+  } 
+#else
+  data=inb (Port);
 #endif
-    {
-      data=inb (Port);
-    }
   return data;
 }