i2c-i801.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. /*
  2. i2c-i801.c - Part of lm_sensors, Linux kernel modules for hardware
  3. monitoring
  4. Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>,
  5. Philip Edelbrock <phil@netroedge.com>, and Mark D. Studebaker
  6. <mdsxyz123@yahoo.com>
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. /*
  20. SUPPORTED DEVICES PCI ID
  21. 82801AA 2413
  22. 82801AB 2423
  23. 82801BA 2443
  24. 82801CA/CAM 2483
  25. 82801DB 24C3 (HW PEC supported, 32 byte buffer not supported)
  26. 82801EB 24D3 (HW PEC supported, 32 byte buffer not supported)
  27. 6300ESB 25A4
  28. ICH6 266A
  29. ICH7 27DA
  30. ESB2 269B
  31. ICH8 283E
  32. This driver supports several versions of Intel's I/O Controller Hubs (ICH).
  33. For SMBus support, they are similar to the PIIX4 and are part
  34. of Intel's '810' and other chipsets.
  35. See the file Documentation/i2c/busses/i2c-i801 for details.
  36. I2C Block Read and Process Call are not supported.
  37. */
  38. /* Note: we assume there can only be one I801, with one SMBus interface */
  39. #include <linux/module.h>
  40. #include <linux/pci.h>
  41. #include <linux/kernel.h>
  42. #include <linux/stddef.h>
  43. #include <linux/delay.h>
  44. #include <linux/sched.h>
  45. #include <linux/ioport.h>
  46. #include <linux/init.h>
  47. #include <linux/i2c.h>
  48. #include <asm/io.h>
  49. /* I801 SMBus address offsets */
  50. #define SMBHSTSTS (0 + i801_smba)
  51. #define SMBHSTCNT (2 + i801_smba)
  52. #define SMBHSTCMD (3 + i801_smba)
  53. #define SMBHSTADD (4 + i801_smba)
  54. #define SMBHSTDAT0 (5 + i801_smba)
  55. #define SMBHSTDAT1 (6 + i801_smba)
  56. #define SMBBLKDAT (7 + i801_smba)
  57. #define SMBPEC (8 + i801_smba) /* ICH4 only */
  58. #define SMBAUXSTS (12 + i801_smba) /* ICH4 only */
  59. #define SMBAUXCTL (13 + i801_smba) /* ICH4 only */
  60. /* PCI Address Constants */
  61. #define SMBBAR 4
  62. #define SMBHSTCFG 0x040
  63. /* Host configuration bits for SMBHSTCFG */
  64. #define SMBHSTCFG_HST_EN 1
  65. #define SMBHSTCFG_SMB_SMI_EN 2
  66. #define SMBHSTCFG_I2C_EN 4
  67. /* Other settings */
  68. #define MAX_TIMEOUT 100
  69. #define ENABLE_INT9 0 /* set to 0x01 to enable - untested */
  70. /* I801 command constants */
  71. #define I801_QUICK 0x00
  72. #define I801_BYTE 0x04
  73. #define I801_BYTE_DATA 0x08
  74. #define I801_WORD_DATA 0x0C
  75. #define I801_PROC_CALL 0x10 /* later chips only, unimplemented */
  76. #define I801_BLOCK_DATA 0x14
  77. #define I801_I2C_BLOCK_DATA 0x18 /* unimplemented */
  78. #define I801_BLOCK_LAST 0x34
  79. #define I801_I2C_BLOCK_LAST 0x38 /* unimplemented */
  80. #define I801_START 0x40
  81. #define I801_PEC_EN 0x80 /* ICH4 only */
  82. static int i801_transaction(void);
  83. static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
  84. int command, int hwpec);
  85. static unsigned long i801_smba;
  86. static struct pci_driver i801_driver;
  87. static struct pci_dev *I801_dev;
  88. static int isich4;
  89. static int i801_transaction(void)
  90. {
  91. int temp;
  92. int result = 0;
  93. int timeout = 0;
  94. dev_dbg(&I801_dev->dev, "Transaction (pre): CNT=%02x, CMD=%02x, "
  95. "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb_p(SMBHSTCNT),
  96. inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0),
  97. inb_p(SMBHSTDAT1));
  98. /* Make sure the SMBus host is ready to start transmitting */
  99. /* 0x1f = Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
  100. if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
  101. dev_dbg(&I801_dev->dev, "SMBus busy (%02x). Resetting...\n",
  102. temp);
  103. outb_p(temp, SMBHSTSTS);
  104. if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
  105. dev_dbg(&I801_dev->dev, "Failed! (%02x)\n", temp);
  106. return -1;
  107. } else {
  108. dev_dbg(&I801_dev->dev, "Successfull!\n");
  109. }
  110. }
  111. outb_p(inb(SMBHSTCNT) | I801_START, SMBHSTCNT);
  112. /* We will always wait for a fraction of a second! */
  113. do {
  114. msleep(1);
  115. temp = inb_p(SMBHSTSTS);
  116. } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
  117. /* If the SMBus is still busy, we give up */
  118. if (timeout >= MAX_TIMEOUT) {
  119. dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
  120. result = -1;
  121. }
  122. if (temp & 0x10) {
  123. result = -1;
  124. dev_dbg(&I801_dev->dev, "Error: Failed bus transaction\n");
  125. }
  126. if (temp & 0x08) {
  127. result = -1;
  128. dev_err(&I801_dev->dev, "Bus collision! SMBus may be locked "
  129. "until next hard reset. (sorry!)\n");
  130. /* Clock stops and slave is stuck in mid-transmission */
  131. }
  132. if (temp & 0x04) {
  133. result = -1;
  134. dev_dbg(&I801_dev->dev, "Error: no response!\n");
  135. }
  136. if ((inb_p(SMBHSTSTS) & 0x1f) != 0x00)
  137. outb_p(inb(SMBHSTSTS), SMBHSTSTS);
  138. if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
  139. dev_dbg(&I801_dev->dev, "Failed reset at end of transaction "
  140. "(%02x)\n", temp);
  141. }
  142. dev_dbg(&I801_dev->dev, "Transaction (post): CNT=%02x, CMD=%02x, "
  143. "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb_p(SMBHSTCNT),
  144. inb_p(SMBHSTCMD), inb_p(SMBHSTADD), inb_p(SMBHSTDAT0),
  145. inb_p(SMBHSTDAT1));
  146. return result;
  147. }
  148. /* All-inclusive block transaction function */
  149. static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
  150. int command, int hwpec)
  151. {
  152. int i, len;
  153. int smbcmd;
  154. int temp;
  155. int result = 0;
  156. int timeout;
  157. unsigned char hostc, errmask;
  158. if (command == I2C_SMBUS_I2C_BLOCK_DATA) {
  159. if (read_write == I2C_SMBUS_WRITE) {
  160. /* set I2C_EN bit in configuration register */
  161. pci_read_config_byte(I801_dev, SMBHSTCFG, &hostc);
  162. pci_write_config_byte(I801_dev, SMBHSTCFG,
  163. hostc | SMBHSTCFG_I2C_EN);
  164. } else {
  165. dev_err(&I801_dev->dev,
  166. "I2C_SMBUS_I2C_BLOCK_READ not DB!\n");
  167. return -1;
  168. }
  169. }
  170. if (read_write == I2C_SMBUS_WRITE) {
  171. len = data->block[0];
  172. if (len < 1)
  173. len = 1;
  174. if (len > 32)
  175. len = 32;
  176. outb_p(len, SMBHSTDAT0);
  177. outb_p(data->block[1], SMBBLKDAT);
  178. } else {
  179. len = 32; /* max for reads */
  180. }
  181. if(isich4 && command != I2C_SMBUS_I2C_BLOCK_DATA) {
  182. /* set 32 byte buffer */
  183. }
  184. for (i = 1; i <= len; i++) {
  185. if (i == len && read_write == I2C_SMBUS_READ)
  186. smbcmd = I801_BLOCK_LAST;
  187. else
  188. smbcmd = I801_BLOCK_DATA;
  189. outb_p(smbcmd | ENABLE_INT9, SMBHSTCNT);
  190. dev_dbg(&I801_dev->dev, "Block (pre %d): CNT=%02x, CMD=%02x, "
  191. "ADD=%02x, DAT0=%02x, BLKDAT=%02x\n", i,
  192. inb_p(SMBHSTCNT), inb_p(SMBHSTCMD), inb_p(SMBHSTADD),
  193. inb_p(SMBHSTDAT0), inb_p(SMBBLKDAT));
  194. /* Make sure the SMBus host is ready to start transmitting */
  195. temp = inb_p(SMBHSTSTS);
  196. if (i == 1) {
  197. /* Erronenous conditions before transaction:
  198. * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
  199. errmask=0x9f;
  200. } else {
  201. /* Erronenous conditions during transaction:
  202. * Failed, Bus_Err, Dev_Err, Intr */
  203. errmask=0x1e;
  204. }
  205. if (temp & errmask) {
  206. dev_dbg(&I801_dev->dev, "SMBus busy (%02x). "
  207. "Resetting...\n", temp);
  208. outb_p(temp, SMBHSTSTS);
  209. if (((temp = inb_p(SMBHSTSTS)) & errmask) != 0x00) {
  210. dev_err(&I801_dev->dev,
  211. "Reset failed! (%02x)\n", temp);
  212. result = -1;
  213. goto END;
  214. }
  215. if (i != 1) {
  216. /* if die in middle of block transaction, fail */
  217. result = -1;
  218. goto END;
  219. }
  220. }
  221. if (i == 1)
  222. outb_p(inb(SMBHSTCNT) | I801_START, SMBHSTCNT);
  223. /* We will always wait for a fraction of a second! */
  224. timeout = 0;
  225. do {
  226. msleep(1);
  227. temp = inb_p(SMBHSTSTS);
  228. }
  229. while ((!(temp & 0x80))
  230. && (timeout++ < MAX_TIMEOUT));
  231. /* If the SMBus is still busy, we give up */
  232. if (timeout >= MAX_TIMEOUT) {
  233. result = -1;
  234. dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
  235. }
  236. if (temp & 0x10) {
  237. result = -1;
  238. dev_dbg(&I801_dev->dev,
  239. "Error: Failed bus transaction\n");
  240. } else if (temp & 0x08) {
  241. result = -1;
  242. dev_err(&I801_dev->dev, "Bus collision!\n");
  243. } else if (temp & 0x04) {
  244. result = -1;
  245. dev_dbg(&I801_dev->dev, "Error: no response!\n");
  246. }
  247. if (i == 1 && read_write == I2C_SMBUS_READ) {
  248. len = inb_p(SMBHSTDAT0);
  249. if (len < 1)
  250. len = 1;
  251. if (len > 32)
  252. len = 32;
  253. data->block[0] = len;
  254. }
  255. /* Retrieve/store value in SMBBLKDAT */
  256. if (read_write == I2C_SMBUS_READ)
  257. data->block[i] = inb_p(SMBBLKDAT);
  258. if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
  259. outb_p(data->block[i+1], SMBBLKDAT);
  260. if ((temp & 0x9e) != 0x00)
  261. outb_p(temp, SMBHSTSTS); /* signals SMBBLKDAT ready */
  262. if ((temp = (0x1e & inb_p(SMBHSTSTS))) != 0x00) {
  263. dev_dbg(&I801_dev->dev,
  264. "Bad status (%02x) at end of transaction\n",
  265. temp);
  266. }
  267. dev_dbg(&I801_dev->dev, "Block (post %d): CNT=%02x, CMD=%02x, "
  268. "ADD=%02x, DAT0=%02x, BLKDAT=%02x\n", i,
  269. inb_p(SMBHSTCNT), inb_p(SMBHSTCMD), inb_p(SMBHSTADD),
  270. inb_p(SMBHSTDAT0), inb_p(SMBBLKDAT));
  271. if (result < 0)
  272. goto END;
  273. }
  274. if (hwpec) {
  275. /* wait for INTR bit as advised by Intel */
  276. timeout = 0;
  277. do {
  278. msleep(1);
  279. temp = inb_p(SMBHSTSTS);
  280. } while ((!(temp & 0x02))
  281. && (timeout++ < MAX_TIMEOUT));
  282. if (timeout >= MAX_TIMEOUT) {
  283. dev_dbg(&I801_dev->dev, "PEC Timeout!\n");
  284. }
  285. outb_p(temp, SMBHSTSTS);
  286. }
  287. result = 0;
  288. END:
  289. if (command == I2C_SMBUS_I2C_BLOCK_DATA) {
  290. /* restore saved configuration register value */
  291. pci_write_config_byte(I801_dev, SMBHSTCFG, hostc);
  292. }
  293. return result;
  294. }
  295. /* Return -1 on error. */
  296. static s32 i801_access(struct i2c_adapter * adap, u16 addr,
  297. unsigned short flags, char read_write, u8 command,
  298. int size, union i2c_smbus_data * data)
  299. {
  300. int hwpec;
  301. int block = 0;
  302. int ret, xact = 0;
  303. hwpec = isich4 && (flags & I2C_CLIENT_PEC)
  304. && size != I2C_SMBUS_QUICK
  305. && size != I2C_SMBUS_I2C_BLOCK_DATA;
  306. switch (size) {
  307. case I2C_SMBUS_QUICK:
  308. outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
  309. SMBHSTADD);
  310. xact = I801_QUICK;
  311. break;
  312. case I2C_SMBUS_BYTE:
  313. outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
  314. SMBHSTADD);
  315. if (read_write == I2C_SMBUS_WRITE)
  316. outb_p(command, SMBHSTCMD);
  317. xact = I801_BYTE;
  318. break;
  319. case I2C_SMBUS_BYTE_DATA:
  320. outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
  321. SMBHSTADD);
  322. outb_p(command, SMBHSTCMD);
  323. if (read_write == I2C_SMBUS_WRITE)
  324. outb_p(data->byte, SMBHSTDAT0);
  325. xact = I801_BYTE_DATA;
  326. break;
  327. case I2C_SMBUS_WORD_DATA:
  328. outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
  329. SMBHSTADD);
  330. outb_p(command, SMBHSTCMD);
  331. if (read_write == I2C_SMBUS_WRITE) {
  332. outb_p(data->word & 0xff, SMBHSTDAT0);
  333. outb_p((data->word & 0xff00) >> 8, SMBHSTDAT1);
  334. }
  335. xact = I801_WORD_DATA;
  336. break;
  337. case I2C_SMBUS_BLOCK_DATA:
  338. case I2C_SMBUS_I2C_BLOCK_DATA:
  339. outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
  340. SMBHSTADD);
  341. outb_p(command, SMBHSTCMD);
  342. block = 1;
  343. break;
  344. case I2C_SMBUS_PROC_CALL:
  345. default:
  346. dev_err(&I801_dev->dev, "Unsupported transaction %d\n", size);
  347. return -1;
  348. }
  349. outb_p(hwpec, SMBAUXCTL); /* enable/disable hardware PEC */
  350. if(block)
  351. ret = i801_block_transaction(data, read_write, size, hwpec);
  352. else {
  353. outb_p(xact | ENABLE_INT9, SMBHSTCNT);
  354. ret = i801_transaction();
  355. }
  356. /* Some BIOSes don't like it when PEC is enabled at reboot or resume
  357. time, so we forcibly disable it after every transaction. */
  358. if (hwpec)
  359. outb_p(0, SMBAUXCTL);
  360. if(block)
  361. return ret;
  362. if(ret)
  363. return -1;
  364. if ((read_write == I2C_SMBUS_WRITE) || (xact == I801_QUICK))
  365. return 0;
  366. switch (xact & 0x7f) {
  367. case I801_BYTE: /* Result put in SMBHSTDAT0 */
  368. case I801_BYTE_DATA:
  369. data->byte = inb_p(SMBHSTDAT0);
  370. break;
  371. case I801_WORD_DATA:
  372. data->word = inb_p(SMBHSTDAT0) + (inb_p(SMBHSTDAT1) << 8);
  373. break;
  374. }
  375. return 0;
  376. }
  377. static u32 i801_func(struct i2c_adapter *adapter)
  378. {
  379. return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
  380. I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
  381. I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
  382. | (isich4 ? I2C_FUNC_SMBUS_HWPEC_CALC : 0);
  383. }
  384. static const struct i2c_algorithm smbus_algorithm = {
  385. .smbus_xfer = i801_access,
  386. .functionality = i801_func,
  387. };
  388. static struct i2c_adapter i801_adapter = {
  389. .owner = THIS_MODULE,
  390. .class = I2C_CLASS_HWMON,
  391. .algo = &smbus_algorithm,
  392. };
  393. static struct pci_device_id i801_ids[] = {
  394. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) },
  395. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) },
  396. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) },
  397. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_3) },
  398. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_3) },
  399. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_3) },
  400. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_4) },
  401. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_16) },
  402. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_17) },
  403. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_17) },
  404. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) },
  405. { 0, }
  406. };
  407. MODULE_DEVICE_TABLE (pci, i801_ids);
  408. static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
  409. {
  410. unsigned char temp;
  411. int err;
  412. I801_dev = dev;
  413. if ((dev->device == PCI_DEVICE_ID_INTEL_82801DB_3) ||
  414. (dev->device == PCI_DEVICE_ID_INTEL_82801EB_3) ||
  415. (dev->device == PCI_DEVICE_ID_INTEL_ESB_4))
  416. isich4 = 1;
  417. else
  418. isich4 = 0;
  419. err = pci_enable_device(dev);
  420. if (err) {
  421. dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n",
  422. err);
  423. goto exit;
  424. }
  425. /* Determine the address of the SMBus area */
  426. i801_smba = pci_resource_start(dev, SMBBAR);
  427. if (!i801_smba) {
  428. dev_err(&dev->dev, "SMBus base address uninitialized, "
  429. "upgrade BIOS\n");
  430. err = -ENODEV;
  431. goto exit;
  432. }
  433. err = pci_request_region(dev, SMBBAR, i801_driver.name);
  434. if (err) {
  435. dev_err(&dev->dev, "Failed to request SMBus region "
  436. "0x%lx-0x%Lx\n", i801_smba,
  437. (unsigned long long)pci_resource_end(dev, SMBBAR));
  438. goto exit;
  439. }
  440. pci_read_config_byte(I801_dev, SMBHSTCFG, &temp);
  441. temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */
  442. if (!(temp & SMBHSTCFG_HST_EN)) {
  443. dev_info(&dev->dev, "Enabling SMBus device\n");
  444. temp |= SMBHSTCFG_HST_EN;
  445. }
  446. pci_write_config_byte(I801_dev, SMBHSTCFG, temp);
  447. if (temp & SMBHSTCFG_SMB_SMI_EN)
  448. dev_dbg(&dev->dev, "SMBus using interrupt SMI#\n");
  449. else
  450. dev_dbg(&dev->dev, "SMBus using PCI Interrupt\n");
  451. /* set up the driverfs linkage to our parent device */
  452. i801_adapter.dev.parent = &dev->dev;
  453. snprintf(i801_adapter.name, I2C_NAME_SIZE,
  454. "SMBus I801 adapter at %04lx", i801_smba);
  455. err = i2c_add_adapter(&i801_adapter);
  456. if (err) {
  457. dev_err(&dev->dev, "Failed to add SMBus adapter\n");
  458. goto exit_release;
  459. }
  460. return 0;
  461. exit_release:
  462. pci_release_region(dev, SMBBAR);
  463. exit:
  464. return err;
  465. }
  466. static void __devexit i801_remove(struct pci_dev *dev)
  467. {
  468. i2c_del_adapter(&i801_adapter);
  469. pci_release_region(dev, SMBBAR);
  470. /*
  471. * do not call pci_disable_device(dev) since it can cause hard hangs on
  472. * some systems during power-off (eg. Fujitsu-Siemens Lifebook E8010)
  473. */
  474. }
  475. static struct pci_driver i801_driver = {
  476. .name = "i801_smbus",
  477. .id_table = i801_ids,
  478. .probe = i801_probe,
  479. .remove = __devexit_p(i801_remove),
  480. };
  481. static int __init i2c_i801_init(void)
  482. {
  483. return pci_register_driver(&i801_driver);
  484. }
  485. static void __exit i2c_i801_exit(void)
  486. {
  487. pci_unregister_driver(&i801_driver);
  488. }
  489. MODULE_AUTHOR ("Frodo Looijaard <frodol@dds.nl>, "
  490. "Philip Edelbrock <phil@netroedge.com>, "
  491. "and Mark D. Studebaker <mdsxyz123@yahoo.com>");
  492. MODULE_DESCRIPTION("I801 SMBus driver");
  493. MODULE_LICENSE("GPL");
  494. module_init(i2c_i801_init);
  495. module_exit(i2c_i801_exit);