sun8i_tcon_top.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /* Copyright (c) 2018 Jernej Skrabec <jernej.skrabec@siol.net> */
  3. #ifndef _SUN8I_TCON_TOP_H_
  4. #define _SUN8I_TCON_TOP_H_
  5. #include <linux/clk.h>
  6. #include <linux/clk-provider.h>
  7. #include <linux/reset.h>
  8. #include <linux/spinlock.h>
  9. #define TCON_TOP_TCON_TV_SETUP_REG 0x00
  10. #define TCON_TOP_PORT_SEL_REG 0x1C
  11. #define TCON_TOP_PORT_DE0_MSK GENMASK(1, 0)
  12. #define TCON_TOP_PORT_DE1_MSK GENMASK(5, 4)
  13. #define TCON_TOP_GATE_SRC_REG 0x20
  14. #define TCON_TOP_HDMI_SRC_MSK GENMASK(29, 28)
  15. #define TCON_TOP_TCON_TV1_GATE 24
  16. #define TCON_TOP_TCON_TV0_GATE 20
  17. #define TCON_TOP_TCON_DSI_GATE 16
  18. #define CLK_NUM 3
  19. struct sun8i_tcon_top {
  20. struct clk *bus;
  21. struct clk_hw_onecell_data *clk_data;
  22. void __iomem *regs;
  23. struct reset_control *rst;
  24. /*
  25. * spinlock is used to synchronize access to same
  26. * register where multiple clock gates can be set.
  27. */
  28. spinlock_t reg_lock;
  29. };
  30. extern const struct of_device_id sun8i_tcon_top_of_table[];
  31. int sun8i_tcon_top_set_hdmi_src(struct device *dev, int tcon);
  32. int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon);
  33. #endif /* _SUN8I_TCON_TOP_H_ */