044-clk-cygnus-Convert-all-macros-to-all-caps.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. From b5116083e227fa478e20d5ed945430088aa1a00b Mon Sep 17 00:00:00 2001
  2. From: Jon Mason <jonmason@broadcom.com>
  3. Date: Thu, 15 Oct 2015 15:48:25 -0400
  4. Subject: [PATCH 44/50] clk: cygnus: Convert all macros to all caps
  5. The macros that are being used to initialize the values of the clk
  6. structures should be all caps. Find and replace all of them with their
  7. relevant counterparts.
  8. Signed-off-by: Jon Mason <jonmason@broadcom.com>
  9. ---
  10. drivers/clk/bcm/clk-cygnus.c | 146 +++++++++++++++++++++----------------------
  11. 1 file changed, 73 insertions(+), 73 deletions(-)
  12. --- a/drivers/clk/bcm/clk-cygnus.c
  13. +++ b/drivers/clk/bcm/clk-cygnus.c
  14. @@ -23,28 +23,28 @@
  15. #include <dt-bindings/clock/bcm-cygnus.h>
  16. #include "clk-iproc.h"
  17. -#define reg_val(o, s, w) { .offset = o, .shift = s, .width = w, }
  18. +#define REG_VAL(o, s, w) { .offset = o, .shift = s, .width = w, }
  19. -#define aon_val(o, pw, ps, is) { .offset = o, .pwr_width = pw, \
  20. +#define AON_VAL(o, pw, ps, is) { .offset = o, .pwr_width = pw, \
  21. .pwr_shift = ps, .iso_shift = is }
  22. -#define sw_ctrl_val(o, s) { .offset = o, .shift = s, }
  23. +#define SW_CTRL_VAL(o, s) { .offset = o, .shift = s, }
  24. -#define asiu_div_val(o, es, hs, hw, ls, lw) \
  25. +#define ASIU_DIV_VAL(o, es, hs, hw, ls, lw) \
  26. { .offset = o, .en_shift = es, .high_shift = hs, \
  27. .high_width = hw, .low_shift = ls, .low_width = lw }
  28. -#define reset_val(o, rs, prs, kis, kiw, kps, kpw, kas, kaw) { .offset = o, \
  29. +#define RESET_VAL(o, rs, prs, kis, kiw, kps, kpw, kas, kaw) { .offset = o, \
  30. .reset_shift = rs, .p_reset_shift = prs, .ki_shift = kis, \
  31. .ki_width = kiw, .kp_shift = kps, .kp_width = kpw, .ka_shift = kas, \
  32. .ka_width = kaw }
  33. -#define vco_ctrl_val(uo, lo) { .u_offset = uo, .l_offset = lo }
  34. +#define VCO_CTRL_VAL(uo, lo) { .u_offset = uo, .l_offset = lo }
  35. -#define enable_val(o, es, hs, bs) { .offset = o, .enable_shift = es, \
  36. +#define ENABLE_VAL(o, es, hs, bs) { .offset = o, .enable_shift = es, \
  37. .hold_shift = hs, .bypass_shift = bs }
  38. -#define asiu_gate_val(o, es) { .offset = o, .en_shift = es }
  39. +#define ASIU_GATE_VAL(o, es) { .offset = o, .en_shift = es }
  40. static void __init cygnus_armpll_init(struct device_node *node)
  41. {
  42. @@ -55,52 +55,52 @@ CLK_OF_DECLARE(cygnus_armpll, "brcm,cygn
  43. static const struct iproc_pll_ctrl genpll = {
  44. .flags = IPROC_CLK_AON | IPROC_CLK_PLL_HAS_NDIV_FRAC |
  45. IPROC_CLK_PLL_NEEDS_SW_CFG,
  46. - .aon = aon_val(0x0, 2, 1, 0),
  47. - .reset = reset_val(0x0, 11, 10, 4, 3, 0, 4, 7, 3),
  48. - .sw_ctrl = sw_ctrl_val(0x10, 31),
  49. - .ndiv_int = reg_val(0x10, 20, 10),
  50. - .ndiv_frac = reg_val(0x10, 0, 20),
  51. - .pdiv = reg_val(0x14, 0, 4),
  52. - .vco_ctrl = vco_ctrl_val(0x18, 0x1c),
  53. - .status = reg_val(0x28, 12, 1),
  54. + .aon = AON_VAL(0x0, 2, 1, 0),
  55. + .reset = RESET_VAL(0x0, 11, 10, 4, 3, 0, 4, 7, 3),
  56. + .sw_ctrl = SW_CTRL_VAL(0x10, 31),
  57. + .ndiv_int = REG_VAL(0x10, 20, 10),
  58. + .ndiv_frac = REG_VAL(0x10, 0, 20),
  59. + .pdiv = REG_VAL(0x14, 0, 4),
  60. + .vco_ctrl = VCO_CTRL_VAL(0x18, 0x1c),
  61. + .status = REG_VAL(0x28, 12, 1),
  62. };
  63. static const struct iproc_clk_ctrl genpll_clk[] = {
  64. [BCM_CYGNUS_GENPLL_AXI21_CLK] = {
  65. .channel = BCM_CYGNUS_GENPLL_AXI21_CLK,
  66. .flags = IPROC_CLK_AON,
  67. - .enable = enable_val(0x4, 6, 0, 12),
  68. - .mdiv = reg_val(0x20, 0, 8),
  69. + .enable = ENABLE_VAL(0x4, 6, 0, 12),
  70. + .mdiv = REG_VAL(0x20, 0, 8),
  71. },
  72. [BCM_CYGNUS_GENPLL_250MHZ_CLK] = {
  73. .channel = BCM_CYGNUS_GENPLL_250MHZ_CLK,
  74. .flags = IPROC_CLK_AON,
  75. - .enable = enable_val(0x4, 7, 1, 13),
  76. - .mdiv = reg_val(0x20, 10, 8),
  77. + .enable = ENABLE_VAL(0x4, 7, 1, 13),
  78. + .mdiv = REG_VAL(0x20, 10, 8),
  79. },
  80. [BCM_CYGNUS_GENPLL_IHOST_SYS_CLK] = {
  81. .channel = BCM_CYGNUS_GENPLL_IHOST_SYS_CLK,
  82. .flags = IPROC_CLK_AON,
  83. - .enable = enable_val(0x4, 8, 2, 14),
  84. - .mdiv = reg_val(0x20, 20, 8),
  85. + .enable = ENABLE_VAL(0x4, 8, 2, 14),
  86. + .mdiv = REG_VAL(0x20, 20, 8),
  87. },
  88. [BCM_CYGNUS_GENPLL_ENET_SW_CLK] = {
  89. .channel = BCM_CYGNUS_GENPLL_ENET_SW_CLK,
  90. .flags = IPROC_CLK_AON,
  91. - .enable = enable_val(0x4, 9, 3, 15),
  92. - .mdiv = reg_val(0x24, 0, 8),
  93. + .enable = ENABLE_VAL(0x4, 9, 3, 15),
  94. + .mdiv = REG_VAL(0x24, 0, 8),
  95. },
  96. [BCM_CYGNUS_GENPLL_AUDIO_125_CLK] = {
  97. .channel = BCM_CYGNUS_GENPLL_AUDIO_125_CLK,
  98. .flags = IPROC_CLK_AON,
  99. - .enable = enable_val(0x4, 10, 4, 16),
  100. - .mdiv = reg_val(0x24, 10, 8),
  101. + .enable = ENABLE_VAL(0x4, 10, 4, 16),
  102. + .mdiv = REG_VAL(0x24, 10, 8),
  103. },
  104. [BCM_CYGNUS_GENPLL_CAN_CLK] = {
  105. .channel = BCM_CYGNUS_GENPLL_CAN_CLK,
  106. .flags = IPROC_CLK_AON,
  107. - .enable = enable_val(0x4, 11, 5, 17),
  108. - .mdiv = reg_val(0x24, 20, 8),
  109. + .enable = ENABLE_VAL(0x4, 11, 5, 17),
  110. + .mdiv = REG_VAL(0x24, 20, 8),
  111. },
  112. };
  113. @@ -113,51 +113,51 @@ CLK_OF_DECLARE(cygnus_genpll, "brcm,cygn
  114. static const struct iproc_pll_ctrl lcpll0 = {
  115. .flags = IPROC_CLK_AON | IPROC_CLK_PLL_NEEDS_SW_CFG,
  116. - .aon = aon_val(0x0, 2, 5, 4),
  117. - .reset = reset_val(0x0, 31, 30, 27, 3, 23, 4, 19, 4),
  118. - .sw_ctrl = sw_ctrl_val(0x4, 31),
  119. - .ndiv_int = reg_val(0x4, 16, 10),
  120. - .pdiv = reg_val(0x4, 26, 4),
  121. - .vco_ctrl = vco_ctrl_val(0x10, 0x14),
  122. - .status = reg_val(0x18, 12, 1),
  123. + .aon = AON_VAL(0x0, 2, 5, 4),
  124. + .reset = RESET_VAL(0x0, 31, 30, 27, 3, 23, 4, 19, 4),
  125. + .sw_ctrl = SW_CTRL_VAL(0x4, 31),
  126. + .ndiv_int = REG_VAL(0x4, 16, 10),
  127. + .pdiv = REG_VAL(0x4, 26, 4),
  128. + .vco_ctrl = VCO_CTRL_VAL(0x10, 0x14),
  129. + .status = REG_VAL(0x18, 12, 1),
  130. };
  131. static const struct iproc_clk_ctrl lcpll0_clk[] = {
  132. [BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK] = {
  133. .channel = BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK,
  134. .flags = IPROC_CLK_AON,
  135. - .enable = enable_val(0x0, 7, 1, 13),
  136. - .mdiv = reg_val(0x8, 0, 8),
  137. + .enable = ENABLE_VAL(0x0, 7, 1, 13),
  138. + .mdiv = REG_VAL(0x8, 0, 8),
  139. },
  140. [BCM_CYGNUS_LCPLL0_DDR_PHY_CLK] = {
  141. .channel = BCM_CYGNUS_LCPLL0_DDR_PHY_CLK,
  142. .flags = IPROC_CLK_AON,
  143. - .enable = enable_val(0x0, 8, 2, 14),
  144. - .mdiv = reg_val(0x8, 10, 8),
  145. + .enable = ENABLE_VAL(0x0, 8, 2, 14),
  146. + .mdiv = REG_VAL(0x8, 10, 8),
  147. },
  148. [BCM_CYGNUS_LCPLL0_SDIO_CLK] = {
  149. .channel = BCM_CYGNUS_LCPLL0_SDIO_CLK,
  150. .flags = IPROC_CLK_AON,
  151. - .enable = enable_val(0x0, 9, 3, 15),
  152. - .mdiv = reg_val(0x8, 20, 8),
  153. + .enable = ENABLE_VAL(0x0, 9, 3, 15),
  154. + .mdiv = REG_VAL(0x8, 20, 8),
  155. },
  156. [BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK] = {
  157. .channel = BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK,
  158. .flags = IPROC_CLK_AON,
  159. - .enable = enable_val(0x0, 10, 4, 16),
  160. - .mdiv = reg_val(0xc, 0, 8),
  161. + .enable = ENABLE_VAL(0x0, 10, 4, 16),
  162. + .mdiv = REG_VAL(0xc, 0, 8),
  163. },
  164. [BCM_CYGNUS_LCPLL0_SMART_CARD_CLK] = {
  165. .channel = BCM_CYGNUS_LCPLL0_SMART_CARD_CLK,
  166. .flags = IPROC_CLK_AON,
  167. - .enable = enable_val(0x0, 11, 5, 17),
  168. - .mdiv = reg_val(0xc, 10, 8),
  169. + .enable = ENABLE_VAL(0x0, 11, 5, 17),
  170. + .mdiv = REG_VAL(0xc, 10, 8),
  171. },
  172. [BCM_CYGNUS_LCPLL0_CH5_UNUSED] = {
  173. .channel = BCM_CYGNUS_LCPLL0_CH5_UNUSED,
  174. .flags = IPROC_CLK_AON,
  175. - .enable = enable_val(0x0, 12, 6, 18),
  176. - .mdiv = reg_val(0xc, 20, 8),
  177. + .enable = ENABLE_VAL(0x0, 12, 6, 18),
  178. + .mdiv = REG_VAL(0xc, 20, 8),
  179. },
  180. };
  181. @@ -189,52 +189,52 @@ static const struct iproc_pll_vco_param
  182. static const struct iproc_pll_ctrl mipipll = {
  183. .flags = IPROC_CLK_PLL_ASIU | IPROC_CLK_PLL_HAS_NDIV_FRAC |
  184. IPROC_CLK_NEEDS_READ_BACK,
  185. - .aon = aon_val(0x0, 4, 17, 16),
  186. - .asiu = asiu_gate_val(0x0, 3),
  187. - .reset = reset_val(0x0, 11, 10, 4, 3, 0, 4, 7, 4),
  188. - .ndiv_int = reg_val(0x10, 20, 10),
  189. - .ndiv_frac = reg_val(0x10, 0, 20),
  190. - .pdiv = reg_val(0x14, 0, 4),
  191. - .vco_ctrl = vco_ctrl_val(0x18, 0x1c),
  192. - .status = reg_val(0x28, 12, 1),
  193. + .aon = AON_VAL(0x0, 4, 17, 16),
  194. + .asiu = ASIU_GATE_VAL(0x0, 3),
  195. + .reset = RESET_VAL(0x0, 11, 10, 4, 3, 0, 4, 7, 4),
  196. + .ndiv_int = REG_VAL(0x10, 20, 10),
  197. + .ndiv_frac = REG_VAL(0x10, 0, 20),
  198. + .pdiv = REG_VAL(0x14, 0, 4),
  199. + .vco_ctrl = VCO_CTRL_VAL(0x18, 0x1c),
  200. + .status = REG_VAL(0x28, 12, 1),
  201. };
  202. static const struct iproc_clk_ctrl mipipll_clk[] = {
  203. [BCM_CYGNUS_MIPIPLL_CH0_UNUSED] = {
  204. .channel = BCM_CYGNUS_MIPIPLL_CH0_UNUSED,
  205. .flags = IPROC_CLK_NEEDS_READ_BACK,
  206. - .enable = enable_val(0x4, 12, 6, 18),
  207. - .mdiv = reg_val(0x20, 0, 8),
  208. + .enable = ENABLE_VAL(0x4, 12, 6, 18),
  209. + .mdiv = REG_VAL(0x20, 0, 8),
  210. },
  211. [BCM_CYGNUS_MIPIPLL_CH1_LCD] = {
  212. .channel = BCM_CYGNUS_MIPIPLL_CH1_LCD,
  213. .flags = IPROC_CLK_NEEDS_READ_BACK,
  214. - .enable = enable_val(0x4, 13, 7, 19),
  215. - .mdiv = reg_val(0x20, 10, 8),
  216. + .enable = ENABLE_VAL(0x4, 13, 7, 19),
  217. + .mdiv = REG_VAL(0x20, 10, 8),
  218. },
  219. [BCM_CYGNUS_MIPIPLL_CH2_V3D] = {
  220. .channel = BCM_CYGNUS_MIPIPLL_CH2_V3D,
  221. .flags = IPROC_CLK_NEEDS_READ_BACK,
  222. - .enable = enable_val(0x4, 14, 8, 20),
  223. - .mdiv = reg_val(0x20, 20, 8),
  224. + .enable = ENABLE_VAL(0x4, 14, 8, 20),
  225. + .mdiv = REG_VAL(0x20, 20, 8),
  226. },
  227. [BCM_CYGNUS_MIPIPLL_CH3_UNUSED] = {
  228. .channel = BCM_CYGNUS_MIPIPLL_CH3_UNUSED,
  229. .flags = IPROC_CLK_NEEDS_READ_BACK,
  230. - .enable = enable_val(0x4, 15, 9, 21),
  231. - .mdiv = reg_val(0x24, 0, 8),
  232. + .enable = ENABLE_VAL(0x4, 15, 9, 21),
  233. + .mdiv = REG_VAL(0x24, 0, 8),
  234. },
  235. [BCM_CYGNUS_MIPIPLL_CH4_UNUSED] = {
  236. .channel = BCM_CYGNUS_MIPIPLL_CH4_UNUSED,
  237. .flags = IPROC_CLK_NEEDS_READ_BACK,
  238. - .enable = enable_val(0x4, 16, 10, 22),
  239. - .mdiv = reg_val(0x24, 10, 8),
  240. + .enable = ENABLE_VAL(0x4, 16, 10, 22),
  241. + .mdiv = REG_VAL(0x24, 10, 8),
  242. },
  243. [BCM_CYGNUS_MIPIPLL_CH5_UNUSED] = {
  244. .channel = BCM_CYGNUS_MIPIPLL_CH5_UNUSED,
  245. .flags = IPROC_CLK_NEEDS_READ_BACK,
  246. - .enable = enable_val(0x4, 17, 11, 23),
  247. - .mdiv = reg_val(0x24, 20, 8),
  248. + .enable = ENABLE_VAL(0x4, 17, 11, 23),
  249. + .mdiv = REG_VAL(0x24, 20, 8),
  250. },
  251. };
  252. @@ -247,15 +247,15 @@ static void __init cygnus_mipipll_clk_in
  253. CLK_OF_DECLARE(cygnus_mipipll, "brcm,cygnus-mipipll", cygnus_mipipll_clk_init);
  254. static const struct iproc_asiu_div asiu_div[] = {
  255. - [BCM_CYGNUS_ASIU_KEYPAD_CLK] = asiu_div_val(0x0, 31, 16, 10, 0, 10),
  256. - [BCM_CYGNUS_ASIU_ADC_CLK] = asiu_div_val(0x4, 31, 16, 10, 0, 10),
  257. - [BCM_CYGNUS_ASIU_PWM_CLK] = asiu_div_val(0x8, 31, 16, 10, 0, 10),
  258. + [BCM_CYGNUS_ASIU_KEYPAD_CLK] = ASIU_DIV_VAL(0x0, 31, 16, 10, 0, 10),
  259. + [BCM_CYGNUS_ASIU_ADC_CLK] = ASIU_DIV_VAL(0x4, 31, 16, 10, 0, 10),
  260. + [BCM_CYGNUS_ASIU_PWM_CLK] = ASIU_DIV_VAL(0x8, 31, 16, 10, 0, 10),
  261. };
  262. static const struct iproc_asiu_gate asiu_gate[] = {
  263. - [BCM_CYGNUS_ASIU_KEYPAD_CLK] = asiu_gate_val(0x0, 7),
  264. - [BCM_CYGNUS_ASIU_ADC_CLK] = asiu_gate_val(0x0, 9),
  265. - [BCM_CYGNUS_ASIU_PWM_CLK] = asiu_gate_val(IPROC_CLK_INVALID_OFFSET, 0),
  266. + [BCM_CYGNUS_ASIU_KEYPAD_CLK] = ASIU_GATE_VAL(0x0, 7),
  267. + [BCM_CYGNUS_ASIU_ADC_CLK] = ASIU_GATE_VAL(0x0, 9),
  268. + [BCM_CYGNUS_ASIU_PWM_CLK] = ASIU_GATE_VAL(IPROC_CLK_INVALID_OFFSET, 0),
  269. };
  270. static void __init cygnus_asiu_init(struct device_node *node)