Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-integrator/impd1.c |
| 3 | * |
| 4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This file provides the core support for the IM-PD1 module. |
| 11 | * |
| 12 | * Module / boot parameters. |
| 13 | * lmid=n impd1.lmid=n - set the logic module position in stack to 'n' |
| 14 | */ |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/moduleparam.h> |
| 17 | #include <linux/init.h> |
| 18 | #include <linux/device.h> |
| 19 | #include <linux/errno.h> |
| 20 | #include <linux/mm.h> |
Russell King | a62c80e | 2006-01-07 13:52:45 +0000 | [diff] [blame] | 21 | #include <linux/amba/bus.h> |
| 22 | #include <linux/amba/clcd.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 23 | #include <linux/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
Russell King | d72fbdf | 2008-11-08 20:08:08 +0000 | [diff] [blame] | 25 | #include <asm/clkdev.h> |
| 26 | #include <mach/clkdev.h> |
Russell King | c5a0adb | 2010-01-16 20:16:10 +0000 | [diff] [blame] | 27 | #include <asm/hardware/icst.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | #include <mach/lm.h> |
| 29 | #include <mach/impd1.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <asm/sizes.h> |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | static int module_id; |
| 33 | |
| 34 | module_param_named(lmid, module_id, int, 0444); |
| 35 | MODULE_PARM_DESC(lmid, "logic module stack position"); |
| 36 | |
| 37 | struct impd1_module { |
| 38 | void __iomem *base; |
| 39 | struct clk vcos[2]; |
Russell King | d72fbdf | 2008-11-08 20:08:08 +0000 | [diff] [blame] | 40 | struct clk_lookup *clks[3]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
Russell King | 39c0cb0 | 2010-01-16 16:27:28 +0000 | [diff] [blame] | 43 | static const struct icst_params impd1_vco_params = { |
Russell King | 64fceb1 | 2010-01-16 17:28:44 +0000 | [diff] [blame] | 44 | .ref = 24000000, /* 24 MHz */ |
Russell King | 4de2edb | 2010-01-16 18:08:47 +0000 | [diff] [blame] | 45 | .vco_max = ICST525_VCO_MAX_3V, |
Russell King | e73a46a | 2010-01-16 19:49:39 +0000 | [diff] [blame] | 46 | .vco_min = ICST525_VCO_MIN, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | .vd_min = 12, |
| 48 | .vd_max = 519, |
| 49 | .rd_min = 3, |
| 50 | .rd_max = 120, |
Russell King | 232eaf7 | 2010-01-16 19:46:19 +0000 | [diff] [blame] | 51 | .s2div = icst525_s2div, |
| 52 | .idx2s = icst525_idx2s, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
Russell King | 39c0cb0 | 2010-01-16 16:27:28 +0000 | [diff] [blame] | 55 | static void impd1_setvco(struct clk *clk, struct icst_vco vco) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | { |
| 57 | struct impd1_module *impd1 = clk->data; |
Russell King | d1914c7 | 2010-01-14 20:09:34 +0000 | [diff] [blame^] | 58 | u32 val = vco.v | (vco.r << 9) | (vco.s << 16); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | writel(0xa05f, impd1->base + IMPD1_LOCK); |
Russell King | d1914c7 | 2010-01-14 20:09:34 +0000 | [diff] [blame^] | 61 | writel(val, clk->vcoreg); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | writel(0, impd1->base + IMPD1_LOCK); |
| 63 | |
Russell King | d185663 | 2005-10-21 10:17:37 +0100 | [diff] [blame] | 64 | #ifdef DEBUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | vco.v = val & 0x1ff; |
| 66 | vco.r = (val >> 9) & 0x7f; |
| 67 | vco.s = (val >> 16) & 7; |
| 68 | |
Russell King | 64fceb1 | 2010-01-16 17:28:44 +0000 | [diff] [blame] | 69 | pr_debug("IM-PD1: VCO%d clock is %ld Hz\n", |
| 70 | vconr, icst525_hz(&impd1_vco_params, vco)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | #endif |
| 72 | } |
| 73 | |
| 74 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) |
| 75 | { |
| 76 | struct impd1_module *impd1 = dev_get_drvdata(dev); |
| 77 | u32 cur; |
| 78 | |
| 79 | val &= mask; |
| 80 | cur = readl(impd1->base + IMPD1_CTRL) & ~mask; |
| 81 | writel(cur | val, impd1->base + IMPD1_CTRL); |
| 82 | } |
| 83 | |
| 84 | EXPORT_SYMBOL(impd1_tweak_control); |
| 85 | |
| 86 | /* |
| 87 | * CLCD support |
| 88 | */ |
| 89 | #define PANEL PROSPECTOR |
| 90 | |
| 91 | #define LTM10C209 1 |
| 92 | #define PROSPECTOR 2 |
| 93 | #define SVGA 3 |
| 94 | #define VGA 4 |
| 95 | |
| 96 | #if PANEL == VGA |
| 97 | #define PANELTYPE vga |
| 98 | static struct clcd_panel vga = { |
| 99 | .mode = { |
| 100 | .name = "VGA", |
| 101 | .refresh = 60, |
| 102 | .xres = 640, |
| 103 | .yres = 480, |
| 104 | .pixclock = 39721, |
| 105 | .left_margin = 40, |
| 106 | .right_margin = 24, |
| 107 | .upper_margin = 32, |
| 108 | .lower_margin = 11, |
| 109 | .hsync_len = 96, |
| 110 | .vsync_len = 2, |
| 111 | .sync = 0, |
| 112 | .vmode = FB_VMODE_NONINTERLACED, |
| 113 | }, |
| 114 | .width = -1, |
| 115 | .height = -1, |
| 116 | .tim2 = TIM2_BCD | TIM2_IPC, |
| 117 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
| 118 | .connector = IMPD1_CTRL_DISP_VGA, |
| 119 | .bpp = 16, |
| 120 | .grayscale = 0, |
| 121 | }; |
| 122 | |
| 123 | #elif PANEL == SVGA |
| 124 | #define PANELTYPE svga |
| 125 | static struct clcd_panel svga = { |
| 126 | .mode = { |
| 127 | .name = "SVGA", |
| 128 | .refresh = 0, |
| 129 | .xres = 800, |
| 130 | .yres = 600, |
| 131 | .pixclock = 27778, |
| 132 | .left_margin = 20, |
| 133 | .right_margin = 20, |
| 134 | .upper_margin = 5, |
| 135 | .lower_margin = 5, |
| 136 | .hsync_len = 164, |
| 137 | .vsync_len = 62, |
| 138 | .sync = 0, |
| 139 | .vmode = FB_VMODE_NONINTERLACED, |
| 140 | }, |
| 141 | .width = -1, |
| 142 | .height = -1, |
| 143 | .tim2 = TIM2_BCD, |
| 144 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
| 145 | .connector = IMPD1_CTRL_DISP_VGA, |
| 146 | .bpp = 16, |
| 147 | .grayscale = 0, |
| 148 | }; |
| 149 | |
| 150 | #elif PANEL == PROSPECTOR |
| 151 | #define PANELTYPE prospector |
| 152 | static struct clcd_panel prospector = { |
| 153 | .mode = { |
| 154 | .name = "PROSPECTOR", |
| 155 | .refresh = 0, |
| 156 | .xres = 640, |
| 157 | .yres = 480, |
| 158 | .pixclock = 40000, |
| 159 | .left_margin = 33, |
| 160 | .right_margin = 64, |
| 161 | .upper_margin = 36, |
| 162 | .lower_margin = 7, |
| 163 | .hsync_len = 64, |
| 164 | .vsync_len = 25, |
| 165 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 166 | .vmode = FB_VMODE_NONINTERLACED, |
| 167 | }, |
| 168 | .width = -1, |
| 169 | .height = -1, |
| 170 | .tim2 = TIM2_BCD, |
| 171 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
| 172 | .fixedtimings = 1, |
| 173 | .connector = IMPD1_CTRL_DISP_LCD, |
| 174 | .bpp = 16, |
| 175 | .grayscale = 0, |
| 176 | }; |
| 177 | |
| 178 | #elif PANEL == LTM10C209 |
| 179 | #define PANELTYPE ltm10c209 |
| 180 | /* |
| 181 | * Untested. |
| 182 | */ |
| 183 | static struct clcd_panel ltm10c209 = { |
| 184 | .mode = { |
| 185 | .name = "LTM10C209", |
| 186 | .refresh = 0, |
| 187 | .xres = 640, |
| 188 | .yres = 480, |
| 189 | .pixclock = 40000, |
| 190 | .left_margin = 20, |
| 191 | .right_margin = 20, |
| 192 | .upper_margin = 19, |
| 193 | .lower_margin = 19, |
| 194 | .hsync_len = 20, |
| 195 | .vsync_len = 10, |
| 196 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 197 | .vmode = FB_VMODE_NONINTERLACED, |
| 198 | }, |
| 199 | .width = -1, |
| 200 | .height = -1, |
| 201 | .tim2 = TIM2_BCD, |
| 202 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
| 203 | .fixedtimings = 1, |
| 204 | .connector = IMPD1_CTRL_DISP_LCD, |
| 205 | .bpp = 16, |
| 206 | .grayscale = 0, |
| 207 | }; |
| 208 | #endif |
| 209 | |
| 210 | /* |
| 211 | * Disable all display connectors on the interface module. |
| 212 | */ |
| 213 | static void impd1fb_clcd_disable(struct clcd_fb *fb) |
| 214 | { |
| 215 | impd1_tweak_control(fb->dev->dev.parent, IMPD1_CTRL_DISP_MASK, 0); |
| 216 | } |
| 217 | |
| 218 | /* |
| 219 | * Enable the relevant connector on the interface module. |
| 220 | */ |
| 221 | static void impd1fb_clcd_enable(struct clcd_fb *fb) |
| 222 | { |
| 223 | impd1_tweak_control(fb->dev->dev.parent, IMPD1_CTRL_DISP_MASK, |
| 224 | fb->panel->connector | IMPD1_CTRL_DISP_ENABLE); |
| 225 | } |
| 226 | |
| 227 | static int impd1fb_clcd_setup(struct clcd_fb *fb) |
| 228 | { |
| 229 | unsigned long framebase = fb->dev->res.start + 0x01000000; |
| 230 | unsigned long framesize = SZ_1M; |
| 231 | int ret = 0; |
| 232 | |
| 233 | fb->panel = &PANELTYPE; |
| 234 | |
| 235 | if (!request_mem_region(framebase, framesize, "clcd framebuffer")) { |
| 236 | printk(KERN_ERR "IM-PD1: unable to reserve framebuffer\n"); |
| 237 | return -EBUSY; |
| 238 | } |
| 239 | |
| 240 | fb->fb.screen_base = ioremap(framebase, framesize); |
| 241 | if (!fb->fb.screen_base) { |
| 242 | printk(KERN_ERR "IM-PD1: unable to map framebuffer\n"); |
| 243 | ret = -ENOMEM; |
| 244 | goto free_buffer; |
| 245 | } |
| 246 | |
| 247 | fb->fb.fix.smem_start = framebase; |
| 248 | fb->fb.fix.smem_len = framesize; |
| 249 | |
| 250 | return 0; |
| 251 | |
| 252 | free_buffer: |
| 253 | release_mem_region(framebase, framesize); |
| 254 | return ret; |
| 255 | } |
| 256 | |
| 257 | static int impd1fb_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) |
| 258 | { |
| 259 | unsigned long start, size; |
| 260 | |
| 261 | start = vma->vm_pgoff + (fb->fb.fix.smem_start >> PAGE_SHIFT); |
| 262 | size = vma->vm_end - vma->vm_start; |
| 263 | |
| 264 | return remap_pfn_range(vma, vma->vm_start, start, size, |
| 265 | vma->vm_page_prot); |
| 266 | } |
| 267 | |
| 268 | static void impd1fb_clcd_remove(struct clcd_fb *fb) |
| 269 | { |
| 270 | iounmap(fb->fb.screen_base); |
| 271 | release_mem_region(fb->fb.fix.smem_start, fb->fb.fix.smem_len); |
| 272 | } |
| 273 | |
| 274 | static struct clcd_board impd1_clcd_data = { |
| 275 | .name = "IM-PD/1", |
| 276 | .check = clcdfb_check, |
| 277 | .decode = clcdfb_decode, |
| 278 | .disable = impd1fb_clcd_disable, |
| 279 | .enable = impd1fb_clcd_enable, |
| 280 | .setup = impd1fb_clcd_setup, |
| 281 | .mmap = impd1fb_clcd_mmap, |
| 282 | .remove = impd1fb_clcd_remove, |
| 283 | }; |
| 284 | |
| 285 | struct impd1_device { |
| 286 | unsigned long offset; |
| 287 | unsigned int irq[2]; |
| 288 | unsigned int id; |
| 289 | void *platform_data; |
| 290 | }; |
| 291 | |
| 292 | static struct impd1_device impd1_devs[] = { |
| 293 | { |
| 294 | .offset = 0x03000000, |
| 295 | .id = 0x00041190, |
| 296 | }, { |
| 297 | .offset = 0x00100000, |
| 298 | .irq = { 1 }, |
| 299 | .id = 0x00141011, |
| 300 | }, { |
| 301 | .offset = 0x00200000, |
| 302 | .irq = { 2 }, |
| 303 | .id = 0x00141011, |
| 304 | }, { |
| 305 | .offset = 0x00300000, |
| 306 | .irq = { 3 }, |
| 307 | .id = 0x00041022, |
| 308 | }, { |
| 309 | .offset = 0x00400000, |
| 310 | .irq = { 4 }, |
| 311 | .id = 0x00041061, |
| 312 | }, { |
| 313 | .offset = 0x00500000, |
| 314 | .irq = { 5 }, |
| 315 | .id = 0x00041061, |
| 316 | }, { |
| 317 | .offset = 0x00600000, |
| 318 | .irq = { 6 }, |
| 319 | .id = 0x00041130, |
| 320 | }, { |
| 321 | .offset = 0x00700000, |
| 322 | .irq = { 7, 8 }, |
| 323 | .id = 0x00041181, |
| 324 | }, { |
| 325 | .offset = 0x00800000, |
| 326 | .irq = { 9 }, |
| 327 | .id = 0x00041041, |
| 328 | }, { |
| 329 | .offset = 0x01000000, |
| 330 | .irq = { 11 }, |
| 331 | .id = 0x00041110, |
| 332 | .platform_data = &impd1_clcd_data, |
| 333 | } |
| 334 | }; |
| 335 | |
Russell King | d72fbdf | 2008-11-08 20:08:08 +0000 | [diff] [blame] | 336 | static struct clk fixed_14745600 = { |
| 337 | .rate = 14745600, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | }; |
| 339 | |
| 340 | static int impd1_probe(struct lm_device *dev) |
| 341 | { |
| 342 | struct impd1_module *impd1; |
| 343 | int i, ret; |
| 344 | |
| 345 | if (dev->id != module_id) |
| 346 | return -EINVAL; |
| 347 | |
| 348 | if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) |
| 349 | return -EBUSY; |
| 350 | |
Russell King | d2a02b9 | 2006-03-20 19:46:41 +0000 | [diff] [blame] | 351 | impd1 = kzalloc(sizeof(struct impd1_module), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | if (!impd1) { |
| 353 | ret = -ENOMEM; |
| 354 | goto release_lm; |
| 355 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | |
| 357 | impd1->base = ioremap(dev->resource.start, SZ_4K); |
| 358 | if (!impd1->base) { |
| 359 | ret = -ENOMEM; |
| 360 | goto free_impd1; |
| 361 | } |
| 362 | |
| 363 | lm_set_drvdata(dev, impd1); |
| 364 | |
Russell King | 7c28472 | 2008-05-23 19:35:52 +0100 | [diff] [blame] | 365 | printk("IM-PD1 found at 0x%08lx\n", |
| 366 | (unsigned long)dev->resource.start); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | |
| 368 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { |
| 369 | impd1->vcos[i].owner = THIS_MODULE, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | impd1->vcos[i].params = &impd1_vco_params, |
| 371 | impd1->vcos[i].data = impd1, |
| 372 | impd1->vcos[i].setvco = impd1_setvco; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | } |
Russell King | d1914c7 | 2010-01-14 20:09:34 +0000 | [diff] [blame^] | 374 | impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1; |
| 375 | impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | |
Russell King | d72fbdf | 2008-11-08 20:08:08 +0000 | [diff] [blame] | 377 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", |
| 378 | dev->id); |
| 379 | impd1->clks[1] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00100", |
| 380 | dev->id); |
| 381 | impd1->clks[2] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00200", |
| 382 | dev->id); |
| 383 | for (i = 0; i < ARRAY_SIZE(impd1->clks); i++) |
| 384 | clkdev_add(impd1->clks[i]); |
| 385 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { |
| 387 | struct impd1_device *idev = impd1_devs + i; |
| 388 | struct amba_device *d; |
| 389 | unsigned long pc_base; |
| 390 | |
| 391 | pc_base = dev->resource.start + idev->offset; |
| 392 | |
Russell King | d2a02b9 | 2006-03-20 19:46:41 +0000 | [diff] [blame] | 393 | d = kzalloc(sizeof(struct amba_device), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | if (!d) |
| 395 | continue; |
| 396 | |
Kay Sievers | 3f97870 | 2008-05-30 17:42:11 +0200 | [diff] [blame] | 397 | dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | d->dev.parent = &dev->dev; |
| 399 | d->res.start = dev->resource.start + idev->offset; |
| 400 | d->res.end = d->res.start + SZ_4K - 1; |
| 401 | d->res.flags = IORESOURCE_MEM; |
| 402 | d->irq[0] = dev->irq; |
| 403 | d->irq[1] = dev->irq; |
| 404 | d->periphid = idev->id; |
| 405 | d->dev.platform_data = idev->platform_data; |
| 406 | |
| 407 | ret = amba_device_register(d, &dev->resource); |
| 408 | if (ret) { |
Russell King | faa64c9 | 2008-08-05 10:36:00 +0100 | [diff] [blame] | 409 | dev_err(&d->dev, "unable to register device: %d\n", ret); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | kfree(d); |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | return 0; |
| 415 | |
| 416 | free_impd1: |
| 417 | if (impd1 && impd1->base) |
| 418 | iounmap(impd1->base); |
Jesper Juhl | b2325fe | 2005-11-07 01:01:35 -0800 | [diff] [blame] | 419 | kfree(impd1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 420 | release_lm: |
| 421 | release_mem_region(dev->resource.start, SZ_4K); |
| 422 | return ret; |
| 423 | } |
| 424 | |
Russell King | d185663 | 2005-10-21 10:17:37 +0100 | [diff] [blame] | 425 | static int impd1_remove_one(struct device *dev, void *data) |
| 426 | { |
| 427 | device_unregister(dev); |
| 428 | return 0; |
| 429 | } |
| 430 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 431 | static void impd1_remove(struct lm_device *dev) |
| 432 | { |
| 433 | struct impd1_module *impd1 = lm_get_drvdata(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | int i; |
| 435 | |
Russell King | d185663 | 2005-10-21 10:17:37 +0100 | [diff] [blame] | 436 | device_for_each_child(&dev->dev, NULL, impd1_remove_one); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 437 | |
Russell King | d72fbdf | 2008-11-08 20:08:08 +0000 | [diff] [blame] | 438 | for (i = 0; i < ARRAY_SIZE(impd1->clks); i++) |
| 439 | clkdev_drop(impd1->clks[i]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | |
| 441 | lm_set_drvdata(dev, NULL); |
| 442 | |
| 443 | iounmap(impd1->base); |
| 444 | kfree(impd1); |
| 445 | release_mem_region(dev->resource.start, SZ_4K); |
| 446 | } |
| 447 | |
| 448 | static struct lm_driver impd1_driver = { |
| 449 | .drv = { |
| 450 | .name = "impd1", |
| 451 | }, |
| 452 | .probe = impd1_probe, |
| 453 | .remove = impd1_remove, |
| 454 | }; |
| 455 | |
| 456 | static int __init impd1_init(void) |
| 457 | { |
| 458 | return lm_driver_register(&impd1_driver); |
| 459 | } |
| 460 | |
| 461 | static void __exit impd1_exit(void) |
| 462 | { |
| 463 | lm_driver_unregister(&impd1_driver); |
| 464 | } |
| 465 | |
| 466 | module_init(impd1_init); |
| 467 | module_exit(impd1_exit); |
| 468 | |
| 469 | MODULE_LICENSE("GPL"); |
| 470 | MODULE_DESCRIPTION("Integrator/IM-PD1 logic module core driver"); |
| 471 | MODULE_AUTHOR("Deep Blue Solutions Ltd"); |