pata_icside.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. #include <linux/kernel.h>
  2. #include <linux/module.h>
  3. #include <linux/init.h>
  4. #include <linux/blkdev.h>
  5. #include <scsi/scsi_host.h>
  6. #include <linux/ata.h>
  7. #include <linux/libata.h>
  8. #include <asm/dma.h>
  9. #include <asm/ecard.h>
  10. #define DRV_NAME "pata_icside"
  11. #define ICS_IDENT_OFFSET 0x2280
  12. #define ICS_ARCIN_V5_INTRSTAT 0x0000
  13. #define ICS_ARCIN_V5_INTROFFSET 0x0004
  14. #define ICS_ARCIN_V6_INTROFFSET_1 0x2200
  15. #define ICS_ARCIN_V6_INTRSTAT_1 0x2290
  16. #define ICS_ARCIN_V6_INTROFFSET_2 0x3200
  17. #define ICS_ARCIN_V6_INTRSTAT_2 0x3290
  18. struct portinfo {
  19. unsigned int dataoffset;
  20. unsigned int ctrloffset;
  21. unsigned int stepping;
  22. };
  23. static const struct portinfo pata_icside_portinfo_v5 = {
  24. .dataoffset = 0x2800,
  25. .ctrloffset = 0x2b80,
  26. .stepping = 6,
  27. };
  28. static const struct portinfo pata_icside_portinfo_v6_1 = {
  29. .dataoffset = 0x2000,
  30. .ctrloffset = 0x2380,
  31. .stepping = 6,
  32. };
  33. static const struct portinfo pata_icside_portinfo_v6_2 = {
  34. .dataoffset = 0x3000,
  35. .ctrloffset = 0x3380,
  36. .stepping = 6,
  37. };
  38. #define PATA_ICSIDE_MAX_SG 128
  39. struct pata_icside_state {
  40. void __iomem *irq_port;
  41. void __iomem *ioc_base;
  42. unsigned int type;
  43. unsigned int dma;
  44. struct {
  45. u8 port_sel;
  46. u8 disabled;
  47. unsigned int speed[ATA_MAX_DEVICES];
  48. } port[2];
  49. struct scatterlist sg[PATA_ICSIDE_MAX_SG];
  50. };
  51. struct pata_icside_info {
  52. struct pata_icside_state *state;
  53. struct expansion_card *ec;
  54. void __iomem *base;
  55. void __iomem *irqaddr;
  56. unsigned int irqmask;
  57. const expansioncard_ops_t *irqops;
  58. unsigned int mwdma_mask;
  59. unsigned int nr_ports;
  60. const struct portinfo *port[2];
  61. unsigned long raw_base;
  62. unsigned long raw_ioc_base;
  63. };
  64. #define ICS_TYPE_A3IN 0
  65. #define ICS_TYPE_A3USER 1
  66. #define ICS_TYPE_V6 3
  67. #define ICS_TYPE_V5 15
  68. #define ICS_TYPE_NOTYPE ((unsigned int)-1)
  69. /* ---------------- Version 5 PCB Support Functions --------------------- */
  70. /* Prototype: pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr)
  71. * Purpose : enable interrupts from card
  72. */
  73. static void pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr)
  74. {
  75. struct pata_icside_state *state = ec->irq_data;
  76. writeb(0, state->irq_port + ICS_ARCIN_V5_INTROFFSET);
  77. }
  78. /* Prototype: pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr)
  79. * Purpose : disable interrupts from card
  80. */
  81. static void pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr)
  82. {
  83. struct pata_icside_state *state = ec->irq_data;
  84. readb(state->irq_port + ICS_ARCIN_V5_INTROFFSET);
  85. }
  86. static const expansioncard_ops_t pata_icside_ops_arcin_v5 = {
  87. .irqenable = pata_icside_irqenable_arcin_v5,
  88. .irqdisable = pata_icside_irqdisable_arcin_v5,
  89. };
  90. /* ---------------- Version 6 PCB Support Functions --------------------- */
  91. /* Prototype: pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
  92. * Purpose : enable interrupts from card
  93. */
  94. static void pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
  95. {
  96. struct pata_icside_state *state = ec->irq_data;
  97. void __iomem *base = state->irq_port;
  98. if (!state->port[0].disabled)
  99. writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
  100. if (!state->port[1].disabled)
  101. writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
  102. }
  103. /* Prototype: pata_icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
  104. * Purpose : disable interrupts from card
  105. */
  106. static void pata_icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
  107. {
  108. struct pata_icside_state *state = ec->irq_data;
  109. readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
  110. readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
  111. }
  112. /* Prototype: pata_icside_irqprobe(struct expansion_card *ec)
  113. * Purpose : detect an active interrupt from card
  114. */
  115. static int pata_icside_irqpending_arcin_v6(struct expansion_card *ec)
  116. {
  117. struct pata_icside_state *state = ec->irq_data;
  118. return readb(state->irq_port + ICS_ARCIN_V6_INTRSTAT_1) & 1 ||
  119. readb(state->irq_port + ICS_ARCIN_V6_INTRSTAT_2) & 1;
  120. }
  121. static const expansioncard_ops_t pata_icside_ops_arcin_v6 = {
  122. .irqenable = pata_icside_irqenable_arcin_v6,
  123. .irqdisable = pata_icside_irqdisable_arcin_v6,
  124. .irqpending = pata_icside_irqpending_arcin_v6,
  125. };
  126. /*
  127. * SG-DMA support.
  128. *
  129. * Similar to the BM-DMA, but we use the RiscPCs IOMD DMA controllers.
  130. * There is only one DMA controller per card, which means that only
  131. * one drive can be accessed at one time. NOTE! We do not enforce that
  132. * here, but we rely on the main IDE driver spotting that both
  133. * interfaces use the same IRQ, which should guarantee this.
  134. */
  135. /*
  136. * Configure the IOMD to give the appropriate timings for the transfer
  137. * mode being requested. We take the advice of the ATA standards, and
  138. * calculate the cycle time based on the transfer mode, and the EIDE
  139. * MW DMA specs that the drive provides in the IDENTIFY command.
  140. *
  141. * We have the following IOMD DMA modes to choose from:
  142. *
  143. * Type Active Recovery Cycle
  144. * A 250 (250) 312 (550) 562 (800)
  145. * B 187 (200) 250 (550) 437 (750)
  146. * C 125 (125) 125 (375) 250 (500)
  147. * D 62 (50) 125 (375) 187 (425)
  148. *
  149. * (figures in brackets are actual measured timings on DIOR/DIOW)
  150. *
  151. * However, we also need to take care of the read/write active and
  152. * recovery timings:
  153. *
  154. * Read Write
  155. * Mode Active -- Recovery -- Cycle IOMD type
  156. * MW0 215 50 215 480 A
  157. * MW1 80 50 50 150 C
  158. * MW2 70 25 25 120 C
  159. */
  160. static void pata_icside_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  161. {
  162. struct pata_icside_state *state = ap->host->private_data;
  163. struct ata_timing t;
  164. unsigned int cycle;
  165. char iomd_type;
  166. /*
  167. * DMA is based on a 16MHz clock
  168. */
  169. if (ata_timing_compute(adev, adev->dma_mode, &t, 1000, 1))
  170. return;
  171. /*
  172. * Choose the IOMD cycle timing which ensure that the interface
  173. * satisfies the measured active, recovery and cycle times.
  174. */
  175. if (t.active <= 50 && t.recover <= 375 && t.cycle <= 425)
  176. iomd_type = 'D', cycle = 187;
  177. else if (t.active <= 125 && t.recover <= 375 && t.cycle <= 500)
  178. iomd_type = 'C', cycle = 250;
  179. else if (t.active <= 200 && t.recover <= 550 && t.cycle <= 750)
  180. iomd_type = 'B', cycle = 437;
  181. else
  182. iomd_type = 'A', cycle = 562;
  183. ata_dev_printk(adev, KERN_INFO, "timings: act %dns rec %dns cyc %dns (%c)\n",
  184. t.active, t.recover, t.cycle, iomd_type);
  185. state->port[ap->port_no].speed[adev->devno] = cycle;
  186. }
  187. static void pata_icside_bmdma_setup(struct ata_queued_cmd *qc)
  188. {
  189. struct ata_port *ap = qc->ap;
  190. struct pata_icside_state *state = ap->host->private_data;
  191. struct scatterlist *sg, *rsg = state->sg;
  192. unsigned int write = qc->tf.flags & ATA_TFLAG_WRITE;
  193. unsigned int si;
  194. /*
  195. * We are simplex; BUG if we try to fiddle with DMA
  196. * while it's active.
  197. */
  198. BUG_ON(dma_channel_active(state->dma));
  199. /*
  200. * Copy ATAs scattered sg list into a contiguous array of sg
  201. */
  202. for_each_sg(qc->sg, sg, qc->n_elem, si) {
  203. memcpy(rsg, sg, sizeof(*sg));
  204. rsg++;
  205. }
  206. /*
  207. * Route the DMA signals to the correct interface
  208. */
  209. writeb(state->port[ap->port_no].port_sel, state->ioc_base);
  210. set_dma_speed(state->dma, state->port[ap->port_no].speed[qc->dev->devno]);
  211. set_dma_sg(state->dma, state->sg, rsg - state->sg);
  212. set_dma_mode(state->dma, write ? DMA_MODE_WRITE : DMA_MODE_READ);
  213. /* issue r/w command */
  214. ap->ops->exec_command(ap, &qc->tf);
  215. }
  216. static void pata_icside_bmdma_start(struct ata_queued_cmd *qc)
  217. {
  218. struct ata_port *ap = qc->ap;
  219. struct pata_icside_state *state = ap->host->private_data;
  220. BUG_ON(dma_channel_active(state->dma));
  221. enable_dma(state->dma);
  222. }
  223. static void pata_icside_bmdma_stop(struct ata_queued_cmd *qc)
  224. {
  225. struct ata_port *ap = qc->ap;
  226. struct pata_icside_state *state = ap->host->private_data;
  227. disable_dma(state->dma);
  228. /* see ata_bmdma_stop */
  229. ata_altstatus(ap);
  230. }
  231. static u8 pata_icside_bmdma_status(struct ata_port *ap)
  232. {
  233. struct pata_icside_state *state = ap->host->private_data;
  234. void __iomem *irq_port;
  235. irq_port = state->irq_port + (ap->port_no ? ICS_ARCIN_V6_INTRSTAT_2 :
  236. ICS_ARCIN_V6_INTRSTAT_1);
  237. return readb(irq_port) & 1 ? ATA_DMA_INTR : 0;
  238. }
  239. static int icside_dma_init(struct pata_icside_info *info)
  240. {
  241. struct pata_icside_state *state = info->state;
  242. struct expansion_card *ec = info->ec;
  243. int i;
  244. for (i = 0; i < ATA_MAX_DEVICES; i++) {
  245. state->port[0].speed[i] = 480;
  246. state->port[1].speed[i] = 480;
  247. }
  248. if (ec->dma != NO_DMA && !request_dma(ec->dma, DRV_NAME)) {
  249. state->dma = ec->dma;
  250. info->mwdma_mask = 0x07; /* MW0..2 */
  251. }
  252. return 0;
  253. }
  254. static struct scsi_host_template pata_icside_sht = {
  255. ATA_BASE_SHT(DRV_NAME),
  256. .sg_tablesize = PATA_ICSIDE_MAX_SG,
  257. .dma_boundary = ~0, /* no dma boundaries */
  258. };
  259. static void pata_icside_postreset(struct ata_link *link, unsigned int *classes)
  260. {
  261. struct ata_port *ap = link->ap;
  262. struct pata_icside_state *state = ap->host->private_data;
  263. if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE)
  264. return ata_std_postreset(link, classes);
  265. state->port[ap->port_no].disabled = 1;
  266. if (state->type == ICS_TYPE_V6) {
  267. /*
  268. * Disable interrupts from this port, otherwise we
  269. * receive spurious interrupts from the floating
  270. * interrupt line.
  271. */
  272. void __iomem *irq_port = state->irq_port +
  273. (ap->port_no ? ICS_ARCIN_V6_INTROFFSET_2 : ICS_ARCIN_V6_INTROFFSET_1);
  274. readb(irq_port);
  275. }
  276. }
  277. static void pata_icside_error_handler(struct ata_port *ap)
  278. {
  279. ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL,
  280. pata_icside_postreset);
  281. }
  282. static struct ata_port_operations pata_icside_port_ops = {
  283. .inherits = &ata_sff_port_ops,
  284. /* no need to build any PRD tables for DMA */
  285. .qc_prep = ata_noop_qc_prep,
  286. .data_xfer = ata_data_xfer_noirq,
  287. .bmdma_setup = pata_icside_bmdma_setup,
  288. .bmdma_start = pata_icside_bmdma_start,
  289. .bmdma_stop = pata_icside_bmdma_stop,
  290. .bmdma_status = pata_icside_bmdma_status,
  291. .cable_detect = ata_cable_40wire,
  292. .set_dmamode = pata_icside_set_dmamode,
  293. .error_handler = pata_icside_error_handler,
  294. .post_internal_cmd = pata_icside_bmdma_stop,
  295. };
  296. static void __devinit
  297. pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base,
  298. struct pata_icside_info *info,
  299. const struct portinfo *port)
  300. {
  301. struct ata_ioports *ioaddr = &ap->ioaddr;
  302. void __iomem *cmd = base + port->dataoffset;
  303. ioaddr->cmd_addr = cmd;
  304. ioaddr->data_addr = cmd + (ATA_REG_DATA << port->stepping);
  305. ioaddr->error_addr = cmd + (ATA_REG_ERR << port->stepping);
  306. ioaddr->feature_addr = cmd + (ATA_REG_FEATURE << port->stepping);
  307. ioaddr->nsect_addr = cmd + (ATA_REG_NSECT << port->stepping);
  308. ioaddr->lbal_addr = cmd + (ATA_REG_LBAL << port->stepping);
  309. ioaddr->lbam_addr = cmd + (ATA_REG_LBAM << port->stepping);
  310. ioaddr->lbah_addr = cmd + (ATA_REG_LBAH << port->stepping);
  311. ioaddr->device_addr = cmd + (ATA_REG_DEVICE << port->stepping);
  312. ioaddr->status_addr = cmd + (ATA_REG_STATUS << port->stepping);
  313. ioaddr->command_addr = cmd + (ATA_REG_CMD << port->stepping);
  314. ioaddr->ctl_addr = base + port->ctrloffset;
  315. ioaddr->altstatus_addr = ioaddr->ctl_addr;
  316. ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
  317. info->raw_base + port->dataoffset,
  318. info->raw_base + port->ctrloffset);
  319. if (info->raw_ioc_base)
  320. ata_port_desc(ap, "iocbase 0x%lx", info->raw_ioc_base);
  321. }
  322. static int __devinit pata_icside_register_v5(struct pata_icside_info *info)
  323. {
  324. struct pata_icside_state *state = info->state;
  325. void __iomem *base;
  326. base = ecardm_iomap(info->ec, ECARD_RES_MEMC, 0, 0);
  327. if (!base)
  328. return -ENOMEM;
  329. state->irq_port = base;
  330. info->base = base;
  331. info->irqaddr = base + ICS_ARCIN_V5_INTRSTAT;
  332. info->irqmask = 1;
  333. info->irqops = &pata_icside_ops_arcin_v5;
  334. info->nr_ports = 1;
  335. info->port[0] = &pata_icside_portinfo_v5;
  336. info->raw_base = ecard_resource_start(info->ec, ECARD_RES_MEMC);
  337. return 0;
  338. }
  339. static int __devinit pata_icside_register_v6(struct pata_icside_info *info)
  340. {
  341. struct pata_icside_state *state = info->state;
  342. struct expansion_card *ec = info->ec;
  343. void __iomem *ioc_base, *easi_base;
  344. unsigned int sel = 0;
  345. ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
  346. if (!ioc_base)
  347. return -ENOMEM;
  348. easi_base = ioc_base;
  349. if (ecard_resource_flags(ec, ECARD_RES_EASI)) {
  350. easi_base = ecardm_iomap(ec, ECARD_RES_EASI, 0, 0);
  351. if (!easi_base)
  352. return -ENOMEM;
  353. /*
  354. * Enable access to the EASI region.
  355. */
  356. sel = 1 << 5;
  357. }
  358. writeb(sel, ioc_base);
  359. state->irq_port = easi_base;
  360. state->ioc_base = ioc_base;
  361. state->port[0].port_sel = sel;
  362. state->port[1].port_sel = sel | 1;
  363. info->base = easi_base;
  364. info->irqops = &pata_icside_ops_arcin_v6;
  365. info->nr_ports = 2;
  366. info->port[0] = &pata_icside_portinfo_v6_1;
  367. info->port[1] = &pata_icside_portinfo_v6_2;
  368. info->raw_base = ecard_resource_start(ec, ECARD_RES_EASI);
  369. info->raw_ioc_base = ecard_resource_start(ec, ECARD_RES_IOCFAST);
  370. return icside_dma_init(info);
  371. }
  372. static int __devinit pata_icside_add_ports(struct pata_icside_info *info)
  373. {
  374. struct expansion_card *ec = info->ec;
  375. struct ata_host *host;
  376. int i;
  377. if (info->irqaddr) {
  378. ec->irqaddr = info->irqaddr;
  379. ec->irqmask = info->irqmask;
  380. }
  381. if (info->irqops)
  382. ecard_setirq(ec, info->irqops, info->state);
  383. /*
  384. * Be on the safe side - disable interrupts
  385. */
  386. ec->ops->irqdisable(ec, ec->irq);
  387. host = ata_host_alloc(&ec->dev, info->nr_ports);
  388. if (!host)
  389. return -ENOMEM;
  390. host->private_data = info->state;
  391. host->flags = ATA_HOST_SIMPLEX;
  392. for (i = 0; i < info->nr_ports; i++) {
  393. struct ata_port *ap = host->ports[i];
  394. ap->pio_mask = 0x1f;
  395. ap->mwdma_mask = info->mwdma_mask;
  396. ap->flags |= ATA_FLAG_SLAVE_POSS;
  397. ap->ops = &pata_icside_port_ops;
  398. pata_icside_setup_ioaddr(ap, info->base, info, info->port[i]);
  399. }
  400. return ata_host_activate(host, ec->irq, ata_interrupt, 0,
  401. &pata_icside_sht);
  402. }
  403. static int __devinit
  404. pata_icside_probe(struct expansion_card *ec, const struct ecard_id *id)
  405. {
  406. struct pata_icside_state *state;
  407. struct pata_icside_info info;
  408. void __iomem *idmem;
  409. int ret;
  410. ret = ecard_request_resources(ec);
  411. if (ret)
  412. goto out;
  413. state = devm_kzalloc(&ec->dev, sizeof(*state), GFP_KERNEL);
  414. if (!state) {
  415. ret = -ENOMEM;
  416. goto release;
  417. }
  418. state->type = ICS_TYPE_NOTYPE;
  419. state->dma = NO_DMA;
  420. idmem = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
  421. if (idmem) {
  422. unsigned int type;
  423. type = readb(idmem + ICS_IDENT_OFFSET) & 1;
  424. type |= (readb(idmem + ICS_IDENT_OFFSET + 4) & 1) << 1;
  425. type |= (readb(idmem + ICS_IDENT_OFFSET + 8) & 1) << 2;
  426. type |= (readb(idmem + ICS_IDENT_OFFSET + 12) & 1) << 3;
  427. ecardm_iounmap(ec, idmem);
  428. state->type = type;
  429. }
  430. memset(&info, 0, sizeof(info));
  431. info.state = state;
  432. info.ec = ec;
  433. switch (state->type) {
  434. case ICS_TYPE_A3IN:
  435. dev_warn(&ec->dev, "A3IN unsupported\n");
  436. ret = -ENODEV;
  437. break;
  438. case ICS_TYPE_A3USER:
  439. dev_warn(&ec->dev, "A3USER unsupported\n");
  440. ret = -ENODEV;
  441. break;
  442. case ICS_TYPE_V5:
  443. ret = pata_icside_register_v5(&info);
  444. break;
  445. case ICS_TYPE_V6:
  446. ret = pata_icside_register_v6(&info);
  447. break;
  448. default:
  449. dev_warn(&ec->dev, "unknown interface type\n");
  450. ret = -ENODEV;
  451. break;
  452. }
  453. if (ret == 0)
  454. ret = pata_icside_add_ports(&info);
  455. if (ret == 0)
  456. goto out;
  457. release:
  458. ecard_release_resources(ec);
  459. out:
  460. return ret;
  461. }
  462. static void pata_icside_shutdown(struct expansion_card *ec)
  463. {
  464. struct ata_host *host = ecard_get_drvdata(ec);
  465. unsigned long flags;
  466. /*
  467. * Disable interrupts from this card. We need to do
  468. * this before disabling EASI since we may be accessing
  469. * this register via that region.
  470. */
  471. local_irq_save(flags);
  472. ec->ops->irqdisable(ec, ec->irq);
  473. local_irq_restore(flags);
  474. /*
  475. * Reset the ROM pointer so that we can read the ROM
  476. * after a soft reboot. This also disables access to
  477. * the IDE taskfile via the EASI region.
  478. */
  479. if (host) {
  480. struct pata_icside_state *state = host->private_data;
  481. if (state->ioc_base)
  482. writeb(0, state->ioc_base);
  483. }
  484. }
  485. static void __devexit pata_icside_remove(struct expansion_card *ec)
  486. {
  487. struct ata_host *host = ecard_get_drvdata(ec);
  488. struct pata_icside_state *state = host->private_data;
  489. ata_host_detach(host);
  490. pata_icside_shutdown(ec);
  491. /*
  492. * don't NULL out the drvdata - devres/libata wants it
  493. * to free the ata_host structure.
  494. */
  495. if (state->dma != NO_DMA)
  496. free_dma(state->dma);
  497. ecard_release_resources(ec);
  498. }
  499. static const struct ecard_id pata_icside_ids[] = {
  500. { MANU_ICS, PROD_ICS_IDE },
  501. { MANU_ICS2, PROD_ICS2_IDE },
  502. { 0xffff, 0xffff }
  503. };
  504. static struct ecard_driver pata_icside_driver = {
  505. .probe = pata_icside_probe,
  506. .remove = __devexit_p(pata_icside_remove),
  507. .shutdown = pata_icside_shutdown,
  508. .id_table = pata_icside_ids,
  509. .drv = {
  510. .name = DRV_NAME,
  511. },
  512. };
  513. static int __init pata_icside_init(void)
  514. {
  515. return ecard_register_driver(&pata_icside_driver);
  516. }
  517. static void __exit pata_icside_exit(void)
  518. {
  519. ecard_remove_driver(&pata_icside_driver);
  520. }
  521. MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
  522. MODULE_LICENSE("GPL");
  523. MODULE_DESCRIPTION("ICS PATA driver");
  524. module_init(pata_icside_init);
  525. module_exit(pata_icside_exit);