board-rx51-video.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 <plat/display.h>
  18. #include <plat/vram.h>
  19. #include <plat/mcspi.h>
  20. #include "mux.h"
  21. #define RX51_LCD_RESET_GPIO 90
  22. #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
  23. static int rx51_lcd_enable(struct omap_dss_device *dssdev)
  24. {
  25. gpio_set_value(dssdev->reset_gpio, 1);
  26. return 0;
  27. }
  28. static void rx51_lcd_disable(struct omap_dss_device *dssdev)
  29. {
  30. gpio_set_value(dssdev->reset_gpio, 0);
  31. }
  32. static struct omap_dss_device rx51_lcd_device = {
  33. .name = "lcd",
  34. .driver_name = "panel-acx565akm",
  35. .type = OMAP_DISPLAY_TYPE_SDI,
  36. .phy.sdi.datapairs = 2,
  37. .reset_gpio = RX51_LCD_RESET_GPIO,
  38. .platform_enable = rx51_lcd_enable,
  39. .platform_disable = rx51_lcd_disable,
  40. };
  41. static struct omap_dss_device *rx51_dss_devices[] = {
  42. &rx51_lcd_device,
  43. };
  44. static struct omap_dss_board_info rx51_dss_board_info = {
  45. .num_devices = ARRAY_SIZE(rx51_dss_devices),
  46. .devices = rx51_dss_devices,
  47. .default_device = &rx51_lcd_device,
  48. };
  49. struct platform_device rx51_display_device = {
  50. .name = "omapdss",
  51. .id = -1,
  52. .dev = {
  53. .platform_data = &rx51_dss_board_info,
  54. },
  55. };
  56. static struct platform_device *rx51_video_devices[] __initdata = {
  57. &rx51_display_device,
  58. };
  59. static int __init rx51_video_init(void)
  60. {
  61. if (!machine_is_nokia_rx51())
  62. return 0;
  63. if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
  64. pr_err("%s cannot configure MUX for LCD RESET\n", __func__);
  65. return 0;
  66. }
  67. if (gpio_request(RX51_LCD_RESET_GPIO, "LCD ACX565AKM reset")) {
  68. pr_err("%s failed to get LCD Reset GPIO\n", __func__);
  69. return 0;
  70. }
  71. gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
  72. platform_add_devices(rx51_video_devices,
  73. ARRAY_SIZE(rx51_video_devices));
  74. return 0;
  75. }
  76. subsys_initcall(rx51_video_init);
  77. void __init rx51_video_mem_init(void)
  78. {
  79. /*
  80. * GFX 864x480x32bpp
  81. * VID1/2 1280x720x32bpp double buffered
  82. */
  83. omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +
  84. 2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);
  85. }
  86. #else
  87. void __init rx51_video_mem_init(void) { }
  88. #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */