dev-fb.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* linux/arch/arm/plat-s3c/dev-fb.c
  2. *
  3. * Copyright 2008 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. * http://armlinux.simtec.co.uk/
  6. *
  7. * S3C series device definition for framebuffer device
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/string.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/fb.h>
  17. #include <mach/map.h>
  18. #include <mach/regs-fb.h>
  19. #include <plat/fb.h>
  20. #include <plat/devs.h>
  21. #include <plat/cpu.h>
  22. static struct resource s3c_fb_resource[] = {
  23. [0] = {
  24. .start = S3C_PA_FB,
  25. .end = S3C_PA_FB + SZ_16K - 1,
  26. .flags = IORESOURCE_MEM,
  27. },
  28. [1] = {
  29. .start = IRQ_LCD_VSYNC,
  30. .end = IRQ_LCD_VSYNC,
  31. .flags = IORESOURCE_IRQ,
  32. },
  33. [2] = {
  34. .start = IRQ_LCD_FIFO,
  35. .end = IRQ_LCD_FIFO,
  36. .flags = IORESOURCE_IRQ,
  37. },
  38. [3] = {
  39. .start = IRQ_LCD_SYSTEM,
  40. .end = IRQ_LCD_SYSTEM,
  41. .flags = IORESOURCE_IRQ,
  42. },
  43. };
  44. struct platform_device s3c_device_fb = {
  45. .name = "s3c-fb",
  46. .id = -1,
  47. .num_resources = ARRAY_SIZE(s3c_fb_resource),
  48. .resource = s3c_fb_resource,
  49. .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
  50. .dev.coherent_dma_mask = 0xffffffffUL,
  51. };
  52. void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
  53. {
  54. struct s3c_fb_platdata *npd;
  55. if (!pd) {
  56. printk(KERN_ERR "%s: no platform data\n", __func__);
  57. return;
  58. }
  59. npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
  60. if (!npd)
  61. printk(KERN_ERR "%s: no memory for platform data\n", __func__);
  62. s3c_device_fb.dev.platform_data = npd;
  63. }