display.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Display setup code for the Merisc board
  3. *
  4. * Copyright (C) 2008 Martinsson Elektronik AB
  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. #include <linux/init.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/fb.h>
  13. #include <video/atmel_lcdc.h>
  14. #include <asm/setup.h>
  15. #include <mach/board.h>
  16. #include "merisc.h"
  17. static struct fb_videomode merisc_fb_videomode[] = {
  18. {
  19. .refresh = 44,
  20. .xres = 640,
  21. .yres = 480,
  22. .left_margin = 96,
  23. .right_margin = 96,
  24. .upper_margin = 34,
  25. .lower_margin = 8,
  26. .hsync_len = 64,
  27. .vsync_len = 64,
  28. .name = "640x480 @ 44",
  29. .pixclock = KHZ2PICOS(25180),
  30. .sync = 0,
  31. .vmode = FB_VMODE_NONINTERLACED,
  32. },
  33. };
  34. static struct fb_monspecs merisc_fb_monspecs = {
  35. .manufacturer = "Kyo",
  36. .monitor = "TCG075VG2AD",
  37. .modedb = merisc_fb_videomode,
  38. .modedb_len = ARRAY_SIZE(merisc_fb_videomode),
  39. .hfmin = 30000,
  40. .hfmax = 33333,
  41. .vfmin = 60,
  42. .vfmax = 90,
  43. .dclkmax = 30000000,
  44. };
  45. struct atmel_lcdfb_pdata merisc_lcdc_data = {
  46. .default_bpp = 24,
  47. .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
  48. .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
  49. | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
  50. | ATMEL_LCDC_MEMOR_BIG),
  51. .default_monspecs = &merisc_fb_monspecs,
  52. .guard_time = 2,
  53. };
  54. static int __init merisc_display_init(void)
  55. {
  56. at32_add_device_lcdc(0, &merisc_lcdc_data, fbmem_start,
  57. fbmem_size, 0);
  58. return 0;
  59. }
  60. device_initcall(merisc_display_init);