board-zoom-display.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 <video/omap-panel-data.h>
  18. #include "board-zoom.h"
  19. #include "soc.h"
  20. #include "common.h"
  21. #define LCD_PANEL_RESET_GPIO_PROD 96
  22. #define LCD_PANEL_RESET_GPIO_PILOT 55
  23. #define LCD_PANEL_QVGA_GPIO 56
  24. static struct panel_nec_nl8048_data zoom_lcd_data = {
  25. /* res_gpio filled in code */
  26. .qvga_gpio = LCD_PANEL_QVGA_GPIO,
  27. };
  28. static struct omap_dss_device zoom_lcd_device = {
  29. .name = "lcd",
  30. .driver_name = "NEC_8048_panel",
  31. .type = OMAP_DISPLAY_TYPE_DPI,
  32. .phy.dpi.data_lines = 24,
  33. .data = &zoom_lcd_data,
  34. };
  35. static struct omap_dss_device *zoom_dss_devices[] = {
  36. &zoom_lcd_device,
  37. };
  38. static struct omap_dss_board_info zoom_dss_data = {
  39. .num_devices = ARRAY_SIZE(zoom_dss_devices),
  40. .devices = zoom_dss_devices,
  41. .default_device = &zoom_lcd_device,
  42. };
  43. static void __init zoom_lcd_panel_init(void)
  44. {
  45. zoom_lcd_data.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
  46. LCD_PANEL_RESET_GPIO_PROD :
  47. LCD_PANEL_RESET_GPIO_PILOT;
  48. }
  49. static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
  50. .turbo_mode = 1,
  51. };
  52. static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
  53. [0] = {
  54. .modalias = "nec_8048_spi",
  55. .bus_num = 1,
  56. .chip_select = 2,
  57. .max_speed_hz = 375000,
  58. .controller_data = &dss_lcd_mcspi_config,
  59. },
  60. };
  61. void __init zoom_display_init(void)
  62. {
  63. omap_display_init(&zoom_dss_data);
  64. spi_register_board_info(nec_8048_spi_board_info,
  65. ARRAY_SIZE(nec_8048_spi_board_info));
  66. zoom_lcd_panel_init();
  67. }