nxp-fb.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* SPDX-License-Identifier: GPL-2.0+
  2. *
  3. * Copyright (c) 2017 FriendlyARM (www.arm9.net)
  4. *
  5. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  6. * http://www.samsung.com/
  7. *
  8. * Header file for NXP Display Driver
  9. */
  10. #ifndef __MACH_NXP_FB_H__
  11. #define __MACH_NXP_FB_H__
  12. /*
  13. * struct nxp_lcd_polarity
  14. * @rise_vclk: if 1, video data is fetched at rising edge
  15. * @inv_hsync: if HSYNC polarity is inversed
  16. * @inv_vsync: if VSYNC polarity is inversed
  17. * @inv_vden: if VDEN polarity is inversed
  18. */
  19. struct nxp_lcd_polarity {
  20. int rise_vclk;
  21. int inv_hsync;
  22. int inv_vsync;
  23. int inv_vden;
  24. };
  25. /*
  26. * struct nxp_lcd_timing
  27. * @h_fp: horizontal front porch
  28. * @h_bp: horizontal back porch
  29. * @h_sw: horizontal sync width
  30. * @v_fp: vertical front porch
  31. * @v_fpe: vertical front porch for even field
  32. * @v_bp: vertical back porch
  33. * @v_bpe: vertical back porch for even field
  34. */
  35. struct nxp_lcd_timing {
  36. int h_fp;
  37. int h_bp;
  38. int h_sw;
  39. int v_fp;
  40. int v_fpe;
  41. int v_bp;
  42. int v_bpe;
  43. int v_sw;
  44. };
  45. /*
  46. * struct nxp_lcd
  47. * @width: horizontal resolution
  48. * @height: vertical resolution
  49. * @p_width: width of lcd in mm
  50. * @p_height: height of lcd in mm
  51. * @bpp: bits per pixel
  52. * @freq: vframe frequency
  53. * @timing: timing values
  54. * @polarity: polarity settings
  55. * @gpio_init: pointer to GPIO init function
  56. *
  57. */
  58. struct nxp_lcd {
  59. int width;
  60. int height;
  61. int p_width;
  62. int p_height;
  63. int bpp;
  64. int freq;
  65. struct nxp_lcd_timing timing;
  66. struct nxp_lcd_polarity polarity;
  67. void (*gpio_init)(void);
  68. };
  69. /**
  70. * Public interfaces
  71. */
  72. enum lcd_format {
  73. LCD_VESA = 0,
  74. LCD_JEIDA = 1,
  75. LCD_LOC = 2,
  76. LCD_RGB = 4,
  77. LCD_HDMI = 5,
  78. };
  79. extern int bd_setup_lcd_by_id(int id);
  80. extern int bd_setup_lcd_by_name(char *name);
  81. extern struct nxp_lcd *bd_get_lcd(void);
  82. extern const char *bd_get_lcd_name(void);
  83. extern int bd_get_lcd_density(void);
  84. extern enum lcd_format bd_get_lcd_format(void);
  85. extern int bd_fixup_lcd_fdt(void *blob, struct nxp_lcd *cfg);
  86. #endif /* __MACH_NXP_FB_H__ */