/drivers/char/i8k.c

https://bitbucket.org/evzijst/gittest · C · 788 lines · 559 code · 114 blank · 115 comment · 91 complexity · 74486b5afb7eaee4ae94c61d66927c4d MD5 · raw file

  1. /*
  2. * i8k.c -- Linux driver for accessing the SMM BIOS on Dell laptops.
  3. * See http://www.debian.org/~dz/i8k/ for more information
  4. * and for latest version of this driver.
  5. *
  6. * Copyright (C) 2001 Massimo Dal Zotto <dz@debian.org>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2, or (at your option) any
  11. * later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #include <linux/module.h>
  19. #include <linux/types.h>
  20. #include <linux/init.h>
  21. #include <linux/proc_fs.h>
  22. #include <linux/apm_bios.h>
  23. #include <asm/uaccess.h>
  24. #include <asm/io.h>
  25. #include <linux/i8k.h>
  26. #define I8K_VERSION "1.13 14/05/2002"
  27. #define I8K_SMM_FN_STATUS 0x0025
  28. #define I8K_SMM_POWER_STATUS 0x0069
  29. #define I8K_SMM_SET_FAN 0x01a3
  30. #define I8K_SMM_GET_FAN 0x00a3
  31. #define I8K_SMM_GET_SPEED 0x02a3
  32. #define I8K_SMM_GET_TEMP 0x10a3
  33. #define I8K_SMM_GET_DELL_SIG 0xffa3
  34. #define I8K_SMM_BIOS_VERSION 0x00a6
  35. #define I8K_FAN_MULT 30
  36. #define I8K_MAX_TEMP 127
  37. #define I8K_FN_NONE 0x00
  38. #define I8K_FN_UP 0x01
  39. #define I8K_FN_DOWN 0x02
  40. #define I8K_FN_MUTE 0x04
  41. #define I8K_FN_MASK 0x07
  42. #define I8K_FN_SHIFT 8
  43. #define I8K_POWER_AC 0x05
  44. #define I8K_POWER_BATTERY 0x01
  45. #define I8K_TEMPERATURE_BUG 1
  46. #define DELL_SIGNATURE "Dell Computer"
  47. static char *supported_models[] = {
  48. "Inspiron",
  49. "Latitude",
  50. NULL
  51. };
  52. static char system_vendor[48] = "?";
  53. static char product_name [48] = "?";
  54. static char bios_version [4] = "?";
  55. static char serial_number[16] = "?";
  56. MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
  57. MODULE_DESCRIPTION("Driver for accessing SMM BIOS on Dell laptops");
  58. MODULE_LICENSE("GPL");
  59. static int force;
  60. module_param(force, bool, 0);
  61. MODULE_PARM_DESC(force, "Force loading without checking for supported models");
  62. static int restricted;
  63. module_param(restricted, bool, 0);
  64. MODULE_PARM_DESC(restricted, "Allow fan control if SYS_ADMIN capability set");
  65. static int power_status;
  66. module_param(power_status, bool, 0600);
  67. MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
  68. static ssize_t i8k_read(struct file *, char __user *, size_t, loff_t *);
  69. static int i8k_ioctl(struct inode *, struct file *, unsigned int,
  70. unsigned long);
  71. static struct file_operations i8k_fops = {
  72. .read = i8k_read,
  73. .ioctl = i8k_ioctl,
  74. };
  75. typedef struct {
  76. unsigned int eax;
  77. unsigned int ebx __attribute__ ((packed));
  78. unsigned int ecx __attribute__ ((packed));
  79. unsigned int edx __attribute__ ((packed));
  80. unsigned int esi __attribute__ ((packed));
  81. unsigned int edi __attribute__ ((packed));
  82. } SMMRegisters;
  83. typedef struct {
  84. u8 type;
  85. u8 length;
  86. u16 handle;
  87. } DMIHeader;
  88. /*
  89. * Call the System Management Mode BIOS. Code provided by Jonathan Buzzard.
  90. */
  91. static int i8k_smm(SMMRegisters *regs)
  92. {
  93. int rc;
  94. int eax = regs->eax;
  95. asm("pushl %%eax\n\t" \
  96. "movl 0(%%eax),%%edx\n\t" \
  97. "push %%edx\n\t" \
  98. "movl 4(%%eax),%%ebx\n\t" \
  99. "movl 8(%%eax),%%ecx\n\t" \
  100. "movl 12(%%eax),%%edx\n\t" \
  101. "movl 16(%%eax),%%esi\n\t" \
  102. "movl 20(%%eax),%%edi\n\t" \
  103. "popl %%eax\n\t" \
  104. "out %%al,$0xb2\n\t" \
  105. "out %%al,$0x84\n\t" \
  106. "xchgl %%eax,(%%esp)\n\t"
  107. "movl %%ebx,4(%%eax)\n\t" \
  108. "movl %%ecx,8(%%eax)\n\t" \
  109. "movl %%edx,12(%%eax)\n\t" \
  110. "movl %%esi,16(%%eax)\n\t" \
  111. "movl %%edi,20(%%eax)\n\t" \
  112. "popl %%edx\n\t" \
  113. "movl %%edx,0(%%eax)\n\t" \
  114. "lahf\n\t" \
  115. "shrl $8,%%eax\n\t" \
  116. "andl $1,%%eax\n" \
  117. : "=a" (rc)
  118. : "a" (regs)
  119. : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
  120. if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff) || (regs->eax == eax)) {
  121. return -EINVAL;
  122. }
  123. return 0;
  124. }
  125. /*
  126. * Read the bios version. Return the version as an integer corresponding
  127. * to the ascii value, for example "A17" is returned as 0x00413137.
  128. */
  129. static int i8k_get_bios_version(void)
  130. {
  131. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  132. int rc;
  133. regs.eax = I8K_SMM_BIOS_VERSION;
  134. if ((rc=i8k_smm(&regs)) < 0) {
  135. return rc;
  136. }
  137. return regs.eax;
  138. }
  139. /*
  140. * Read the machine id.
  141. */
  142. static int i8k_get_serial_number(unsigned char *buff)
  143. {
  144. strlcpy(buff, serial_number, sizeof(serial_number));
  145. return 0;
  146. }
  147. /*
  148. * Read the Fn key status.
  149. */
  150. static int i8k_get_fn_status(void)
  151. {
  152. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  153. int rc;
  154. regs.eax = I8K_SMM_FN_STATUS;
  155. if ((rc=i8k_smm(&regs)) < 0) {
  156. return rc;
  157. }
  158. switch ((regs.eax >> I8K_FN_SHIFT) & I8K_FN_MASK) {
  159. case I8K_FN_UP:
  160. return I8K_VOL_UP;
  161. case I8K_FN_DOWN:
  162. return I8K_VOL_DOWN;
  163. case I8K_FN_MUTE:
  164. return I8K_VOL_MUTE;
  165. default:
  166. return 0;
  167. }
  168. }
  169. /*
  170. * Read the power status.
  171. */
  172. static int i8k_get_power_status(void)
  173. {
  174. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  175. int rc;
  176. regs.eax = I8K_SMM_POWER_STATUS;
  177. if ((rc=i8k_smm(&regs)) < 0) {
  178. return rc;
  179. }
  180. switch (regs.eax & 0xff) {
  181. case I8K_POWER_AC:
  182. return I8K_AC;
  183. default:
  184. return I8K_BATTERY;
  185. }
  186. }
  187. /*
  188. * Read the fan status.
  189. */
  190. static int i8k_get_fan_status(int fan)
  191. {
  192. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  193. int rc;
  194. regs.eax = I8K_SMM_GET_FAN;
  195. regs.ebx = fan & 0xff;
  196. if ((rc=i8k_smm(&regs)) < 0) {
  197. return rc;
  198. }
  199. return (regs.eax & 0xff);
  200. }
  201. /*
  202. * Read the fan speed in RPM.
  203. */
  204. static int i8k_get_fan_speed(int fan)
  205. {
  206. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  207. int rc;
  208. regs.eax = I8K_SMM_GET_SPEED;
  209. regs.ebx = fan & 0xff;
  210. if ((rc=i8k_smm(&regs)) < 0) {
  211. return rc;
  212. }
  213. return (regs.eax & 0xffff) * I8K_FAN_MULT;
  214. }
  215. /*
  216. * Set the fan speed (off, low, high). Returns the new fan status.
  217. */
  218. static int i8k_set_fan(int fan, int speed)
  219. {
  220. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  221. int rc;
  222. speed = (speed < 0) ? 0 : ((speed > I8K_FAN_MAX) ? I8K_FAN_MAX : speed);
  223. regs.eax = I8K_SMM_SET_FAN;
  224. regs.ebx = (fan & 0xff) | (speed << 8);
  225. if ((rc=i8k_smm(&regs)) < 0) {
  226. return rc;
  227. }
  228. return (i8k_get_fan_status(fan));
  229. }
  230. /*
  231. * Read the cpu temperature.
  232. */
  233. static int i8k_get_cpu_temp(void)
  234. {
  235. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  236. int rc;
  237. int temp;
  238. #ifdef I8K_TEMPERATURE_BUG
  239. static int prev = 0;
  240. #endif
  241. regs.eax = I8K_SMM_GET_TEMP;
  242. if ((rc=i8k_smm(&regs)) < 0) {
  243. return rc;
  244. }
  245. temp = regs.eax & 0xff;
  246. #ifdef I8K_TEMPERATURE_BUG
  247. /*
  248. * Sometimes the temperature sensor returns 0x99, which is out of range.
  249. * In this case we return (once) the previous cached value. For example:
  250. # 1003655137 00000058 00005a4b
  251. # 1003655138 00000099 00003a80 <--- 0x99 = 153 degrees
  252. # 1003655139 00000054 00005c52
  253. */
  254. if (temp > I8K_MAX_TEMP) {
  255. temp = prev;
  256. prev = I8K_MAX_TEMP;
  257. } else {
  258. prev = temp;
  259. }
  260. #endif
  261. return temp;
  262. }
  263. static int i8k_get_dell_signature(void)
  264. {
  265. SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
  266. int rc;
  267. regs.eax = I8K_SMM_GET_DELL_SIG;
  268. if ((rc=i8k_smm(&regs)) < 0) {
  269. return rc;
  270. }
  271. if ((regs.eax == 1145651527) && (regs.edx == 1145392204)) {
  272. return 0;
  273. } else {
  274. return -1;
  275. }
  276. }
  277. static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
  278. unsigned long arg)
  279. {
  280. int val;
  281. int speed;
  282. unsigned char buff[16];
  283. int __user *argp = (int __user *)arg;
  284. if (!argp)
  285. return -EINVAL;
  286. switch (cmd) {
  287. case I8K_BIOS_VERSION:
  288. val = i8k_get_bios_version();
  289. break;
  290. case I8K_MACHINE_ID:
  291. memset(buff, 0, 16);
  292. val = i8k_get_serial_number(buff);
  293. break;
  294. case I8K_FN_STATUS:
  295. val = i8k_get_fn_status();
  296. break;
  297. case I8K_POWER_STATUS:
  298. val = i8k_get_power_status();
  299. break;
  300. case I8K_GET_TEMP:
  301. val = i8k_get_cpu_temp();
  302. break;
  303. case I8K_GET_SPEED:
  304. if (copy_from_user(&val, argp, sizeof(int))) {
  305. return -EFAULT;
  306. }
  307. val = i8k_get_fan_speed(val);
  308. break;
  309. case I8K_GET_FAN:
  310. if (copy_from_user(&val, argp, sizeof(int))) {
  311. return -EFAULT;
  312. }
  313. val = i8k_get_fan_status(val);
  314. break;
  315. case I8K_SET_FAN:
  316. if (restricted && !capable(CAP_SYS_ADMIN)) {
  317. return -EPERM;
  318. }
  319. if (copy_from_user(&val, argp, sizeof(int))) {
  320. return -EFAULT;
  321. }
  322. if (copy_from_user(&speed, argp+1, sizeof(int))) {
  323. return -EFAULT;
  324. }
  325. val = i8k_set_fan(val, speed);
  326. break;
  327. default:
  328. return -EINVAL;
  329. }
  330. if (val < 0) {
  331. return val;
  332. }
  333. switch (cmd) {
  334. case I8K_BIOS_VERSION:
  335. if (copy_to_user(argp, &val, 4)) {
  336. return -EFAULT;
  337. }
  338. break;
  339. case I8K_MACHINE_ID:
  340. if (copy_to_user(argp, buff, 16)) {
  341. return -EFAULT;
  342. }
  343. break;
  344. default:
  345. if (copy_to_user(argp, &val, sizeof(int))) {
  346. return -EFAULT;
  347. }
  348. break;
  349. }
  350. return 0;
  351. }
  352. /*
  353. * Print the information for /proc/i8k.
  354. */
  355. static int i8k_get_info(char *buffer, char **start, off_t fpos, int length)
  356. {
  357. int n, fn_key, cpu_temp, ac_power;
  358. int left_fan, right_fan, left_speed, right_speed;
  359. cpu_temp = i8k_get_cpu_temp(); /* 11100 µs */
  360. left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */
  361. right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */
  362. left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */
  363. right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT); /* 580 µs */
  364. fn_key = i8k_get_fn_status(); /* 750 µs */
  365. if (power_status) {
  366. ac_power = i8k_get_power_status(); /* 14700 µs */
  367. } else {
  368. ac_power = -1;
  369. }
  370. /*
  371. * Info:
  372. *
  373. * 1) Format version (this will change if format changes)
  374. * 2) BIOS version
  375. * 3) BIOS machine ID
  376. * 4) Cpu temperature
  377. * 5) Left fan status
  378. * 6) Right fan status
  379. * 7) Left fan speed
  380. * 8) Right fan speed
  381. * 9) AC power
  382. * 10) Fn Key status
  383. */
  384. n = sprintf(buffer, "%s %s %s %d %d %d %d %d %d %d\n",
  385. I8K_PROC_FMT,
  386. bios_version,
  387. serial_number,
  388. cpu_temp,
  389. left_fan,
  390. right_fan,
  391. left_speed,
  392. right_speed,
  393. ac_power,
  394. fn_key);
  395. return n;
  396. }
  397. static ssize_t i8k_read(struct file *f, char __user *buffer, size_t len, loff_t *fpos)
  398. {
  399. int n;
  400. char info[128];
  401. n = i8k_get_info(info, NULL, 0, 128);
  402. if (n <= 0) {
  403. return n;
  404. }
  405. if (*fpos >= n) {
  406. return 0;
  407. }
  408. if ((*fpos + len) >= n) {
  409. len = n - *fpos;
  410. }
  411. if (copy_to_user(buffer, info, len) != 0) {
  412. return -EFAULT;
  413. }
  414. *fpos += len;
  415. return len;
  416. }
  417. static char* __init string_trim(char *s, int size)
  418. {
  419. int len;
  420. char *p;
  421. if ((len = strlen(s)) > size) {
  422. len = size;
  423. }
  424. for (p=s+len-1; len && (*p==' '); len--,p--) {
  425. *p = '\0';
  426. }
  427. return s;
  428. }
  429. /* DMI code, stolen from arch/i386/kernel/dmi_scan.c */
  430. /*
  431. * |<-- dmi->length -->|
  432. * | |
  433. * |dmi header s=N | string1,\0, ..., stringN,\0, ..., \0
  434. * | |
  435. * +-----------------------+
  436. */
  437. static char* __init dmi_string(DMIHeader *dmi, u8 s)
  438. {
  439. u8 *p;
  440. if (!s) {
  441. return "";
  442. }
  443. s--;
  444. p = (u8 *)dmi + dmi->length;
  445. while (s > 0) {
  446. p += strlen(p);
  447. p++;
  448. s--;
  449. }
  450. return p;
  451. }
  452. static void __init dmi_decode(DMIHeader *dmi)
  453. {
  454. u8 *data = (u8 *) dmi;
  455. char *p;
  456. #ifdef I8K_DEBUG
  457. int i;
  458. printk("%08x ", (int)data);
  459. for (i=0; i<data[1] && i<64; i++) {
  460. printk("%02x ", data[i]);
  461. }
  462. printk("\n");
  463. #endif
  464. switch (dmi->type) {
  465. case 0: /* BIOS Information */
  466. p = dmi_string(dmi,data[5]);
  467. if (*p) {
  468. strlcpy(bios_version, p, sizeof(bios_version));
  469. string_trim(bios_version, sizeof(bios_version));
  470. }
  471. break;
  472. case 1: /* System Information */
  473. p = dmi_string(dmi,data[4]);
  474. if (*p) {
  475. strlcpy(system_vendor, p, sizeof(system_vendor));
  476. string_trim(system_vendor, sizeof(system_vendor));
  477. }
  478. p = dmi_string(dmi,data[5]);
  479. if (*p) {
  480. strlcpy(product_name, p, sizeof(product_name));
  481. string_trim(product_name, sizeof(product_name));
  482. }
  483. p = dmi_string(dmi,data[7]);
  484. if (*p) {
  485. strlcpy(serial_number, p, sizeof(serial_number));
  486. string_trim(serial_number, sizeof(serial_number));
  487. }
  488. break;
  489. }
  490. }
  491. static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*))
  492. {
  493. u8 *buf;
  494. u8 *data;
  495. DMIHeader *dmi;
  496. int i = 1;
  497. buf = ioremap(base, len);
  498. if (buf == NULL) {
  499. return -1;
  500. }
  501. data = buf;
  502. /*
  503. * Stop when we see al the items the table claimed to have
  504. * or we run off the end of the table (also happens)
  505. */
  506. while ((i<num) && ((data-buf) < len)) {
  507. dmi = (DMIHeader *)data;
  508. /*
  509. * Avoid misparsing crud if the length of the last
  510. * record is crap
  511. */
  512. if ((data-buf+dmi->length) >= len) {
  513. break;
  514. }
  515. fn(dmi);
  516. data += dmi->length;
  517. /*
  518. * Don't go off the end of the data if there is
  519. * stuff looking like string fill past the end
  520. */
  521. while (((data-buf) < len) && (*data || data[1])) {
  522. data++;
  523. }
  524. data += 2;
  525. i++;
  526. }
  527. iounmap(buf);
  528. return 0;
  529. }
  530. static int __init dmi_iterate(void (*decode)(DMIHeader *))
  531. {
  532. unsigned char buf[20];
  533. void __iomem *p = ioremap(0xe0000, 0x20000), *q;
  534. if (!p)
  535. return -1;
  536. for (q = p; q < p + 0x20000; q += 16) {
  537. memcpy_fromio(buf, q, 20);
  538. if (memcmp(buf, "_DMI_", 5)==0) {
  539. u16 num = buf[13]<<8 | buf[12];
  540. u16 len = buf [7]<<8 | buf [6];
  541. u32 base = buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8];
  542. #ifdef I8K_DEBUG
  543. printk(KERN_INFO "DMI %d.%d present.\n",
  544. buf[14]>>4, buf[14]&0x0F);
  545. printk(KERN_INFO "%d structures occupying %d bytes.\n",
  546. buf[13]<<8 | buf[12],
  547. buf [7]<<8 | buf[6]);
  548. printk(KERN_INFO "DMI table at 0x%08X.\n",
  549. buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
  550. #endif
  551. if (dmi_table(base, len, num, decode)==0) {
  552. iounmap(p);
  553. return 0;
  554. }
  555. }
  556. }
  557. iounmap(p);
  558. return -1;
  559. }
  560. /* end of DMI code */
  561. /*
  562. * Get DMI information.
  563. */
  564. static int __init i8k_dmi_probe(void)
  565. {
  566. char **p;
  567. if (dmi_iterate(dmi_decode) != 0) {
  568. printk(KERN_INFO "i8k: unable to get DMI information\n");
  569. return -ENODEV;
  570. }
  571. if (strncmp(system_vendor,DELL_SIGNATURE,strlen(DELL_SIGNATURE)) != 0) {
  572. printk(KERN_INFO "i8k: not running on a Dell system\n");
  573. return -ENODEV;
  574. }
  575. for (p=supported_models; ; p++) {
  576. if (!*p) {
  577. printk(KERN_INFO "i8k: unsupported model: %s\n", product_name);
  578. return -ENODEV;
  579. }
  580. if (strncmp(product_name,*p,strlen(*p)) == 0) {
  581. break;
  582. }
  583. }
  584. return 0;
  585. }
  586. /*
  587. * Probe for the presence of a supported laptop.
  588. */
  589. static int __init i8k_probe(void)
  590. {
  591. char buff[4];
  592. int version;
  593. int smm_found = 0;
  594. /*
  595. * Get DMI information
  596. */
  597. if (i8k_dmi_probe() != 0) {
  598. printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
  599. system_vendor, product_name, bios_version);
  600. }
  601. /*
  602. * Get SMM Dell signature
  603. */
  604. if (i8k_get_dell_signature() != 0) {
  605. printk(KERN_INFO "i8k: unable to get SMM Dell signature\n");
  606. } else {
  607. smm_found = 1;
  608. }
  609. /*
  610. * Get SMM BIOS version.
  611. */
  612. version = i8k_get_bios_version();
  613. if (version <= 0) {
  614. printk(KERN_INFO "i8k: unable to get SMM BIOS version\n");
  615. } else {
  616. smm_found = 1;
  617. buff[0] = (version >> 16) & 0xff;
  618. buff[1] = (version >> 8) & 0xff;
  619. buff[2] = (version) & 0xff;
  620. buff[3] = '\0';
  621. /*
  622. * If DMI BIOS version is unknown use SMM BIOS version.
  623. */
  624. if (bios_version[0] == '?') {
  625. strcpy(bios_version, buff);
  626. }
  627. /*
  628. * Check if the two versions match.
  629. */
  630. if (strncmp(buff,bios_version,sizeof(bios_version)) != 0) {
  631. printk(KERN_INFO "i8k: BIOS version mismatch: %s != %s\n",
  632. buff, bios_version);
  633. }
  634. }
  635. if (!smm_found && !force) {
  636. return -ENODEV;
  637. }
  638. return 0;
  639. }
  640. #ifdef MODULE
  641. static
  642. #endif
  643. int __init i8k_init(void)
  644. {
  645. struct proc_dir_entry *proc_i8k;
  646. /* Are we running on an supported laptop? */
  647. if (i8k_probe() != 0) {
  648. return -ENODEV;
  649. }
  650. /* Register the proc entry */
  651. proc_i8k = create_proc_info_entry("i8k", 0, NULL, i8k_get_info);
  652. if (!proc_i8k) {
  653. return -ENOENT;
  654. }
  655. proc_i8k->proc_fops = &i8k_fops;
  656. proc_i8k->owner = THIS_MODULE;
  657. printk(KERN_INFO
  658. "Dell laptop SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n",
  659. I8K_VERSION);
  660. return 0;
  661. }
  662. #ifdef MODULE
  663. int init_module(void)
  664. {
  665. return i8k_init();
  666. }
  667. void cleanup_module(void)
  668. {
  669. /* Remove the proc entry */
  670. remove_proc_entry("i8k", NULL);
  671. printk(KERN_INFO "i8k: module unloaded\n");
  672. }
  673. #endif
  674. /* end of file */