board-zoom-display.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2010 Texas Instruments Inc.
  3. *
  4. * Modified from mach-omap2/board-zoom-peripherals.c
  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/platform_data/spi-omap2-mcspi.h>
  16. #include <video/omapdss.h>
  17. #include "board-zoom.h"
  18. #include "soc.h"
  19. #include "common.h"
  20. #define LCD_PANEL_RESET_GPIO_PROD 96
  21. #define LCD_PANEL_RESET_GPIO_PILOT 55
  22. #define LCD_PANEL_QVGA_GPIO 56
  23. static struct gpio zoom_lcd_gpios[] __initdata = {
  24. { -EINVAL, GPIOF_OUT_INIT_HIGH, "lcd reset" },
  25. { LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "lcd qvga" },
  26. };
  27. static void __init zoom_lcd_panel_init(void)
  28. {
  29. zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
  30. LCD_PANEL_RESET_GPIO_PROD :
  31. LCD_PANEL_RESET_GPIO_PILOT;
  32. if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
  33. pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
  34. }
  35. static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
  36. {
  37. return 0;
  38. }
  39. static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
  40. {
  41. }
  42. static struct omap_dss_device zoom_lcd_device = {
  43. .name = "lcd",
  44. .driver_name = "NEC_8048_panel",
  45. .type = OMAP_DISPLAY_TYPE_DPI,
  46. .phy.dpi.data_lines = 24,
  47. .platform_enable = zoom_panel_enable_lcd,
  48. .platform_disable = zoom_panel_disable_lcd,
  49. };
  50. static struct omap_dss_device *zoom_dss_devices[] = {
  51. &zoom_lcd_device,
  52. };
  53. static struct omap_dss_board_info zoom_dss_data = {
  54. .num_devices = ARRAY_SIZE(zoom_dss_devices),
  55. .devices = zoom_dss_devices,
  56. .default_device = &zoom_lcd_device,
  57. };
  58. static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
  59. .turbo_mode = 1,
  60. };
  61. static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
  62. [0] = {
  63. .modalias = "nec_8048_spi",
  64. .bus_num = 1,
  65. .chip_select = 2,
  66. .max_speed_hz = 375000,
  67. .controller_data = &dss_lcd_mcspi_config,
  68. },
  69. };
  70. void __init zoom_display_init(void)
  71. {
  72. omap_display_init(&zoom_dss_data);
  73. spi_register_board_info(nec_8048_spi_board_info,
  74. ARRAY_SIZE(nec_8048_spi_board_info));
  75. zoom_lcd_panel_init();
  76. }