0011-reset-starfive-Rename-jh7100-to-jh71x0-for-the-commo.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. From 798b9b4681be53ddbf1d8db8a88ff19aaaca500f Mon Sep 17 00:00:00 2001
  2. From: Emil Renner Berthing <[email protected]>
  3. Date: Sat, 1 Apr 2023 19:19:23 +0800
  4. Subject: [PATCH 011/122] reset: starfive: Rename "jh7100" to "jh71x0" for the
  5. common code
  6. For the common code will be shared with the StarFive JH7110 SoC.
  7. Tested-by: Tommaso Merciai <[email protected]>
  8. Reviewed-by: Conor Dooley <[email protected]>
  9. Reviewed-by: Emil Renner Berthing <[email protected]>
  10. Signed-off-by: Emil Renner Berthing <[email protected]>
  11. Signed-off-by: Hal Feng <[email protected]>
  12. Signed-off-by: Conor Dooley <[email protected]>
  13. ---
  14. .../reset/starfive/reset-starfive-jh7100.c | 2 +-
  15. .../reset/starfive/reset-starfive-jh71x0.c | 50 +++++++++----------
  16. .../reset/starfive/reset-starfive-jh71x0.h | 2 +-
  17. 3 files changed, 27 insertions(+), 27 deletions(-)
  18. --- a/drivers/reset/starfive/reset-starfive-jh7100.c
  19. +++ b/drivers/reset/starfive/reset-starfive-jh7100.c
  20. @@ -51,7 +51,7 @@ static int __init jh7100_reset_probe(str
  21. if (IS_ERR(base))
  22. return PTR_ERR(base);
  23. - return reset_starfive_jh7100_register(&pdev->dev, pdev->dev.of_node,
  24. + return reset_starfive_jh71x0_register(&pdev->dev, pdev->dev.of_node,
  25. base + JH7100_RESET_ASSERT0,
  26. base + JH7100_RESET_STATUS0,
  27. jh7100_reset_asserted,
  28. --- a/drivers/reset/starfive/reset-starfive-jh71x0.c
  29. +++ b/drivers/reset/starfive/reset-starfive-jh71x0.c
  30. @@ -1,6 +1,6 @@
  31. // SPDX-License-Identifier: GPL-2.0-or-later
  32. /*
  33. - * Reset driver for the StarFive JH7100 SoC
  34. + * Reset driver for the StarFive JH71X0 SoCs
  35. *
  36. * Copyright (C) 2021 Emil Renner Berthing <[email protected]>
  37. */
  38. @@ -15,7 +15,7 @@
  39. #include "reset-starfive-jh71x0.h"
  40. -struct jh7100_reset {
  41. +struct jh71x0_reset {
  42. struct reset_controller_dev rcdev;
  43. /* protect registers against concurrent read-modify-write */
  44. spinlock_t lock;
  45. @@ -24,16 +24,16 @@ struct jh7100_reset {
  46. const u64 *asserted;
  47. };
  48. -static inline struct jh7100_reset *
  49. -jh7100_reset_from(struct reset_controller_dev *rcdev)
  50. +static inline struct jh71x0_reset *
  51. +jh71x0_reset_from(struct reset_controller_dev *rcdev)
  52. {
  53. - return container_of(rcdev, struct jh7100_reset, rcdev);
  54. + return container_of(rcdev, struct jh71x0_reset, rcdev);
  55. }
  56. -static int jh7100_reset_update(struct reset_controller_dev *rcdev,
  57. +static int jh71x0_reset_update(struct reset_controller_dev *rcdev,
  58. unsigned long id, bool assert)
  59. {
  60. - struct jh7100_reset *data = jh7100_reset_from(rcdev);
  61. + struct jh71x0_reset *data = jh71x0_reset_from(rcdev);
  62. unsigned long offset = BIT_ULL_WORD(id);
  63. u64 mask = BIT_ULL_MASK(id);
  64. void __iomem *reg_assert = data->assert + offset * sizeof(u64);
  65. @@ -62,34 +62,34 @@ static int jh7100_reset_update(struct re
  66. return ret;
  67. }
  68. -static int jh7100_reset_assert(struct reset_controller_dev *rcdev,
  69. +static int jh71x0_reset_assert(struct reset_controller_dev *rcdev,
  70. unsigned long id)
  71. {
  72. - return jh7100_reset_update(rcdev, id, true);
  73. + return jh71x0_reset_update(rcdev, id, true);
  74. }
  75. -static int jh7100_reset_deassert(struct reset_controller_dev *rcdev,
  76. +static int jh71x0_reset_deassert(struct reset_controller_dev *rcdev,
  77. unsigned long id)
  78. {
  79. - return jh7100_reset_update(rcdev, id, false);
  80. + return jh71x0_reset_update(rcdev, id, false);
  81. }
  82. -static int jh7100_reset_reset(struct reset_controller_dev *rcdev,
  83. +static int jh71x0_reset_reset(struct reset_controller_dev *rcdev,
  84. unsigned long id)
  85. {
  86. int ret;
  87. - ret = jh7100_reset_assert(rcdev, id);
  88. + ret = jh71x0_reset_assert(rcdev, id);
  89. if (ret)
  90. return ret;
  91. - return jh7100_reset_deassert(rcdev, id);
  92. + return jh71x0_reset_deassert(rcdev, id);
  93. }
  94. -static int jh7100_reset_status(struct reset_controller_dev *rcdev,
  95. +static int jh71x0_reset_status(struct reset_controller_dev *rcdev,
  96. unsigned long id)
  97. {
  98. - struct jh7100_reset *data = jh7100_reset_from(rcdev);
  99. + struct jh71x0_reset *data = jh71x0_reset_from(rcdev);
  100. unsigned long offset = BIT_ULL_WORD(id);
  101. u64 mask = BIT_ULL_MASK(id);
  102. void __iomem *reg_status = data->status + offset * sizeof(u64);
  103. @@ -98,25 +98,25 @@ static int jh7100_reset_status(struct re
  104. return !((value ^ data->asserted[offset]) & mask);
  105. }
  106. -static const struct reset_control_ops jh7100_reset_ops = {
  107. - .assert = jh7100_reset_assert,
  108. - .deassert = jh7100_reset_deassert,
  109. - .reset = jh7100_reset_reset,
  110. - .status = jh7100_reset_status,
  111. +static const struct reset_control_ops jh71x0_reset_ops = {
  112. + .assert = jh71x0_reset_assert,
  113. + .deassert = jh71x0_reset_deassert,
  114. + .reset = jh71x0_reset_reset,
  115. + .status = jh71x0_reset_status,
  116. };
  117. -int reset_starfive_jh7100_register(struct device *dev, struct device_node *of_node,
  118. +int reset_starfive_jh71x0_register(struct device *dev, struct device_node *of_node,
  119. void __iomem *assert, void __iomem *status,
  120. const u64 *asserted, unsigned int nr_resets,
  121. struct module *owner)
  122. {
  123. - struct jh7100_reset *data;
  124. + struct jh71x0_reset *data;
  125. data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
  126. if (!data)
  127. return -ENOMEM;
  128. - data->rcdev.ops = &jh7100_reset_ops;
  129. + data->rcdev.ops = &jh71x0_reset_ops;
  130. data->rcdev.owner = owner;
  131. data->rcdev.nr_resets = nr_resets;
  132. data->rcdev.dev = dev;
  133. @@ -129,4 +129,4 @@ int reset_starfive_jh7100_register(struc
  134. return devm_reset_controller_register(dev, &data->rcdev);
  135. }
  136. -EXPORT_SYMBOL_GPL(reset_starfive_jh7100_register);
  137. +EXPORT_SYMBOL_GPL(reset_starfive_jh71x0_register);
  138. --- a/drivers/reset/starfive/reset-starfive-jh71x0.h
  139. +++ b/drivers/reset/starfive/reset-starfive-jh71x0.h
  140. @@ -6,7 +6,7 @@
  141. #ifndef __RESET_STARFIVE_JH71X0_H
  142. #define __RESET_STARFIVE_JH71X0_H
  143. -int reset_starfive_jh7100_register(struct device *dev, struct device_node *of_node,
  144. +int reset_starfive_jh71x0_register(struct device *dev, struct device_node *of_node,
  145. void __iomem *assert, void __iomem *status,
  146. const u64 *asserted, unsigned int nr_resets,
  147. struct module *owner);