sde_hw_qdss.h 1.7 KB

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