Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Glue code for the ISP1760 driver and bus |
| 3 | * Currently there is support for |
| 4 | * - OpenFirmware |
| 5 | * - PCI |
| 6 | * |
| 7 | * (c) 2007 Sebastian Siewior <bigeasy@linutronix.de> |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | #include <linux/usb.h> |
| 12 | #include <linux/io.h> |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 13 | #include <linux/platform_device.h> |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 14 | |
| 15 | #include "../core/hcd.h" |
| 16 | #include "isp1760-hcd.h" |
| 17 | |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 18 | #ifdef CONFIG_PPC_OF |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 19 | #include <linux/of.h> |
| 20 | #include <linux/of_platform.h> |
| 21 | #endif |
| 22 | |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 23 | #ifdef CONFIG_PCI |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 24 | #include <linux/pci.h> |
| 25 | #endif |
| 26 | |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 27 | #ifdef CONFIG_PPC_OF |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 28 | static int of_isp1760_probe(struct of_device *dev, |
| 29 | const struct of_device_id *match) |
| 30 | { |
| 31 | struct usb_hcd *hcd; |
| 32 | struct device_node *dp = dev->node; |
| 33 | struct resource *res; |
| 34 | struct resource memory; |
| 35 | struct of_irq oirq; |
| 36 | int virq; |
| 37 | u64 res_len; |
| 38 | int ret; |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 39 | const unsigned int *prop; |
| 40 | unsigned int devflags = 0; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 41 | |
| 42 | ret = of_address_to_resource(dp, 0, &memory); |
| 43 | if (ret) |
| 44 | return -ENXIO; |
| 45 | |
| 46 | res = request_mem_region(memory.start, memory.end - memory.start + 1, |
Kay Sievers | 7071a3c | 2008-05-02 06:02:41 +0200 | [diff] [blame] | 47 | dev_name(&dev->dev)); |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 48 | if (!res) |
| 49 | return -EBUSY; |
| 50 | |
| 51 | res_len = memory.end - memory.start + 1; |
| 52 | |
| 53 | if (of_irq_map_one(dp, 0, &oirq)) { |
| 54 | ret = -ENODEV; |
| 55 | goto release_reg; |
| 56 | } |
| 57 | |
| 58 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
| 59 | oirq.size); |
| 60 | |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 61 | if (of_device_is_compatible(dp, "nxp,usb-isp1761")) |
| 62 | devflags |= ISP1760_FLAG_ISP1761; |
| 63 | |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 64 | /* Some systems wire up only 16 of the 32 data lines */ |
| 65 | prop = of_get_property(dp, "bus-width", NULL); |
| 66 | if (prop && *prop == 16) |
| 67 | devflags |= ISP1760_FLAG_BUS_WIDTH_16; |
| 68 | |
| 69 | if (of_get_property(dp, "port1-otg", NULL) != NULL) |
| 70 | devflags |= ISP1760_FLAG_OTG_EN; |
| 71 | |
| 72 | if (of_get_property(dp, "analog-oc", NULL) != NULL) |
| 73 | devflags |= ISP1760_FLAG_ANALOG_OC; |
| 74 | |
| 75 | if (of_get_property(dp, "dack-polarity", NULL) != NULL) |
| 76 | devflags |= ISP1760_FLAG_DACK_POL_HIGH; |
| 77 | |
| 78 | if (of_get_property(dp, "dreq-polarity", NULL) != NULL) |
| 79 | devflags |= ISP1760_FLAG_DREQ_POL_HIGH; |
| 80 | |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 81 | hcd = isp1760_register(memory.start, res_len, virq, |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 82 | IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), |
| 83 | devflags); |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 84 | if (IS_ERR(hcd)) { |
| 85 | ret = PTR_ERR(hcd); |
| 86 | goto release_reg; |
| 87 | } |
| 88 | |
| 89 | dev_set_drvdata(&dev->dev, hcd); |
| 90 | return ret; |
| 91 | |
| 92 | release_reg: |
| 93 | release_mem_region(memory.start, memory.end - memory.start + 1); |
| 94 | return ret; |
| 95 | } |
| 96 | |
| 97 | static int of_isp1760_remove(struct of_device *dev) |
| 98 | { |
| 99 | struct usb_hcd *hcd = dev_get_drvdata(&dev->dev); |
| 100 | |
| 101 | dev_set_drvdata(&dev->dev, NULL); |
| 102 | |
| 103 | usb_remove_hcd(hcd); |
| 104 | iounmap(hcd->regs); |
| 105 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
| 106 | usb_put_hcd(hcd); |
| 107 | return 0; |
| 108 | } |
| 109 | |
| 110 | static struct of_device_id of_isp1760_match[] = { |
| 111 | { |
| 112 | .compatible = "nxp,usb-isp1760", |
| 113 | }, |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 114 | { |
| 115 | .compatible = "nxp,usb-isp1761", |
| 116 | }, |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 117 | { }, |
| 118 | }; |
| 119 | MODULE_DEVICE_TABLE(of, of_isp1760_match); |
| 120 | |
| 121 | static struct of_platform_driver isp1760_of_driver = { |
| 122 | .name = "nxp-isp1760", |
| 123 | .match_table = of_isp1760_match, |
| 124 | .probe = of_isp1760_probe, |
| 125 | .remove = of_isp1760_remove, |
| 126 | }; |
| 127 | #endif |
| 128 | |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 129 | #ifdef CONFIG_PCI |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 130 | static int __devinit isp1761_pci_probe(struct pci_dev *dev, |
| 131 | const struct pci_device_id *id) |
| 132 | { |
| 133 | u8 latency, limit; |
| 134 | __u32 reg_data; |
| 135 | int retry_count; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 136 | struct usb_hcd *hcd; |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 137 | unsigned int devflags = 0; |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 138 | int ret_status = 0; |
| 139 | |
| 140 | resource_size_t pci_mem_phy0; |
| 141 | resource_size_t memlength; |
| 142 | |
| 143 | u8 __iomem *chip_addr; |
| 144 | u8 __iomem *iobase; |
| 145 | resource_size_t nxp_pci_io_base; |
| 146 | resource_size_t iolength; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 147 | |
| 148 | if (usb_disabled()) |
| 149 | return -ENODEV; |
| 150 | |
| 151 | if (pci_enable_device(dev) < 0) |
| 152 | return -ENODEV; |
| 153 | |
| 154 | if (!dev->irq) |
| 155 | return -ENODEV; |
| 156 | |
| 157 | /* Grab the PLX PCI mem maped port start address we need */ |
| 158 | nxp_pci_io_base = pci_resource_start(dev, 0); |
| 159 | iolength = pci_resource_len(dev, 0); |
| 160 | |
| 161 | if (!request_mem_region(nxp_pci_io_base, iolength, "ISP1761 IO MEM")) { |
| 162 | printk(KERN_ERR "request region #1\n"); |
| 163 | return -EBUSY; |
| 164 | } |
| 165 | |
| 166 | iobase = ioremap_nocache(nxp_pci_io_base, iolength); |
| 167 | if (!iobase) { |
| 168 | printk(KERN_ERR "ioremap #1\n"); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 169 | ret_status = -ENOMEM; |
| 170 | goto cleanup1; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 171 | } |
| 172 | /* Grab the PLX PCI shared memory of the ISP 1761 we need */ |
| 173 | pci_mem_phy0 = pci_resource_start(dev, 3); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 174 | memlength = pci_resource_len(dev, 3); |
| 175 | if (memlength < 0xffff) { |
| 176 | printk(KERN_ERR "memory length for this resource is wrong\n"); |
| 177 | ret_status = -ENOMEM; |
| 178 | goto cleanup2; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 179 | } |
| 180 | |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 181 | if (!request_mem_region(pci_mem_phy0, memlength, "ISP-PCI")) { |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 182 | printk(KERN_ERR "host controller already in use\n"); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 183 | ret_status = -EBUSY; |
| 184 | goto cleanup2; |
| 185 | } |
| 186 | |
| 187 | /* map available memory */ |
| 188 | chip_addr = ioremap_nocache(pci_mem_phy0,memlength); |
| 189 | if (!chip_addr) { |
| 190 | printk(KERN_ERR "Error ioremap failed\n"); |
| 191 | ret_status = -ENOMEM; |
| 192 | goto cleanup3; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | /* bad pci latencies can contribute to overruns */ |
| 196 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &latency); |
| 197 | if (latency) { |
| 198 | pci_read_config_byte(dev, PCI_MAX_LAT, &limit); |
| 199 | if (limit && limit < latency) |
| 200 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, limit); |
| 201 | } |
| 202 | |
| 203 | /* Try to check whether we can access Scratch Register of |
| 204 | * Host Controller or not. The initial PCI access is retried until |
| 205 | * local init for the PCI bridge is completed |
| 206 | */ |
| 207 | retry_count = 20; |
| 208 | reg_data = 0; |
| 209 | while ((reg_data != 0xFACE) && retry_count) { |
| 210 | /*by default host is in 16bit mode, so |
| 211 | * io operations at this stage must be 16 bit |
| 212 | * */ |
| 213 | writel(0xface, chip_addr + HC_SCRATCH_REG); |
| 214 | udelay(100); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 215 | reg_data = readl(chip_addr + HC_SCRATCH_REG) & 0x0000ffff; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 216 | retry_count--; |
| 217 | } |
| 218 | |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 219 | iounmap(chip_addr); |
| 220 | |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 221 | /* Host Controller presence is detected by writing to scratch register |
| 222 | * and reading back and checking the contents are same or not |
| 223 | */ |
| 224 | if (reg_data != 0xFACE) { |
Greg Kroah-Hartman | 802f389 | 2008-08-14 09:37:34 -0700 | [diff] [blame] | 225 | dev_err(&dev->dev, "scratch register mismatch %x\n", reg_data); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 226 | ret_status = -ENOMEM; |
| 227 | goto cleanup3; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | pci_set_master(dev); |
| 231 | |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 232 | /* configure PLX PCI chip to pass interrupts */ |
| 233 | #define PLX_INT_CSR_REG 0x68 |
| 234 | reg_data = readl(iobase + PLX_INT_CSR_REG); |
| 235 | reg_data |= 0x900; |
| 236 | writel(reg_data, iobase + PLX_INT_CSR_REG); |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 237 | |
| 238 | dev->dev.dma_mask = NULL; |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 239 | hcd = isp1760_register(pci_mem_phy0, memlength, dev->irq, |
Nate Case | 3faefc8 | 2008-06-17 11:11:38 -0500 | [diff] [blame] | 240 | IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), |
| 241 | devflags); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 242 | if (IS_ERR(hcd)) { |
| 243 | ret_status = -ENODEV; |
| 244 | goto cleanup3; |
Julien Brunel | ce5dee5 | 2008-09-24 18:00:36 +0200 | [diff] [blame] | 245 | } |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 246 | |
| 247 | /* done with PLX IO access */ |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 248 | iounmap(iobase); |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 249 | release_mem_region(nxp_pci_io_base, iolength); |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 250 | |
| 251 | pci_set_drvdata(dev, hcd); |
| 252 | return 0; |
| 253 | |
| 254 | cleanup3: |
| 255 | release_mem_region(pci_mem_phy0, memlength); |
| 256 | cleanup2: |
| 257 | iounmap(iobase); |
| 258 | cleanup1: |
| 259 | release_mem_region(nxp_pci_io_base, iolength); |
| 260 | return ret_status; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 261 | } |
Karl Bongers | 6013bbb | 2008-12-01 11:47:40 +0100 | [diff] [blame] | 262 | |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 263 | static void isp1761_pci_remove(struct pci_dev *dev) |
| 264 | { |
| 265 | struct usb_hcd *hcd; |
| 266 | |
| 267 | hcd = pci_get_drvdata(dev); |
| 268 | |
| 269 | usb_remove_hcd(hcd); |
| 270 | iounmap(hcd->regs); |
| 271 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
| 272 | usb_put_hcd(hcd); |
| 273 | |
| 274 | pci_disable_device(dev); |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | static void isp1761_pci_shutdown(struct pci_dev *dev) |
| 278 | { |
| 279 | printk(KERN_ERR "ips1761_pci_shutdown\n"); |
| 280 | } |
| 281 | |
Sebastian Andrzej Siewior | 6c07356 | 2008-11-30 16:50:04 +0100 | [diff] [blame] | 282 | static const struct pci_device_id isp1760_plx [] = { |
| 283 | { |
| 284 | .class = PCI_CLASS_BRIDGE_OTHER << 8, |
| 285 | .class_mask = ~0, |
| 286 | .vendor = PCI_VENDOR_ID_PLX, |
| 287 | .device = 0x5406, |
| 288 | .subvendor = PCI_VENDOR_ID_PLX, |
| 289 | .subdevice = 0x9054, |
| 290 | }, |
| 291 | { } |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 292 | }; |
| 293 | MODULE_DEVICE_TABLE(pci, isp1760_plx); |
| 294 | |
| 295 | static struct pci_driver isp1761_pci_driver = { |
| 296 | .name = "isp1760", |
| 297 | .id_table = isp1760_plx, |
| 298 | .probe = isp1761_pci_probe, |
| 299 | .remove = isp1761_pci_remove, |
| 300 | .shutdown = isp1761_pci_shutdown, |
| 301 | }; |
| 302 | #endif |
| 303 | |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 304 | static int __devinit isp1760_plat_probe(struct platform_device *pdev) |
| 305 | { |
| 306 | int ret = 0; |
| 307 | struct usb_hcd *hcd; |
| 308 | struct resource *mem_res; |
| 309 | struct resource *irq_res; |
| 310 | resource_size_t mem_size; |
| 311 | unsigned long irqflags = IRQF_SHARED | IRQF_DISABLED; |
| 312 | |
| 313 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 314 | if (!mem_res) { |
| 315 | pr_warning("isp1760: Memory resource not available\n"); |
| 316 | ret = -ENODEV; |
| 317 | goto out; |
| 318 | } |
| 319 | mem_size = resource_size(mem_res); |
| 320 | if (!request_mem_region(mem_res->start, mem_size, "isp1760")) { |
| 321 | pr_warning("isp1760: Cannot reserve the memory resource\n"); |
| 322 | ret = -EBUSY; |
| 323 | goto out; |
| 324 | } |
| 325 | |
| 326 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
| 327 | if (!irq_res) { |
| 328 | pr_warning("isp1760: IRQ resource not available\n"); |
| 329 | return -ENODEV; |
| 330 | } |
| 331 | irqflags |= irq_res->flags & IRQF_TRIGGER_MASK; |
| 332 | |
| 333 | hcd = isp1760_register(mem_res->start, mem_size, irq_res->start, |
| 334 | irqflags, &pdev->dev, dev_name(&pdev->dev), 0); |
| 335 | if (IS_ERR(hcd)) { |
| 336 | pr_warning("isp1760: Failed to register the HCD device\n"); |
| 337 | ret = -ENODEV; |
| 338 | goto cleanup; |
| 339 | } |
| 340 | |
| 341 | pr_info("ISP1760 USB device initialised\n"); |
| 342 | return ret; |
| 343 | |
| 344 | cleanup: |
| 345 | release_mem_region(mem_res->start, mem_size); |
| 346 | out: |
| 347 | return ret; |
| 348 | } |
| 349 | |
| 350 | static int __devexit isp1760_plat_remove(struct platform_device *pdev) |
| 351 | { |
| 352 | struct resource *mem_res; |
| 353 | resource_size_t mem_size; |
| 354 | |
| 355 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 356 | mem_size = resource_size(mem_res); |
| 357 | release_mem_region(mem_res->start, mem_size); |
| 358 | |
| 359 | return 0; |
| 360 | } |
| 361 | |
| 362 | static struct platform_driver isp1760_plat_driver = { |
| 363 | .probe = isp1760_plat_probe, |
| 364 | .remove = isp1760_plat_remove, |
| 365 | .driver = { |
| 366 | .name = "isp1760", |
| 367 | }, |
| 368 | }; |
| 369 | |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 370 | static int __init isp1760_init(void) |
| 371 | { |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 372 | int ret, any_ret = -ENODEV; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 373 | |
| 374 | init_kmem_once(); |
| 375 | |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 376 | ret = platform_driver_register(&isp1760_plat_driver); |
| 377 | if (!ret) |
| 378 | any_ret = 0; |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 379 | #ifdef CONFIG_PPC_OF |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 380 | ret = of_register_platform_driver(&isp1760_of_driver); |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 381 | if (!ret) |
| 382 | any_ret = 0; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 383 | #endif |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 384 | #ifdef CONFIG_PCI |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 385 | ret = pci_register_driver(&isp1761_pci_driver); |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 386 | if (!ret) |
| 387 | any_ret = 0; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 388 | #endif |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 389 | |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 390 | if (any_ret) |
| 391 | deinit_kmem_cache(); |
| 392 | return any_ret; |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 393 | } |
| 394 | module_init(isp1760_init); |
| 395 | |
| 396 | static void __exit isp1760_exit(void) |
| 397 | { |
Catalin Marinas | f7e7aa5 | 2009-02-10 16:55:51 +0000 | [diff] [blame^] | 398 | platform_driver_unregister(&isp1760_plat_driver); |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 399 | #ifdef CONFIG_PPC_OF |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 400 | of_unregister_platform_driver(&isp1760_of_driver); |
| 401 | #endif |
Sebastian Andrzej Siewior | ff30bf1 | 2008-11-02 15:25:42 +0100 | [diff] [blame] | 402 | #ifdef CONFIG_PCI |
Sebastian Siewior | db11e47 | 2008-04-24 00:37:04 +0200 | [diff] [blame] | 403 | pci_unregister_driver(&isp1761_pci_driver); |
| 404 | #endif |
| 405 | deinit_kmem_cache(); |
| 406 | } |
| 407 | module_exit(isp1760_exit); |