meson_drv.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2016 BayLibre, SAS
  3. * Author: Neil Armstrong <narmstrong@baylibre.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __MESON_DRV_H
  19. #define __MESON_DRV_H
  20. #include <linux/platform_device.h>
  21. #include <linux/regmap.h>
  22. #include <linux/of.h>
  23. #include <drm/drmP.h>
  24. struct meson_drm {
  25. struct device *dev;
  26. void __iomem *io_base;
  27. struct regmap *hhi;
  28. struct regmap *dmc;
  29. int vsync_irq;
  30. struct drm_device *drm;
  31. struct drm_crtc *crtc;
  32. struct drm_fbdev_cma *fbdev;
  33. struct drm_plane *primary_plane;
  34. /* Components Data */
  35. struct {
  36. bool osd1_enabled;
  37. bool osd1_interlace;
  38. bool osd1_commit;
  39. uint32_t osd1_ctrl_stat;
  40. uint32_t osd1_blk0_cfg[5];
  41. } viu;
  42. struct {
  43. unsigned int current_mode;
  44. bool hdmi_repeat;
  45. bool venc_repeat;
  46. bool hdmi_use_enci;
  47. } venc;
  48. };
  49. static inline int meson_vpu_is_compatible(struct meson_drm *priv,
  50. const char *compat)
  51. {
  52. return of_device_is_compatible(priv->dev->of_node, compat);
  53. }
  54. #endif /* __MESON_DRV_H */