dw_hdmi.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2011 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. */
  9. #ifndef __DW_HDMI__
  10. #define __DW_HDMI__
  11. #include <drm/drmP.h>
  12. enum {
  13. DW_HDMI_RES_8,
  14. DW_HDMI_RES_10,
  15. DW_HDMI_RES_12,
  16. DW_HDMI_RES_MAX,
  17. };
  18. enum dw_hdmi_devtype {
  19. IMX6Q_HDMI,
  20. IMX6DL_HDMI,
  21. RK3288_HDMI,
  22. };
  23. struct dw_hdmi_mpll_config {
  24. unsigned long mpixelclock;
  25. struct {
  26. u16 cpce;
  27. u16 gmp;
  28. } res[DW_HDMI_RES_MAX];
  29. };
  30. struct dw_hdmi_curr_ctrl {
  31. unsigned long mpixelclock;
  32. u16 curr[DW_HDMI_RES_MAX];
  33. };
  34. struct dw_hdmi_phy_config {
  35. unsigned long mpixelclock;
  36. u16 sym_ctr; /*clock symbol and transmitter control*/
  37. u16 term; /*transmission termination value*/
  38. u16 vlev_ctr; /* voltage level control */
  39. };
  40. struct dw_hdmi_plat_data {
  41. enum dw_hdmi_devtype dev_type;
  42. const struct dw_hdmi_mpll_config *mpll_cfg;
  43. const struct dw_hdmi_curr_ctrl *cur_ctr;
  44. const struct dw_hdmi_phy_config *phy_config;
  45. enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
  46. struct drm_display_mode *mode);
  47. };
  48. void dw_hdmi_unbind(struct device *dev, struct device *master, void *data);
  49. int dw_hdmi_bind(struct device *dev, struct device *master,
  50. void *data, struct drm_encoder *encoder,
  51. struct resource *iores, int irq,
  52. const struct dw_hdmi_plat_data *plat_data);
  53. #endif /* __IMX_HDMI_H__ */