i82092.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /*
  2. * Driver for Intel I82092AA PCI-PCMCIA bridge.
  3. *
  4. * (C) 2001 Red Hat, Inc.
  5. *
  6. * Author: Arjan Van De Ven <arjanv@redhat.com>
  7. * Loosly based on i82365.c from the pcmcia-cs package
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/module.h>
  11. #include <linux/pci.h>
  12. #include <linux/init.h>
  13. #include <linux/workqueue.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/device.h>
  16. #include <pcmcia/ss.h>
  17. #include <asm/io.h>
  18. #include "i82092aa.h"
  19. #include "i82365.h"
  20. MODULE_LICENSE("GPL");
  21. /* PCI core routines */
  22. static const struct pci_device_id i82092aa_pci_ids[] = {
  23. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82092AA_0) },
  24. { }
  25. };
  26. MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
  27. static struct pci_driver i82092aa_pci_driver = {
  28. .name = "i82092aa",
  29. .id_table = i82092aa_pci_ids,
  30. .probe = i82092aa_pci_probe,
  31. .remove = i82092aa_pci_remove,
  32. };
  33. /* the pccard structure and its functions */
  34. static struct pccard_operations i82092aa_operations = {
  35. .init = i82092aa_init,
  36. .get_status = i82092aa_get_status,
  37. .set_socket = i82092aa_set_socket,
  38. .set_io_map = i82092aa_set_io_map,
  39. .set_mem_map = i82092aa_set_mem_map,
  40. };
  41. /* The card can do up to 4 sockets, allocate a structure for each of them */
  42. struct socket_info {
  43. int number;
  44. int card_state; /* 0 = no socket,
  45. 1 = empty socket,
  46. 2 = card but not initialized,
  47. 3 = operational card */
  48. unsigned int io_base; /* base io address of the socket */
  49. struct pcmcia_socket socket;
  50. struct pci_dev *dev; /* The PCI device for the socket */
  51. };
  52. #define MAX_SOCKETS 4
  53. static struct socket_info sockets[MAX_SOCKETS];
  54. static int socket_count; /* shortcut */
  55. static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
  56. {
  57. unsigned char configbyte;
  58. int i, ret;
  59. enter("i82092aa_pci_probe");
  60. if ((ret = pci_enable_device(dev)))
  61. return ret;
  62. pci_read_config_byte(dev, 0x40, &configbyte); /* PCI Configuration Control */
  63. switch(configbyte&6) {
  64. case 0:
  65. socket_count = 2;
  66. break;
  67. case 2:
  68. socket_count = 1;
  69. break;
  70. case 4:
  71. case 6:
  72. socket_count = 4;
  73. break;
  74. default:
  75. printk(KERN_ERR "i82092aa: Oops, you did something we didn't think of.\n");
  76. ret = -EIO;
  77. goto err_out_disable;
  78. }
  79. printk(KERN_INFO "i82092aa: configured as a %d socket device.\n", socket_count);
  80. if (!request_region(pci_resource_start(dev, 0), 2, "i82092aa")) {
  81. ret = -EBUSY;
  82. goto err_out_disable;
  83. }
  84. for (i = 0;i<socket_count;i++) {
  85. sockets[i].card_state = 1; /* 1 = present but empty */
  86. sockets[i].io_base = pci_resource_start(dev, 0);
  87. sockets[i].socket.features |= SS_CAP_PCCARD;
  88. sockets[i].socket.map_size = 0x1000;
  89. sockets[i].socket.irq_mask = 0;
  90. sockets[i].socket.pci_irq = dev->irq;
  91. sockets[i].socket.cb_dev = dev;
  92. sockets[i].socket.owner = THIS_MODULE;
  93. sockets[i].number = i;
  94. if (card_present(i)) {
  95. sockets[i].card_state = 3;
  96. dprintk(KERN_DEBUG "i82092aa: slot %i is occupied\n",i);
  97. } else {
  98. dprintk(KERN_DEBUG "i82092aa: slot %i is vacant\n",i);
  99. }
  100. }
  101. /* Now, specifiy that all interrupts are to be done as PCI interrupts */
  102. configbyte = 0xFF; /* bitmask, one bit per event, 1 = PCI interrupt, 0 = ISA interrupt */
  103. pci_write_config_byte(dev, 0x50, configbyte); /* PCI Interrupt Routing Register */
  104. /* Register the interrupt handler */
  105. dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq);
  106. if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED, "i82092aa", i82092aa_interrupt))) {
  107. printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq);
  108. goto err_out_free_res;
  109. }
  110. for (i = 0; i<socket_count; i++) {
  111. sockets[i].socket.dev.parent = &dev->dev;
  112. sockets[i].socket.ops = &i82092aa_operations;
  113. sockets[i].socket.resource_ops = &pccard_nonstatic_ops;
  114. ret = pcmcia_register_socket(&sockets[i].socket);
  115. if (ret) {
  116. goto err_out_free_sockets;
  117. }
  118. }
  119. leave("i82092aa_pci_probe");
  120. return 0;
  121. err_out_free_sockets:
  122. if (i) {
  123. for (i--;i>=0;i--) {
  124. pcmcia_unregister_socket(&sockets[i].socket);
  125. }
  126. }
  127. free_irq(dev->irq, i82092aa_interrupt);
  128. err_out_free_res:
  129. release_region(pci_resource_start(dev, 0), 2);
  130. err_out_disable:
  131. pci_disable_device(dev);
  132. return ret;
  133. }
  134. static void i82092aa_pci_remove(struct pci_dev *dev)
  135. {
  136. int i;
  137. enter("i82092aa_pci_remove");
  138. free_irq(dev->irq, i82092aa_interrupt);
  139. for (i = 0; i < socket_count; i++)
  140. pcmcia_unregister_socket(&sockets[i].socket);
  141. leave("i82092aa_pci_remove");
  142. }
  143. static DEFINE_SPINLOCK(port_lock);
  144. /* basic value read/write functions */
  145. static unsigned char indirect_read(int socket, unsigned short reg)
  146. {
  147. unsigned short int port;
  148. unsigned char val;
  149. unsigned long flags;
  150. spin_lock_irqsave(&port_lock,flags);
  151. reg += socket * 0x40;
  152. port = sockets[socket].io_base;
  153. outb(reg,port);
  154. val = inb(port+1);
  155. spin_unlock_irqrestore(&port_lock,flags);
  156. return val;
  157. }
  158. #if 0
  159. static unsigned short indirect_read16(int socket, unsigned short reg)
  160. {
  161. unsigned short int port;
  162. unsigned short tmp;
  163. unsigned long flags;
  164. spin_lock_irqsave(&port_lock,flags);
  165. reg = reg + socket * 0x40;
  166. port = sockets[socket].io_base;
  167. outb(reg,port);
  168. tmp = inb(port+1);
  169. reg++;
  170. outb(reg,port);
  171. tmp = tmp | (inb(port+1)<<8);
  172. spin_unlock_irqrestore(&port_lock,flags);
  173. return tmp;
  174. }
  175. #endif
  176. static void indirect_write(int socket, unsigned short reg, unsigned char value)
  177. {
  178. unsigned short int port;
  179. unsigned long flags;
  180. spin_lock_irqsave(&port_lock,flags);
  181. reg = reg + socket * 0x40;
  182. port = sockets[socket].io_base;
  183. outb(reg,port);
  184. outb(value,port+1);
  185. spin_unlock_irqrestore(&port_lock,flags);
  186. }
  187. static void indirect_setbit(int socket, unsigned short reg, unsigned char mask)
  188. {
  189. unsigned short int port;
  190. unsigned char val;
  191. unsigned long flags;
  192. spin_lock_irqsave(&port_lock,flags);
  193. reg = reg + socket * 0x40;
  194. port = sockets[socket].io_base;
  195. outb(reg,port);
  196. val = inb(port+1);
  197. val |= mask;
  198. outb(reg,port);
  199. outb(val,port+1);
  200. spin_unlock_irqrestore(&port_lock,flags);
  201. }
  202. static void indirect_resetbit(int socket, unsigned short reg, unsigned char mask)
  203. {
  204. unsigned short int port;
  205. unsigned char val;
  206. unsigned long flags;
  207. spin_lock_irqsave(&port_lock,flags);
  208. reg = reg + socket * 0x40;
  209. port = sockets[socket].io_base;
  210. outb(reg,port);
  211. val = inb(port+1);
  212. val &= ~mask;
  213. outb(reg,port);
  214. outb(val,port+1);
  215. spin_unlock_irqrestore(&port_lock,flags);
  216. }
  217. static void indirect_write16(int socket, unsigned short reg, unsigned short value)
  218. {
  219. unsigned short int port;
  220. unsigned char val;
  221. unsigned long flags;
  222. spin_lock_irqsave(&port_lock,flags);
  223. reg = reg + socket * 0x40;
  224. port = sockets[socket].io_base;
  225. outb(reg,port);
  226. val = value & 255;
  227. outb(val,port+1);
  228. reg++;
  229. outb(reg,port);
  230. val = value>>8;
  231. outb(val,port+1);
  232. spin_unlock_irqrestore(&port_lock,flags);
  233. }
  234. /* simple helper functions */
  235. /* External clock time, in nanoseconds. 120 ns = 8.33 MHz */
  236. static int cycle_time = 120;
  237. static int to_cycles(int ns)
  238. {
  239. if (cycle_time!=0)
  240. return ns/cycle_time;
  241. else
  242. return 0;
  243. }
  244. /* Interrupt handler functionality */
  245. static irqreturn_t i82092aa_interrupt(int irq, void *dev)
  246. {
  247. int i;
  248. int loopcount = 0;
  249. int handled = 0;
  250. unsigned int events, active=0;
  251. /* enter("i82092aa_interrupt");*/
  252. while (1) {
  253. loopcount++;
  254. if (loopcount>20) {
  255. printk(KERN_ERR "i82092aa: infinite eventloop in interrupt \n");
  256. break;
  257. }
  258. active = 0;
  259. for (i=0;i<socket_count;i++) {
  260. int csc;
  261. if (sockets[i].card_state==0) /* Inactive socket, should not happen */
  262. continue;
  263. csc = indirect_read(i,I365_CSC); /* card status change register */
  264. if (csc==0) /* no events on this socket */
  265. continue;
  266. handled = 1;
  267. events = 0;
  268. if (csc & I365_CSC_DETECT) {
  269. events |= SS_DETECT;
  270. printk("Card detected in socket %i!\n",i);
  271. }
  272. if (indirect_read(i,I365_INTCTL) & I365_PC_IOCARD) {
  273. /* For IO/CARDS, bit 0 means "read the card" */
  274. events |= (csc & I365_CSC_STSCHG) ? SS_STSCHG : 0;
  275. } else {
  276. /* Check for battery/ready events */
  277. events |= (csc & I365_CSC_BVD1) ? SS_BATDEAD : 0;
  278. events |= (csc & I365_CSC_BVD2) ? SS_BATWARN : 0;
  279. events |= (csc & I365_CSC_READY) ? SS_READY : 0;
  280. }
  281. if (events) {
  282. pcmcia_parse_events(&sockets[i].socket, events);
  283. }
  284. active |= events;
  285. }
  286. if (active==0) /* no more events to handle */
  287. break;
  288. }
  289. return IRQ_RETVAL(handled);
  290. /* leave("i82092aa_interrupt");*/
  291. }
  292. /* socket functions */
  293. static int card_present(int socketno)
  294. {
  295. unsigned int val;
  296. enter("card_present");
  297. if ((socketno<0) || (socketno >= MAX_SOCKETS))
  298. return 0;
  299. if (sockets[socketno].io_base == 0)
  300. return 0;
  301. val = indirect_read(socketno, 1); /* Interface status register */
  302. if ((val&12)==12) {
  303. leave("card_present 1");
  304. return 1;
  305. }
  306. leave("card_present 0");
  307. return 0;
  308. }
  309. static void set_bridge_state(int sock)
  310. {
  311. enter("set_bridge_state");
  312. indirect_write(sock, I365_GBLCTL,0x00);
  313. indirect_write(sock, I365_GENCTL,0x00);
  314. indirect_setbit(sock, I365_INTCTL,0x08);
  315. leave("set_bridge_state");
  316. }
  317. static int i82092aa_init(struct pcmcia_socket *sock)
  318. {
  319. int i;
  320. struct resource res = { .start = 0, .end = 0x0fff };
  321. pccard_io_map io = { 0, 0, 0, 0, 1 };
  322. pccard_mem_map mem = { .res = &res, };
  323. enter("i82092aa_init");
  324. for (i = 0; i < 2; i++) {
  325. io.map = i;
  326. i82092aa_set_io_map(sock, &io);
  327. }
  328. for (i = 0; i < 5; i++) {
  329. mem.map = i;
  330. i82092aa_set_mem_map(sock, &mem);
  331. }
  332. leave("i82092aa_init");
  333. return 0;
  334. }
  335. static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
  336. {
  337. unsigned int sock = container_of(socket, struct socket_info, socket)->number;
  338. unsigned int status;
  339. enter("i82092aa_get_status");
  340. status = indirect_read(sock,I365_STATUS); /* Interface Status Register */
  341. *value = 0;
  342. if ((status & I365_CS_DETECT) == I365_CS_DETECT) {
  343. *value |= SS_DETECT;
  344. }
  345. /* IO cards have a different meaning of bits 0,1 */
  346. /* Also notice the inverse-logic on the bits */
  347. if (indirect_read(sock, I365_INTCTL) & I365_PC_IOCARD) {
  348. /* IO card */
  349. if (!(status & I365_CS_STSCHG))
  350. *value |= SS_STSCHG;
  351. } else { /* non I/O card */
  352. if (!(status & I365_CS_BVD1))
  353. *value |= SS_BATDEAD;
  354. if (!(status & I365_CS_BVD2))
  355. *value |= SS_BATWARN;
  356. }
  357. if (status & I365_CS_WRPROT)
  358. (*value) |= SS_WRPROT; /* card is write protected */
  359. if (status & I365_CS_READY)
  360. (*value) |= SS_READY; /* card is not busy */
  361. if (status & I365_CS_POWERON)
  362. (*value) |= SS_POWERON; /* power is applied to the card */
  363. leave("i82092aa_get_status");
  364. return 0;
  365. }
  366. static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
  367. {
  368. unsigned int sock = container_of(socket, struct socket_info, socket)->number;
  369. unsigned char reg;
  370. enter("i82092aa_set_socket");
  371. /* First, set the global controller options */
  372. set_bridge_state(sock);
  373. /* Values for the IGENC register */
  374. reg = 0;
  375. if (!(state->flags & SS_RESET)) /* The reset bit has "inverse" logic */
  376. reg = reg | I365_PC_RESET;
  377. if (state->flags & SS_IOCARD)
  378. reg = reg | I365_PC_IOCARD;
  379. indirect_write(sock,I365_INTCTL,reg); /* IGENC, Interrupt and General Control Register */
  380. /* Power registers */
  381. reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
  382. if (state->flags & SS_PWR_AUTO) {
  383. printk("Auto power\n");
  384. reg |= I365_PWR_AUTO; /* automatic power mngmnt */
  385. }
  386. if (state->flags & SS_OUTPUT_ENA) {
  387. printk("Power Enabled \n");
  388. reg |= I365_PWR_OUT; /* enable power */
  389. }
  390. switch (state->Vcc) {
  391. case 0:
  392. break;
  393. case 50:
  394. printk("setting voltage to Vcc to 5V on socket %i\n",sock);
  395. reg |= I365_VCC_5V;
  396. break;
  397. default:
  398. printk("i82092aa: i82092aa_set_socket called with invalid VCC power value: %i ", state->Vcc);
  399. leave("i82092aa_set_socket");
  400. return -EINVAL;
  401. }
  402. switch (state->Vpp) {
  403. case 0:
  404. printk("not setting Vpp on socket %i\n",sock);
  405. break;
  406. case 50:
  407. printk("setting Vpp to 5.0 for socket %i\n",sock);
  408. reg |= I365_VPP1_5V | I365_VPP2_5V;
  409. break;
  410. case 120:
  411. printk("setting Vpp to 12.0\n");
  412. reg |= I365_VPP1_12V | I365_VPP2_12V;
  413. break;
  414. default:
  415. printk("i82092aa: i82092aa_set_socket called with invalid VPP power value: %i ", state->Vcc);
  416. leave("i82092aa_set_socket");
  417. return -EINVAL;
  418. }
  419. if (reg != indirect_read(sock,I365_POWER)) /* only write if changed */
  420. indirect_write(sock,I365_POWER,reg);
  421. /* Enable specific interrupt events */
  422. reg = 0x00;
  423. if (state->csc_mask & SS_DETECT) {
  424. reg |= I365_CSC_DETECT;
  425. }
  426. if (state->flags & SS_IOCARD) {
  427. if (state->csc_mask & SS_STSCHG)
  428. reg |= I365_CSC_STSCHG;
  429. } else {
  430. if (state->csc_mask & SS_BATDEAD)
  431. reg |= I365_CSC_BVD1;
  432. if (state->csc_mask & SS_BATWARN)
  433. reg |= I365_CSC_BVD2;
  434. if (state->csc_mask & SS_READY)
  435. reg |= I365_CSC_READY;
  436. }
  437. /* now write the value and clear the (probably bogus) pending stuff by doing a dummy read*/
  438. indirect_write(sock,I365_CSCINT,reg);
  439. (void)indirect_read(sock,I365_CSC);
  440. leave("i82092aa_set_socket");
  441. return 0;
  442. }
  443. static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_map *io)
  444. {
  445. unsigned int sock = container_of(socket, struct socket_info, socket)->number;
  446. unsigned char map, ioctl;
  447. enter("i82092aa_set_io_map");
  448. map = io->map;
  449. /* Check error conditions */
  450. if (map > 1) {
  451. leave("i82092aa_set_io_map with invalid map");
  452. return -EINVAL;
  453. }
  454. if ((io->start > 0xffff) || (io->stop > 0xffff) || (io->stop < io->start)){
  455. leave("i82092aa_set_io_map with invalid io");
  456. return -EINVAL;
  457. }
  458. /* Turn off the window before changing anything */
  459. if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_IO(map))
  460. indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_IO(map));
  461. /* printk("set_io_map: Setting range to %x - %x \n",io->start,io->stop); */
  462. /* write the new values */
  463. indirect_write16(sock,I365_IO(map)+I365_W_START,io->start);
  464. indirect_write16(sock,I365_IO(map)+I365_W_STOP,io->stop);
  465. ioctl = indirect_read(sock,I365_IOCTL) & ~I365_IOCTL_MASK(map);
  466. if (io->flags & (MAP_16BIT|MAP_AUTOSZ))
  467. ioctl |= I365_IOCTL_16BIT(map);
  468. indirect_write(sock,I365_IOCTL,ioctl);
  469. /* Turn the window back on if needed */
  470. if (io->flags & MAP_ACTIVE)
  471. indirect_setbit(sock,I365_ADDRWIN,I365_ENA_IO(map));
  472. leave("i82092aa_set_io_map");
  473. return 0;
  474. }
  475. static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem)
  476. {
  477. struct socket_info *sock_info = container_of(socket, struct socket_info, socket);
  478. unsigned int sock = sock_info->number;
  479. struct pci_bus_region region;
  480. unsigned short base, i;
  481. unsigned char map;
  482. enter("i82092aa_set_mem_map");
  483. pcibios_resource_to_bus(sock_info->dev->bus, &region, mem->res);
  484. map = mem->map;
  485. if (map > 4) {
  486. leave("i82092aa_set_mem_map: invalid map");
  487. return -EINVAL;
  488. }
  489. if ( (mem->card_start > 0x3ffffff) || (region.start > region.end) ||
  490. (mem->speed > 1000) ) {
  491. leave("i82092aa_set_mem_map: invalid address / speed");
  492. printk("invalid mem map for socket %i: %llx to %llx with a "
  493. "start of %x\n",
  494. sock,
  495. (unsigned long long)region.start,
  496. (unsigned long long)region.end,
  497. mem->card_start);
  498. return -EINVAL;
  499. }
  500. /* Turn off the window before changing anything */
  501. if (indirect_read(sock, I365_ADDRWIN) & I365_ENA_MEM(map))
  502. indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_MEM(map));
  503. /* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, region.start,region.end,sock,mem->speed,mem->flags & MAP_ACTIVE); */
  504. /* write the start address */
  505. base = I365_MEM(map);
  506. i = (region.start >> 12) & 0x0fff;
  507. if (mem->flags & MAP_16BIT)
  508. i |= I365_MEM_16BIT;
  509. if (mem->flags & MAP_0WS)
  510. i |= I365_MEM_0WS;
  511. indirect_write16(sock,base+I365_W_START,i);
  512. /* write the stop address */
  513. i= (region.end >> 12) & 0x0fff;
  514. switch (to_cycles(mem->speed)) {
  515. case 0:
  516. break;
  517. case 1:
  518. i |= I365_MEM_WS0;
  519. break;
  520. case 2:
  521. i |= I365_MEM_WS1;
  522. break;
  523. default:
  524. i |= I365_MEM_WS1 | I365_MEM_WS0;
  525. break;
  526. }
  527. indirect_write16(sock,base+I365_W_STOP,i);
  528. /* card start */
  529. i = ((mem->card_start - region.start) >> 12) & 0x3fff;
  530. if (mem->flags & MAP_WRPROT)
  531. i |= I365_MEM_WRPROT;
  532. if (mem->flags & MAP_ATTRIB) {
  533. /* printk("requesting attribute memory for socket %i\n",sock);*/
  534. i |= I365_MEM_REG;
  535. } else {
  536. /* printk("requesting normal memory for socket %i\n",sock);*/
  537. }
  538. indirect_write16(sock,base+I365_W_OFF,i);
  539. /* Enable the window if necessary */
  540. if (mem->flags & MAP_ACTIVE)
  541. indirect_setbit(sock, I365_ADDRWIN, I365_ENA_MEM(map));
  542. leave("i82092aa_set_mem_map");
  543. return 0;
  544. }
  545. static int i82092aa_module_init(void)
  546. {
  547. return pci_register_driver(&i82092aa_pci_driver);
  548. }
  549. static void i82092aa_module_exit(void)
  550. {
  551. enter("i82092aa_module_exit");
  552. pci_unregister_driver(&i82092aa_pci_driver);
  553. if (sockets[0].io_base>0)
  554. release_region(sockets[0].io_base, 2);
  555. leave("i82092aa_module_exit");
  556. }
  557. module_init(i82092aa_module_init);
  558. module_exit(i82092aa_module_exit);