aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-02-11 06:55:43 -0500
committerInki Dae <daeinki@gmail.com>2016-03-01 09:37:18 -0500
commitbb32e4088c92088c63c1d8175e607e93f08dcc9c (patch)
tree51a422bf6e9801f44218a0bd4a366e0cb369a0fa
parentfdc2e108932b302beb1e05515cdd722eb81d3a79 (diff)
drm/exynos/dsi: replace registry access macros with functions
Functions are preferred over macros as more type-safe. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c108
1 files changed, 57 insertions, 51 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 53a7f5fe6c82..0971f4b17f6b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -209,12 +209,6 @@
209 209
210#define OLD_SCLK_MIPI_CLK_NAME "pll_clk" 210#define OLD_SCLK_MIPI_CLK_NAME "pll_clk"
211 211
212#define REG_ADDR(dsi, reg_idx) ((dsi)->reg_base + \
213 dsi->driver_data->reg_ofs[(reg_idx)])
214#define DSI_WRITE(dsi, reg_idx, val) writel((val), \
215 REG_ADDR((dsi), (reg_idx)))
216#define DSI_READ(dsi, reg_idx) readl(REG_ADDR((dsi), (reg_idx)))
217
218static char *clk_names[5] = { "bus_clk", "sclk_mipi", 212static char *clk_names[5] = { "bus_clk", "sclk_mipi",
219 "phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0", 213 "phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0",
220 "sclk_rgb_vclk_to_dsim0" }; 214 "sclk_rgb_vclk_to_dsim0" };
@@ -324,6 +318,18 @@ enum reg_idx {
324 DSIM_PHYTIMING2_REG, 318 DSIM_PHYTIMING2_REG,
325 NUM_REGS 319 NUM_REGS
326}; 320};
321
322static inline void exynos_dsi_write(struct exynos_dsi *dsi, enum reg_idx idx,
323 u32 val)
324{
325 writel(val, dsi->reg_base + dsi->driver_data->reg_ofs[idx]);
326}
327
328static inline u32 exynos_dsi_read(struct exynos_dsi *dsi, enum reg_idx idx)
329{
330 return readl(dsi->reg_base + dsi->driver_data->reg_ofs[idx]);
331}
332
327static unsigned int exynos_reg_ofs[] = { 333static unsigned int exynos_reg_ofs[] = {
328 [DSIM_STATUS_REG] = 0x00, 334 [DSIM_STATUS_REG] = 0x00,
329 [DSIM_SWRST_REG] = 0x04, 335 [DSIM_SWRST_REG] = 0x04,
@@ -546,10 +552,10 @@ static void exynos_dsi_wait_for_reset(struct exynos_dsi *dsi)
546 552
547static void exynos_dsi_reset(struct exynos_dsi *dsi) 553static void exynos_dsi_reset(struct exynos_dsi *dsi)
548{ 554{
549 struct exynos_dsi_driver_data *driver_data = dsi->driver_data; 555 u32 reset_val = dsi->driver_data->reg_values[RESET_TYPE];
550 556
551 reinit_completion(&dsi->completed); 557 reinit_completion(&dsi->completed);
552 DSI_WRITE(dsi, DSIM_SWRST_REG, driver_data->reg_values[RESET_TYPE]); 558 exynos_dsi_write(dsi, DSIM_SWRST_REG, reset_val);
553} 559}
554 560
555#ifndef MHZ 561#ifndef MHZ
@@ -652,7 +658,7 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi,
652 reg |= DSIM_FREQ_BAND(band); 658 reg |= DSIM_FREQ_BAND(band);
653 } 659 }
654 660
655 DSI_WRITE(dsi, DSIM_PLLCTRL_REG, reg); 661 exynos_dsi_write(dsi, DSIM_PLLCTRL_REG, reg);
656 662
657 timeout = 1000; 663 timeout = 1000;
658 do { 664 do {
@@ -660,7 +666,7 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi,
660 dev_err(dsi->dev, "PLL failed to stabilize\n"); 666 dev_err(dsi->dev, "PLL failed to stabilize\n");
661 return 0; 667 return 0;
662 } 668 }
663 reg = DSI_READ(dsi, DSIM_STATUS_REG); 669 reg = exynos_dsi_read(dsi, DSIM_STATUS_REG);
664 } while ((reg & DSIM_PLL_STABLE) == 0); 670 } while ((reg & DSIM_PLL_STABLE) == 0);
665 671
666 return fout; 672 return fout;
@@ -690,7 +696,7 @@ static int exynos_dsi_enable_clock(struct exynos_dsi *dsi)
690 dev_dbg(dsi->dev, "hs_clk = %lu, byte_clk = %lu, esc_clk = %lu\n", 696 dev_dbg(dsi->dev, "hs_clk = %lu, byte_clk = %lu, esc_clk = %lu\n",
691 hs_clk, byte_clk, esc_clk); 697 hs_clk, byte_clk, esc_clk);
692 698
693 reg = DSI_READ(dsi, DSIM_CLKCTRL_REG); 699 reg = exynos_dsi_read(dsi, DSIM_CLKCTRL_REG);
694 reg &= ~(DSIM_ESC_PRESCALER_MASK | DSIM_LANE_ESC_CLK_EN_CLK 700 reg &= ~(DSIM_ESC_PRESCALER_MASK | DSIM_LANE_ESC_CLK_EN_CLK
695 | DSIM_LANE_ESC_CLK_EN_DATA_MASK | DSIM_PLL_BYPASS 701 | DSIM_LANE_ESC_CLK_EN_DATA_MASK | DSIM_PLL_BYPASS
696 | DSIM_BYTE_CLK_SRC_MASK); 702 | DSIM_BYTE_CLK_SRC_MASK);
@@ -700,7 +706,7 @@ static int exynos_dsi_enable_clock(struct exynos_dsi *dsi)
700 | DSIM_LANE_ESC_CLK_EN_DATA(BIT(dsi->lanes) - 1) 706 | DSIM_LANE_ESC_CLK_EN_DATA(BIT(dsi->lanes) - 1)
701 | DSIM_BYTE_CLK_SRC(0) 707 | DSIM_BYTE_CLK_SRC(0)
702 | DSIM_TX_REQUEST_HSCLK; 708 | DSIM_TX_REQUEST_HSCLK;
703 DSI_WRITE(dsi, DSIM_CLKCTRL_REG, reg); 709 exynos_dsi_write(dsi, DSIM_CLKCTRL_REG, reg);
704 710
705 return 0; 711 return 0;
706} 712}
@@ -717,7 +723,7 @@ static void exynos_dsi_set_phy_ctrl(struct exynos_dsi *dsi)
717 /* B D-PHY: D-PHY Master & Slave Analog Block control */ 723 /* B D-PHY: D-PHY Master & Slave Analog Block control */
718 reg = reg_values[PHYCTRL_ULPS_EXIT] | reg_values[PHYCTRL_VREG_LP] | 724 reg = reg_values[PHYCTRL_ULPS_EXIT] | reg_values[PHYCTRL_VREG_LP] |
719 reg_values[PHYCTRL_SLEW_UP]; 725 reg_values[PHYCTRL_SLEW_UP];
720 DSI_WRITE(dsi, DSIM_PHYCTRL_REG, reg); 726 exynos_dsi_write(dsi, DSIM_PHYCTRL_REG, reg);
721 727
722 /* 728 /*
723 * T LPX: Transmitted length of any Low-Power state period 729 * T LPX: Transmitted length of any Low-Power state period
@@ -725,7 +731,7 @@ static void exynos_dsi_set_phy_ctrl(struct exynos_dsi *dsi)
725 * burst 731 * burst
726 */ 732 */
727 reg = reg_values[PHYTIMING_LPX] | reg_values[PHYTIMING_HS_EXIT]; 733 reg = reg_values[PHYTIMING_LPX] | reg_values[PHYTIMING_HS_EXIT];
728 DSI_WRITE(dsi, DSIM_PHYTIMING_REG, reg); 734 exynos_dsi_write(dsi, DSIM_PHYTIMING_REG, reg);
729 735
730 /* 736 /*
731 * T CLK-PREPARE: Time that the transmitter drives the Clock Lane LP-00 737 * T CLK-PREPARE: Time that the transmitter drives the Clock Lane LP-00
@@ -745,7 +751,7 @@ static void exynos_dsi_set_phy_ctrl(struct exynos_dsi *dsi)
745 reg_values[PHYTIMING_CLK_POST] | 751 reg_values[PHYTIMING_CLK_POST] |
746 reg_values[PHYTIMING_CLK_TRAIL]; 752 reg_values[PHYTIMING_CLK_TRAIL];
747 753
748 DSI_WRITE(dsi, DSIM_PHYTIMING1_REG, reg); 754 exynos_dsi_write(dsi, DSIM_PHYTIMING1_REG, reg);
749 755
750 /* 756 /*
751 * T HS-PREPARE: Time that the transmitter drives the Data Lane LP-00 757 * T HS-PREPARE: Time that the transmitter drives the Data Lane LP-00
@@ -758,29 +764,29 @@ static void exynos_dsi_set_phy_ctrl(struct exynos_dsi *dsi)
758 */ 764 */
759 reg = reg_values[PHYTIMING_HS_PREPARE] | reg_values[PHYTIMING_HS_ZERO] | 765 reg = reg_values[PHYTIMING_HS_PREPARE] | reg_values[PHYTIMING_HS_ZERO] |
760 reg_values[PHYTIMING_HS_TRAIL]; 766 reg_values[PHYTIMING_HS_TRAIL];
761 DSI_WRITE(dsi, DSIM_PHYTIMING2_REG, reg); 767 exynos_dsi_write(dsi, DSIM_PHYTIMING2_REG, reg);
762} 768}
763 769
764static void exynos_dsi_disable_clock(struct exynos_dsi *dsi) 770static void exynos_dsi_disable_clock(struct exynos_dsi *dsi)
765{ 771{
766 u32 reg; 772 u32 reg;
767 773
768 reg = DSI_READ(dsi, DSIM_CLKCTRL_REG); 774 reg = exynos_dsi_read(dsi, DSIM_CLKCTRL_REG);
769 reg &= ~(DSIM_LANE_ESC_CLK_EN_CLK | DSIM_LANE_ESC_CLK_EN_DATA_MASK 775 reg &= ~(DSIM_LANE_ESC_CLK_EN_CLK | DSIM_LANE_ESC_CLK_EN_DATA_MASK
770 | DSIM_ESC_CLKEN | DSIM_BYTE_CLKEN); 776 | DSIM_ESC_CLKEN | DSIM_BYTE_CLKEN);
771 DSI_WRITE(dsi, DSIM_CLKCTRL_REG, reg); 777 exynos_dsi_write(dsi, DSIM_CLKCTRL_REG, reg);
772 778
773 reg = DSI_READ(dsi, DSIM_PLLCTRL_REG); 779 reg = exynos_dsi_read(dsi, DSIM_PLLCTRL_REG);
774 reg &= ~DSIM_PLL_EN; 780 reg &= ~DSIM_PLL_EN;
775 DSI_WRITE(dsi, DSIM_PLLCTRL_REG, reg); 781 exynos_dsi_write(dsi, DSIM_PLLCTRL_REG, reg);
776} 782}
777 783
778static void exynos_dsi_enable_lane(struct exynos_dsi *dsi, u32 lane) 784static void exynos_dsi_enable_lane(struct exynos_dsi *dsi, u32 lane)
779{ 785{
780 u32 reg = DSI_READ(dsi, DSIM_CONFIG_REG); 786 u32 reg = exynos_dsi_read(dsi, DSIM_CONFIG_REG);
781 reg |= (DSIM_NUM_OF_DATA_LANE(dsi->lanes - 1) | DSIM_LANE_EN_CLK | 787 reg |= (DSIM_NUM_OF_DATA_LANE(dsi->lanes - 1) | DSIM_LANE_EN_CLK |
782 DSIM_LANE_EN(lane)); 788 DSIM_LANE_EN(lane));
783 DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); 789 exynos_dsi_write(dsi, DSIM_CONFIG_REG, reg);
784} 790}
785 791
786static int exynos_dsi_init_link(struct exynos_dsi *dsi) 792static int exynos_dsi_init_link(struct exynos_dsi *dsi)
@@ -791,14 +797,14 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)
791 u32 lanes_mask; 797 u32 lanes_mask;
792 798
793 /* Initialize FIFO pointers */ 799 /* Initialize FIFO pointers */
794 reg = DSI_READ(dsi, DSIM_FIFOCTRL_REG); 800 reg = exynos_dsi_read(dsi, DSIM_FIFOCTRL_REG);
795 reg &= ~0x1f; 801 reg &= ~0x1f;
796 DSI_WRITE(dsi, DSIM_FIFOCTRL_REG, reg); 802 exynos_dsi_write(dsi, DSIM_FIFOCTRL_REG, reg);
797 803
798 usleep_range(9000, 11000); 804 usleep_range(9000, 11000);
799 805
800 reg |= 0x1f; 806 reg |= 0x1f;
801 DSI_WRITE(dsi, DSIM_FIFOCTRL_REG, reg); 807 exynos_dsi_write(dsi, DSIM_FIFOCTRL_REG, reg);
802 usleep_range(9000, 11000); 808 usleep_range(9000, 11000);
803 809
804 /* DSI configuration */ 810 /* DSI configuration */
@@ -867,7 +873,7 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)
867 dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) { 873 dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) {
868 reg |= DSIM_CLKLANE_STOP; 874 reg |= DSIM_CLKLANE_STOP;
869 } 875 }
870 DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); 876 exynos_dsi_write(dsi, DSIM_CONFIG_REG, reg);
871 877
872 lanes_mask = BIT(dsi->lanes) - 1; 878 lanes_mask = BIT(dsi->lanes) - 1;
873 exynos_dsi_enable_lane(dsi, lanes_mask); 879 exynos_dsi_enable_lane(dsi, lanes_mask);
@@ -880,19 +886,19 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)
880 return -EFAULT; 886 return -EFAULT;
881 } 887 }
882 888
883 reg = DSI_READ(dsi, DSIM_STATUS_REG); 889 reg = exynos_dsi_read(dsi, DSIM_STATUS_REG);
884 if ((reg & DSIM_STOP_STATE_DAT(lanes_mask)) 890 if ((reg & DSIM_STOP_STATE_DAT(lanes_mask))
885 != DSIM_STOP_STATE_DAT(lanes_mask)) 891 != DSIM_STOP_STATE_DAT(lanes_mask))
886 continue; 892 continue;
887 } while (!(reg & (DSIM_STOP_STATE_CLK | DSIM_TX_READY_HS_CLK))); 893 } while (!(reg & (DSIM_STOP_STATE_CLK | DSIM_TX_READY_HS_CLK)));
888 894
889 reg = DSI_READ(dsi, DSIM_ESCMODE_REG); 895 reg = exynos_dsi_read(dsi, DSIM_ESCMODE_REG);
890 reg &= ~DSIM_STOP_STATE_CNT_MASK; 896 reg &= ~DSIM_STOP_STATE_CNT_MASK;
891 reg |= DSIM_STOP_STATE_CNT(driver_data->reg_values[STOP_STATE_CNT]); 897 reg |= DSIM_STOP_STATE_CNT(driver_data->reg_values[STOP_STATE_CNT]);
892 DSI_WRITE(dsi, DSIM_ESCMODE_REG, reg); 898 exynos_dsi_write(dsi, DSIM_ESCMODE_REG, reg);
893 899
894 reg = DSIM_BTA_TIMEOUT(0xff) | DSIM_LPDR_TIMEOUT(0xffff); 900 reg = DSIM_BTA_TIMEOUT(0xff) | DSIM_LPDR_TIMEOUT(0xffff);
895 DSI_WRITE(dsi, DSIM_TIMEOUT_REG, reg); 901 exynos_dsi_write(dsi, DSIM_TIMEOUT_REG, reg);
896 902
897 return 0; 903 return 0;
898} 904}
@@ -907,20 +913,20 @@ static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi)
907 reg = DSIM_CMD_ALLOW(0xf) 913 reg = DSIM_CMD_ALLOW(0xf)
908 | DSIM_STABLE_VFP(vm->vfront_porch) 914 | DSIM_STABLE_VFP(vm->vfront_porch)
909 | DSIM_MAIN_VBP(vm->vback_porch); 915 | DSIM_MAIN_VBP(vm->vback_porch);
910 DSI_WRITE(dsi, DSIM_MVPORCH_REG, reg); 916 exynos_dsi_write(dsi, DSIM_MVPORCH_REG, reg);
911 917
912 reg = DSIM_MAIN_HFP(vm->hfront_porch) 918 reg = DSIM_MAIN_HFP(vm->hfront_porch)
913 | DSIM_MAIN_HBP(vm->hback_porch); 919 | DSIM_MAIN_HBP(vm->hback_porch);
914 DSI_WRITE(dsi, DSIM_MHPORCH_REG, reg); 920 exynos_dsi_write(dsi, DSIM_MHPORCH_REG, reg);
915 921
916 reg = DSIM_MAIN_VSA(vm->vsync_len) 922 reg = DSIM_MAIN_VSA(vm->vsync_len)
917 | DSIM_MAIN_HSA(vm->hsync_len); 923 | DSIM_MAIN_HSA(vm->hsync_len);
918 DSI_WRITE(dsi, DSIM_MSYNC_REG, reg); 924 exynos_dsi_write(dsi, DSIM_MSYNC_REG, reg);
919 } 925 }
920 reg = DSIM_MAIN_HRESOL(vm->hactive, num_bits_resol) | 926 reg = DSIM_MAIN_HRESOL(vm->hactive, num_bits_resol) |
921 DSIM_MAIN_VRESOL(vm->vactive, num_bits_resol); 927 DSIM_MAIN_VRESOL(vm->vactive, num_bits_resol);
922 928
923 DSI_WRITE(dsi, DSIM_MDRESOL_REG, reg); 929 exynos_dsi_write(dsi, DSIM_MDRESOL_REG, reg);
924 930
925 dev_dbg(dsi->dev, "LCD size = %dx%d\n", vm->hactive, vm->vactive); 931 dev_dbg(dsi->dev, "LCD size = %dx%d\n", vm->hactive, vm->vactive);
926} 932}
@@ -929,12 +935,12 @@ static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable)
929{ 935{
930 u32 reg; 936 u32 reg;
931 937
932 reg = DSI_READ(dsi, DSIM_MDRESOL_REG); 938 reg = exynos_dsi_read(dsi, DSIM_MDRESOL_REG);
933 if (enable) 939 if (enable)
934 reg |= DSIM_MAIN_STAND_BY; 940 reg |= DSIM_MAIN_STAND_BY;
935 else 941 else
936 reg &= ~DSIM_MAIN_STAND_BY; 942 reg &= ~DSIM_MAIN_STAND_BY;
937 DSI_WRITE(dsi, DSIM_MDRESOL_REG, reg); 943 exynos_dsi_write(dsi, DSIM_MDRESOL_REG, reg);
938} 944}
939 945
940static int exynos_dsi_wait_for_hdr_fifo(struct exynos_dsi *dsi) 946static int exynos_dsi_wait_for_hdr_fifo(struct exynos_dsi *dsi)
@@ -942,7 +948,7 @@ static int exynos_dsi_wait_for_hdr_fifo(struct exynos_dsi *dsi)
942 int timeout = 2000; 948 int timeout = 2000;
943 949
944 do { 950 do {
945 u32 reg = DSI_READ(dsi, DSIM_FIFOCTRL_REG); 951 u32 reg = exynos_dsi_read(dsi, DSIM_FIFOCTRL_REG);
946 952
947 if (!(reg & DSIM_SFR_HEADER_FULL)) 953 if (!(reg & DSIM_SFR_HEADER_FULL))
948 return 0; 954 return 0;
@@ -956,21 +962,21 @@ static int exynos_dsi_wait_for_hdr_fifo(struct exynos_dsi *dsi)
956 962
957static void exynos_dsi_set_cmd_lpm(struct exynos_dsi *dsi, bool lpm) 963static void exynos_dsi_set_cmd_lpm(struct exynos_dsi *dsi, bool lpm)
958{ 964{
959 u32 v = DSI_READ(dsi, DSIM_ESCMODE_REG); 965 u32 v = exynos_dsi_read(dsi, DSIM_ESCMODE_REG);
960 966
961 if (lpm) 967 if (lpm)
962 v |= DSIM_CMD_LPDT_LP; 968 v |= DSIM_CMD_LPDT_LP;
963 else 969 else
964 v &= ~DSIM_CMD_LPDT_LP; 970 v &= ~DSIM_CMD_LPDT_LP;
965 971
966 DSI_WRITE(dsi, DSIM_ESCMODE_REG, v); 972 exynos_dsi_write(dsi, DSIM_ESCMODE_REG, v);
967} 973}
968 974
969static void exynos_dsi_force_bta(struct exynos_dsi *dsi) 975static void exynos_dsi_force_bta(struct exynos_dsi *dsi)
970{ 976{
971 u32 v = DSI_READ(dsi, DSIM_ESCMODE_REG); 977 u32 v = exynos_dsi_read(dsi, DSIM_ESCMODE_REG);
972 v |= DSIM_FORCE_BTA; 978 v |= DSIM_FORCE_BTA;
973 DSI_WRITE(dsi, DSIM_ESCMODE_REG, v); 979 exynos_dsi_write(dsi, DSIM_ESCMODE_REG, v);
974} 980}
975 981
976static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi, 982static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
@@ -994,7 +1000,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
994 while (length >= 4) { 1000 while (length >= 4) {
995 reg = (payload[3] << 24) | (payload[2] << 16) 1001 reg = (payload[3] << 24) | (payload[2] << 16)
996 | (payload[1] << 8) | payload[0]; 1002 | (payload[1] << 8) | payload[0];
997 DSI_WRITE(dsi, DSIM_PAYLOAD_REG, reg); 1003 exynos_dsi_write(dsi, DSIM_PAYLOAD_REG, reg);
998 payload += 4; 1004 payload += 4;
999 length -= 4; 1005 length -= 4;
1000 } 1006 }
@@ -1009,7 +1015,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
1009 /* Fall through */ 1015 /* Fall through */
1010 case 1: 1016 case 1:
1011 reg |= payload[0]; 1017 reg |= payload[0];
1012 DSI_WRITE(dsi, DSIM_PAYLOAD_REG, reg); 1018 exynos_dsi_write(dsi, DSIM_PAYLOAD_REG, reg);
1013 break; 1019 break;
1014 case 0: 1020 case 0:
1015 /* Do nothing */ 1021 /* Do nothing */
@@ -1032,7 +1038,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
1032 dsi->state ^= DSIM_STATE_CMD_LPM; 1038 dsi->state ^= DSIM_STATE_CMD_LPM;
1033 } 1039 }
1034 1040
1035 DSI_WRITE(dsi, DSIM_PKTHDR_REG, reg); 1041 exynos_dsi_write(dsi, DSIM_PKTHDR_REG, reg);
1036 1042
1037 if (xfer->flags & MIPI_DSI_MSG_REQ_ACK) 1043 if (xfer->flags & MIPI_DSI_MSG_REQ_ACK)
1038 exynos_dsi_force_bta(dsi); 1044 exynos_dsi_force_bta(dsi);
@@ -1048,7 +1054,7 @@ static void exynos_dsi_read_from_fifo(struct exynos_dsi *dsi,
1048 u32 reg; 1054 u32 reg;
1049 1055
1050 if (first) { 1056 if (first) {
1051 reg = DSI_READ(dsi, DSIM_RXFIFO_REG); 1057 reg = exynos_dsi_read(dsi, DSIM_RXFIFO_REG);
1052 1058
1053 switch (reg & 0x3f) { 1059 switch (reg & 0x3f) {
1054 case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE: 1060 case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE:
@@ -1087,7 +1093,7 @@ static void exynos_dsi_read_from_fifo(struct exynos_dsi *dsi,
1087 1093
1088 /* Receive payload */ 1094 /* Receive payload */
1089 while (length >= 4) { 1095 while (length >= 4) {
1090 reg = DSI_READ(dsi, DSIM_RXFIFO_REG); 1096 reg = exynos_dsi_read(dsi, DSIM_RXFIFO_REG);
1091 payload[0] = (reg >> 0) & 0xff; 1097 payload[0] = (reg >> 0) & 0xff;
1092 payload[1] = (reg >> 8) & 0xff; 1098 payload[1] = (reg >> 8) & 0xff;
1093 payload[2] = (reg >> 16) & 0xff; 1099 payload[2] = (reg >> 16) & 0xff;
@@ -1097,7 +1103,7 @@ static void exynos_dsi_read_from_fifo(struct exynos_dsi *dsi,
1097 } 1103 }
1098 1104
1099 if (length) { 1105 if (length) {
1100 reg = DSI_READ(dsi, DSIM_RXFIFO_REG); 1106 reg = exynos_dsi_read(dsi, DSIM_RXFIFO_REG);
1101 switch (length) { 1107 switch (length) {
1102 case 3: 1108 case 3:
1103 payload[2] = (reg >> 16) & 0xff; 1109 payload[2] = (reg >> 16) & 0xff;
@@ -1116,7 +1122,7 @@ static void exynos_dsi_read_from_fifo(struct exynos_dsi *dsi,
1116clear_fifo: 1122clear_fifo:
1117 length = DSI_RX_FIFO_SIZE / 4; 1123 length = DSI_RX_FIFO_SIZE / 4;
1118 do { 1124 do {
1119 reg = DSI_READ(dsi, DSIM_RXFIFO_REG); 1125 reg = exynos_dsi_read(dsi, DSIM_RXFIFO_REG);
1120 if (reg == DSI_RX_FIFO_EMPTY) 1126 if (reg == DSI_RX_FIFO_EMPTY)
1121 break; 1127 break;
1122 } while (--length); 1128 } while (--length);
@@ -1272,20 +1278,20 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id)
1272 struct exynos_dsi *dsi = dev_id; 1278 struct exynos_dsi *dsi = dev_id;
1273 u32 status; 1279 u32 status;
1274 1280
1275 status = DSI_READ(dsi, DSIM_INTSRC_REG); 1281 status = exynos_dsi_read(dsi, DSIM_INTSRC_REG);
1276 if (!status) { 1282 if (!status) {
1277 static unsigned long int j; 1283 static unsigned long int j;
1278 if (printk_timed_ratelimit(&j, 500)) 1284 if (printk_timed_ratelimit(&j, 500))
1279 dev_warn(dsi->dev, "spurious interrupt\n"); 1285 dev_warn(dsi->dev, "spurious interrupt\n");
1280 return IRQ_HANDLED; 1286 return IRQ_HANDLED;
1281 } 1287 }
1282 DSI_WRITE(dsi, DSIM_INTSRC_REG, status); 1288 exynos_dsi_write(dsi, DSIM_INTSRC_REG, status);
1283 1289
1284 if (status & DSIM_INT_SW_RST_RELEASE) { 1290 if (status & DSIM_INT_SW_RST_RELEASE) {
1285 u32 mask = ~(DSIM_INT_RX_DONE | DSIM_INT_SFR_FIFO_EMPTY | 1291 u32 mask = ~(DSIM_INT_RX_DONE | DSIM_INT_SFR_FIFO_EMPTY |
1286 DSIM_INT_SFR_HDR_FIFO_EMPTY | DSIM_INT_FRAME_DONE | 1292 DSIM_INT_SFR_HDR_FIFO_EMPTY | DSIM_INT_FRAME_DONE |
1287 DSIM_INT_RX_ECC_ERR | DSIM_INT_SW_RST_RELEASE); 1293 DSIM_INT_RX_ECC_ERR | DSIM_INT_SW_RST_RELEASE);
1288 DSI_WRITE(dsi, DSIM_INTMSK_REG, mask); 1294 exynos_dsi_write(dsi, DSIM_INTMSK_REG, mask);
1289 complete(&dsi->completed); 1295 complete(&dsi->completed);
1290 return IRQ_HANDLED; 1296 return IRQ_HANDLED;
1291 } 1297 }