aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i2c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-08-14 15:43:29 -0400
committerDave Airlie <airlied@redhat.com>2013-08-18 19:10:19 -0400
commit5e74c22cd1e0f9e49573fe580de47e198ee04975 (patch)
tree1d8cdbc82a6f70afb4eec6d74460528aa04d98f2 /drivers/gpu/drm/i2c
parent20c17675fea9ddf94b8249a67fb95fd26e732baf (diff)
drm/i2c: tda998x: prepare for video input configuration
The video-input-port (VIP) is highly configurable. This prepares current driver to allow to configure VIP configuration, as some boards connect lcd controller and TDA998x "pin-swapped" and depend on VIP to swap the pins by register configuration. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Darren Etheridge <detheridge@ti.com> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Russell King <rmk_kernel@arm.linux.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index a701411fcc0d..527d11b5ff14 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -32,6 +32,9 @@ struct tda998x_priv {
32 uint16_t rev; 32 uint16_t rev;
33 uint8_t current_page; 33 uint8_t current_page;
34 int dpms; 34 int dpms;
35 u8 vip_cntrl_0;
36 u8 vip_cntrl_1;
37 u8 vip_cntrl_2;
35}; 38};
36 39
37#define to_tda998x_priv(x) ((struct tda998x_priv *)to_encoder_slave(x)->slave_priv) 40#define to_tda998x_priv(x) ((struct tda998x_priv *)to_encoder_slave(x)->slave_priv)
@@ -448,12 +451,9 @@ tda998x_encoder_dpms(struct drm_encoder *encoder, int mode)
448 reg_write(encoder, REG_ENA_VP_1, 0xff); 451 reg_write(encoder, REG_ENA_VP_1, 0xff);
449 reg_write(encoder, REG_ENA_VP_2, 0xff); 452 reg_write(encoder, REG_ENA_VP_2, 0xff);
450 /* set muxing after enabling ports: */ 453 /* set muxing after enabling ports: */
451 reg_write(encoder, REG_VIP_CNTRL_0, 454 reg_write(encoder, REG_VIP_CNTRL_0, priv->vip_cntrl_0);
452 VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3)); 455 reg_write(encoder, REG_VIP_CNTRL_1, priv->vip_cntrl_1);
453 reg_write(encoder, REG_VIP_CNTRL_1, 456 reg_write(encoder, REG_VIP_CNTRL_2, priv->vip_cntrl_2);
454 VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1));
455 reg_write(encoder, REG_VIP_CNTRL_2,
456 VIP_CNTRL_2_SWAP_E(4) | VIP_CNTRL_2_SWAP_F(5));
457 break; 457 break;
458 case DRM_MODE_DPMS_OFF: 458 case DRM_MODE_DPMS_OFF:
459 /* disable audio and video ports */ 459 /* disable audio and video ports */
@@ -823,6 +823,10 @@ tda998x_encoder_init(struct i2c_client *client,
823 if (!priv) 823 if (!priv)
824 return -ENOMEM; 824 return -ENOMEM;
825 825
826 priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3);
827 priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1);
828 priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_CNTRL_2_SWAP_F(5);
829
826 priv->current_page = 0; 830 priv->current_page = 0;
827 priv->cec = i2c_new_dummy(client->adapter, 0x34); 831 priv->cec = i2c_new_dummy(client->adapter, 0x34);
828 priv->dpms = DRM_MODE_DPMS_OFF; 832 priv->dpms = DRM_MODE_DPMS_OFF;