|
16 | 16 |
|
17 | 17 | #include "pmc.h"
|
18 | 18 |
|
19 |
| -#define SAMA7G5_INIT_TABLE(_table, _count) \ |
20 |
| - do { \ |
21 |
| - u8 _i; \ |
22 |
| - for (_i = 0; _i < (_count); _i++) \ |
23 |
| - (_table)[_i] = _i; \ |
24 |
| - } while (0) |
25 |
| - |
26 |
| -#define SAMA7G5_FILL_TABLE(_to, _from, _count) \ |
27 |
| - do { \ |
28 |
| - u8 _i; \ |
29 |
| - for (_i = 0; _i < (_count); _i++) { \ |
30 |
| - (_to)[_i] = (_from)[_i]; \ |
31 |
| - } \ |
32 |
| - } while (0) |
33 |
| - |
34 | 19 | static DEFINE_SPINLOCK(pmc_pll_lock);
|
35 | 20 | static DEFINE_SPINLOCK(pmc_mck0_lock);
|
36 | 21 | static DEFINE_SPINLOCK(pmc_mckX_lock);
|
@@ -1119,17 +1104,17 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
|
1119 | 1104 | if (!mux_table)
|
1120 | 1105 | goto err_free;
|
1121 | 1106 |
|
1122 |
| - SAMA7G5_INIT_TABLE(mux_table, 3); |
1123 |
| - SAMA7G5_FILL_TABLE(&mux_table[3], sama7g5_mckx[i].ep_mux_table, |
1124 |
| - sama7g5_mckx[i].ep_count); |
| 1107 | + PMC_INIT_TABLE(mux_table, 3); |
| 1108 | + PMC_FILL_TABLE(&mux_table[3], sama7g5_mckx[i].ep_mux_table, |
| 1109 | + sama7g5_mckx[i].ep_count); |
1125 | 1110 | for (j = 0; j < sama7g5_mckx[i].ep_count; j++) {
|
1126 | 1111 | u8 pll_id = sama7g5_mckx[i].ep[j].pll_id;
|
1127 | 1112 | u8 pll_compid = sama7g5_mckx[i].ep[j].pll_compid;
|
1128 | 1113 |
|
1129 | 1114 | tmp_parent_hws[j] = sama7g5_plls[pll_id][pll_compid].hw;
|
1130 | 1115 | }
|
1131 |
| - SAMA7G5_FILL_TABLE(&parent_hws[3], tmp_parent_hws, |
1132 |
| - sama7g5_mckx[i].ep_count); |
| 1116 | + PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws, |
| 1117 | + sama7g5_mckx[i].ep_count); |
1133 | 1118 |
|
1134 | 1119 | hw = at91_clk_sama7g5_register_master(regmap, sama7g5_mckx[i].n,
|
1135 | 1120 | num_parents, NULL, parent_hws, mux_table,
|
@@ -1215,17 +1200,17 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
|
1215 | 1200 | if (!mux_table)
|
1216 | 1201 | goto err_free;
|
1217 | 1202 |
|
1218 |
| - SAMA7G5_INIT_TABLE(mux_table, 3); |
1219 |
| - SAMA7G5_FILL_TABLE(&mux_table[3], sama7g5_gck[i].pp_mux_table, |
1220 |
| - sama7g5_gck[i].pp_count); |
| 1203 | + PMC_INIT_TABLE(mux_table, 3); |
| 1204 | + PMC_FILL_TABLE(&mux_table[3], sama7g5_gck[i].pp_mux_table, |
| 1205 | + sama7g5_gck[i].pp_count); |
1221 | 1206 | for (j = 0; j < sama7g5_gck[i].pp_count; j++) {
|
1222 | 1207 | u8 pll_id = sama7g5_gck[i].pp[j].pll_id;
|
1223 | 1208 | u8 pll_compid = sama7g5_gck[i].pp[j].pll_compid;
|
1224 | 1209 |
|
1225 | 1210 | tmp_parent_hws[j] = sama7g5_plls[pll_id][pll_compid].hw;
|
1226 | 1211 | }
|
1227 |
| - SAMA7G5_FILL_TABLE(&parent_hws[3], tmp_parent_hws, |
1228 |
| - sama7g5_gck[i].pp_count); |
| 1212 | + PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws, |
| 1213 | + sama7g5_gck[i].pp_count); |
1229 | 1214 |
|
1230 | 1215 | hw = at91_clk_register_generated(regmap, &pmc_pcr_lock,
|
1231 | 1216 | &sama7g5_pcr_layout,
|
|
0 commit comments