i2c-algo-bit.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /* -------------------------------------------------------------------------
  2. * i2c-algo-bit.c i2c driver algorithms for bit-shift adapters
  3. * -------------------------------------------------------------------------
  4. * Copyright (C) 1995-2000 Simon G. Vogl
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. * ------------------------------------------------------------------------- */
  17. /* With some changes from Frodo Looijaard <frodol@dds.nl>, Kyösti Mälkki
  18. <kmalkki@cc.hut.fi> and Jean Delvare <khali@linux-fr.org> */
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include <linux/delay.h>
  22. #include <linux/init.h>
  23. #include <linux/errno.h>
  24. #include <linux/sched.h>
  25. #include <linux/i2c.h>
  26. #include <linux/i2c-algo-bit.h>
  27. /* ----- global defines ----------------------------------------------- */
  28. #ifdef DEBUG
  29. #define bit_dbg(level, dev, format, args...) \
  30. do { \
  31. if (i2c_debug >= level) \
  32. dev_dbg(dev, format, ##args); \
  33. } while (0)
  34. #else
  35. #define bit_dbg(level, dev, format, args...) \
  36. do {} while (0)
  37. #endif /* DEBUG */
  38. /* ----- global variables --------------------------------------------- */
  39. static int bit_test; /* see if the line-setting functions work */
  40. module_param(bit_test, bool, 0);
  41. MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck");
  42. #ifdef DEBUG
  43. static int i2c_debug = 1;
  44. module_param(i2c_debug, int, S_IRUGO | S_IWUSR);
  45. MODULE_PARM_DESC(i2c_debug,
  46. "debug level - 0 off; 1 normal; 2 verbose; 3 very verbose");
  47. #endif
  48. /* --- setting states on the bus with the right timing: --------------- */
  49. #define setsda(adap, val) adap->setsda(adap->data, val)
  50. #define setscl(adap, val) adap->setscl(adap->data, val)
  51. #define getsda(adap) adap->getsda(adap->data)
  52. #define getscl(adap) adap->getscl(adap->data)
  53. static inline void sdalo(struct i2c_algo_bit_data *adap)
  54. {
  55. setsda(adap, 0);
  56. udelay((adap->udelay + 1) / 2);
  57. }
  58. static inline void sdahi(struct i2c_algo_bit_data *adap)
  59. {
  60. setsda(adap, 1);
  61. udelay((adap->udelay + 1) / 2);
  62. }
  63. static inline void scllo(struct i2c_algo_bit_data *adap)
  64. {
  65. setscl(adap, 0);
  66. udelay(adap->udelay / 2);
  67. }
  68. /*
  69. * Raise scl line, and do checking for delays. This is necessary for slower
  70. * devices.
  71. */
  72. static int sclhi(struct i2c_algo_bit_data *adap)
  73. {
  74. unsigned long start;
  75. setscl(adap, 1);
  76. /* Not all adapters have scl sense line... */
  77. if (!adap->getscl)
  78. goto done;
  79. start = jiffies;
  80. while (!getscl(adap)) {
  81. /* This hw knows how to read the clock line, so we wait
  82. * until it actually gets high. This is safer as some
  83. * chips may hold it low ("clock stretching") while they
  84. * are processing data internally.
  85. */
  86. if (time_after(jiffies, start + adap->timeout))
  87. return -ETIMEDOUT;
  88. cond_resched();
  89. }
  90. #ifdef DEBUG
  91. if (jiffies != start && i2c_debug >= 3)
  92. pr_debug("i2c-algo-bit: needed %ld jiffies for SCL to go "
  93. "high\n", jiffies - start);
  94. #endif
  95. done:
  96. udelay(adap->udelay);
  97. return 0;
  98. }
  99. /* --- other auxiliary functions -------------------------------------- */
  100. static void i2c_start(struct i2c_algo_bit_data *adap)
  101. {
  102. /* assert: scl, sda are high */
  103. setsda(adap, 0);
  104. udelay(adap->udelay);
  105. scllo(adap);
  106. }
  107. static void i2c_repstart(struct i2c_algo_bit_data *adap)
  108. {
  109. /* assert: scl is low */
  110. sdahi(adap);
  111. sclhi(adap);
  112. setsda(adap, 0);
  113. udelay(adap->udelay);
  114. scllo(adap);
  115. }
  116. static void i2c_stop(struct i2c_algo_bit_data *adap)
  117. {
  118. /* assert: scl is low */
  119. sdalo(adap);
  120. sclhi(adap);
  121. setsda(adap, 1);
  122. udelay(adap->udelay);
  123. }
  124. /* send a byte without start cond., look for arbitration,
  125. check ackn. from slave */
  126. /* returns:
  127. * 1 if the device acknowledged
  128. * 0 if the device did not ack
  129. * -ETIMEDOUT if an error occurred (while raising the scl line)
  130. */
  131. static int i2c_outb(struct i2c_adapter *i2c_adap, unsigned char c)
  132. {
  133. int i;
  134. int sb;
  135. int ack;
  136. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  137. /* assert: scl is low */
  138. for (i = 7; i >= 0; i--) {
  139. sb = (c >> i) & 1;
  140. setsda(adap, sb);
  141. udelay((adap->udelay + 1) / 2);
  142. if (sclhi(adap) < 0) { /* timed out */
  143. bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, "
  144. "timeout at bit #%d\n", (int)c, i);
  145. return -ETIMEDOUT;
  146. }
  147. /* FIXME do arbitration here:
  148. * if (sb && !getsda(adap)) -> ouch! Get out of here.
  149. *
  150. * Report a unique code, so higher level code can retry
  151. * the whole (combined) message and *NOT* issue STOP.
  152. */
  153. scllo(adap);
  154. }
  155. sdahi(adap);
  156. if (sclhi(adap) < 0) { /* timeout */
  157. bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, "
  158. "timeout at ack\n", (int)c);
  159. return -ETIMEDOUT;
  160. }
  161. /* read ack: SDA should be pulled down by slave, or it may
  162. * NAK (usually to report problems with the data we wrote).
  163. */
  164. ack = !getsda(adap); /* ack: sda is pulled low -> success */
  165. bit_dbg(2, &i2c_adap->dev, "i2c_outb: 0x%02x %s\n", (int)c,
  166. ack ? "A" : "NA");
  167. scllo(adap);
  168. return ack;
  169. /* assert: scl is low (sda undef) */
  170. }
  171. static int i2c_inb(struct i2c_adapter *i2c_adap)
  172. {
  173. /* read byte via i2c port, without start/stop sequence */
  174. /* acknowledge is sent in i2c_read. */
  175. int i;
  176. unsigned char indata = 0;
  177. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  178. /* assert: scl is low */
  179. sdahi(adap);
  180. for (i = 0; i < 8; i++) {
  181. if (sclhi(adap) < 0) { /* timeout */
  182. bit_dbg(1, &i2c_adap->dev, "i2c_inb: timeout at bit "
  183. "#%d\n", 7 - i);
  184. return -ETIMEDOUT;
  185. }
  186. indata *= 2;
  187. if (getsda(adap))
  188. indata |= 0x01;
  189. setscl(adap, 0);
  190. udelay(i == 7 ? adap->udelay / 2 : adap->udelay);
  191. }
  192. /* assert: scl is low */
  193. return indata;
  194. }
  195. /*
  196. * Sanity check for the adapter hardware - check the reaction of
  197. * the bus lines only if it seems to be idle.
  198. */
  199. static int test_bus(struct i2c_algo_bit_data *adap, char *name)
  200. {
  201. int scl, sda;
  202. if (adap->getscl == NULL)
  203. pr_info("%s: Testing SDA only, SCL is not readable\n", name);
  204. sda = getsda(adap);
  205. scl = (adap->getscl == NULL) ? 1 : getscl(adap);
  206. if (!scl || !sda) {
  207. printk(KERN_WARNING "%s: bus seems to be busy\n", name);
  208. goto bailout;
  209. }
  210. sdalo(adap);
  211. sda = getsda(adap);
  212. scl = (adap->getscl == NULL) ? 1 : getscl(adap);
  213. if (sda) {
  214. printk(KERN_WARNING "%s: SDA stuck high!\n", name);
  215. goto bailout;
  216. }
  217. if (!scl) {
  218. printk(KERN_WARNING "%s: SCL unexpected low "
  219. "while pulling SDA low!\n", name);
  220. goto bailout;
  221. }
  222. sdahi(adap);
  223. sda = getsda(adap);
  224. scl = (adap->getscl == NULL) ? 1 : getscl(adap);
  225. if (!sda) {
  226. printk(KERN_WARNING "%s: SDA stuck low!\n", name);
  227. goto bailout;
  228. }
  229. if (!scl) {
  230. printk(KERN_WARNING "%s: SCL unexpected low "
  231. "while pulling SDA high!\n", name);
  232. goto bailout;
  233. }
  234. scllo(adap);
  235. sda = getsda(adap);
  236. scl = (adap->getscl == NULL) ? 0 : getscl(adap);
  237. if (scl) {
  238. printk(KERN_WARNING "%s: SCL stuck high!\n", name);
  239. goto bailout;
  240. }
  241. if (!sda) {
  242. printk(KERN_WARNING "%s: SDA unexpected low "
  243. "while pulling SCL low!\n", name);
  244. goto bailout;
  245. }
  246. sclhi(adap);
  247. sda = getsda(adap);
  248. scl = (adap->getscl == NULL) ? 1 : getscl(adap);
  249. if (!scl) {
  250. printk(KERN_WARNING "%s: SCL stuck low!\n", name);
  251. goto bailout;
  252. }
  253. if (!sda) {
  254. printk(KERN_WARNING "%s: SDA unexpected low "
  255. "while pulling SCL high!\n", name);
  256. goto bailout;
  257. }
  258. pr_info("%s: Test OK\n", name);
  259. return 0;
  260. bailout:
  261. sdahi(adap);
  262. sclhi(adap);
  263. return -ENODEV;
  264. }
  265. /* ----- Utility functions
  266. */
  267. /* try_address tries to contact a chip for a number of
  268. * times before it gives up.
  269. * return values:
  270. * 1 chip answered
  271. * 0 chip did not answer
  272. * -x transmission error
  273. */
  274. static int try_address(struct i2c_adapter *i2c_adap,
  275. unsigned char addr, int retries)
  276. {
  277. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  278. int i, ret = 0;
  279. for (i = 0; i <= retries; i++) {
  280. ret = i2c_outb(i2c_adap, addr);
  281. if (ret == 1 || i == retries)
  282. break;
  283. bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
  284. i2c_stop(adap);
  285. udelay(adap->udelay);
  286. yield();
  287. bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
  288. i2c_start(adap);
  289. }
  290. if (i && ret)
  291. bit_dbg(1, &i2c_adap->dev, "Used %d tries to %s client at "
  292. "0x%02x: %s\n", i + 1,
  293. addr & 1 ? "read from" : "write to", addr >> 1,
  294. ret == 1 ? "success" : "failed, timeout?");
  295. return ret;
  296. }
  297. static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
  298. {
  299. const unsigned char *temp = msg->buf;
  300. int count = msg->len;
  301. unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
  302. int retval;
  303. int wrcount = 0;
  304. while (count > 0) {
  305. retval = i2c_outb(i2c_adap, *temp);
  306. /* OK/ACK; or ignored NAK */
  307. if ((retval > 0) || (nak_ok && (retval == 0))) {
  308. count--;
  309. temp++;
  310. wrcount++;
  311. /* A slave NAKing the master means the slave didn't like
  312. * something about the data it saw. For example, maybe
  313. * the SMBus PEC was wrong.
  314. */
  315. } else if (retval == 0) {
  316. dev_err(&i2c_adap->dev, "sendbytes: NAK bailout.\n");
  317. return -EIO;
  318. /* Timeout; or (someday) lost arbitration
  319. *
  320. * FIXME Lost ARB implies retrying the transaction from
  321. * the first message, after the "winning" master issues
  322. * its STOP. As a rule, upper layer code has no reason
  323. * to know or care about this ... it is *NOT* an error.
  324. */
  325. } else {
  326. dev_err(&i2c_adap->dev, "sendbytes: error %d\n",
  327. retval);
  328. return retval;
  329. }
  330. }
  331. return wrcount;
  332. }
  333. static int acknak(struct i2c_adapter *i2c_adap, int is_ack)
  334. {
  335. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  336. /* assert: sda is high */
  337. if (is_ack) /* send ack */
  338. setsda(adap, 0);
  339. udelay((adap->udelay + 1) / 2);
  340. if (sclhi(adap) < 0) { /* timeout */
  341. dev_err(&i2c_adap->dev, "readbytes: ack/nak timeout\n");
  342. return -ETIMEDOUT;
  343. }
  344. scllo(adap);
  345. return 0;
  346. }
  347. static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
  348. {
  349. int inval;
  350. int rdcount = 0; /* counts bytes read */
  351. unsigned char *temp = msg->buf;
  352. int count = msg->len;
  353. const unsigned flags = msg->flags;
  354. while (count > 0) {
  355. inval = i2c_inb(i2c_adap);
  356. if (inval >= 0) {
  357. *temp = inval;
  358. rdcount++;
  359. } else { /* read timed out */
  360. break;
  361. }
  362. temp++;
  363. count--;
  364. /* Some SMBus transactions require that we receive the
  365. transaction length as the first read byte. */
  366. if (rdcount == 1 && (flags & I2C_M_RECV_LEN)) {
  367. if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) {
  368. if (!(flags & I2C_M_NO_RD_ACK))
  369. acknak(i2c_adap, 0);
  370. dev_err(&i2c_adap->dev, "readbytes: invalid "
  371. "block length (%d)\n", inval);
  372. return -EREMOTEIO;
  373. }
  374. /* The original count value accounts for the extra
  375. bytes, that is, either 1 for a regular transaction,
  376. or 2 for a PEC transaction. */
  377. count += inval;
  378. msg->len += inval;
  379. }
  380. bit_dbg(2, &i2c_adap->dev, "readbytes: 0x%02x %s\n",
  381. inval,
  382. (flags & I2C_M_NO_RD_ACK)
  383. ? "(no ack/nak)"
  384. : (count ? "A" : "NA"));
  385. if (!(flags & I2C_M_NO_RD_ACK)) {
  386. inval = acknak(i2c_adap, count);
  387. if (inval < 0)
  388. return inval;
  389. }
  390. }
  391. return rdcount;
  392. }
  393. /* doAddress initiates the transfer by generating the start condition (in
  394. * try_address) and transmits the address in the necessary format to handle
  395. * reads, writes as well as 10bit-addresses.
  396. * returns:
  397. * 0 everything went okay, the chip ack'ed, or IGNORE_NAK flag was set
  398. * -x an error occurred (like: -EREMOTEIO if the device did not answer, or
  399. * -ETIMEDOUT, for example if the lines are stuck...)
  400. */
  401. static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
  402. {
  403. unsigned short flags = msg->flags;
  404. unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
  405. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  406. unsigned char addr;
  407. int ret, retries;
  408. retries = nak_ok ? 0 : i2c_adap->retries;
  409. if (flags & I2C_M_TEN) {
  410. /* a ten bit address */
  411. addr = 0xf0 | ((msg->addr >> 7) & 0x03);
  412. bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr);
  413. /* try extended address code...*/
  414. ret = try_address(i2c_adap, addr, retries);
  415. if ((ret != 1) && !nak_ok) {
  416. dev_err(&i2c_adap->dev,
  417. "died at extended address code\n");
  418. return -EREMOTEIO;
  419. }
  420. /* the remaining 8 bit address */
  421. ret = i2c_outb(i2c_adap, msg->addr & 0x7f);
  422. if ((ret != 1) && !nak_ok) {
  423. /* the chip did not ack / xmission error occurred */
  424. dev_err(&i2c_adap->dev, "died at 2nd address code\n");
  425. return -EREMOTEIO;
  426. }
  427. if (flags & I2C_M_RD) {
  428. bit_dbg(3, &i2c_adap->dev, "emitting repeated "
  429. "start condition\n");
  430. i2c_repstart(adap);
  431. /* okay, now switch into reading mode */
  432. addr |= 0x01;
  433. ret = try_address(i2c_adap, addr, retries);
  434. if ((ret != 1) && !nak_ok) {
  435. dev_err(&i2c_adap->dev,
  436. "died at repeated address code\n");
  437. return -EREMOTEIO;
  438. }
  439. }
  440. } else { /* normal 7bit address */
  441. addr = msg->addr << 1;
  442. if (flags & I2C_M_RD)
  443. addr |= 1;
  444. if (flags & I2C_M_REV_DIR_ADDR)
  445. addr ^= 1;
  446. ret = try_address(i2c_adap, addr, retries);
  447. if ((ret != 1) && !nak_ok)
  448. return -ENXIO;
  449. }
  450. return 0;
  451. }
  452. static int bit_xfer(struct i2c_adapter *i2c_adap,
  453. struct i2c_msg msgs[], int num)
  454. {
  455. struct i2c_msg *pmsg;
  456. struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
  457. int i, ret;
  458. unsigned short nak_ok;
  459. if (adap->pre_xfer) {
  460. ret = adap->pre_xfer(i2c_adap);
  461. if (ret < 0)
  462. return ret;
  463. }
  464. bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
  465. i2c_start(adap);
  466. for (i = 0; i < num; i++) {
  467. pmsg = &msgs[i];
  468. nak_ok = pmsg->flags & I2C_M_IGNORE_NAK;
  469. if (!(pmsg->flags & I2C_M_NOSTART)) {
  470. if (i) {
  471. bit_dbg(3, &i2c_adap->dev, "emitting "
  472. "repeated start condition\n");
  473. i2c_repstart(adap);
  474. }
  475. ret = bit_doAddress(i2c_adap, pmsg);
  476. if ((ret != 0) && !nak_ok) {
  477. bit_dbg(1, &i2c_adap->dev, "NAK from "
  478. "device addr 0x%02x msg #%d\n",
  479. msgs[i].addr, i);
  480. goto bailout;
  481. }
  482. }
  483. if (pmsg->flags & I2C_M_RD) {
  484. /* read bytes into buffer*/
  485. ret = readbytes(i2c_adap, pmsg);
  486. if (ret >= 1)
  487. bit_dbg(2, &i2c_adap->dev, "read %d byte%s\n",
  488. ret, ret == 1 ? "" : "s");
  489. if (ret < pmsg->len) {
  490. if (ret >= 0)
  491. ret = -EREMOTEIO;
  492. goto bailout;
  493. }
  494. } else {
  495. /* write bytes from buffer */
  496. ret = sendbytes(i2c_adap, pmsg);
  497. if (ret >= 1)
  498. bit_dbg(2, &i2c_adap->dev, "wrote %d byte%s\n",
  499. ret, ret == 1 ? "" : "s");
  500. if (ret < pmsg->len) {
  501. if (ret >= 0)
  502. ret = -EREMOTEIO;
  503. goto bailout;
  504. }
  505. }
  506. }
  507. ret = i;
  508. bailout:
  509. bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
  510. i2c_stop(adap);
  511. if (adap->post_xfer)
  512. adap->post_xfer(i2c_adap);
  513. return ret;
  514. }
  515. static u32 bit_func(struct i2c_adapter *adap)
  516. {
  517. return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
  518. I2C_FUNC_SMBUS_READ_BLOCK_DATA |
  519. I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
  520. I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
  521. }
  522. /* -----exported algorithm data: ------------------------------------- */
  523. static const struct i2c_algorithm i2c_bit_algo = {
  524. .master_xfer = bit_xfer,
  525. .functionality = bit_func,
  526. };
  527. /*
  528. * registering functions to load algorithms at runtime
  529. */
  530. static int __i2c_bit_add_bus(struct i2c_adapter *adap,
  531. int (*add_adapter)(struct i2c_adapter *))
  532. {
  533. struct i2c_algo_bit_data *bit_adap = adap->algo_data;
  534. int ret;
  535. if (bit_test) {
  536. ret = test_bus(bit_adap, adap->name);
  537. if (ret < 0)
  538. return -ENODEV;
  539. }
  540. /* register new adapter to i2c module... */
  541. adap->algo = &i2c_bit_algo;
  542. adap->retries = 3;
  543. ret = add_adapter(adap);
  544. if (ret < 0)
  545. return ret;
  546. /* Complain if SCL can't be read */
  547. if (bit_adap->getscl == NULL) {
  548. dev_warn(&adap->dev, "Not I2C compliant: can't read SCL\n");
  549. dev_warn(&adap->dev, "Bus may be unreliable\n");
  550. }
  551. return 0;
  552. }
  553. int i2c_bit_add_bus(struct i2c_adapter *adap)
  554. {
  555. return __i2c_bit_add_bus(adap, i2c_add_adapter);
  556. }
  557. EXPORT_SYMBOL(i2c_bit_add_bus);
  558. int i2c_bit_add_numbered_bus(struct i2c_adapter *adap)
  559. {
  560. return __i2c_bit_add_bus(adap, i2c_add_numbered_adapter);
  561. }
  562. EXPORT_SYMBOL(i2c_bit_add_numbered_bus);
  563. MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
  564. MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
  565. MODULE_LICENSE("GPL");