1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifdef DATA
22#undef DATA
23#endif
24
25#define DATA 0
26#define STAT 1
27#define CTRL 2
28
29struct lineop {
30 u8 val;
31 u8 port;
32 u8 inverted;
33};
34
35struct adapter_parm {
36 struct lineop setsda;
37 struct lineop setscl;
38 struct lineop getsda;
39 struct lineop getscl;
40 struct lineop init;
41};
42
43static struct adapter_parm adapter_parm[] = {
44
45 {
46 .setsda = { 0x80, DATA, 1 },
47 .setscl = { 0x08, CTRL, 0 },
48 .getsda = { 0x80, STAT, 0 },
49 .getscl = { 0x08, STAT, 0 },
50 },
51
52 {
53 .setsda = { 0x02, DATA, 0 },
54 .setscl = { 0x01, DATA, 0 },
55 .getsda = { 0x80, STAT, 1 },
56 },
57
58 {
59 .setsda = { 0x02, CTRL, 1 },
60 .setscl = { 0x08, CTRL, 1 },
61 .getsda = { 0x10, STAT, 0 },
62 },
63
64 {
65 .setsda = { 0x02, DATA, 1 },
66 .setscl = { 0x01, DATA, 1 },
67 .getsda = { 0x40, STAT, 1 },
68 .getscl = { 0x08, STAT, 1 },
69 },
70
71 {
72 .setsda = { 0x02, DATA, 1 },
73 .setscl = { 0x01, DATA, 1 },
74 .getsda = { 0x10, STAT, 1 },
75 .init = { 0xf0, DATA, 0 },
76 },
77
78 {
79 .setsda = { 0x02, DATA, 1 },
80 .setscl = { 0x01, DATA, 1 },
81 .getsda = { 0x10, STAT, 1 },
82 },
83};
84
85static int type;
86module_param(type, int, 0);
87MODULE_PARM_DESC(type,
88 "Type of adapter:\n"
89 " 0 = Philips adapter\n"
90 " 1 = home brew teletext adapter\n"
91 " 2 = Velleman K8000 adapter\n"
92 " 3 = ELV adapter\n"
93 " 4 = ADM1032 evaluation board\n"
94 " 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n");
95