@@ -189,8 +189,8 @@ struct dsi_reg { u16 idx; };
189
189
#define FINT_MIN 750000
190
190
#define REGN_MAX (1 << 7)
191
191
#define REGM_MAX ((1 << 11) - 1)
192
- #define REGM3_MAX (1 << 4)
193
- #define REGM4_MAX (1 << 4)
192
+ #define REGM_DISPC_MAX (1 << 4)
193
+ #define REGM_DSI_MAX (1 << 4)
194
194
#define LP_DIV_MAX ((1 << 13) - 1)
195
195
196
196
enum fifo_size {
@@ -642,7 +642,7 @@ static void dsi_vc_disable_bta_irq(int channel)
642
642
dsi_write_reg (DSI_VC_IRQENABLE (channel ), l );
643
643
}
644
644
645
- /* DSI func clock. this could also be DSI2_PLL_FCLK */
645
+ /* DSI func clock. this could also be dsi_pll_hsdiv_dsi_clk */
646
646
static inline void enable_clocks (bool enable )
647
647
{
648
648
if (enable )
@@ -712,14 +712,14 @@ static inline int dsi_if_enable(bool enable)
712
712
return 0 ;
713
713
}
714
714
715
- unsigned long dsi_get_dsi1_pll_rate (void )
715
+ unsigned long dsi_get_pll_hsdiv_dispc_rate (void )
716
716
{
717
- return dsi .current_cinfo .dsi1_pll_fclk ;
717
+ return dsi .current_cinfo .dsi_pll_hsdiv_dispc_clk ;
718
718
}
719
719
720
- static unsigned long dsi_get_dsi2_pll_rate (void )
720
+ static unsigned long dsi_get_pll_hsdiv_dsi_rate (void )
721
721
{
722
- return dsi .current_cinfo .dsi2_pll_fclk ;
722
+ return dsi .current_cinfo .dsi_pll_hsdiv_dsi_clk ;
723
723
}
724
724
725
725
static unsigned long dsi_get_txbyteclkhs (void )
@@ -732,11 +732,11 @@ static unsigned long dsi_fclk_rate(void)
732
732
unsigned long r ;
733
733
734
734
if (dss_get_dsi_clk_source () == DSS_CLK_SRC_FCK ) {
735
- /* DSI FCLK source is DSS1_ALWON_FCK, which is dss1_fck */
735
+ /* DSI FCLK source is DSS_CLK_FCK */
736
736
r = dss_clk_get_rate (DSS_CLK_FCK );
737
737
} else {
738
- /* DSI FCLK source is DSI2_PLL_FCLK */
739
- r = dsi_get_dsi2_pll_rate ();
738
+ /* DSI FCLK source is dsi_pll_hsdiv_dsi_clk */
739
+ r = dsi_get_pll_hsdiv_dsi_rate ();
740
740
}
741
741
742
742
return r ;
@@ -806,16 +806,16 @@ static int dsi_calc_clock_rates(struct omap_dss_device *dssdev,
806
806
if (cinfo -> regm == 0 || cinfo -> regm > REGM_MAX )
807
807
return - EINVAL ;
808
808
809
- if (cinfo -> regm3 > REGM3_MAX )
809
+ if (cinfo -> regm_dispc > REGM_DISPC_MAX )
810
810
return - EINVAL ;
811
811
812
- if (cinfo -> regm4 > REGM4_MAX )
812
+ if (cinfo -> regm_dsi > REGM_DSI_MAX )
813
813
return - EINVAL ;
814
814
815
- if (cinfo -> use_dss2_fck ) {
815
+ if (cinfo -> use_sys_clk ) {
816
816
cinfo -> clkin = dss_clk_get_rate (DSS_CLK_SYSCK );
817
817
/* XXX it is unclear if highfreq should be used
818
- * with DSS2_FCK source also */
818
+ * with DSS_SYS_CLK source also */
819
819
cinfo -> highfreq = 0 ;
820
820
} else {
821
821
cinfo -> clkin = dispc_pclk_rate (dssdev -> manager -> id );
@@ -836,15 +836,17 @@ static int dsi_calc_clock_rates(struct omap_dss_device *dssdev,
836
836
if (cinfo -> clkin4ddr > 1800 * 1000 * 1000 )
837
837
return - EINVAL ;
838
838
839
- if (cinfo -> regm3 > 0 )
840
- cinfo -> dsi1_pll_fclk = cinfo -> clkin4ddr / cinfo -> regm3 ;
839
+ if (cinfo -> regm_dispc > 0 )
840
+ cinfo -> dsi_pll_hsdiv_dispc_clk =
841
+ cinfo -> clkin4ddr / cinfo -> regm_dispc ;
841
842
else
842
- cinfo -> dsi1_pll_fclk = 0 ;
843
+ cinfo -> dsi_pll_hsdiv_dispc_clk = 0 ;
843
844
844
- if (cinfo -> regm4 > 0 )
845
- cinfo -> dsi2_pll_fclk = cinfo -> clkin4ddr / cinfo -> regm4 ;
845
+ if (cinfo -> regm_dsi > 0 )
846
+ cinfo -> dsi_pll_hsdiv_dsi_clk =
847
+ cinfo -> clkin4ddr / cinfo -> regm_dsi ;
846
848
else
847
- cinfo -> dsi2_pll_fclk = 0 ;
849
+ cinfo -> dsi_pll_hsdiv_dsi_clk = 0 ;
848
850
849
851
return 0 ;
850
852
}
@@ -857,18 +859,18 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
857
859
struct dispc_clock_info best_dispc ;
858
860
int min_fck_per_pck ;
859
861
int match = 0 ;
860
- unsigned long dss_clk_fck2 , max_dss_fck ;
862
+ unsigned long dss_sys_clk , max_dss_fck ;
861
863
862
- dss_clk_fck2 = dss_clk_get_rate (DSS_CLK_SYSCK );
864
+ dss_sys_clk = dss_clk_get_rate (DSS_CLK_SYSCK );
863
865
864
866
max_dss_fck = dss_feat_get_max_dss_fck ();
865
867
866
868
if (req_pck == dsi .cache_req_pck &&
867
- dsi .cache_cinfo .clkin == dss_clk_fck2 ) {
869
+ dsi .cache_cinfo .clkin == dss_sys_clk ) {
868
870
DSSDBG ("DSI clock info found from cache\n" );
869
871
* dsi_cinfo = dsi .cache_cinfo ;
870
- dispc_find_clk_divs (is_tft , req_pck , dsi_cinfo -> dsi1_pll_fclk ,
871
- dispc_cinfo );
872
+ dispc_find_clk_divs (is_tft , req_pck ,
873
+ dsi_cinfo -> dsi_pll_hsdiv_dispc_clk , dispc_cinfo );
872
874
return 0 ;
873
875
}
874
876
@@ -889,8 +891,8 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
889
891
memset (& best_dispc , 0 , sizeof (best_dispc ));
890
892
891
893
memset (& cur , 0 , sizeof (cur ));
892
- cur .clkin = dss_clk_fck2 ;
893
- cur .use_dss2_fck = 1 ;
894
+ cur .clkin = dss_sys_clk ;
895
+ cur .use_sys_clk = 1 ;
894
896
cur .highfreq = 0 ;
895
897
896
898
/* no highfreq: 0.75MHz < Fint = clkin / regn < 2.1MHz */
@@ -916,30 +918,32 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
916
918
if (cur .clkin4ddr > 1800 * 1000 * 1000 )
917
919
break ;
918
920
919
- /* DSI1_PLL_FCLK(MHz) = DSIPHY(MHz) / regm3 < 173MHz */
920
- for (cur .regm3 = 1 ; cur .regm3 < REGM3_MAX ;
921
- ++ cur .regm3 ) {
921
+ /* dsi_pll_hsdiv_dispc_clk(MHz) =
922
+ * DSIPHY(MHz) / regm_dispc < 173MHz/186Mhz */
923
+ for (cur .regm_dispc = 1 ; cur .regm_dispc < REGM_DISPC_MAX ;
924
+ ++ cur .regm_dispc ) {
922
925
struct dispc_clock_info cur_dispc ;
923
- cur .dsi1_pll_fclk = cur .clkin4ddr / cur .regm3 ;
926
+ cur .dsi_pll_hsdiv_dispc_clk =
927
+ cur .clkin4ddr / cur .regm_dispc ;
924
928
925
929
/* this will narrow down the search a bit,
926
930
* but still give pixclocks below what was
927
931
* requested */
928
- if (cur .dsi1_pll_fclk < req_pck )
932
+ if (cur .dsi_pll_hsdiv_dispc_clk < req_pck )
929
933
break ;
930
934
931
- if (cur .dsi1_pll_fclk > max_dss_fck )
935
+ if (cur .dsi_pll_hsdiv_dispc_clk > max_dss_fck )
932
936
continue ;
933
937
934
938
if (min_fck_per_pck &&
935
- cur .dsi1_pll_fclk <
939
+ cur .dsi_pll_hsdiv_dispc_clk <
936
940
req_pck * min_fck_per_pck )
937
941
continue ;
938
942
939
943
match = 1 ;
940
944
941
945
dispc_find_clk_divs (is_tft , req_pck ,
942
- cur .dsi1_pll_fclk ,
946
+ cur .dsi_pll_hsdiv_dispc_clk ,
943
947
& cur_dispc );
944
948
945
949
if (abs (cur_dispc .pck - req_pck ) <
@@ -968,9 +972,9 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
968
972
return - EINVAL ;
969
973
}
970
974
971
- /* DSI2_PLL_FCLK (regm4 ) is not used */
972
- best .regm4 = 0 ;
973
- best .dsi2_pll_fclk = 0 ;
975
+ /* dsi_pll_hsdiv_dsi_clk (regm_dsi ) is not used */
976
+ best .regm_dsi = 0 ;
977
+ best .dsi_pll_hsdiv_dsi_clk = 0 ;
974
978
975
979
if (dsi_cinfo )
976
980
* dsi_cinfo = best ;
@@ -994,18 +998,20 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
994
998
995
999
dsi .current_cinfo .fint = cinfo -> fint ;
996
1000
dsi .current_cinfo .clkin4ddr = cinfo -> clkin4ddr ;
997
- dsi .current_cinfo .dsi1_pll_fclk = cinfo -> dsi1_pll_fclk ;
998
- dsi .current_cinfo .dsi2_pll_fclk = cinfo -> dsi2_pll_fclk ;
1001
+ dsi .current_cinfo .dsi_pll_hsdiv_dispc_clk =
1002
+ cinfo -> dsi_pll_hsdiv_dispc_clk ;
1003
+ dsi .current_cinfo .dsi_pll_hsdiv_dsi_clk =
1004
+ cinfo -> dsi_pll_hsdiv_dsi_clk ;
999
1005
1000
1006
dsi .current_cinfo .regn = cinfo -> regn ;
1001
1007
dsi .current_cinfo .regm = cinfo -> regm ;
1002
- dsi .current_cinfo .regm3 = cinfo -> regm3 ;
1003
- dsi .current_cinfo .regm4 = cinfo -> regm4 ;
1008
+ dsi .current_cinfo .regm_dispc = cinfo -> regm_dispc ;
1009
+ dsi .current_cinfo .regm_dsi = cinfo -> regm_dsi ;
1004
1010
1005
1011
DSSDBG ("DSI Fint %ld\n" , cinfo -> fint );
1006
1012
1007
1013
DSSDBG ("clkin (%s) rate %ld, highfreq %d\n" ,
1008
- cinfo -> use_dss2_fck ? "dss2_fck " : "pclkfree" ,
1014
+ cinfo -> use_sys_clk ? "dss_sys_clk " : "pclkfree" ,
1009
1015
cinfo -> clkin ,
1010
1016
cinfo -> highfreq );
1011
1017
@@ -1022,24 +1028,24 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
1022
1028
1023
1029
DSSDBG ("Clock lane freq %ld Hz\n" , cinfo -> clkin4ddr / 4 );
1024
1030
1025
- DSSDBG ("regm3 = %d, %s (%s) = %lu\n" , cinfo -> regm3 ,
1031
+ DSSDBG ("regm_dispc = %d, %s (%s) = %lu\n" , cinfo -> regm_dispc ,
1026
1032
dss_get_generic_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC ),
1027
1033
dss_feat_get_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC ),
1028
- cinfo -> dsi1_pll_fclk );
1029
- DSSDBG ("regm4 = %d, %s (%s) = %lu\n" , cinfo -> regm4 ,
1034
+ cinfo -> dsi_pll_hsdiv_dispc_clk );
1035
+ DSSDBG ("regm_dsi = %d, %s (%s) = %lu\n" , cinfo -> regm_dsi ,
1030
1036
dss_get_generic_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DSI ),
1031
1037
dss_feat_get_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DSI ),
1032
- cinfo -> dsi2_pll_fclk );
1038
+ cinfo -> dsi_pll_hsdiv_dsi_clk );
1033
1039
1034
1040
REG_FLD_MOD (DSI_PLL_CONTROL , 0 , 0 , 0 ); /* DSI_PLL_AUTOMODE = manual */
1035
1041
1036
1042
l = dsi_read_reg (DSI_PLL_CONFIGURATION1 );
1037
1043
l = FLD_MOD (l , 1 , 0 , 0 ); /* DSI_PLL_STOPMODE */
1038
1044
l = FLD_MOD (l , cinfo -> regn - 1 , 7 , 1 ); /* DSI_PLL_REGN */
1039
1045
l = FLD_MOD (l , cinfo -> regm , 18 , 8 ); /* DSI_PLL_REGM */
1040
- l = FLD_MOD (l , cinfo -> regm3 > 0 ? cinfo -> regm3 - 1 : 0 ,
1046
+ l = FLD_MOD (l , cinfo -> regm_dispc > 0 ? cinfo -> regm_dispc - 1 : 0 ,
1041
1047
22 , 19 ); /* DSI_CLOCK_DIV */
1042
- l = FLD_MOD (l , cinfo -> regm4 > 0 ? cinfo -> regm4 - 1 : 0 ,
1048
+ l = FLD_MOD (l , cinfo -> regm_dsi > 0 ? cinfo -> regm_dsi - 1 : 0 ,
1043
1049
26 , 23 ); /* DSIPROTO_CLOCK_DIV */
1044
1050
dsi_write_reg (DSI_PLL_CONFIGURATION1 , l );
1045
1051
@@ -1057,7 +1063,7 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
1057
1063
1058
1064
l = dsi_read_reg (DSI_PLL_CONFIGURATION2 );
1059
1065
l = FLD_MOD (l , f , 4 , 1 ); /* DSI_PLL_FREQSEL */
1060
- l = FLD_MOD (l , cinfo -> use_dss2_fck ? 0 : 1 ,
1066
+ l = FLD_MOD (l , cinfo -> use_sys_clk ? 0 : 1 ,
1061
1067
11 , 11 ); /* DSI_PLL_CLKSEL */
1062
1068
l = FLD_MOD (l , cinfo -> highfreq ,
1063
1069
12 , 12 ); /* DSI_PLL_HIGHFREQ */
@@ -1186,26 +1192,26 @@ void dsi_dump_clocks(struct seq_file *s)
1186
1192
1187
1193
seq_printf (s , "dsi pll source = %s\n" ,
1188
1194
clksel == 0 ?
1189
- "dss2_alwon_fclk " : "pclkfree" );
1195
+ "dss_sys_clk " : "pclkfree" );
1190
1196
1191
1197
seq_printf (s , "Fint\t\t%-16luregn %u\n" , cinfo -> fint , cinfo -> regn );
1192
1198
1193
1199
seq_printf (s , "CLKIN4DDR\t%-16luregm %u\n" ,
1194
1200
cinfo -> clkin4ddr , cinfo -> regm );
1195
1201
1196
- seq_printf (s , "%s (%s)\t%-16luregm3 %u\t(%s)\n" ,
1202
+ seq_printf (s , "%s (%s)\t%-16luregm_dispc %u\t(%s)\n" ,
1197
1203
dss_get_generic_clk_source_name (dispc_clk_src ),
1198
1204
dss_feat_get_clk_source_name (dispc_clk_src ),
1199
- cinfo -> dsi1_pll_fclk ,
1200
- cinfo -> regm3 ,
1205
+ cinfo -> dsi_pll_hsdiv_dispc_clk ,
1206
+ cinfo -> regm_dispc ,
1201
1207
dispc_clk_src == DSS_CLK_SRC_FCK ?
1202
1208
"off" : "on" );
1203
1209
1204
- seq_printf (s , "%s (%s)\t%-16luregm4 %u\t(%s)\n" ,
1210
+ seq_printf (s , "%s (%s)\t%-16luregm_dsi %u\t(%s)\n" ,
1205
1211
dss_get_generic_clk_source_name (dsi_clk_src ),
1206
1212
dss_feat_get_clk_source_name (dsi_clk_src ),
1207
- cinfo -> dsi2_pll_fclk ,
1208
- cinfo -> regm4 ,
1213
+ cinfo -> dsi_pll_hsdiv_dsi_clk ,
1214
+ cinfo -> regm_dsi ,
1209
1215
dsi_clk_src == DSS_CLK_SRC_FCK ?
1210
1216
"off" : "on" );
1211
1217
@@ -2989,12 +2995,12 @@ static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev)
2989
2995
struct dsi_clock_info cinfo ;
2990
2996
int r ;
2991
2997
2992
- /* we always use DSS2_FCK as input clock */
2993
- cinfo .use_dss2_fck = true;
2998
+ /* we always use DSS_CLK_SYSCK as input clock */
2999
+ cinfo .use_sys_clk = true;
2994
3000
cinfo .regn = dssdev -> phy .dsi .div .regn ;
2995
3001
cinfo .regm = dssdev -> phy .dsi .div .regm ;
2996
- cinfo .regm3 = dssdev -> phy .dsi .div .regm3 ;
2997
- cinfo .regm4 = dssdev -> phy .dsi .div .regm4 ;
3002
+ cinfo .regm_dispc = dssdev -> phy .dsi .div .regm_dispc ;
3003
+ cinfo .regm_dsi = dssdev -> phy .dsi .div .regm_dsi ;
2998
3004
r = dsi_calc_clock_rates (dssdev , & cinfo );
2999
3005
if (r ) {
3000
3006
DSSERR ("Failed to calc dsi clocks\n" );
@@ -3016,7 +3022,7 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev)
3016
3022
int r ;
3017
3023
unsigned long long fck ;
3018
3024
3019
- fck = dsi_get_dsi1_pll_rate ();
3025
+ fck = dsi_get_pll_hsdiv_dispc_rate ();
3020
3026
3021
3027
dispc_cinfo .lck_div = dssdev -> phy .dsi .div .lck_div ;
3022
3028
dispc_cinfo .pck_div = dssdev -> phy .dsi .div .pck_div ;
@@ -3244,15 +3250,15 @@ int dsi_init_display(struct omap_dss_device *dssdev)
3244
3250
return 0 ;
3245
3251
}
3246
3252
3247
- void dsi_wait_dsi1_pll_active (void )
3253
+ void dsi_wait_pll_hsdiv_dispc_active (void )
3248
3254
{
3249
3255
if (wait_for_bit_change (DSI_PLL_STATUS , 7 , 1 ) != 1 )
3250
3256
DSSERR ("%s (%s) not active\n" ,
3251
3257
dss_get_generic_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC ),
3252
3258
dss_feat_get_clk_source_name (DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC ));
3253
3259
}
3254
3260
3255
- void dsi_wait_dsi2_pll_active (void )
3261
+ void dsi_wait_pll_hsdiv_dsi_active (void )
3256
3262
{
3257
3263
if (wait_for_bit_change (DSI_PLL_STATUS , 8 , 1 ) != 1 )
3258
3264
DSSERR ("%s (%s) not active\n" ,
0 commit comments