clk-zynqmp.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2016-2018 Xilinx
  4. */
  5. #ifndef __LINUX_CLK_ZYNQMP_H_
  6. #define __LINUX_CLK_ZYNQMP_H_
  7. #include <linux/spinlock.h>
  8. #include <linux/firmware/xlnx-zynqmp.h>
  9. /* Clock APIs payload parameters */
  10. #define CLK_GET_NAME_RESP_LEN 16
  11. #define CLK_GET_TOPOLOGY_RESP_WORDS 3
  12. #define CLK_GET_PARENTS_RESP_WORDS 3
  13. #define CLK_GET_ATTR_RESP_WORDS 1
  14. enum topology_type {
  15. TYPE_INVALID,
  16. TYPE_MUX,
  17. TYPE_PLL,
  18. TYPE_FIXEDFACTOR,
  19. TYPE_DIV1,
  20. TYPE_DIV2,
  21. TYPE_GATE,
  22. };
  23. /**
  24. * struct clock_topology - Clock topology
  25. * @type: Type of topology
  26. * @flag: Topology flags
  27. * @type_flag: Topology type specific flag
  28. */
  29. struct clock_topology {
  30. u32 type;
  31. u32 flag;
  32. u32 type_flag;
  33. };
  34. struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id,
  35. const char * const *parents,
  36. u8 num_parents,
  37. const struct clock_topology *nodes);
  38. struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id,
  39. const char * const *parents,
  40. u8 num_parents,
  41. const struct clock_topology *nodes);
  42. struct clk_hw *zynqmp_clk_register_divider(const char *name,
  43. u32 clk_id,
  44. const char * const *parents,
  45. u8 num_parents,
  46. const struct clock_topology *nodes);
  47. struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
  48. const char * const *parents,
  49. u8 num_parents,
  50. const struct clock_topology *nodes);
  51. struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name,
  52. u32 clk_id,
  53. const char * const *parents,
  54. u8 num_parents,
  55. const struct clock_topology *nodes);
  56. #endif