clk-regmap-mux-div.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2017, Linaro Limited
  4. * Author: Georgi Djakov <georgi.djakov@linaro.org>
  5. */
  6. #ifndef __QCOM_CLK_REGMAP_MUX_DIV_H__
  7. #define __QCOM_CLK_REGMAP_MUX_DIV_H__
  8. #include <linux/clk-provider.h>
  9. #include "clk-regmap.h"
  10. /**
  11. * struct mux_div_clk - combined mux/divider clock
  12. * @reg_offset: offset of the mux/divider register
  13. * @hid_width: number of bits in half integer divider
  14. * @hid_shift: lowest bit of hid value field
  15. * @src_width: number of bits in source select
  16. * @src_shift: lowest bit of source select field
  17. * @div: the divider raw configuration value
  18. * @src: the mux index which will be used if the clock is enabled
  19. * @parent_map: map from parent_names index to src_sel field
  20. * @clkr: handle between common and hardware-specific interfaces
  21. * @pclk: the input PLL clock
  22. * @clk_nb: clock notifier for rate changes of the input PLL
  23. */
  24. struct clk_regmap_mux_div {
  25. u32 reg_offset;
  26. u32 hid_width;
  27. u32 hid_shift;
  28. u32 src_width;
  29. u32 src_shift;
  30. u32 div;
  31. u32 src;
  32. const u32 *parent_map;
  33. struct clk_regmap clkr;
  34. struct clk *pclk;
  35. struct notifier_block clk_nb;
  36. };
  37. extern const struct clk_ops clk_regmap_mux_div_ops;
  38. extern int mux_div_set_src_div(struct clk_regmap_mux_div *md, u32 src, u32 div);
  39. #endif