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