wtf!?

 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
--- i2c.c 2009-05-29 00:33:46.000000000 +0700
+++ /home/dottedmag/i2c.c 2009-09-11 22:09:06.000000000 +0700
@@ -135,17 +135,22 @@
int cnt = count;
int timeout = 5;
+// printk(KERN_ERR "Read I2C: %d\n", (int)buf[0]);
+
L_try_again:
if (timeout < 0)
goto L_timeout;
__i2c_send_nack(); /* Master does not send ACK, slave sends it */
+
+#ifndef CONFIG_KEYBOARD_EREADER_JZ
__i2c_send_start();
if (i2c_put_data( (device << 1) | I2C_WRITE ) < 0)
goto device_werr;
if (i2c_put_data(address) < 0)
goto address_err;
+#endif
__i2c_send_start();
if (i2c_put_data( (device << 1) | I2C_READ ) < 0)
@@ -204,8 +211,10 @@
goto device_err;
#ifdef CONFIG_JZ_TPANEL_ATA2508
if (address == 0xff) {
+#ifndef CONFIG_KEYBOARD_EREADER_JZ
if (i2c_put_data_nack(tmpaddr) < 0)
goto address_err;
+#endif
while (cnt) {
if (++cnt_in_pg > 8) {
__i2c_send_stop();
@@ -220,9 +229,10 @@
}
}
else {
-
+#ifndef CONFIG_KEYBOARD_EREADER_JZ
if (i2c_put_data(tmpaddr) < 0)
goto address_err;
+#endif
while (cnt) {
if (++cnt_in_pg > 8) {
__i2c_send_stop();
@@ -237,8 +247,10 @@
}
}
#else
+#ifndef CONFIG_KEYBOARD_EREADER_JZ
if (i2c_put_data(tmpaddr) < 0)
goto address_err;
+#endif
while (cnt) {
if (++cnt_in_pg > 8) {
__i2c_send_stop();