blob: fc16f9d268a32bcaa4cb7f002734bfb33ab08176 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* ------------------------------------------------------------------------- */
2/* i2c-algo-bit.c i2c driver algorithms for bit-shift adapters */
3/* ------------------------------------------------------------------------- */
4/* Copyright (C) 1995-2000 Simon G. Vogl
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19/* ------------------------------------------------------------------------- */
20
21/* With some changes from Frodo Looijaard <frodol@dds.nl>, Kyösti Mälkki
22 <kmalkki@cc.hut.fi> and Jean Delvare <khali@linux-fr.org> */
23
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/delay.h>
27#include <linux/slab.h>
28#include <linux/init.h>
29#include <linux/errno.h>
30#include <linux/sched.h>
31#include <linux/i2c.h>
32#include <linux/i2c-algo-bit.h>
33
34
35/* ----- global defines ----------------------------------------------- */
36#define DEB(x) if (i2c_debug>=1) x;
37#define DEB2(x) if (i2c_debug>=2) x;
38#define DEBSTAT(x) if (i2c_debug>=3) x; /* print several statistical values*/
39#define DEBPROTO(x) if (i2c_debug>=9) { x; }
40 /* debug the protocol by showing transferred bits */
41
42
43/* ----- global variables --------------------------------------------- */
44
45/* module parameters:
46 */
47static int i2c_debug;
48static int bit_test; /* see if the line-setting functions work */
49
50/* --- setting states on the bus with the right timing: --------------- */
51
52#define setsda(adap,val) adap->setsda(adap->data, val)
53#define setscl(adap,val) adap->setscl(adap->data, val)
54#define getsda(adap) adap->getsda(adap->data)
55#define getscl(adap) adap->getscl(adap->data)
56
57static inline void sdalo(struct i2c_algo_bit_data *adap)
58{
59 setsda(adap,0);
60 udelay(adap->udelay);
61}
62
63static inline void sdahi(struct i2c_algo_bit_data *adap)
64{
65 setsda(adap,1);
66 udelay(adap->udelay);
67}
68
69static inline void scllo(struct i2c_algo_bit_data *adap)
70{
71 setscl(adap,0);
72 udelay(adap->udelay);
73}
74
75/*
76 * Raise scl line, and do checking for delays. This is necessary for slower
77 * devices.
78 */
Jean Delvare7b288a02006-09-03 22:22:12 +020079static int sclhi(struct i2c_algo_bit_data *adap)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080{
81 unsigned long start;
82
83 setscl(adap,1);
84
85 /* Not all adapters have scl sense line... */
Jean Delvare7b288a02006-09-03 22:22:12 +020086 if (!adap->getscl)
87 goto done;
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
89 start=jiffies;
90 while (! getscl(adap) ) {
91 /* the hw knows how to read the clock line,
92 * so we wait until it actually gets high.
93 * This is safer as some chips may hold it low
94 * while they are processing data internally.
95 */
96 if (time_after_eq(jiffies, start+adap->timeout)) {
97 return -ETIMEDOUT;
98 }
99 cond_resched();
100 }
101 DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start));
Jean Delvare7b288a02006-09-03 22:22:12 +0200102
103done:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 udelay(adap->udelay);
105 return 0;
106}
107
108
109/* --- other auxiliary functions -------------------------------------- */
110static void i2c_start(struct i2c_algo_bit_data *adap)
111{
112 /* assert: scl, sda are high */
113 DEBPROTO(printk("S "));
114 sdalo(adap);
115 scllo(adap);
116}
117
118static void i2c_repstart(struct i2c_algo_bit_data *adap)
119{
120 /* scl, sda may not be high */
121 DEBPROTO(printk(" Sr "));
122 setsda(adap,1);
123 sclhi(adap);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124
125 sdalo(adap);
126 scllo(adap);
127}
128
129
130static void i2c_stop(struct i2c_algo_bit_data *adap)
131{
132 DEBPROTO(printk("P\n"));
133 /* assert: scl is low */
134 sdalo(adap);
135 sclhi(adap);
136 sdahi(adap);
137}
138
139
140
141/* send a byte without start cond., look for arbitration,
142 check ackn. from slave */
143/* returns:
144 * 1 if the device acknowledged
145 * 0 if the device did not ack
146 * -ETIMEDOUT if an error occurred (while raising the scl line)
147 */
148static int i2c_outb(struct i2c_adapter *i2c_adap, char c)
149{
150 int i;
151 int sb;
152 int ack;
153 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
154
155 /* assert: scl is low */
156 for ( i=7 ; i>=0 ; i-- ) {
157 sb = c & ( 1 << i );
158 setsda(adap,sb);
159 udelay(adap->udelay);
160 DEBPROTO(printk(KERN_DEBUG "%d",sb!=0));
161 if (sclhi(adap)<0) { /* timed out */
162 sdahi(adap); /* we don't want to block the net */
163 DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x, timeout at bit #%d\n", c&0xff, i));
164 return -ETIMEDOUT;
165 };
166 /* do arbitration here:
167 * if ( sb && ! getsda(adap) ) -> ouch! Get out of here.
168 */
169 setscl(adap, 0 );
170 udelay(adap->udelay);
171 }
172 sdahi(adap);
173 if (sclhi(adap)<0){ /* timeout */
174 DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x, timeout at ack\n", c&0xff));
175 return -ETIMEDOUT;
176 };
177 /* read ack: SDA should be pulled down by slave */
178 ack=getsda(adap); /* ack: sda is pulled low ->success. */
179 DEB2(printk(KERN_DEBUG " i2c_outb: 0x%02x , getsda() = %d\n", c & 0xff, ack));
180
181 DEBPROTO( printk(KERN_DEBUG "[%2.2x]",c&0xff) );
182 DEBPROTO(if (0==ack){ printk(KERN_DEBUG " A ");} else printk(KERN_DEBUG " NA ") );
183 scllo(adap);
184 return 0==ack; /* return 1 if device acked */
185 /* assert: scl is low (sda undef) */
186}
187
188
189static int i2c_inb(struct i2c_adapter *i2c_adap)
190{
191 /* read byte via i2c port, without start/stop sequence */
192 /* acknowledge is sent in i2c_read. */
193 int i;
194 unsigned char indata=0;
195 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
196
197 /* assert: scl is low */
198 sdahi(adap);
199 for (i=0;i<8;i++) {
200 if (sclhi(adap)<0) { /* timeout */
201 DEB2(printk(KERN_DEBUG " i2c_inb: timeout at bit #%d\n", 7-i));
202 return -ETIMEDOUT;
203 };
204 indata *= 2;
205 if ( getsda(adap) )
206 indata |= 0x01;
207 scllo(adap);
208 }
209 /* assert: scl is low */
210 DEB2(printk(KERN_DEBUG "i2c_inb: 0x%02x\n", indata & 0xff));
211
212 DEBPROTO(printk(KERN_DEBUG " 0x%02x", indata & 0xff));
213 return (int) (indata & 0xff);
214}
215
216/*
217 * Sanity check for the adapter hardware - check the reaction of
218 * the bus lines only if it seems to be idle.
219 */
220static int test_bus(struct i2c_algo_bit_data *adap, char* name) {
221 int scl,sda;
222
223 if (adap->getscl==NULL)
224 printk(KERN_INFO "i2c-algo-bit.o: Testing SDA only, "
225 "SCL is not readable.\n");
226
227 sda=getsda(adap);
228 scl=(adap->getscl==NULL?1:getscl(adap));
229 printk(KERN_DEBUG "i2c-algo-bit.o: (0) scl=%d, sda=%d\n",scl,sda);
230 if (!scl || !sda ) {
231 printk(KERN_WARNING "i2c-algo-bit.o: %s seems to be busy.\n", name);
232 goto bailout;
233 }
234
235 sdalo(adap);
236 sda=getsda(adap);
237 scl=(adap->getscl==NULL?1:getscl(adap));
238 printk(KERN_DEBUG "i2c-algo-bit.o: (1) scl=%d, sda=%d\n",scl,sda);
239 if ( 0 != sda ) {
240 printk(KERN_WARNING "i2c-algo-bit.o: SDA stuck high!\n");
241 goto bailout;
242 }
243 if ( 0 == scl ) {
244 printk(KERN_WARNING "i2c-algo-bit.o: SCL unexpected low "
245 "while pulling SDA low!\n");
246 goto bailout;
247 }
248
249 sdahi(adap);
250 sda=getsda(adap);
251 scl=(adap->getscl==NULL?1:getscl(adap));
252 printk(KERN_DEBUG "i2c-algo-bit.o: (2) scl=%d, sda=%d\n",scl,sda);
253 if ( 0 == sda ) {
254 printk(KERN_WARNING "i2c-algo-bit.o: SDA stuck low!\n");
255 goto bailout;
256 }
257 if ( 0 == scl ) {
258 printk(KERN_WARNING "i2c-algo-bit.o: SCL unexpected low "
259 "while pulling SDA high!\n");
260 goto bailout;
261 }
262
263 scllo(adap);
264 sda=getsda(adap);
265 scl=(adap->getscl==NULL?0:getscl(adap));
266 printk(KERN_DEBUG "i2c-algo-bit.o: (3) scl=%d, sda=%d\n",scl,sda);
267 if ( 0 != scl ) {
268 printk(KERN_WARNING "i2c-algo-bit.o: SCL stuck high!\n");
269 goto bailout;
270 }
271 if ( 0 == sda ) {
272 printk(KERN_WARNING "i2c-algo-bit.o: SDA unexpected low "
273 "while pulling SCL low!\n");
274 goto bailout;
275 }
276
277 sclhi(adap);
278 sda=getsda(adap);
279 scl=(adap->getscl==NULL?1:getscl(adap));
280 printk(KERN_DEBUG "i2c-algo-bit.o: (4) scl=%d, sda=%d\n",scl,sda);
281 if ( 0 == scl ) {
282 printk(KERN_WARNING "i2c-algo-bit.o: SCL stuck low!\n");
283 goto bailout;
284 }
285 if ( 0 == sda ) {
286 printk(KERN_WARNING "i2c-algo-bit.o: SDA unexpected low "
287 "while pulling SCL high!\n");
288 goto bailout;
289 }
290 printk(KERN_INFO "i2c-algo-bit.o: %s passed test.\n",name);
291 return 0;
292bailout:
293 sdahi(adap);
294 sclhi(adap);
295 return -ENODEV;
296}
297
298/* ----- Utility functions
299 */
300
301/* try_address tries to contact a chip for a number of
302 * times before it gives up.
303 * return values:
304 * 1 chip answered
305 * 0 chip did not answer
306 * -x transmission error
307 */
Jean Delvare7b288a02006-09-03 22:22:12 +0200308static int try_address(struct i2c_adapter *i2c_adap,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 unsigned char addr, int retries)
310{
311 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
312 int i,ret = -1;
313 for (i=0;i<=retries;i++) {
314 ret = i2c_outb(i2c_adap,addr);
Jean Delvare1ecac072007-05-01 23:26:28 +0200315 if (ret == 1 || i == retries)
316 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 i2c_stop(adap);
318 udelay(5/*adap->udelay*/);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 i2c_start(adap);
320 udelay(adap->udelay);
321 }
322 DEB2(if (i)
323 printk(KERN_DEBUG "i2c-algo-bit.o: Used %d tries to %s client at 0x%02x : %s\n",
324 i+1, addr & 1 ? "read" : "write", addr>>1,
325 ret==1 ? "success" : ret==0 ? "no ack" : "failed, timeout?" )
326 );
327 return ret;
328}
329
330static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
331{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332 char c;
333 const char *temp = msg->buf;
334 int count = msg->len;
335 unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
336 int retval;
337 int wrcount=0;
338
339 while (count > 0) {
340 c = *temp;
341 DEB2(dev_dbg(&i2c_adap->dev, "sendbytes: writing %2.2X\n", c&0xff));
342 retval = i2c_outb(i2c_adap,c);
343 if ((retval>0) || (nak_ok && (retval==0))) { /* ok or ignored NAK */
344 count--;
345 temp++;
346 wrcount++;
347 } else { /* arbitration or no acknowledge */
348 dev_err(&i2c_adap->dev, "sendbytes: error - bailout.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349 return (retval<0)? retval : -EFAULT;
350 /* got a better one ?? */
351 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 }
353 return wrcount;
354}
355
Jean Delvare7b288a02006-09-03 22:22:12 +0200356static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357{
358 int inval;
359 int rdcount=0; /* counts bytes read */
360 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
361 char *temp = msg->buf;
362 int count = msg->len;
363
364 while (count > 0) {
365 inval = i2c_inb(i2c_adap);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 if (inval>=0) {
367 *temp = inval;
368 rdcount++;
369 } else { /* read timed out */
370 printk(KERN_ERR "i2c-algo-bit.o: readbytes: i2c_inb timed out.\n");
371 break;
372 }
373
374 temp++;
375 count--;
376
377 if (msg->flags & I2C_M_NO_RD_ACK)
378 continue;
379
380 if ( count > 0 ) { /* send ack */
381 sdalo(adap);
382 DEBPROTO(printk(" Am "));
383 } else {
384 sdahi(adap); /* neg. ack on last byte */
385 DEBPROTO(printk(" NAm "));
386 }
387 if (sclhi(adap)<0) { /* timeout */
388 sdahi(adap);
389 printk(KERN_ERR "i2c-algo-bit.o: readbytes: Timeout at ack\n");
390 return -ETIMEDOUT;
391 };
392 scllo(adap);
393 sdahi(adap);
Jean Delvare3c4bb242007-05-01 23:26:29 +0200394
395 /* Some SMBus transactions require that we receive the
396 transaction length as the first read byte. */
397 if (rdcount == 1 && (msg->flags & I2C_M_RECV_LEN)) {
398 if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) {
399 printk(KERN_ERR "i2c-algo-bit: readbytes: "
400 "invalid block length (%d)\n", inval);
401 return -EREMOTEIO;
402 }
403 /* The original count value accounts for the extra
404 bytes, that is, either 1 for a regular transaction,
405 or 2 for a PEC transaction. */
406 count += inval;
407 msg->len += inval;
408 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 }
410 return rdcount;
411}
412
413/* doAddress initiates the transfer by generating the start condition (in
414 * try_address) and transmits the address in the necessary format to handle
415 * reads, writes as well as 10bit-addresses.
416 * returns:
417 * 0 everything went okay, the chip ack'ed, or IGNORE_NAK flag was set
418 * -x an error occurred (like: -EREMOTEIO if the device did not answer, or
419 * -ETIMEDOUT, for example if the lines are stuck...)
420 */
Jean Delvare7b288a02006-09-03 22:22:12 +0200421static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422{
423 unsigned short flags = msg->flags;
424 unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
425 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
426
427 unsigned char addr;
428 int ret, retries;
429
430 retries = nak_ok ? 0 : i2c_adap->retries;
431
432 if ( (flags & I2C_M_TEN) ) {
433 /* a ten bit address */
434 addr = 0xf0 | (( msg->addr >> 7) & 0x03);
435 DEB2(printk(KERN_DEBUG "addr0: %d\n",addr));
436 /* try extended address code...*/
437 ret = try_address(i2c_adap, addr, retries);
438 if ((ret != 1) && !nak_ok) {
439 printk(KERN_ERR "died at extended address code.\n");
440 return -EREMOTEIO;
441 }
442 /* the remaining 8 bit address */
443 ret = i2c_outb(i2c_adap,msg->addr & 0x7f);
444 if ((ret != 1) && !nak_ok) {
445 /* the chip did not ack / xmission error occurred */
446 printk(KERN_ERR "died at 2nd address code.\n");
447 return -EREMOTEIO;
448 }
449 if ( flags & I2C_M_RD ) {
450 i2c_repstart(adap);
451 /* okay, now switch into reading mode */
452 addr |= 0x01;
453 ret = try_address(i2c_adap, addr, retries);
454 if ((ret!=1) && !nak_ok) {
455 printk(KERN_ERR "died at extended address code.\n");
456 return -EREMOTEIO;
457 }
458 }
459 } else { /* normal 7bit address */
460 addr = ( msg->addr << 1 );
461 if (flags & I2C_M_RD )
462 addr |= 1;
463 if (flags & I2C_M_REV_DIR_ADDR )
464 addr ^= 1;
465 ret = try_address(i2c_adap, addr, retries);
466 if ((ret!=1) && !nak_ok)
467 return -EREMOTEIO;
468 }
469
470 return 0;
471}
472
473static int bit_xfer(struct i2c_adapter *i2c_adap,
474 struct i2c_msg msgs[], int num)
475{
476 struct i2c_msg *pmsg;
477 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
478
479 int i,ret;
480 unsigned short nak_ok;
481
482 i2c_start(adap);
483 for (i=0;i<num;i++) {
484 pmsg = &msgs[i];
485 nak_ok = pmsg->flags & I2C_M_IGNORE_NAK;
486 if (!(pmsg->flags & I2C_M_NOSTART)) {
487 if (i) {
488 i2c_repstart(adap);
489 }
490 ret = bit_doAddress(i2c_adap, pmsg);
491 if ((ret != 0) && !nak_ok) {
492 DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: NAK from device addr %2.2x msg #%d\n"
493 ,msgs[i].addr,i));
Jean Delvare1ecac072007-05-01 23:26:28 +0200494 goto bailout;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 }
496 }
497 if (pmsg->flags & I2C_M_RD ) {
498 /* read bytes into buffer*/
499 ret = readbytes(i2c_adap, pmsg);
500 DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: read %d bytes.\n",ret));
Jean Delvare1ecac072007-05-01 23:26:28 +0200501 if (ret < pmsg->len) {
502 if (ret >= 0)
503 ret = -EREMOTEIO;
504 goto bailout;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505 }
506 } else {
507 /* write bytes from buffer */
508 ret = sendbytes(i2c_adap, pmsg);
509 DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: wrote %d bytes.\n",ret));
Jean Delvare1ecac072007-05-01 23:26:28 +0200510 if (ret < pmsg->len) {
511 if (ret >= 0)
512 ret = -EREMOTEIO;
513 goto bailout;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514 }
515 }
516 }
Jean Delvare1ecac072007-05-01 23:26:28 +0200517 ret = i;
518
519bailout:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 i2c_stop(adap);
Jean Delvare1ecac072007-05-01 23:26:28 +0200521 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522}
523
524static u32 bit_func(struct i2c_adapter *adap)
525{
526 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
Jean Delvare3c4bb242007-05-01 23:26:29 +0200527 I2C_FUNC_SMBUS_READ_BLOCK_DATA |
528 I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700529 I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
530}
531
532
533/* -----exported algorithm data: ------------------------------------- */
534
Jean Delvare9e11a9f2006-09-03 22:38:52 +0200535static const struct i2c_algorithm i2c_bit_algo = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 .master_xfer = bit_xfer,
537 .functionality = bit_func,
538};
539
540/*
541 * registering functions to load algorithms at runtime
542 */
Jean Delvare0f3b4832007-05-01 23:26:31 +0200543static int i2c_bit_prepare_bus(struct i2c_adapter *adap)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700544{
545 struct i2c_algo_bit_data *bit_adap = adap->algo_data;
546
547 if (bit_test) {
548 int ret = test_bus(bit_adap, adap->name);
549 if (ret<0)
550 return -ENODEV;
551 }
552
553 DEB2(dev_dbg(&adap->dev, "hw routines registered.\n"));
554
555 /* register new adapter to i2c module... */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 adap->algo = &i2c_bit_algo;
557
558 adap->timeout = 100; /* default values, should */
559 adap->retries = 3; /* be replaced by defines */
560
Jean Delvare0f3b4832007-05-01 23:26:31 +0200561 return 0;
562}
563
564int i2c_bit_add_bus(struct i2c_adapter *adap)
565{
566 int err;
567
568 err = i2c_bit_prepare_bus(adap);
569 if (err)
570 return err;
571
Mark M. Hoffmanb39ad0c2006-07-01 17:16:06 +0200572 return i2c_add_adapter(adap);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574EXPORT_SYMBOL(i2c_bit_add_bus);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575
Jean Delvare0f3b4832007-05-01 23:26:31 +0200576int i2c_bit_add_numbered_bus(struct i2c_adapter *adap)
577{
578 int err;
579
580 err = i2c_bit_prepare_bus(adap);
581 if (err)
582 return err;
583
584 return i2c_add_numbered_adapter(adap);
585}
586EXPORT_SYMBOL(i2c_bit_add_numbered_bus);
587
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
589MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
590MODULE_LICENSE("GPL");
591
592module_param(bit_test, bool, 0);
593module_param(i2c_debug, int, S_IRUGO | S_IWUSR);
594
595MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck");
596MODULE_PARM_DESC(i2c_debug,
597 "debug level - 0 off; 1 normal; 2,3 more verbose; 9 bit-protocol");