aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i2c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2014-01-25 12:14:39 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-02-13 14:43:43 -0500
commita8b517e5312124e2dd7b6d6d9afac458aaecfbf3 (patch)
tree1353f29627013e4f8a0e3091c9261832fd1206fb /drivers/gpu/drm/i2c
parent85c988bb26a3da46c04284bc43f93d732986547b (diff)
drm/i2c: tda998x: code optimization
This patch reduces the number of I2C exchanges by setting many bits in one write and removing a useless write. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 4352294d75cd..666ee24329b9 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -669,10 +669,8 @@ tda998x_configure_audio(struct tda998x_priv *priv,
669 } 669 }
670 670
671 reg_write(priv, REG_AIP_CLKSEL, clksel_aip); 671 reg_write(priv, REG_AIP_CLKSEL, clksel_aip);
672 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT); 672 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT |
673 673 AIP_CNTRL_0_ACR_MAN); /* auto CTS */
674 /* Enable automatic CTS generation */
675 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_ACR_MAN);
676 reg_write(priv, REG_CTS_N, cts_n); 674 reg_write(priv, REG_CTS_N, cts_n);
677 675
678 /* 676 /*
@@ -908,10 +906,10 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder,
908 reg_write(priv, REG_VIP_CNTRL_5, VIP_CNTRL_5_SP_CNT(0)); 906 reg_write(priv, REG_VIP_CNTRL_5, VIP_CNTRL_5_SP_CNT(0));
909 reg_write(priv, REG_VIP_CNTRL_4, VIP_CNTRL_4_BLANKIT(0) | 907 reg_write(priv, REG_VIP_CNTRL_4, VIP_CNTRL_4_BLANKIT(0) |
910 VIP_CNTRL_4_BLC(0)); 908 VIP_CNTRL_4_BLC(0));
911 reg_clear(priv, REG_PLL_SERIAL_3, PLL_SERIAL_3_SRL_CCIR);
912 909
913 reg_clear(priv, REG_PLL_SERIAL_1, PLL_SERIAL_1_SRL_MAN_IZ); 910 reg_clear(priv, REG_PLL_SERIAL_1, PLL_SERIAL_1_SRL_MAN_IZ);
914 reg_clear(priv, REG_PLL_SERIAL_3, PLL_SERIAL_3_SRL_DE); 911 reg_clear(priv, REG_PLL_SERIAL_3, PLL_SERIAL_3_SRL_CCIR |
912 PLL_SERIAL_3_SRL_DE);
915 reg_write(priv, REG_SERIALIZER, 0); 913 reg_write(priv, REG_SERIALIZER, 0);
916 reg_write(priv, REG_HVF_CNTRL_1, HVF_CNTRL_1_VQR(0)); 914 reg_write(priv, REG_HVF_CNTRL_1, HVF_CNTRL_1_VQR(0));
917 915
@@ -931,8 +929,6 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder,
931 /* set BIAS tmds value: */ 929 /* set BIAS tmds value: */
932 reg_write(priv, REG_ANA_GENERAL, 0x09); 930 reg_write(priv, REG_ANA_GENERAL, 0x09);
933 931
934 reg_write(priv, REG_TBG_CNTRL_0, 0);
935
936 /* 932 /*
937 * Sync on rising HSYNC/VSYNC 933 * Sync on rising HSYNC/VSYNC
938 */ 934 */