119-v6.0-03-clk-qcom-clk-rpm-convert-to-parent_data-API.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From 129d9cd9c25041f8b8681fd6e8584fa47c385f3b Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Thu, 7 Jul 2022 00:53:20 +0200
  4. Subject: [PATCH] clk: qcom: clk-rpm: convert to parent_data API
  5. Convert clk-rpm driver to parent_data API.
  6. We keep the old pxo/cxo_board parent naming to keep compatibility with
  7. old DT and we use the new pxo/cxo for new implementation where these
  8. clock are defined in DTS.
  9. Signed-off-by: Christian Marangi <[email protected]>
  10. Signed-off-by: Bjorn Andersson <[email protected]>
  11. Link: https://lore.kernel.org/r/[email protected]
  12. ---
  13. drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
  14. 1 file changed, 16 insertions(+), 8 deletions(-)
  15. --- a/drivers/clk/qcom/clk-rpm.c
  16. +++ b/drivers/clk/qcom/clk-rpm.c
  17. @@ -23,6 +23,14 @@
  18. #define QCOM_RPM_SCALING_ENABLE_ID 0x2
  19. #define QCOM_RPM_XO_MODE_ON 0x2
  20. +static const struct clk_parent_data gcc_pxo[] = {
  21. + { .fw_name = "pxo", .name = "pxo_board" },
  22. +};
  23. +
  24. +static const struct clk_parent_data gcc_cxo[] = {
  25. + { .fw_name = "cxo", .name = "cxo_board" },
  26. +};
  27. +
  28. #define DEFINE_CLK_RPM(_platform, _name, _active, r_id) \
  29. static struct clk_rpm _platform##_##_active; \
  30. static struct clk_rpm _platform##_##_name = { \
  31. @@ -32,8 +40,8 @@
  32. .hw.init = &(struct clk_init_data){ \
  33. .ops = &clk_rpm_ops, \
  34. .name = #_name, \
  35. - .parent_names = (const char *[]){ "pxo_board" }, \
  36. - .num_parents = 1, \
  37. + .parent_data = gcc_pxo, \
  38. + .num_parents = ARRAY_SIZE(gcc_pxo), \
  39. }, \
  40. }; \
  41. static struct clk_rpm _platform##_##_active = { \
  42. @@ -44,8 +52,8 @@
  43. .hw.init = &(struct clk_init_data){ \
  44. .ops = &clk_rpm_ops, \
  45. .name = #_active, \
  46. - .parent_names = (const char *[]){ "pxo_board" }, \
  47. - .num_parents = 1, \
  48. + .parent_data = gcc_pxo, \
  49. + .num_parents = ARRAY_SIZE(gcc_pxo), \
  50. }, \
  51. }
  52. @@ -56,8 +64,8 @@
  53. .hw.init = &(struct clk_init_data){ \
  54. .ops = &clk_rpm_xo_ops, \
  55. .name = #_name, \
  56. - .parent_names = (const char *[]){ "cxo_board" }, \
  57. - .num_parents = 1, \
  58. + .parent_data = gcc_cxo, \
  59. + .num_parents = ARRAY_SIZE(gcc_cxo), \
  60. }, \
  61. }
  62. @@ -68,8 +76,8 @@
  63. .hw.init = &(struct clk_init_data){ \
  64. .ops = &clk_rpm_fixed_ops, \
  65. .name = #_name, \
  66. - .parent_names = (const char *[]){ "pxo" }, \
  67. - .num_parents = 1, \
  68. + .parent_data = gcc_pxo, \
  69. + .num_parents = ARRAY_SIZE(gcc_pxo), \
  70. }, \
  71. }