dev-fb.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 <linux/gfp.h>
  18. #include <mach/irqs.h>
  19. #include <mach/map.h>
  20. #include <plat/fb.h>
  21. #include <plat/devs.h>
  22. #include <plat/cpu.h>
  23. static struct resource s3c_fb_resource[] = {
  24. [0] = {
  25. .start = S3C_PA_FB,
  26. .end = S3C_PA_FB + SZ_16K - 1,
  27. .flags = IORESOURCE_MEM,
  28. },
  29. [1] = {
  30. .start = IRQ_LCD_VSYNC,
  31. .end = IRQ_LCD_VSYNC,
  32. .flags = IORESOURCE_IRQ,
  33. },
  34. [2] = {
  35. .start = IRQ_LCD_FIFO,
  36. .end = IRQ_LCD_FIFO,
  37. .flags = IORESOURCE_IRQ,
  38. },
  39. [3] = {
  40. .start = IRQ_LCD_SYSTEM,
  41. .end = IRQ_LCD_SYSTEM,
  42. .flags = IORESOURCE_IRQ,
  43. },
  44. };
  45. struct platform_device s3c_device_fb = {
  46. .name = "s3c-fb",
  47. .id = -1,
  48. .num_resources = ARRAY_SIZE(s3c_fb_resource),
  49. .resource = s3c_fb_resource,
  50. .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
  51. .dev.coherent_dma_mask = 0xffffffffUL,
  52. };
  53. void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
  54. {
  55. struct s3c_fb_platdata *npd;
  56. if (!pd) {
  57. printk(KERN_ERR "%s: no platform data\n", __func__);
  58. return;
  59. }
  60. npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
  61. if (!npd)
  62. printk(KERN_ERR "%s: no memory for platform data\n", __func__);
  63. s3c_device_fb.dev.platform_data = npd;
  64. }