aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-omap/include/plat/display.h4
-rw-r--r--drivers/video/omap2/dss/dispc.c2
-rw-r--r--drivers/video/omap2/dss/dpi.c4
-rw-r--r--drivers/video/omap2/dss/dsi.c134
-rw-r--r--drivers/video/omap2/dss/dss.c4
-rw-r--r--drivers/video/omap2/dss/dss.h20
6 files changed, 87 insertions, 81 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 4101bcd2133e..37658249e483 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -403,8 +403,8 @@ struct omap_dss_device {
403 struct { 403 struct {
404 u16 regn; 404 u16 regn;
405 u16 regm; 405 u16 regm;
406 u16 regm3; 406 u16 regm_dispc;
407 u16 regm4; 407 u16 regm_dsi;
408 408
409 u16 lp_clk_div; 409 u16 lp_clk_div;
410 410
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 2c82d9a3df4b..9fb11c17623f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2338,7 +2338,7 @@ unsigned long dispc_fclk_rate(void)
2338 r = dss_clk_get_rate(DSS_CLK_FCK); 2338 r = dss_clk_get_rate(DSS_CLK_FCK);
2339 else 2339 else
2340#ifdef CONFIG_OMAP2_DSS_DSI 2340#ifdef CONFIG_OMAP2_DSS_DSI
2341 r = dsi_get_dsi1_pll_rate(); 2341 r = dsi_get_pll_hsdiv_dispc_rate();
2342#else 2342#else
2343 BUG(); 2343 BUG();
2344#endif 2344#endif
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 1b2867dfeeb9..08fed3080c0a 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -63,7 +63,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, bool is_tft,
63 if (r) 63 if (r)
64 return r; 64 return r;
65 65
66 *fck = dsi_cinfo.dsi1_pll_fclk; 66 *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
67 *lck_div = dispc_cinfo.lck_div; 67 *lck_div = dispc_cinfo.lck_div;
68 *pck_div = dispc_cinfo.pck_div; 68 *pck_div = dispc_cinfo.pck_div;
69 69
@@ -271,7 +271,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
271 if (r) 271 if (r)
272 return r; 272 return r;
273 273
274 fck = dsi_cinfo.dsi1_pll_fclk; 274 fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
275 lck_div = dispc_cinfo.lck_div; 275 lck_div = dispc_cinfo.lck_div;
276 pck_div = dispc_cinfo.pck_div; 276 pck_div = dispc_cinfo.pck_div;
277 } 277 }
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 3ef94227bbe7..37ffbb6ecf69 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -189,8 +189,8 @@ struct dsi_reg { u16 idx; };
189#define FINT_MIN 750000 189#define FINT_MIN 750000
190#define REGN_MAX (1 << 7) 190#define REGN_MAX (1 << 7)
191#define REGM_MAX ((1 << 11) - 1) 191#define REGM_MAX ((1 << 11) - 1)
192#define REGM3_MAX (1 << 4) 192#define REGM_DISPC_MAX (1 << 4)
193#define REGM4_MAX (1 << 4) 193#define REGM_DSI_MAX (1 << 4)
194#define LP_DIV_MAX ((1 << 13) - 1) 194#define LP_DIV_MAX ((1 << 13) - 1)
195 195
196enum fifo_size { 196enum fifo_size {
@@ -642,7 +642,7 @@ static void dsi_vc_disable_bta_irq(int channel)
642 dsi_write_reg(DSI_VC_IRQENABLE(channel), l); 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 */
646static inline void enable_clocks(bool enable) 646static inline void enable_clocks(bool enable)
647{ 647{
648 if (enable) 648 if (enable)
@@ -712,14 +712,14 @@ static inline int dsi_if_enable(bool enable)
712 return 0; 712 return 0;
713} 713}
714 714
715unsigned long dsi_get_dsi1_pll_rate(void) 715unsigned 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
720static unsigned long dsi_get_dsi2_pll_rate(void) 720static 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
725static unsigned long dsi_get_txbyteclkhs(void) 725static unsigned long dsi_get_txbyteclkhs(void)
@@ -732,11 +732,11 @@ static unsigned long dsi_fclk_rate(void)
732 unsigned long r; 732 unsigned long r;
733 733
734 if (dss_get_dsi_clk_source() == DSS_CLK_SRC_FCK) { 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 r = dss_clk_get_rate(DSS_CLK_FCK); 736 r = dss_clk_get_rate(DSS_CLK_FCK);
737 } else { 737 } else {
738 /* DSI FCLK source is DSI2_PLL_FCLK */ 738 /* DSI FCLK source is dsi_pll_hsdiv_dsi_clk */
739 r = dsi_get_dsi2_pll_rate(); 739 r = dsi_get_pll_hsdiv_dsi_rate();
740 } 740 }
741 741
742 return r; 742 return r;
@@ -806,16 +806,16 @@ static int dsi_calc_clock_rates(struct omap_dss_device *dssdev,
806 if (cinfo->regm == 0 || cinfo->regm > REGM_MAX) 806 if (cinfo->regm == 0 || cinfo->regm > REGM_MAX)
807 return -EINVAL; 807 return -EINVAL;
808 808
809 if (cinfo->regm3 > REGM3_MAX) 809 if (cinfo->regm_dispc > REGM_DISPC_MAX)
810 return -EINVAL; 810 return -EINVAL;
811 811
812 if (cinfo->regm4 > REGM4_MAX) 812 if (cinfo->regm_dsi > REGM_DSI_MAX)
813 return -EINVAL; 813 return -EINVAL;
814 814
815 if (cinfo->use_dss2_fck) { 815 if (cinfo->use_sys_clk) {
816 cinfo->clkin = dss_clk_get_rate(DSS_CLK_SYSCK); 816 cinfo->clkin = dss_clk_get_rate(DSS_CLK_SYSCK);
817 /* XXX it is unclear if highfreq should be used 817 /* XXX it is unclear if highfreq should be used
818 * with DSS2_FCK source also */ 818 * with DSS_SYS_CLK source also */
819 cinfo->highfreq = 0; 819 cinfo->highfreq = 0;
820 } else { 820 } else {
821 cinfo->clkin = dispc_pclk_rate(dssdev->manager->id); 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 if (cinfo->clkin4ddr > 1800 * 1000 * 1000) 836 if (cinfo->clkin4ddr > 1800 * 1000 * 1000)
837 return -EINVAL; 837 return -EINVAL;
838 838
839 if (cinfo->regm3 > 0) 839 if (cinfo->regm_dispc > 0)
840 cinfo->dsi1_pll_fclk = cinfo->clkin4ddr / cinfo->regm3; 840 cinfo->dsi_pll_hsdiv_dispc_clk =
841 cinfo->clkin4ddr / cinfo->regm_dispc;
841 else 842 else
842 cinfo->dsi1_pll_fclk = 0; 843 cinfo->dsi_pll_hsdiv_dispc_clk = 0;
843 844
844 if (cinfo->regm4 > 0) 845 if (cinfo->regm_dsi > 0)
845 cinfo->dsi2_pll_fclk = cinfo->clkin4ddr / cinfo->regm4; 846 cinfo->dsi_pll_hsdiv_dsi_clk =
847 cinfo->clkin4ddr / cinfo->regm_dsi;
846 else 848 else
847 cinfo->dsi2_pll_fclk = 0; 849 cinfo->dsi_pll_hsdiv_dsi_clk = 0;
848 850
849 return 0; 851 return 0;
850} 852}
@@ -857,18 +859,18 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
857 struct dispc_clock_info best_dispc; 859 struct dispc_clock_info best_dispc;
858 int min_fck_per_pck; 860 int min_fck_per_pck;
859 int match = 0; 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 max_dss_fck = dss_feat_get_max_dss_fck(); 866 max_dss_fck = dss_feat_get_max_dss_fck();
865 867
866 if (req_pck == dsi.cache_req_pck && 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 DSSDBG("DSI clock info found from cache\n"); 870 DSSDBG("DSI clock info found from cache\n");
869 *dsi_cinfo = dsi.cache_cinfo; 871 *dsi_cinfo = dsi.cache_cinfo;
870 dispc_find_clk_divs(is_tft, req_pck, dsi_cinfo->dsi1_pll_fclk, 872 dispc_find_clk_divs(is_tft, req_pck,
871 dispc_cinfo); 873 dsi_cinfo->dsi_pll_hsdiv_dispc_clk, dispc_cinfo);
872 return 0; 874 return 0;
873 } 875 }
874 876
@@ -889,8 +891,8 @@ retry:
889 memset(&best_dispc, 0, sizeof(best_dispc)); 891 memset(&best_dispc, 0, sizeof(best_dispc));
890 892
891 memset(&cur, 0, sizeof(cur)); 893 memset(&cur, 0, sizeof(cur));
892 cur.clkin = dss_clk_fck2; 894 cur.clkin = dss_sys_clk;
893 cur.use_dss2_fck = 1; 895 cur.use_sys_clk = 1;
894 cur.highfreq = 0; 896 cur.highfreq = 0;
895 897
896 /* no highfreq: 0.75MHz < Fint = clkin / regn < 2.1MHz */ 898 /* no highfreq: 0.75MHz < Fint = clkin / regn < 2.1MHz */
@@ -916,30 +918,32 @@ retry:
916 if (cur.clkin4ddr > 1800 * 1000 * 1000) 918 if (cur.clkin4ddr > 1800 * 1000 * 1000)
917 break; 919 break;
918 920
919 /* DSI1_PLL_FCLK(MHz) = DSIPHY(MHz) / regm3 < 173MHz */ 921 /* dsi_pll_hsdiv_dispc_clk(MHz) =
920 for (cur.regm3 = 1; cur.regm3 < REGM3_MAX; 922 * DSIPHY(MHz) / regm_dispc < 173MHz/186Mhz */
921 ++cur.regm3) { 923 for (cur.regm_dispc = 1; cur.regm_dispc < REGM_DISPC_MAX;
924 ++cur.regm_dispc) {
922 struct dispc_clock_info cur_dispc; 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 /* this will narrow down the search a bit, 929 /* this will narrow down the search a bit,
926 * but still give pixclocks below what was 930 * but still give pixclocks below what was
927 * requested */ 931 * requested */
928 if (cur.dsi1_pll_fclk < req_pck) 932 if (cur.dsi_pll_hsdiv_dispc_clk < req_pck)
929 break; 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 continue; 936 continue;
933 937
934 if (min_fck_per_pck && 938 if (min_fck_per_pck &&
935 cur.dsi1_pll_fclk < 939 cur.dsi_pll_hsdiv_dispc_clk <
936 req_pck * min_fck_per_pck) 940 req_pck * min_fck_per_pck)
937 continue; 941 continue;
938 942
939 match = 1; 943 match = 1;
940 944
941 dispc_find_clk_divs(is_tft, req_pck, 945 dispc_find_clk_divs(is_tft, req_pck,
942 cur.dsi1_pll_fclk, 946 cur.dsi_pll_hsdiv_dispc_clk,
943 &cur_dispc); 947 &cur_dispc);
944 948
945 if (abs(cur_dispc.pck - req_pck) < 949 if (abs(cur_dispc.pck - req_pck) <
@@ -968,9 +972,9 @@ found:
968 return -EINVAL; 972 return -EINVAL;
969 } 973 }
970 974
971 /* DSI2_PLL_FCLK (regm4) is not used */ 975 /* dsi_pll_hsdiv_dsi_clk (regm_dsi) is not used */
972 best.regm4 = 0; 976 best.regm_dsi = 0;
973 best.dsi2_pll_fclk = 0; 977 best.dsi_pll_hsdiv_dsi_clk = 0;
974 978
975 if (dsi_cinfo) 979 if (dsi_cinfo)
976 *dsi_cinfo = best; 980 *dsi_cinfo = best;
@@ -994,18 +998,20 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
994 998
995 dsi.current_cinfo.fint = cinfo->fint; 999 dsi.current_cinfo.fint = cinfo->fint;
996 dsi.current_cinfo.clkin4ddr = cinfo->clkin4ddr; 1000 dsi.current_cinfo.clkin4ddr = cinfo->clkin4ddr;
997 dsi.current_cinfo.dsi1_pll_fclk = cinfo->dsi1_pll_fclk; 1001 dsi.current_cinfo.dsi_pll_hsdiv_dispc_clk =
998 dsi.current_cinfo.dsi2_pll_fclk = cinfo->dsi2_pll_fclk; 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 dsi.current_cinfo.regn = cinfo->regn; 1006 dsi.current_cinfo.regn = cinfo->regn;
1001 dsi.current_cinfo.regm = cinfo->regm; 1007 dsi.current_cinfo.regm = cinfo->regm;
1002 dsi.current_cinfo.regm3 = cinfo->regm3; 1008 dsi.current_cinfo.regm_dispc = cinfo->regm_dispc;
1003 dsi.current_cinfo.regm4 = cinfo->regm4; 1009 dsi.current_cinfo.regm_dsi = cinfo->regm_dsi;
1004 1010
1005 DSSDBG("DSI Fint %ld\n", cinfo->fint); 1011 DSSDBG("DSI Fint %ld\n", cinfo->fint);
1006 1012
1007 DSSDBG("clkin (%s) rate %ld, highfreq %d\n", 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 cinfo->clkin, 1015 cinfo->clkin,
1010 cinfo->highfreq); 1016 cinfo->highfreq);
1011 1017
@@ -1022,14 +1028,14 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
1022 1028
1023 DSSDBG("Clock lane freq %ld Hz\n", cinfo->clkin4ddr / 4); 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 dss_get_generic_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC), 1032 dss_get_generic_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC),
1027 dss_feat_get_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC), 1033 dss_feat_get_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC),
1028 cinfo->dsi1_pll_fclk); 1034 cinfo->dsi_pll_hsdiv_dispc_clk);
1029 DSSDBG("regm4 = %d, %s (%s) = %lu\n", cinfo->regm4, 1035 DSSDBG("regm_dsi = %d, %s (%s) = %lu\n", cinfo->regm_dsi,
1030 dss_get_generic_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DSI), 1036 dss_get_generic_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DSI),
1031 dss_feat_get_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DSI), 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 REG_FLD_MOD(DSI_PLL_CONTROL, 0, 0, 0); /* DSI_PLL_AUTOMODE = manual */ 1040 REG_FLD_MOD(DSI_PLL_CONTROL, 0, 0, 0); /* DSI_PLL_AUTOMODE = manual */
1035 1041
@@ -1037,9 +1043,9 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
1037 l = FLD_MOD(l, 1, 0, 0); /* DSI_PLL_STOPMODE */ 1043 l = FLD_MOD(l, 1, 0, 0); /* DSI_PLL_STOPMODE */
1038 l = FLD_MOD(l, cinfo->regn - 1, 7, 1); /* DSI_PLL_REGN */ 1044 l = FLD_MOD(l, cinfo->regn - 1, 7, 1); /* DSI_PLL_REGN */
1039 l = FLD_MOD(l, cinfo->regm, 18, 8); /* DSI_PLL_REGM */ 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 22, 19); /* DSI_CLOCK_DIV */ 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 26, 23); /* DSIPROTO_CLOCK_DIV */ 1049 26, 23); /* DSIPROTO_CLOCK_DIV */
1044 dsi_write_reg(DSI_PLL_CONFIGURATION1, l); 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 l = dsi_read_reg(DSI_PLL_CONFIGURATION2); 1064 l = dsi_read_reg(DSI_PLL_CONFIGURATION2);
1059 l = FLD_MOD(l, f, 4, 1); /* DSI_PLL_FREQSEL */ 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 11, 11); /* DSI_PLL_CLKSEL */ 1067 11, 11); /* DSI_PLL_CLKSEL */
1062 l = FLD_MOD(l, cinfo->highfreq, 1068 l = FLD_MOD(l, cinfo->highfreq,
1063 12, 12); /* DSI_PLL_HIGHFREQ */ 1069 12, 12); /* DSI_PLL_HIGHFREQ */
@@ -1186,26 +1192,26 @@ void dsi_dump_clocks(struct seq_file *s)
1186 1192
1187 seq_printf(s, "dsi pll source = %s\n", 1193 seq_printf(s, "dsi pll source = %s\n",
1188 clksel == 0 ? 1194 clksel == 0 ?
1189 "dss2_alwon_fclk" : "pclkfree"); 1195 "dss_sys_clk" : "pclkfree");
1190 1196
1191 seq_printf(s, "Fint\t\t%-16luregn %u\n", cinfo->fint, cinfo->regn); 1197 seq_printf(s, "Fint\t\t%-16luregn %u\n", cinfo->fint, cinfo->regn);
1192 1198
1193 seq_printf(s, "CLKIN4DDR\t%-16luregm %u\n", 1199 seq_printf(s, "CLKIN4DDR\t%-16luregm %u\n",
1194 cinfo->clkin4ddr, cinfo->regm); 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 dss_get_generic_clk_source_name(dispc_clk_src), 1203 dss_get_generic_clk_source_name(dispc_clk_src),
1198 dss_feat_get_clk_source_name(dispc_clk_src), 1204 dss_feat_get_clk_source_name(dispc_clk_src),
1199 cinfo->dsi1_pll_fclk, 1205 cinfo->dsi_pll_hsdiv_dispc_clk,
1200 cinfo->regm3, 1206 cinfo->regm_dispc,
1201 dispc_clk_src == DSS_CLK_SRC_FCK ? 1207 dispc_clk_src == DSS_CLK_SRC_FCK ?
1202 "off" : "on"); 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 dss_get_generic_clk_source_name(dsi_clk_src), 1211 dss_get_generic_clk_source_name(dsi_clk_src),
1206 dss_feat_get_clk_source_name(dsi_clk_src), 1212 dss_feat_get_clk_source_name(dsi_clk_src),
1207 cinfo->dsi2_pll_fclk, 1213 cinfo->dsi_pll_hsdiv_dsi_clk,
1208 cinfo->regm4, 1214 cinfo->regm_dsi,
1209 dsi_clk_src == DSS_CLK_SRC_FCK ? 1215 dsi_clk_src == DSS_CLK_SRC_FCK ?
1210 "off" : "on"); 1216 "off" : "on");
1211 1217
@@ -2989,12 +2995,12 @@ static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev)
2989 struct dsi_clock_info cinfo; 2995 struct dsi_clock_info cinfo;
2990 int r; 2996 int r;
2991 2997
2992 /* we always use DSS2_FCK as input clock */ 2998 /* we always use DSS_CLK_SYSCK as input clock */
2993 cinfo.use_dss2_fck = true; 2999 cinfo.use_sys_clk = true;
2994 cinfo.regn = dssdev->phy.dsi.div.regn; 3000 cinfo.regn = dssdev->phy.dsi.div.regn;
2995 cinfo.regm = dssdev->phy.dsi.div.regm; 3001 cinfo.regm = dssdev->phy.dsi.div.regm;
2996 cinfo.regm3 = dssdev->phy.dsi.div.regm3; 3002 cinfo.regm_dispc = dssdev->phy.dsi.div.regm_dispc;
2997 cinfo.regm4 = dssdev->phy.dsi.div.regm4; 3003 cinfo.regm_dsi = dssdev->phy.dsi.div.regm_dsi;
2998 r = dsi_calc_clock_rates(dssdev, &cinfo); 3004 r = dsi_calc_clock_rates(dssdev, &cinfo);
2999 if (r) { 3005 if (r) {
3000 DSSERR("Failed to calc dsi clocks\n"); 3006 DSSERR("Failed to calc dsi clocks\n");
@@ -3016,7 +3022,7 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev)
3016 int r; 3022 int r;
3017 unsigned long long fck; 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 dispc_cinfo.lck_div = dssdev->phy.dsi.div.lck_div; 3027 dispc_cinfo.lck_div = dssdev->phy.dsi.div.lck_div;
3022 dispc_cinfo.pck_div = dssdev->phy.dsi.div.pck_div; 3028 dispc_cinfo.pck_div = dssdev->phy.dsi.div.pck_div;
@@ -3244,7 +3250,7 @@ int dsi_init_display(struct omap_dss_device *dssdev)
3244 return 0; 3250 return 0;
3245} 3251}
3246 3252
3247void dsi_wait_dsi1_pll_active(void) 3253void dsi_wait_pll_hsdiv_dispc_active(void)
3248{ 3254{
3249 if (wait_for_bit_change(DSI_PLL_STATUS, 7, 1) != 1) 3255 if (wait_for_bit_change(DSI_PLL_STATUS, 7, 1) != 1)
3250 DSSERR("%s (%s) not active\n", 3256 DSSERR("%s (%s) not active\n",
@@ -3252,7 +3258,7 @@ void dsi_wait_dsi1_pll_active(void)
3252 dss_feat_get_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC)); 3258 dss_feat_get_clk_source_name(DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC));
3253} 3259}
3254 3260
3255void dsi_wait_dsi2_pll_active(void) 3261void dsi_wait_pll_hsdiv_dsi_active(void)
3256{ 3262{
3257 if (wait_for_bit_change(DSI_PLL_STATUS, 8, 1) != 1) 3263 if (wait_for_bit_change(DSI_PLL_STATUS, 8, 1) != 1)
3258 DSSERR("%s (%s) not active\n", 3264 DSSERR("%s (%s) not active\n",
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index d049598bb412..5c6805b3362d 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -299,7 +299,7 @@ void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
299 b = clk_src == DSS_CLK_SRC_FCK ? 0 : 1; 299 b = clk_src == DSS_CLK_SRC_FCK ? 0 : 1;
300 300
301 if (clk_src == DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC) 301 if (clk_src == DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC)
302 dsi_wait_dsi1_pll_active(); 302 dsi_wait_pll_hsdiv_dispc_active();
303 303
304 REG_FLD_MOD(DSS_CONTROL, b, 0, 0); /* DISPC_CLK_SWITCH */ 304 REG_FLD_MOD(DSS_CONTROL, b, 0, 0); /* DISPC_CLK_SWITCH */
305 305
@@ -316,7 +316,7 @@ void dss_select_dsi_clk_source(enum dss_clk_source clk_src)
316 b = clk_src == DSS_CLK_SRC_FCK ? 0 : 1; 316 b = clk_src == DSS_CLK_SRC_FCK ? 0 : 1;
317 317
318 if (clk_src == DSS_CLK_SRC_DSI_PLL_HSDIV_DSI) 318 if (clk_src == DSS_CLK_SRC_DSI_PLL_HSDIV_DSI)
319 dsi_wait_dsi2_pll_active(); 319 dsi_wait_pll_hsdiv_dsi_active();
320 320
321 REG_FLD_MOD(DSS_CONTROL, b, 1, 1); /* DSI_CLK_SWITCH */ 321 REG_FLD_MOD(DSS_CONTROL, b, 1, 1); /* DSI_CLK_SWITCH */
322 322
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 42ca70f2bfd5..20590fb53c91 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -152,21 +152,21 @@ struct dsi_clock_info {
152 unsigned long fint; 152 unsigned long fint;
153 unsigned long clkin4ddr; 153 unsigned long clkin4ddr;
154 unsigned long clkin; 154 unsigned long clkin;
155 unsigned long dsi1_pll_fclk; 155 unsigned long dsi_pll_hsdiv_dispc_clk; /* DSI1_PLL_CLK */
156 unsigned long dsi2_pll_fclk; 156 unsigned long dsi_pll_hsdiv_dsi_clk; /* DSI2_PLL_CLK */
157 157
158 unsigned long lp_clk; 158 unsigned long lp_clk;
159 159
160 /* dividers */ 160 /* dividers */
161 u16 regn; 161 u16 regn;
162 u16 regm; 162 u16 regm;
163 u16 regm3; 163 u16 regm_dispc; /* REGM3 */
164 u16 regm4; 164 u16 regm_dsi; /* REGM4 */
165 165
166 u16 lp_clk_div; 166 u16 lp_clk_div;
167 167
168 u8 highfreq; 168 u8 highfreq;
169 bool use_dss2_fck; 169 bool use_sys_clk;
170}; 170};
171 171
172struct seq_file; 172struct seq_file;
@@ -278,7 +278,7 @@ void dsi_restore_context(void);
278 278
279int dsi_init_display(struct omap_dss_device *display); 279int dsi_init_display(struct omap_dss_device *display);
280void dsi_irq_handler(void); 280void dsi_irq_handler(void);
281unsigned long dsi_get_dsi1_pll_rate(void); 281unsigned long dsi_get_pll_hsdiv_dispc_rate(void);
282int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo); 282int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo);
283int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck, 283int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
284 struct dsi_clock_info *cinfo, 284 struct dsi_clock_info *cinfo,
@@ -289,8 +289,8 @@ void dsi_pll_uninit(void);
289void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, 289void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
290 u32 fifo_size, enum omap_burst_size *burst_size, 290 u32 fifo_size, enum omap_burst_size *burst_size,
291 u32 *fifo_low, u32 *fifo_high); 291 u32 *fifo_low, u32 *fifo_high);
292void dsi_wait_dsi1_pll_active(void); 292void dsi_wait_pll_hsdiv_dispc_active(void);
293void dsi_wait_dsi2_pll_active(void); 293void dsi_wait_pll_hsdiv_dsi_active(void);
294#else 294#else
295static inline int dsi_init_platform_driver(void) 295static inline int dsi_init_platform_driver(void)
296{ 296{
@@ -299,10 +299,10 @@ static inline int dsi_init_platform_driver(void)
299static inline void dsi_uninit_platform_driver(void) 299static inline void dsi_uninit_platform_driver(void)
300{ 300{
301} 301}
302static inline void dsi_wait_dsi1_pll_active(void) 302static inline void dsi_wait_pll_hsdiv_dispc_active(void)
303{ 303{
304} 304}
305static inline void dsi_wait_dsi2_pll_active(void) 305static inline void dsi_wait_pll_hsdiv_dsi_active(void)
306{ 306{
307} 307}
308#endif 308#endif