dw_hdmi.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. struct dw_hdmi;
  13. enum {
  14. DW_HDMI_RES_8,
  15. DW_HDMI_RES_10,
  16. DW_HDMI_RES_12,
  17. DW_HDMI_RES_MAX,
  18. };
  19. enum dw_hdmi_devtype {
  20. IMX6Q_HDMI,
  21. IMX6DL_HDMI,
  22. RK3288_HDMI,
  23. };
  24. struct dw_hdmi_mpll_config {
  25. unsigned long mpixelclock;
  26. struct {
  27. u16 cpce;
  28. u16 gmp;
  29. } res[DW_HDMI_RES_MAX];
  30. };
  31. struct dw_hdmi_curr_ctrl {
  32. unsigned long mpixelclock;
  33. u16 curr[DW_HDMI_RES_MAX];
  34. };
  35. struct dw_hdmi_phy_config {
  36. unsigned long mpixelclock;
  37. u16 sym_ctr; /*clock symbol and transmitter control*/
  38. u16 term; /*transmission termination value*/
  39. u16 vlev_ctr; /* voltage level control */
  40. };
  41. struct dw_hdmi_plat_data {
  42. enum dw_hdmi_devtype dev_type;
  43. const struct dw_hdmi_mpll_config *mpll_cfg;
  44. const struct dw_hdmi_curr_ctrl *cur_ctr;
  45. const struct dw_hdmi_phy_config *phy_config;
  46. enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
  47. struct drm_display_mode *mode);
  48. };
  49. void dw_hdmi_unbind(struct device *dev, struct device *master, void *data);
  50. int dw_hdmi_bind(struct device *dev, struct device *master,
  51. void *data, struct drm_encoder *encoder,
  52. struct resource *iores, int irq,
  53. const struct dw_hdmi_plat_data *plat_data);
  54. void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
  55. void dw_hdmi_audio_enable(struct dw_hdmi *hdmi);
  56. void dw_hdmi_audio_disable(struct dw_hdmi *hdmi);
  57. #endif /* __IMX_HDMI_H__ */