clk-pll-v1.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2014 MediaTek Inc.
  3. * Author: James Liao <jamesjj.liao@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 __DRV_CLK_PLL_H
  15. #define __DRV_CLK_PLL_H
  16. /*
  17. * This is a private header file. DO NOT include it except clk-*.c.
  18. */
  19. #include <linux/bitops.h>
  20. #include <linux/clk.h>
  21. #include <linux/clk-provider.h>
  22. struct mtk_clk_pll {
  23. struct clk_hw hw;
  24. void __iomem *base_addr;
  25. void __iomem *pwr_addr;
  26. u32 en_mask;
  27. u32 flags;
  28. };
  29. #define to_mtk_clk_pll(_hw) container_of(_hw, struct mtk_clk_pll, hw)
  30. #define HAVE_RST_BAR BIT(0)
  31. #define HAVE_PLL_HP BIT(1)
  32. #define HAVE_FIX_FRQ BIT(2)
  33. #define PLL_AO BIT(3)
  34. struct clk *mtk_clk_register_pll(
  35. const char *name,
  36. const char *parent_name,
  37. u32 *base_addr,
  38. u32 *pwr_addr,
  39. u32 en_mask,
  40. u32 flags,
  41. const struct clk_ops *ops);
  42. #endif /* __DRV_CLK_PLL_H */