@@ -134,15 +134,10 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
134
134
#define PLL_HUAYRA_N_MASK 0xff
135
135
#define PLL_HUAYRA_ALPHA_WIDTH 16
136
136
137
- #define FABIA_OPMODE_STANDBY 0x0
138
- #define FABIA_OPMODE_RUN 0x1
139
-
140
- #define FABIA_PLL_OUT_MASK 0x7
141
- #define FABIA_PLL_RATE_MARGIN 500
142
-
143
- #define TRION_PLL_STANDBY 0x0
144
- #define TRION_PLL_RUN 0x1
145
- #define TRION_PLL_OUT_MASK 0x7
137
+ #define PLL_STANDBY 0x0
138
+ #define PLL_RUN 0x1
139
+ #define PLL_OUT_MASK 0x7
140
+ #define PLL_RATE_MARGIN 500
146
141
147
142
#define pll_alpha_width (p ) \
148
143
((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \
@@ -766,7 +761,7 @@ static int trion_pll_is_enabled(struct clk_alpha_pll *pll,
766
761
if (ret )
767
762
return 0 ;
768
763
769
- return ((opmode_regval & TRION_PLL_RUN ) && (mode_regval & PLL_OUTCTRL ));
764
+ return ((opmode_regval & PLL_RUN ) && (mode_regval & PLL_OUTCTRL ));
770
765
}
771
766
772
767
static int clk_trion_pll_is_enabled (struct clk_hw * hw )
@@ -796,15 +791,15 @@ static int clk_trion_pll_enable(struct clk_hw *hw)
796
791
}
797
792
798
793
/* Set operation mode to RUN */
799
- regmap_write (regmap , PLL_OPMODE (pll ), TRION_PLL_RUN );
794
+ regmap_write (regmap , PLL_OPMODE (pll ), PLL_RUN );
800
795
801
796
ret = wait_for_pll_enable_lock (pll );
802
797
if (ret )
803
798
return ret ;
804
799
805
800
/* Enable the PLL outputs */
806
801
ret = regmap_update_bits (regmap , PLL_USER_CTL (pll ),
807
- TRION_PLL_OUT_MASK , TRION_PLL_OUT_MASK );
802
+ PLL_OUT_MASK , PLL_OUT_MASK );
808
803
if (ret )
809
804
return ret ;
810
805
@@ -837,12 +832,12 @@ static void clk_trion_pll_disable(struct clk_hw *hw)
837
832
838
833
/* Disable the PLL outputs */
839
834
ret = regmap_update_bits (regmap , PLL_USER_CTL (pll ),
840
- TRION_PLL_OUT_MASK , 0 );
835
+ PLL_OUT_MASK , 0 );
841
836
if (ret )
842
837
return ;
843
838
844
839
/* Place the PLL mode in STANDBY */
845
- regmap_write (regmap , PLL_OPMODE (pll ), TRION_PLL_STANDBY );
840
+ regmap_write (regmap , PLL_OPMODE (pll ), PLL_STANDBY );
846
841
regmap_update_bits (regmap , PLL_MODE (pll ), PLL_RESET_N , PLL_RESET_N );
847
842
}
848
843
@@ -1089,14 +1084,14 @@ static int alpha_pll_fabia_enable(struct clk_hw *hw)
1089
1084
return ret ;
1090
1085
1091
1086
/* Skip If PLL is already running */
1092
- if ((opmode_val & FABIA_OPMODE_RUN ) && (val & PLL_OUTCTRL ))
1087
+ if ((opmode_val & PLL_RUN ) && (val & PLL_OUTCTRL ))
1093
1088
return 0 ;
1094
1089
1095
1090
ret = regmap_update_bits (regmap , PLL_MODE (pll ), PLL_OUTCTRL , 0 );
1096
1091
if (ret )
1097
1092
return ret ;
1098
1093
1099
- ret = regmap_write (regmap , PLL_OPMODE (pll ), FABIA_OPMODE_STANDBY );
1094
+ ret = regmap_write (regmap , PLL_OPMODE (pll ), PLL_STANDBY );
1100
1095
if (ret )
1101
1096
return ret ;
1102
1097
@@ -1105,7 +1100,7 @@ static int alpha_pll_fabia_enable(struct clk_hw *hw)
1105
1100
if (ret )
1106
1101
return ret ;
1107
1102
1108
- ret = regmap_write (regmap , PLL_OPMODE (pll ), FABIA_OPMODE_RUN );
1103
+ ret = regmap_write (regmap , PLL_OPMODE (pll ), PLL_RUN );
1109
1104
if (ret )
1110
1105
return ret ;
1111
1106
@@ -1114,7 +1109,7 @@ static int alpha_pll_fabia_enable(struct clk_hw *hw)
1114
1109
return ret ;
1115
1110
1116
1111
ret = regmap_update_bits (regmap , PLL_USER_CTL (pll ),
1117
- FABIA_PLL_OUT_MASK , FABIA_PLL_OUT_MASK );
1112
+ PLL_OUT_MASK , PLL_OUT_MASK );
1118
1113
if (ret )
1119
1114
return ret ;
1120
1115
@@ -1144,13 +1139,12 @@ static void alpha_pll_fabia_disable(struct clk_hw *hw)
1144
1139
return ;
1145
1140
1146
1141
/* Disable main outputs */
1147
- ret = regmap_update_bits (regmap , PLL_USER_CTL (pll ), FABIA_PLL_OUT_MASK ,
1148
- 0 );
1142
+ ret = regmap_update_bits (regmap , PLL_USER_CTL (pll ), PLL_OUT_MASK , 0 );
1149
1143
if (ret )
1150
1144
return ;
1151
1145
1152
1146
/* Place the PLL in STANDBY */
1153
- regmap_write (regmap , PLL_OPMODE (pll ), FABIA_OPMODE_STANDBY );
1147
+ regmap_write (regmap , PLL_OPMODE (pll ), PLL_STANDBY );
1154
1148
}
1155
1149
1156
1150
static unsigned long alpha_pll_fabia_recalc_rate (struct clk_hw * hw ,
@@ -1171,7 +1165,7 @@ static int alpha_pll_fabia_set_rate(struct clk_hw *hw, unsigned long rate,
1171
1165
struct clk_alpha_pll * pll = to_clk_alpha_pll (hw );
1172
1166
u32 l , alpha_width = pll_alpha_width (pll );
1173
1167
u64 a ;
1174
- unsigned long rrate , max = rate + FABIA_PLL_RATE_MARGIN ;
1168
+ unsigned long rrate , max = rate + PLL_RATE_MARGIN ;
1175
1169
1176
1170
rrate = alpha_pll_round_rate (rate , prate , & l , & a , alpha_width );
1177
1171
@@ -1230,7 +1224,7 @@ static int alpha_pll_fabia_prepare(struct clk_hw *hw)
1230
1224
* Due to a limited number of bits for fractional rate programming, the
1231
1225
* rounded up rate could be marginally higher than the requested rate.
1232
1226
*/
1233
- if (rrate > (cal_freq + FABIA_PLL_RATE_MARGIN ) || rrate < cal_freq )
1227
+ if (rrate > (cal_freq + PLL_RATE_MARGIN ) || rrate < cal_freq )
1234
1228
return - EINVAL ;
1235
1229
1236
1230
/* Setup PLL for calibration frequency */
0 commit comments