clk-pll.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014 MediaTek Inc.
  4. * Author: James Liao <[email protected]>
  5. */
  6. #ifndef __DRV_CLK_MTK_PLL_H
  7. #define __DRV_CLK_MTK_PLL_H
  8. #include <linux/types.h>
  9. struct clk_ops;
  10. struct clk_hw_onecell_data;
  11. struct device_node;
  12. struct mtk_pll_div_table {
  13. u32 div;
  14. unsigned long freq;
  15. };
  16. #define HAVE_RST_BAR BIT(0)
  17. #define PLL_AO BIT(1)
  18. struct mtk_pll_data {
  19. int id;
  20. const char *name;
  21. u32 reg;
  22. u32 pwr_reg;
  23. u32 en_mask;
  24. u32 pd_reg;
  25. u32 tuner_reg;
  26. u32 tuner_en_reg;
  27. u8 tuner_en_bit;
  28. int pd_shift;
  29. unsigned int flags;
  30. const struct clk_ops *ops;
  31. u32 rst_bar_mask;
  32. unsigned long fmin;
  33. unsigned long fmax;
  34. int pcwbits;
  35. int pcwibits;
  36. u32 pcw_reg;
  37. int pcw_shift;
  38. u32 pcw_chg_reg;
  39. const struct mtk_pll_div_table *div_table;
  40. const char *parent_name;
  41. u32 en_reg;
  42. u8 pll_en_bit; /* Assume 0, indicates BIT(0) by default */
  43. };
  44. int mtk_clk_register_plls(struct device_node *node,
  45. const struct mtk_pll_data *plls, int num_plls,
  46. struct clk_hw_onecell_data *clk_data);
  47. void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
  48. struct clk_hw_onecell_data *clk_data);
  49. #endif /* __DRV_CLK_MTK_PLL_H */