mtk_mdp_comp.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2016 MediaTek Inc.
  3. * Author: Ming Hsiu Tsai <minghsiu.tsai@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef __MTK_MDP_COMP_H__
  15. #define __MTK_MDP_COMP_H__
  16. /**
  17. * enum mtk_mdp_comp_type - the MDP component
  18. * @MTK_MDP_RDMA: Read DMA
  19. * @MTK_MDP_RSZ: Riszer
  20. * @MTK_MDP_WDMA: Write DMA
  21. * @MTK_MDP_WROT: Write DMA with rotation
  22. */
  23. enum mtk_mdp_comp_type {
  24. MTK_MDP_RDMA,
  25. MTK_MDP_RSZ,
  26. MTK_MDP_WDMA,
  27. MTK_MDP_WROT,
  28. MTK_MDP_COMP_TYPE_MAX,
  29. };
  30. enum mtk_mdp_comp_id {
  31. MTK_MDP_COMP_RDMA0,
  32. MTK_MDP_COMP_RDMA1,
  33. MTK_MDP_COMP_RSZ0,
  34. MTK_MDP_COMP_RSZ1,
  35. MTK_MDP_COMP_RSZ2,
  36. MTK_MDP_COMP_WDMA,
  37. MTK_MDP_COMP_WROT0,
  38. MTK_MDP_COMP_WROT1,
  39. MTK_MDP_COMP_ID_MAX,
  40. };
  41. /**
  42. * struct mtk_mdp_comp - the MDP's function component data
  43. * @dev_node: component device node
  44. * @clk: clocks required for component
  45. * @regs: Mapped address of component registers.
  46. * @larb_dev: SMI device required for component
  47. * @type: component type
  48. * @id: component ID
  49. */
  50. struct mtk_mdp_comp {
  51. struct device_node *dev_node;
  52. struct clk *clk[2];
  53. void __iomem *regs;
  54. struct device *larb_dev;
  55. enum mtk_mdp_comp_type type;
  56. enum mtk_mdp_comp_id id;
  57. };
  58. int mtk_mdp_comp_init(struct device *dev, struct device_node *node,
  59. struct mtk_mdp_comp *comp, enum mtk_mdp_comp_id comp_id);
  60. void mtk_mdp_comp_deinit(struct device *dev, struct mtk_mdp_comp *comp);
  61. int mtk_mdp_comp_get_id(struct device *dev, struct device_node *node,
  62. enum mtk_mdp_comp_type comp_type);
  63. void mtk_mdp_comp_clock_on(struct device *dev, struct mtk_mdp_comp *comp);
  64. void mtk_mdp_comp_clock_off(struct device *dev, struct mtk_mdp_comp *comp);
  65. #endif /* __MTK_MDP_COMP_H__ */