phy-mtk-mipi-dsi.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2019 MediaTek Inc.
  4. * Author: Jitao Shi <[email protected]>
  5. */
  6. #ifndef _MTK_MIPI_TX_H
  7. #define _MTK_MIPI_TX_H
  8. #include <linux/clk.h>
  9. #include <linux/clk-provider.h>
  10. #include <linux/delay.h>
  11. #include <linux/module.h>
  12. #include <linux/nvmem-consumer.h>
  13. #include <linux/of_device.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/phy/phy.h>
  16. #include <linux/slab.h>
  17. struct mtk_mipitx_data {
  18. const u32 mppll_preserve;
  19. const struct clk_ops *mipi_tx_clk_ops;
  20. void (*mipi_tx_enable_signal)(struct phy *phy);
  21. void (*mipi_tx_disable_signal)(struct phy *phy);
  22. };
  23. struct mtk_mipi_tx {
  24. struct device *dev;
  25. void __iomem *regs;
  26. u32 data_rate;
  27. u32 mipitx_drive;
  28. u32 rt_code[5];
  29. const struct mtk_mipitx_data *driver_data;
  30. struct clk_hw pll_hw;
  31. struct clk *pll;
  32. };
  33. struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw *hw);
  34. int mtk_mipi_tx_pll_set_rate(struct clk_hw *hw, unsigned long rate,
  35. unsigned long parent_rate);
  36. unsigned long mtk_mipi_tx_pll_recalc_rate(struct clk_hw *hw,
  37. unsigned long parent_rate);
  38. extern const struct mtk_mipitx_data mt2701_mipitx_data;
  39. extern const struct mtk_mipitx_data mt8173_mipitx_data;
  40. extern const struct mtk_mipitx_data mt8183_mipitx_data;
  41. #endif