fb.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * File: arch/arm/plat-omap/fb.c
  3. *
  4. * Framebuffer device registration for TI OMAP platforms
  5. *
  6. * Copyright (C) 2006 Nokia Corporation
  7. * Author: Imre Deak <imre.deak@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write to the Free Software Foundation, Inc.,
  21. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. */
  23. #include <linux/module.h>
  24. #include <linux/kernel.h>
  25. #include <linux/mm.h>
  26. #include <linux/init.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/memblock.h>
  29. #include <linux/io.h>
  30. #include <linux/omapfb.h>
  31. #include <mach/hardware.h>
  32. #include <asm/mach/map.h>
  33. #include <plat/board.h>
  34. #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
  35. static struct omapfb_platform_data omapfb_config;
  36. static u64 omap_fb_dma_mask = ~(u32)0;
  37. static struct platform_device omap_fb_device = {
  38. .name = "omapfb",
  39. .id = -1,
  40. .dev = {
  41. .dma_mask = &omap_fb_dma_mask,
  42. .coherent_dma_mask = ~(u32)0,
  43. .platform_data = &omapfb_config,
  44. },
  45. .num_resources = 0,
  46. };
  47. void omapfb_set_platform_data(struct omapfb_platform_data *data)
  48. {
  49. }
  50. static int __init omap_init_fb(void)
  51. {
  52. const struct omap_lcd_config *conf;
  53. conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
  54. if (conf == NULL)
  55. return 0;
  56. omapfb_config.lcd = *conf;
  57. return platform_device_register(&omap_fb_device);
  58. }
  59. arch_initcall(omap_init_fb);
  60. #elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
  61. static u64 omap_fb_dma_mask = ~(u32)0;
  62. static struct omapfb_platform_data omapfb_config;
  63. static struct platform_device omap_fb_device = {
  64. .name = "omapfb",
  65. .id = -1,
  66. .dev = {
  67. .dma_mask = &omap_fb_dma_mask,
  68. .coherent_dma_mask = ~(u32)0,
  69. .platform_data = &omapfb_config,
  70. },
  71. .num_resources = 0,
  72. };
  73. void omapfb_set_platform_data(struct omapfb_platform_data *data)
  74. {
  75. omapfb_config = *data;
  76. }
  77. static int __init omap_init_fb(void)
  78. {
  79. return platform_device_register(&omap_fb_device);
  80. }
  81. arch_initcall(omap_init_fb);
  82. #else
  83. void omapfb_set_platform_data(struct omapfb_platform_data *data)
  84. {
  85. }
  86. #endif