sde_hw_qdss.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SDE_HW_QDSS_H
  6. #define _SDE_HW_QDSS_H
  7. #include "sde_hw_catalog.h"
  8. #include "sde_hw_mdss.h"
  9. #include "sde_hw_util.h"
  10. struct sde_hw_qdss;
  11. /**
  12. * struct sde_hw_qdss_ops - interface to the qdss hardware driver functions
  13. * Assumption is these functions will be called after clocks are enabled
  14. */
  15. struct sde_hw_qdss_ops {
  16. /**
  17. * enable_qdss_events - enable qdss events
  18. * @hw_qdss: Pointer to qdss context
  19. */
  20. void (*enable_qdss_events)(struct sde_hw_qdss *hw_qdss, bool enable);
  21. };
  22. struct sde_hw_qdss {
  23. struct sde_hw_blk_reg_map hw;
  24. /* qdss */
  25. enum sde_qdss idx;
  26. const struct sde_qdss_cfg *caps;
  27. /* ops */
  28. struct sde_hw_qdss_ops ops;
  29. };
  30. /**
  31. * to_sde_hw_qdss - convert base hw object to sde_hw_qdss container
  32. * @hw: Pointer to hardware block register map object
  33. * return: Pointer to hardware block container
  34. */
  35. static inline struct sde_hw_qdss *to_sde_hw_qdss(struct sde_hw_blk_reg_map *hw)
  36. {
  37. return container_of(hw, struct sde_hw_qdss, hw);
  38. }
  39. /**
  40. * sde_hw_qdss_init - initializes the qdss block for the passed qdss idx
  41. * @idx: QDSS index for which driver object is required
  42. * @addr: Mapped register io address of MDP
  43. * @m: Pointer to mdss catalog data
  44. * Returns: Error code or allocated sde_hw_qdss context
  45. */
  46. struct sde_hw_blk_reg_map *sde_hw_qdss_init(enum sde_qdss idx,
  47. void __iomem *addr,
  48. struct sde_mdss_cfg *m);
  49. /**
  50. * sde_hw_qdss_destroy - destroys qdss driver context
  51. * should be called to free the context
  52. * @hw: Pointer to hardware block register map object
  53. */
  54. void sde_hw_qdss_destroy(struct sde_hw_blk_reg_map *hw);
  55. #endif /*_SDE_HW_QDSS_H */