diff options
author | Ken Chang <kenc@nvidia.com> | 2013-09-16 02:20:49 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:06:53 -0400 |
commit | 2b903ea3facea15ca61398c49b6880cd5e3a8e93 (patch) | |
tree | 83cf6ba957b3b53773bb987549d8e589754e4264 /drivers/video/tegra/dc/dsi.c | |
parent | 8716ea8d7c6d5f1f1dc96344e0182de87f8f2fd4 (diff) |
video: tegra: dsi: refactor D-PHY timing code
Refactor the code for calculating D-PHY timing to increase the
granularity of DSI Tbit.
Bug 1367094
Change-Id: Ic634879f5a362dd4b5699cf093b03457ee699d2c
Signed-off-by: Ken Chang <kenc@nvidia.com>
(cherry picked from commit fe691453145a8566dee016469f6d8f82d19f3a31)
Reviewed-on: http://git-master/r/281308
(cherry picked from commit 3f623a888199721a1adbcaf6cff223c686d4d971)
Reviewed-on: http://git-master/r/302667
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dsi.c')
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 324 |
1 files changed, 160 insertions, 164 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 6edcb554b..e4071faa8 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c | |||
@@ -713,136 +713,132 @@ static void tegra_dsi_init_sw(struct tegra_dc *dc, | |||
713 | dsi->idle_delay = msecs_to_jiffies(DSI_HOST_IDLE_PERIOD); | 713 | dsi->idle_delay = msecs_to_jiffies(DSI_HOST_IDLE_PERIOD); |
714 | } | 714 | } |
715 | 715 | ||
716 | #define SELECT_T_PHY(platform_t_phy_ns, default_phy, clk_ns, hw_inc) ( \ | 716 | #define SELECT_T_PHY(platform_t_phy_ps, default_phy, clk_ps, hw_inc) ( \ |
717 | (platform_t_phy_ns) ? ( \ | 717 | (platform_t_phy_ps) ? ( \ |
718 | ((DSI_CONVERT_T_PHY_NS_TO_T_PHY(platform_t_phy_ns, clk_ns, hw_inc)) < 0 ? 0 : \ | 718 | ((DSI_CONVERT_T_PHY_PS_TO_T_PHY(platform_t_phy_ps, clk_ps, hw_inc)) < 0 ? 0 : \ |
719 | (DSI_CONVERT_T_PHY_NS_TO_T_PHY(platform_t_phy_ns, clk_ns, hw_inc)))) : \ | 719 | (DSI_CONVERT_T_PHY_PS_TO_T_PHY(platform_t_phy_ps, clk_ps, hw_inc)))) : \ |
720 | ((default_phy) < 0 ? 0 : (default_phy))) | 720 | ((default_phy) < 0 ? 0 : (default_phy))) |
721 | 721 | ||
722 | static void tegra_dsi_get_clk_phy_timing(struct tegra_dc_dsi_data *dsi, | 722 | static void tegra_dsi_get_clk_phy_timing(struct tegra_dc_dsi_data *dsi, |
723 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ns) | 723 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ps) |
724 | { | 724 | { |
725 | phy_timing_clk->t_tlpx = SELECT_T_PHY( | 725 | phy_timing_clk->t_tlpx = SELECT_T_PHY( |
726 | dsi->info.phy_timing.t_tlpx_ns, | 726 | dsi->info.phy_timing.t_tlpx_ns * 1000, |
727 | T_TLPX_DEFAULT(clk_ns), clk_ns, T_TLPX_HW_INC); | 727 | T_TLPX_DEFAULT(clk_ps), clk_ps, T_TLPX_HW_INC); |
728 | 728 | ||
729 | phy_timing_clk->t_clktrail = SELECT_T_PHY( | 729 | phy_timing_clk->t_clktrail = SELECT_T_PHY( |
730 | dsi->info.phy_timing.t_clktrail_ns, | 730 | dsi->info.phy_timing.t_clktrail_ns * 1000, |
731 | T_CLKTRAIL_DEFAULT(clk_ns), clk_ns, T_CLKTRAIL_HW_INC); | 731 | T_CLKTRAIL_DEFAULT(clk_ps), clk_ps, T_CLKTRAIL_HW_INC); |
732 | 732 | ||
733 | phy_timing_clk->t_clkpost = SELECT_T_PHY( | 733 | phy_timing_clk->t_clkpost = SELECT_T_PHY( |
734 | dsi->info.phy_timing.t_clkpost_ns, | 734 | dsi->info.phy_timing.t_clkpost_ns * 1000, |
735 | T_CLKPOST_DEFAULT(clk_ns), clk_ns, T_CLKPOST_HW_INC); | 735 | T_CLKPOST_DEFAULT(clk_ps), clk_ps, T_CLKPOST_HW_INC); |
736 | 736 | ||
737 | phy_timing_clk->t_clkzero = SELECT_T_PHY( | 737 | phy_timing_clk->t_clkzero = SELECT_T_PHY( |
738 | dsi->info.phy_timing.t_clkzero_ns, | 738 | dsi->info.phy_timing.t_clkzero_ns * 1000, |
739 | T_CLKZERO_DEFAULT(clk_ns), clk_ns, T_CLKZERO_HW_INC); | 739 | T_CLKZERO_DEFAULT(clk_ps), clk_ps, T_CLKZERO_HW_INC); |
740 | 740 | ||
741 | phy_timing_clk->t_clkprepare = SELECT_T_PHY( | 741 | phy_timing_clk->t_clkprepare = SELECT_T_PHY( |
742 | dsi->info.phy_timing.t_clkprepare_ns, | 742 | dsi->info.phy_timing.t_clkprepare_ns * 1000, |
743 | T_CLKPREPARE_DEFAULT(clk_ns), clk_ns, T_CLKPREPARE_HW_INC); | 743 | T_CLKPREPARE_DEFAULT(clk_ps), clk_ps, T_CLKPREPARE_HW_INC); |
744 | 744 | ||
745 | phy_timing_clk->t_clkpre = SELECT_T_PHY( | 745 | phy_timing_clk->t_clkpre = SELECT_T_PHY( |
746 | dsi->info.phy_timing.t_clkpre_ns, | 746 | dsi->info.phy_timing.t_clkpre_ns * 1000, |
747 | T_CLKPRE_DEFAULT, clk_ns, T_CLKPRE_HW_INC); | 747 | T_CLKPRE_DEFAULT, clk_ps, T_CLKPRE_HW_INC); |
748 | } | 748 | } |
749 | 749 | ||
750 | static void tegra_dsi_get_hs_phy_timing(struct tegra_dc_dsi_data *dsi, | 750 | static void tegra_dsi_get_hs_phy_timing(struct tegra_dc_dsi_data *dsi, |
751 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ns) | 751 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ps) |
752 | { | 752 | { |
753 | phy_timing_clk->t_tlpx = SELECT_T_PHY( | 753 | phy_timing_clk->t_tlpx = SELECT_T_PHY( |
754 | dsi->info.phy_timing.t_tlpx_ns, | 754 | dsi->info.phy_timing.t_tlpx_ns * 1000, |
755 | T_TLPX_DEFAULT(clk_ns), clk_ns, T_TLPX_HW_INC); | 755 | T_TLPX_DEFAULT(clk_ps), clk_ps, T_TLPX_HW_INC); |
756 | 756 | ||
757 | phy_timing_clk->t_hsdexit = SELECT_T_PHY( | 757 | phy_timing_clk->t_hsdexit = SELECT_T_PHY( |
758 | dsi->info.phy_timing.t_hsdexit_ns, | 758 | dsi->info.phy_timing.t_hsdexit_ns * 1000, |
759 | T_HSEXIT_DEFAULT(clk_ns), clk_ns, T_HSEXIT_HW_INC); | 759 | T_HSEXIT_DEFAULT(clk_ps), clk_ps, T_HSEXIT_HW_INC); |
760 | 760 | ||
761 | phy_timing_clk->t_hstrail = SELECT_T_PHY( | 761 | phy_timing_clk->t_hstrail = SELECT_T_PHY( |
762 | dsi->info.phy_timing.t_hstrail_ns, | 762 | dsi->info.phy_timing.t_hstrail_ns * 1000, |
763 | T_HSTRAIL_DEFAULT(clk_ns), clk_ns, T_HSTRAIL_HW_INC); | 763 | T_HSTRAIL_DEFAULT(clk_ps), clk_ps, T_HSTRAIL_HW_INC); |
764 | 764 | ||
765 | phy_timing_clk->t_datzero = SELECT_T_PHY( | 765 | phy_timing_clk->t_datzero = SELECT_T_PHY( |
766 | dsi->info.phy_timing.t_datzero_ns, | 766 | dsi->info.phy_timing.t_datzero_ns * 1000, |
767 | T_DATZERO_DEFAULT(clk_ns), clk_ns, T_DATZERO_HW_INC); | 767 | T_DATZERO_DEFAULT(clk_ps), clk_ps, T_DATZERO_HW_INC); |
768 | 768 | ||
769 | phy_timing_clk->t_hsprepare = SELECT_T_PHY( | 769 | phy_timing_clk->t_hsprepare = SELECT_T_PHY( |
770 | dsi->info.phy_timing.t_hsprepare_ns, | 770 | dsi->info.phy_timing.t_hsprepare_ns * 1000, |
771 | T_HSPREPARE_DEFAULT(clk_ns), clk_ns, T_HSPREPARE_HW_INC); | 771 | T_HSPREPARE_DEFAULT(clk_ps), clk_ps, T_HSPREPARE_HW_INC); |
772 | } | 772 | } |
773 | 773 | ||
774 | static void tegra_dsi_get_escape_phy_timing(struct tegra_dc_dsi_data *dsi, | 774 | static void tegra_dsi_get_escape_phy_timing(struct tegra_dc_dsi_data *dsi, |
775 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ns) | 775 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ps) |
776 | { | 776 | { |
777 | phy_timing_clk->t_tlpx = SELECT_T_PHY( | 777 | phy_timing_clk->t_tlpx = SELECT_T_PHY( |
778 | dsi->info.phy_timing.t_tlpx_ns, | 778 | dsi->info.phy_timing.t_tlpx_ns * 1000, |
779 | T_TLPX_DEFAULT(clk_ns), clk_ns, T_TLPX_HW_INC); | 779 | T_TLPX_DEFAULT(clk_ps), clk_ps, T_TLPX_HW_INC); |
780 | } | 780 | } |
781 | 781 | ||
782 | static void tegra_dsi_get_bta_phy_timing(struct tegra_dc_dsi_data *dsi, | 782 | static void tegra_dsi_get_bta_phy_timing(struct tegra_dc_dsi_data *dsi, |
783 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ns) | 783 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ps) |
784 | { | 784 | { |
785 | phy_timing_clk->t_tlpx = SELECT_T_PHY( | 785 | phy_timing_clk->t_tlpx = SELECT_T_PHY( |
786 | dsi->info.phy_timing.t_tlpx_ns, | 786 | dsi->info.phy_timing.t_tlpx_ns * 1000, |
787 | T_TLPX_DEFAULT(clk_ns), clk_ns, T_TLPX_HW_INC); | 787 | T_TLPX_DEFAULT(clk_ps), clk_ps, T_TLPX_HW_INC); |
788 | 788 | ||
789 | phy_timing_clk->t_taget = SELECT_T_PHY( | 789 | phy_timing_clk->t_taget = SELECT_T_PHY( |
790 | dsi->info.phy_timing.t_taget_ns, | 790 | dsi->info.phy_timing.t_taget_ns * 1000, |
791 | T_TAGET_DEFAULT(clk_ns), clk_ns, T_TAGET_HW_INC); | 791 | T_TAGET_DEFAULT(clk_ps), clk_ps, T_TAGET_HW_INC); |
792 | 792 | ||
793 | phy_timing_clk->t_tasure = SELECT_T_PHY( | 793 | phy_timing_clk->t_tasure = SELECT_T_PHY( |
794 | dsi->info.phy_timing.t_tasure_ns, | 794 | dsi->info.phy_timing.t_tasure_ns * 1000, |
795 | T_TASURE_DEFAULT(clk_ns), clk_ns, T_TASURE_HW_INC); | 795 | T_TASURE_DEFAULT(clk_ps), clk_ps, T_TASURE_HW_INC); |
796 | 796 | ||
797 | phy_timing_clk->t_tago = SELECT_T_PHY( | 797 | phy_timing_clk->t_tago = SELECT_T_PHY( |
798 | dsi->info.phy_timing.t_tago_ns, | 798 | dsi->info.phy_timing.t_tago_ns * 1000, |
799 | T_TAGO_DEFAULT(clk_ns), clk_ns, T_TAGO_HW_INC); | 799 | T_TAGO_DEFAULT(clk_ps), clk_ps, T_TAGO_HW_INC); |
800 | } | 800 | } |
801 | 801 | ||
802 | static void tegra_dsi_get_ulps_phy_timing(struct tegra_dc_dsi_data *dsi, | 802 | static void tegra_dsi_get_ulps_phy_timing(struct tegra_dc_dsi_data *dsi, |
803 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ns) | 803 | struct dsi_phy_timing_inclk *phy_timing_clk, u32 clk_ps) |
804 | { | 804 | { |
805 | phy_timing_clk->t_tlpx = SELECT_T_PHY( | 805 | phy_timing_clk->t_tlpx = SELECT_T_PHY( |
806 | dsi->info.phy_timing.t_tlpx_ns, | 806 | dsi->info.phy_timing.t_tlpx_ns * 1000, |
807 | T_TLPX_DEFAULT(clk_ns), clk_ns, T_TLPX_HW_INC); | 807 | T_TLPX_DEFAULT(clk_ps), clk_ps, T_TLPX_HW_INC); |
808 | 808 | ||
809 | phy_timing_clk->t_wakeup = SELECT_T_PHY( | 809 | phy_timing_clk->t_wakeup = SELECT_T_PHY( |
810 | dsi->info.phy_timing.t_wakeup_ns, | 810 | dsi->info.phy_timing.t_wakeup_ns * 1000, |
811 | T_WAKEUP_DEFAULT, clk_ns, T_WAKEUP_HW_INC); | 811 | T_WAKEUP_DEFAULT, clk_ps, T_WAKEUP_HW_INC); |
812 | } | 812 | } |
813 | 813 | ||
814 | #undef SELECT_T_PHY | 814 | #undef SELECT_T_PHY |
815 | 815 | ||
816 | static void tegra_dsi_get_phy_timing(struct tegra_dc_dsi_data *dsi, | 816 | static void tegra_dsi_get_phy_timing(struct tegra_dc_dsi_data *dsi, |
817 | struct dsi_phy_timing_inclk *phy_timing_clk, | 817 | struct dsi_phy_timing_inclk *phy_timing_clk, |
818 | u32 clk_ns, u8 lphs) | 818 | u32 clk_ps, u8 lphs) |
819 | { | 819 | { |
820 | if (tegra_platform_is_fpga() && !(dsi->info.ganged_type)) { | 820 | if (tegra_platform_is_fpga() && !(dsi->info.ganged_type)) { |
821 | clk_ns = (1000 * 1000) / (dsi->info.fpga_freq_khz ? | 821 | clk_ps = (1000 * 1000 * 1000) / (dsi->info.fpga_freq_khz ? |
822 | dsi->info.fpga_freq_khz : DEFAULT_FPGA_FREQ_KHZ); | 822 | dsi->info.fpga_freq_khz : DEFAULT_FPGA_FREQ_KHZ); |
823 | } | 823 | } |
824 | 824 | ||
825 | phy_timing_clk->t_hsdexit = dsi->info.phy_timing.t_hsdexit_ns ? | ||
826 | (dsi->info.phy_timing.t_hsdexit_ns / clk_ns) : | ||
827 | (T_HSEXIT_DEFAULT(clk_ns)); | ||
828 | |||
829 | if (lphs == DSI_LPHS_IN_HS_MODE) { | 825 | if (lphs == DSI_LPHS_IN_HS_MODE) { |
830 | tegra_dsi_get_clk_phy_timing(dsi, phy_timing_clk, clk_ns); | 826 | tegra_dsi_get_clk_phy_timing(dsi, phy_timing_clk, clk_ps); |
831 | tegra_dsi_get_hs_phy_timing(dsi, phy_timing_clk, clk_ns); | 827 | tegra_dsi_get_hs_phy_timing(dsi, phy_timing_clk, clk_ps); |
832 | } else { | 828 | } else { |
833 | /* default is LP mode */ | 829 | /* default is LP mode */ |
834 | tegra_dsi_get_escape_phy_timing(dsi, phy_timing_clk, clk_ns); | 830 | tegra_dsi_get_escape_phy_timing(dsi, phy_timing_clk, clk_ps); |
835 | tegra_dsi_get_bta_phy_timing(dsi, phy_timing_clk, clk_ns); | 831 | tegra_dsi_get_bta_phy_timing(dsi, phy_timing_clk, clk_ps); |
836 | tegra_dsi_get_ulps_phy_timing(dsi, phy_timing_clk, clk_ns); | 832 | tegra_dsi_get_ulps_phy_timing(dsi, phy_timing_clk, clk_ps); |
837 | if (dsi->info.enable_hs_clock_on_lp_cmd_mode) | 833 | if (dsi->info.enable_hs_clock_on_lp_cmd_mode) |
838 | tegra_dsi_get_clk_phy_timing(dsi, | 834 | tegra_dsi_get_clk_phy_timing(dsi, |
839 | phy_timing_clk, clk_ns); | 835 | phy_timing_clk, clk_ps); |
840 | } | 836 | } |
841 | } | 837 | } |
842 | 838 | ||
843 | static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | 839 | static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, |
844 | struct dsi_phy_timing_inclk *phy_timing, | 840 | struct dsi_phy_timing_inclk *phy_timing, |
845 | u32 clk_ns, u8 lphs) | 841 | u32 clk_ps, u8 lphs) |
846 | { | 842 | { |
847 | int err = 0; | 843 | int err = 0; |
848 | 844 | ||
@@ -851,14 +847,14 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
851 | ((max) == NOT_DEFINED ? 0 : (val) > (max)) ? -EINVAL : 0) | 847 | ((max) == NOT_DEFINED ? 0 : (val) > (max)) ? -EINVAL : 0) |
852 | 848 | ||
853 | if (tegra_platform_is_fpga()) | 849 | if (tegra_platform_is_fpga()) |
854 | clk_ns = dsi->info.fpga_freq_khz ? | 850 | clk_ps = dsi->info.fpga_freq_khz ? |
855 | ((1000 * 1000) / dsi->info.fpga_freq_khz) : | 851 | ((1000 * 1000 * 1000) / dsi->info.fpga_freq_khz) : |
856 | DEFAULT_FPGA_FREQ_KHZ; | 852 | DEFAULT_FPGA_FREQ_KHZ; |
857 | 853 | ||
858 | err = CHECK_RANGE( | 854 | err = CHECK_RANGE( |
859 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 855 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
860 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC), | 856 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC), |
861 | MIPI_T_TLPX_NS_MIN, MIPI_T_TLPX_NS_MAX); | 857 | MIPI_T_TLPX_PS_MIN, MIPI_T_TLPX_PS_MAX); |
862 | if (err < 0) { | 858 | if (err < 0) { |
863 | dev_warn(&dsi->dc->ndev->dev, | 859 | dev_warn(&dsi->dc->ndev->dev, |
864 | "dsi: Tlpx mipi range violated\n"); | 860 | "dsi: Tlpx mipi range violated\n"); |
@@ -867,9 +863,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
867 | 863 | ||
868 | if (lphs == DSI_LPHS_IN_HS_MODE) { | 864 | if (lphs == DSI_LPHS_IN_HS_MODE) { |
869 | err = CHECK_RANGE( | 865 | err = CHECK_RANGE( |
870 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 866 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
871 | phy_timing->t_hsdexit, clk_ns, T_HSEXIT_HW_INC), | 867 | phy_timing->t_hsdexit, clk_ps, T_HSEXIT_HW_INC), |
872 | MIPI_T_HSEXIT_NS_MIN, MIPI_T_HSEXIT_NS_MAX); | 868 | MIPI_T_HSEXIT_PS_MIN, MIPI_T_HSEXIT_PS_MAX); |
873 | if (err < 0) { | 869 | if (err < 0) { |
874 | dev_warn(&dsi->dc->ndev->dev, | 870 | dev_warn(&dsi->dc->ndev->dev, |
875 | "dsi: HsExit mipi range violated\n"); | 871 | "dsi: HsExit mipi range violated\n"); |
@@ -877,9 +873,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
877 | } | 873 | } |
878 | 874 | ||
879 | err = CHECK_RANGE( | 875 | err = CHECK_RANGE( |
880 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 876 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
881 | phy_timing->t_hstrail, clk_ns, T_HSTRAIL_HW_INC), | 877 | phy_timing->t_hstrail, clk_ps, T_HSTRAIL_HW_INC), |
882 | MIPI_T_HSTRAIL_NS_MIN(clk_ns), MIPI_T_HSTRAIL_NS_MAX); | 878 | MIPI_T_HSTRAIL_PS_MIN(clk_ps), MIPI_T_HSTRAIL_PS_MAX); |
883 | if (err < 0) { | 879 | if (err < 0) { |
884 | dev_warn(&dsi->dc->ndev->dev, | 880 | dev_warn(&dsi->dc->ndev->dev, |
885 | "dsi: HsTrail mipi range violated\n"); | 881 | "dsi: HsTrail mipi range violated\n"); |
@@ -887,9 +883,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
887 | } | 883 | } |
888 | 884 | ||
889 | err = CHECK_RANGE( | 885 | err = CHECK_RANGE( |
890 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 886 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
891 | phy_timing->t_datzero, clk_ns, T_DATZERO_HW_INC), | 887 | phy_timing->t_datzero, clk_ps, T_DATZERO_HW_INC), |
892 | MIPI_T_HSZERO_NS_MIN, MIPI_T_HSZERO_NS_MAX); | 888 | MIPI_T_HSZERO_PS_MIN, MIPI_T_HSZERO_PS_MAX); |
893 | if (err < 0) { | 889 | if (err < 0) { |
894 | dev_warn(&dsi->dc->ndev->dev, | 890 | dev_warn(&dsi->dc->ndev->dev, |
895 | "dsi: HsZero mipi range violated\n"); | 891 | "dsi: HsZero mipi range violated\n"); |
@@ -897,10 +893,10 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
897 | } | 893 | } |
898 | 894 | ||
899 | err = CHECK_RANGE( | 895 | err = CHECK_RANGE( |
900 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 896 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
901 | phy_timing->t_hsprepare, clk_ns, T_HSPREPARE_HW_INC), | 897 | phy_timing->t_hsprepare, clk_ps, T_HSPREPARE_HW_INC), |
902 | MIPI_T_HSPREPARE_NS_MIN(clk_ns), | 898 | MIPI_T_HSPREPARE_PS_MIN(clk_ps), |
903 | MIPI_T_HSPREPARE_NS_MAX(clk_ns)); | 899 | MIPI_T_HSPREPARE_PS_MAX(clk_ps)); |
904 | if (err < 0) { | 900 | if (err < 0) { |
905 | dev_warn(&dsi->dc->ndev->dev, | 901 | dev_warn(&dsi->dc->ndev->dev, |
906 | "dsi: HsPrepare mipi range violated\n"); | 902 | "dsi: HsPrepare mipi range violated\n"); |
@@ -908,12 +904,12 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
908 | } | 904 | } |
909 | 905 | ||
910 | err = CHECK_RANGE( | 906 | err = CHECK_RANGE( |
911 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 907 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
912 | phy_timing->t_hsprepare, clk_ns, T_HSPREPARE_HW_INC) + | 908 | phy_timing->t_hsprepare, clk_ps, T_HSPREPARE_HW_INC) + |
913 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 909 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
914 | phy_timing->t_datzero, clk_ns, T_DATZERO_HW_INC), | 910 | phy_timing->t_datzero, clk_ps, T_DATZERO_HW_INC), |
915 | MIPI_T_HSPREPARE_ADD_HSZERO_NS_MIN(clk_ns), | 911 | MIPI_T_HSPREPARE_ADD_HSZERO_PS_MIN(clk_ps), |
916 | MIPI_T_HSPREPARE_ADD_HSZERO_NS_MAX); | 912 | MIPI_T_HSPREPARE_ADD_HSZERO_PS_MAX); |
917 | if (err < 0) { | 913 | if (err < 0) { |
918 | dev_warn(&dsi->dc->ndev->dev, | 914 | dev_warn(&dsi->dc->ndev->dev, |
919 | "dsi: HsPrepare + HsZero mipi range violated\n"); | 915 | "dsi: HsPrepare + HsZero mipi range violated\n"); |
@@ -922,9 +918,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
922 | } else { | 918 | } else { |
923 | /* default is LP mode */ | 919 | /* default is LP mode */ |
924 | err = CHECK_RANGE( | 920 | err = CHECK_RANGE( |
925 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 921 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
926 | phy_timing->t_wakeup, clk_ns, T_WAKEUP_HW_INC), | 922 | phy_timing->t_wakeup, clk_ps, T_WAKEUP_HW_INC), |
927 | MIPI_T_WAKEUP_NS_MIN, MIPI_T_WAKEUP_NS_MAX); | 923 | MIPI_T_WAKEUP_PS_MIN, MIPI_T_WAKEUP_PS_MAX); |
928 | if (err < 0) { | 924 | if (err < 0) { |
929 | dev_warn(&dsi->dc->ndev->dev, | 925 | dev_warn(&dsi->dc->ndev->dev, |
930 | "dsi: WakeUp mipi range violated\n"); | 926 | "dsi: WakeUp mipi range violated\n"); |
@@ -932,12 +928,12 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
932 | } | 928 | } |
933 | 929 | ||
934 | err = CHECK_RANGE( | 930 | err = CHECK_RANGE( |
935 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 931 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
936 | phy_timing->t_tasure, clk_ns, T_TASURE_HW_INC), | 932 | phy_timing->t_tasure, clk_ps, T_TASURE_HW_INC), |
937 | MIPI_T_TASURE_NS_MIN(DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 933 | MIPI_T_TASURE_PS_MIN(DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
938 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC)), | 934 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC)), |
939 | MIPI_T_TASURE_NS_MAX(DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 935 | MIPI_T_TASURE_PS_MAX(DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
940 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC))); | 936 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC))); |
941 | if (err < 0) { | 937 | if (err < 0) { |
942 | dev_warn(&dsi->dc->ndev->dev, | 938 | dev_warn(&dsi->dc->ndev->dev, |
943 | "dsi: TaSure mipi range violated\n"); | 939 | "dsi: TaSure mipi range violated\n"); |
@@ -948,9 +944,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
948 | if (lphs == DSI_LPHS_IN_HS_MODE || | 944 | if (lphs == DSI_LPHS_IN_HS_MODE || |
949 | dsi->info.enable_hs_clock_on_lp_cmd_mode) { | 945 | dsi->info.enable_hs_clock_on_lp_cmd_mode) { |
950 | err = CHECK_RANGE( | 946 | err = CHECK_RANGE( |
951 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 947 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
952 | phy_timing->t_clktrail, clk_ns, T_CLKTRAIL_HW_INC), | 948 | phy_timing->t_clktrail, clk_ps, T_CLKTRAIL_HW_INC), |
953 | MIPI_T_CLKTRAIL_NS_MIN, MIPI_T_CLKTRAIL_NS_MAX); | 949 | MIPI_T_CLKTRAIL_PS_MIN, MIPI_T_CLKTRAIL_PS_MAX); |
954 | if (err < 0) { | 950 | if (err < 0) { |
955 | dev_warn(&dsi->dc->ndev->dev, | 951 | dev_warn(&dsi->dc->ndev->dev, |
956 | "dsi: ClkTrail mipi range violated\n"); | 952 | "dsi: ClkTrail mipi range violated\n"); |
@@ -958,9 +954,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
958 | } | 954 | } |
959 | 955 | ||
960 | err = CHECK_RANGE( | 956 | err = CHECK_RANGE( |
961 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 957 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
962 | phy_timing->t_clkpost, clk_ns, T_CLKPOST_HW_INC), | 958 | phy_timing->t_clkpost, clk_ps, T_CLKPOST_HW_INC), |
963 | MIPI_T_CLKPOST_NS_MIN(clk_ns), MIPI_T_CLKPOST_NS_MAX); | 959 | MIPI_T_CLKPOST_PS_MIN(clk_ps), MIPI_T_CLKPOST_PS_MAX); |
964 | if (err < 0) { | 960 | if (err < 0) { |
965 | dev_warn(&dsi->dc->ndev->dev, | 961 | dev_warn(&dsi->dc->ndev->dev, |
966 | "dsi: ClkPost mipi range violated\n"); | 962 | "dsi: ClkPost mipi range violated\n"); |
@@ -968,9 +964,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
968 | } | 964 | } |
969 | 965 | ||
970 | err = CHECK_RANGE( | 966 | err = CHECK_RANGE( |
971 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 967 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
972 | phy_timing->t_clkzero, clk_ns, T_CLKZERO_HW_INC), | 968 | phy_timing->t_clkzero, clk_ps, T_CLKZERO_HW_INC), |
973 | MIPI_T_CLKZERO_NS_MIN, MIPI_T_CLKZERO_NS_MAX); | 969 | MIPI_T_CLKZERO_PS_MIN, MIPI_T_CLKZERO_PS_MAX); |
974 | if (err < 0) { | 970 | if (err < 0) { |
975 | dev_warn(&dsi->dc->ndev->dev, | 971 | dev_warn(&dsi->dc->ndev->dev, |
976 | "dsi: ClkZero mipi range violated\n"); | 972 | "dsi: ClkZero mipi range violated\n"); |
@@ -978,9 +974,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
978 | } | 974 | } |
979 | 975 | ||
980 | err = CHECK_RANGE( | 976 | err = CHECK_RANGE( |
981 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 977 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
982 | phy_timing->t_clkprepare, clk_ns, T_CLKPREPARE_HW_INC), | 978 | phy_timing->t_clkprepare, clk_ps, T_CLKPREPARE_HW_INC), |
983 | MIPI_T_CLKPREPARE_NS_MIN, MIPI_T_CLKPREPARE_NS_MAX); | 979 | MIPI_T_CLKPREPARE_PS_MIN, MIPI_T_CLKPREPARE_PS_MAX); |
984 | if (err < 0) { | 980 | if (err < 0) { |
985 | dev_warn(&dsi->dc->ndev->dev, | 981 | dev_warn(&dsi->dc->ndev->dev, |
986 | "dsi: ClkPrepare mipi range violated\n"); | 982 | "dsi: ClkPrepare mipi range violated\n"); |
@@ -988,9 +984,9 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
988 | } | 984 | } |
989 | 985 | ||
990 | err = CHECK_RANGE( | 986 | err = CHECK_RANGE( |
991 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 987 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
992 | phy_timing->t_clkpre, clk_ns, T_CLKPRE_HW_INC), | 988 | phy_timing->t_clkpre, clk_ps, T_CLKPRE_HW_INC), |
993 | MIPI_T_CLKPRE_NS_MIN, MIPI_T_CLKPRE_NS_MAX); | 989 | MIPI_T_CLKPRE_PS_MIN, MIPI_T_CLKPRE_PS_MAX); |
994 | if (err < 0) { | 990 | if (err < 0) { |
995 | dev_warn(&dsi->dc->ndev->dev, | 991 | dev_warn(&dsi->dc->ndev->dev, |
996 | "dsi: ClkPre mipi range violated\n"); | 992 | "dsi: ClkPre mipi range violated\n"); |
@@ -998,12 +994,12 @@ static int tegra_dsi_mipi_phy_timing_range(struct tegra_dc_dsi_data *dsi, | |||
998 | } | 994 | } |
999 | 995 | ||
1000 | err = CHECK_RANGE( | 996 | err = CHECK_RANGE( |
1001 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 997 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1002 | phy_timing->t_clkprepare, clk_ns, T_CLKPREPARE_HW_INC) + | 998 | phy_timing->t_clkprepare, clk_ps, T_CLKPREPARE_HW_INC) + |
1003 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 999 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1004 | phy_timing->t_clkzero, clk_ns, T_CLKZERO_HW_INC), | 1000 | phy_timing->t_clkzero, clk_ps, T_CLKZERO_HW_INC), |
1005 | MIPI_T_CLKPREPARE_ADD_CLKZERO_NS_MIN, | 1001 | MIPI_T_CLKPREPARE_ADD_CLKZERO_PS_MIN, |
1006 | MIPI_T_CLKPREPARE_ADD_CLKZERO_NS_MAX); | 1002 | MIPI_T_CLKPREPARE_ADD_CLKZERO_PS_MAX); |
1007 | if (err < 0) { | 1003 | if (err < 0) { |
1008 | dev_warn(&dsi->dc->ndev->dev, | 1004 | dev_warn(&dsi->dc->ndev->dev, |
1009 | "dsi: ClkPrepare + ClkZero mipi range violated\n"); | 1005 | "dsi: ClkPrepare + ClkZero mipi range violated\n"); |
@@ -1017,14 +1013,14 @@ fail: | |||
1017 | 1013 | ||
1018 | static int tegra_dsi_hs_phy_len(struct tegra_dc_dsi_data *dsi, | 1014 | static int tegra_dsi_hs_phy_len(struct tegra_dc_dsi_data *dsi, |
1019 | struct dsi_phy_timing_inclk *phy_timing, | 1015 | struct dsi_phy_timing_inclk *phy_timing, |
1020 | u32 clk_ns, u8 lphs) | 1016 | u32 clk_ps, u8 lphs) |
1021 | { | 1017 | { |
1022 | u32 hs_t_phy_ns = 0; | 1018 | u32 hs_t_phy_ps = 0; |
1023 | u32 clk_t_phy_ns = 0; | 1019 | u32 clk_t_phy_ps = 0; |
1024 | u32 t_phy_ns; | 1020 | u32 t_phy_ps; |
1025 | u32 h_blank_ns; | 1021 | u32 h_blank_ps; |
1026 | struct tegra_dc_mode *modes; | 1022 | struct tegra_dc_mode *modes; |
1027 | u32 t_pix_ns; | 1023 | u32 t_pix_ps; |
1028 | int err = 0; | 1024 | int err = 0; |
1029 | 1025 | ||
1030 | if (!(lphs == DSI_LPHS_IN_HS_MODE)) | 1026 | if (!(lphs == DSI_LPHS_IN_HS_MODE)) |
@@ -1037,59 +1033,59 @@ static int tegra_dsi_hs_phy_len(struct tegra_dc_dsi_data *dsi, | |||
1037 | goto fail; | 1033 | goto fail; |
1038 | 1034 | ||
1039 | modes = dsi->dc->out->modes; | 1035 | modes = dsi->dc->out->modes; |
1040 | t_pix_ns = clk_ns * BITS_PER_BYTE * | 1036 | t_pix_ps = clk_ps * BITS_PER_BYTE * |
1041 | dsi->pixel_scaler_mul / dsi->pixel_scaler_div; | 1037 | dsi->pixel_scaler_mul / dsi->pixel_scaler_div; |
1042 | 1038 | ||
1043 | hs_t_phy_ns = | 1039 | hs_t_phy_ps = |
1044 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1040 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1045 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC) + | 1041 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC) + |
1046 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1042 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1047 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC) + | 1043 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC) + |
1048 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1044 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1049 | phy_timing->t_hsprepare, clk_ns, T_HSPREPARE_HW_INC) + | 1045 | phy_timing->t_hsprepare, clk_ps, T_HSPREPARE_HW_INC) + |
1050 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1046 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1051 | phy_timing->t_datzero, clk_ns, T_DATZERO_HW_INC) + | 1047 | phy_timing->t_datzero, clk_ps, T_DATZERO_HW_INC) + |
1052 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1048 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1053 | phy_timing->t_hstrail, clk_ns, T_HSTRAIL_HW_INC) + | 1049 | phy_timing->t_hstrail, clk_ps, T_HSTRAIL_HW_INC) + |
1054 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1050 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1055 | phy_timing->t_hsdexit, clk_ns, T_HSEXIT_HW_INC); | 1051 | phy_timing->t_hsdexit, clk_ps, T_HSEXIT_HW_INC); |
1056 | 1052 | ||
1057 | if (dsi->info.video_clock_mode == TEGRA_DSI_VIDEO_CLOCK_TX_ONLY) { | 1053 | if (dsi->info.video_clock_mode == TEGRA_DSI_VIDEO_CLOCK_TX_ONLY) { |
1058 | clk_t_phy_ns = | 1054 | clk_t_phy_ps = |
1059 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1055 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1060 | phy_timing->t_clkpost, clk_ns, T_CLKPOST_HW_INC) + | 1056 | phy_timing->t_clkpost, clk_ps, T_CLKPOST_HW_INC) + |
1061 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1057 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1062 | phy_timing->t_clktrail, clk_ns, T_CLKTRAIL_HW_INC) + | 1058 | phy_timing->t_clktrail, clk_ps, T_CLKTRAIL_HW_INC) + |
1063 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1059 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1064 | phy_timing->t_hsdexit, clk_ns, T_HSEXIT_HW_INC) + | 1060 | phy_timing->t_hsdexit, clk_ps, T_HSEXIT_HW_INC) + |
1065 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1061 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1066 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC) + | 1062 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC) + |
1067 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1063 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1068 | phy_timing->t_clkprepare, clk_ns, T_CLKPREPARE_HW_INC) + | 1064 | phy_timing->t_clkprepare, clk_ps, T_CLKPREPARE_HW_INC) + |
1069 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1065 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1070 | phy_timing->t_clkzero, clk_ns, T_CLKZERO_HW_INC) + | 1066 | phy_timing->t_clkzero, clk_ps, T_CLKZERO_HW_INC) + |
1071 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1067 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1072 | phy_timing->t_clkpre, clk_ns, T_CLKPRE_HW_INC); | 1068 | phy_timing->t_clkpre, clk_ps, T_CLKPRE_HW_INC); |
1073 | 1069 | ||
1074 | /* clk_pre overlaps LP-11 hs mode start sequence */ | 1070 | /* clk_pre overlaps LP-11 hs mode start sequence */ |
1075 | hs_t_phy_ns -= DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1071 | hs_t_phy_ps -= DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1076 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC); | 1072 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC); |
1077 | } | 1073 | } |
1078 | 1074 | ||
1079 | h_blank_ns = t_pix_ns * (modes->h_sync_width + modes->h_back_porch + | 1075 | h_blank_ps = t_pix_ps * (modes->h_sync_width + modes->h_back_porch + |
1080 | modes->h_front_porch); | 1076 | modes->h_front_porch); |
1081 | 1077 | ||
1082 | /* Extra tlpx and byte cycle required by dsi HW */ | 1078 | /* Extra tlpx and byte cycle required by dsi HW */ |
1083 | t_phy_ns = dsi->info.n_data_lanes * (hs_t_phy_ns + clk_t_phy_ns + | 1079 | t_phy_ps = dsi->info.n_data_lanes * (hs_t_phy_ps + clk_t_phy_ps + |
1084 | DSI_CONVERT_T_PHY_TO_T_PHY_NS( | 1080 | DSI_CONVERT_T_PHY_TO_T_PHY_PS( |
1085 | phy_timing->t_tlpx, clk_ns, T_TLPX_HW_INC) + | 1081 | phy_timing->t_tlpx, clk_ps, T_TLPX_HW_INC) + |
1086 | clk_ns * BITS_PER_BYTE); | 1082 | clk_ps * BITS_PER_BYTE); |
1087 | 1083 | ||
1088 | if (h_blank_ns < t_phy_ns) { | 1084 | if (h_blank_ps < t_phy_ps) { |
1089 | err = -EINVAL; | 1085 | err = -EINVAL; |
1090 | dev_WARN(&dsi->dc->ndev->dev, | 1086 | dev_WARN(&dsi->dc->ndev->dev, |
1091 | "dsi: Hblank is smaller than HS phy timing: %u pix\n", | 1087 | "dsi: Hblank is smaller than HS phy timing: %u pix\n", |
1092 | (t_phy_ns - h_blank_ns) / t_pix_ns); | 1088 | (t_phy_ps - h_blank_ps) / t_pix_ps); |
1093 | goto fail; | 1089 | goto fail; |
1094 | } | 1090 | } |
1095 | 1091 | ||
@@ -1100,17 +1096,17 @@ fail: | |||
1100 | 1096 | ||
1101 | static int tegra_dsi_constraint_phy_timing(struct tegra_dc_dsi_data *dsi, | 1097 | static int tegra_dsi_constraint_phy_timing(struct tegra_dc_dsi_data *dsi, |
1102 | struct dsi_phy_timing_inclk *phy_timing, | 1098 | struct dsi_phy_timing_inclk *phy_timing, |
1103 | u32 clk_ns, u8 lphs) | 1099 | u32 clk_ps, u8 lphs) |
1104 | { | 1100 | { |
1105 | int err = 0; | 1101 | int err = 0; |
1106 | 1102 | ||
1107 | err = tegra_dsi_mipi_phy_timing_range(dsi, phy_timing, clk_ns, lphs); | 1103 | err = tegra_dsi_mipi_phy_timing_range(dsi, phy_timing, clk_ps, lphs); |
1108 | if (err < 0) { | 1104 | if (err < 0) { |
1109 | dev_warn(&dsi->dc->ndev->dev, "dsi: mipi range violated\n"); | 1105 | dev_warn(&dsi->dc->ndev->dev, "dsi: mipi range violated\n"); |
1110 | goto fail; | 1106 | goto fail; |
1111 | } | 1107 | } |
1112 | 1108 | ||
1113 | err = tegra_dsi_hs_phy_len(dsi, phy_timing, clk_ns, lphs); | 1109 | err = tegra_dsi_hs_phy_len(dsi, phy_timing, clk_ps, lphs); |
1114 | if (err < 0) { | 1110 | if (err < 0) { |
1115 | dev_err(&dsi->dc->ndev->dev, "dsi: Hblank too short\n"); | 1111 | dev_err(&dsi->dc->ndev->dev, "dsi: Hblank too short\n"); |
1116 | goto fail; | 1112 | goto fail; |
@@ -1127,10 +1123,10 @@ static void tegra_dsi_set_phy_timing(struct tegra_dc_dsi_data *dsi, u8 lphs) | |||
1127 | struct dsi_phy_timing_inclk phy_timing = dsi->phy_timing; | 1123 | struct dsi_phy_timing_inclk phy_timing = dsi->phy_timing; |
1128 | 1124 | ||
1129 | tegra_dsi_get_phy_timing | 1125 | tegra_dsi_get_phy_timing |
1130 | (dsi, &phy_timing, dsi->current_bit_clk_ns, lphs); | 1126 | (dsi, &phy_timing, dsi->current_bit_clk_ps, lphs); |
1131 | 1127 | ||
1132 | tegra_dsi_constraint_phy_timing(dsi, &phy_timing, | 1128 | tegra_dsi_constraint_phy_timing(dsi, &phy_timing, |
1133 | dsi->current_bit_clk_ns, lphs); | 1129 | dsi->current_bit_clk_ps, lphs); |
1134 | 1130 | ||
1135 | if (tegra_platform_is_fpga() && dsi->info.ganged_type) { | 1131 | if (tegra_platform_is_fpga() && dsi->info.ganged_type) { |
1136 | phy_timing.t_hsdexit += T_HSEXIT_HW_INC; | 1132 | phy_timing.t_hsdexit += T_HSEXIT_HW_INC; |
@@ -1321,8 +1317,8 @@ static void tegra_dsi_set_timeout(struct tegra_dc_dsi_data *dsi) | |||
1321 | tegra_dsi_writel(dsi, val, DSI_TIMEOUT_0); | 1317 | tegra_dsi_writel(dsi, val, DSI_TIMEOUT_0); |
1322 | 1318 | ||
1323 | if (dsi->info.panel_reset_timeout_msec) | 1319 | if (dsi->info.panel_reset_timeout_msec) |
1324 | timeout = (dsi->info.panel_reset_timeout_msec * 1000*1000) | 1320 | timeout = (dsi->info.panel_reset_timeout_msec * 1000 * 1000 * |
1325 | / dsi->current_bit_clk_ns; | 1321 | 1000) / dsi->current_bit_clk_ps; |
1326 | else | 1322 | else |
1327 | timeout = DSI_PR_TO_VALUE; | 1323 | timeout = DSI_PR_TO_VALUE; |
1328 | 1324 | ||
@@ -1843,7 +1839,7 @@ static void tegra_dsi_set_dsi_clk(struct tegra_dc *dc, | |||
1843 | 1839 | ||
1844 | dsi->current_dsi_clk_khz = | 1840 | dsi->current_dsi_clk_khz = |
1845 | clk_get_rate(dsi->dsi_clk[0]) / 1000; | 1841 | clk_get_rate(dsi->dsi_clk[0]) / 1000; |
1846 | dsi->current_bit_clk_ns = DIV_ROUND_CLOSEST((1000 * 1000), | 1842 | dsi->current_bit_clk_ps = DIV_ROUND_CLOSEST((1000 * 1000 * 1000), |
1847 | (dsi->current_dsi_clk_khz * 2)); | 1843 | (dsi->current_dsi_clk_khz * 2)); |
1848 | } | 1844 | } |
1849 | 1845 | ||