board-rx51-video.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * linux/arch/arm/mach-omap2/board-rx51-video.c
  3. *
  4. * Copyright (C) 2010 Nokia
  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/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/gpio.h>
  14. #include <linux/spi/spi.h>
  15. #include <linux/mm.h>
  16. #include <asm/mach-types.h>
  17. #include <video/omapdss.h>
  18. #include <plat/vram.h>
  19. #include <plat/mcspi.h>
  20. #include <mach/board-rx51.h>
  21. #include "mux.h"
  22. #define RX51_LCD_RESET_GPIO 90
  23. #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
  24. static int rx51_lcd_enable(struct omap_dss_device *dssdev)
  25. {
  26. gpio_set_value(dssdev->reset_gpio, 1);
  27. return 0;
  28. }
  29. static void rx51_lcd_disable(struct omap_dss_device *dssdev)
  30. {
  31. gpio_set_value(dssdev->reset_gpio, 0);
  32. }
  33. static struct omap_dss_device rx51_lcd_device = {
  34. .name = "lcd",
  35. .driver_name = "panel-acx565akm",
  36. .type = OMAP_DISPLAY_TYPE_SDI,
  37. .phy.sdi.datapairs = 2,
  38. .reset_gpio = RX51_LCD_RESET_GPIO,
  39. .platform_enable = rx51_lcd_enable,
  40. .platform_disable = rx51_lcd_disable,
  41. };
  42. static struct omap_dss_device rx51_tv_device = {
  43. .name = "tv",
  44. .type = OMAP_DISPLAY_TYPE_VENC,
  45. .driver_name = "venc",
  46. .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
  47. };
  48. static struct omap_dss_device *rx51_dss_devices[] = {
  49. &rx51_lcd_device,
  50. &rx51_tv_device,
  51. };
  52. static struct omap_dss_board_info rx51_dss_board_info = {
  53. .num_devices = ARRAY_SIZE(rx51_dss_devices),
  54. .devices = rx51_dss_devices,
  55. .default_device = &rx51_lcd_device,
  56. };
  57. static int __init rx51_video_init(void)
  58. {
  59. if (!machine_is_nokia_rx51())
  60. return 0;
  61. if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
  62. pr_err("%s cannot configure MUX for LCD RESET\n", __func__);
  63. return 0;
  64. }
  65. if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
  66. "LCD ACX565AKM reset")) {
  67. pr_err("%s failed to get LCD Reset GPIO\n", __func__);
  68. return 0;
  69. }
  70. omap_display_init(&rx51_dss_board_info);
  71. return 0;
  72. }
  73. subsys_initcall(rx51_video_init);
  74. void __init rx51_video_mem_init(void)
  75. {
  76. /*
  77. * GFX 864x480x32bpp
  78. * VID1/2 1280x720x32bpp double buffered
  79. */
  80. omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +
  81. 2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);
  82. }
  83. #else
  84. void __init rx51_video_mem_init(void) { }
  85. #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */