board-zoom-display.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_nl8048hl11_platform_data zoom_lcd_pdata = {
  25. .name = "lcd",
  26. .source = "dpi.0",
  27. .data_lines = 24,
  28. .res_gpio = -1, /* filled in code */
  29. .qvga_gpio = LCD_PANEL_QVGA_GPIO,
  30. };
  31. static struct omap_dss_board_info zoom_dss_data = {
  32. .default_display_name = "lcd",
  33. };
  34. static void __init zoom_lcd_panel_init(void)
  35. {
  36. zoom_lcd_pdata.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
  37. LCD_PANEL_RESET_GPIO_PROD :
  38. LCD_PANEL_RESET_GPIO_PILOT;
  39. }
  40. static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
  41. .turbo_mode = 1,
  42. };
  43. static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
  44. [0] = {
  45. .modalias = "panel-nec-nl8048hl11",
  46. .bus_num = 1,
  47. .chip_select = 2,
  48. .max_speed_hz = 375000,
  49. .controller_data = &dss_lcd_mcspi_config,
  50. .platform_data = &zoom_lcd_pdata,
  51. },
  52. };
  53. void __init zoom_display_init(void)
  54. {
  55. omap_display_init(&zoom_dss_data);
  56. zoom_lcd_panel_init();
  57. spi_register_board_info(nec_8048_spi_board_info,
  58. ARRAY_SIZE(nec_8048_spi_board_info));
  59. }