board-rx51-video.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <linux/platform_data/spi-omap2-mcspi.h>
  19. #include "board-rx51.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_tv_device = {
  42. .name = "tv",
  43. .type = OMAP_DISPLAY_TYPE_VENC,
  44. .driver_name = "venc",
  45. .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
  46. };
  47. static struct omap_dss_device *rx51_dss_devices[] = {
  48. &rx51_lcd_device,
  49. &rx51_tv_device,
  50. };
  51. static struct omap_dss_board_info rx51_dss_board_info = {
  52. .num_devices = ARRAY_SIZE(rx51_dss_devices),
  53. .devices = rx51_dss_devices,
  54. .default_device = &rx51_lcd_device,
  55. };
  56. static int __init rx51_video_init(void)
  57. {
  58. if (!machine_is_nokia_rx51())
  59. return 0;
  60. if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {
  61. pr_err("%s cannot configure MUX for LCD RESET\n", __func__);
  62. return 0;
  63. }
  64. if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
  65. "LCD ACX565AKM reset")) {
  66. pr_err("%s failed to get LCD Reset GPIO\n", __func__);
  67. return 0;
  68. }
  69. omap_display_init(&rx51_dss_board_info);
  70. return 0;
  71. }
  72. subsys_initcall(rx51_video_init);
  73. #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */