aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-05-04 15:08:27 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-18 11:00:33 -0400
commit585b691e2180e1501637050290292f77f5c30c7b (patch)
tree07db7ed1845a9f915fb657f4ec0248847698d61d
parentdfdba7fd60592818078e9ceec04ffa49347e1aed (diff)
DRM: Armada: add support for drm tda19988 driver
Add support for TDA998x output via the slave driver in the kernel. Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/gpu/drm/armada/Kconfig9
-rw-r--r--drivers/gpu/drm/armada/armada_drv.c42
2 files changed, 51 insertions, 0 deletions
diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig
index c7a0a944acfe..87e62dd4431d 100644
--- a/drivers/gpu/drm/armada/Kconfig
+++ b/drivers/gpu/drm/armada/Kconfig
@@ -13,3 +13,12 @@ config DRM_ARMADA
13 This driver provides no built-in acceleration; acceleration is 13 This driver provides no built-in acceleration; acceleration is
14 performed by other IP found on the SoC. This driver provides 14 performed by other IP found on the SoC. This driver provides
15 kernel mode setting and buffer management to userspace. 15 kernel mode setting and buffer management to userspace.
16
17config DRM_ARMADA_TDA1998X
18 bool "Support TDA1998X HDMI output"
19 depends on DRM_ARMADA != n
20 depends on I2C && DRM_I2C_NXP_TDA998X = y
21 default y
22 help
23 Support the TDA1998x HDMI output device found on the Solid-Run
24 CuBox.
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 7bfab9a286ae..7aede900a221 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -16,6 +16,42 @@
16#include <drm/armada_drm.h> 16#include <drm/armada_drm.h>
17#include "armada_ioctlP.h" 17#include "armada_ioctlP.h"
18 18
19#ifdef CONFIG_DRM_ARMADA_TDA1998X
20#include <drm/i2c/tda998x.h>
21#include "armada_slave.h"
22
23static struct tda998x_encoder_params params = {
24 /* With 0x24, there is no translation between vp_out and int_vp
25 FB LCD out Pins VIP Int Vp
26 R:23:16 R:7:0 VPC7:0 7:0 7:0[R]
27 G:15:8 G:15:8 VPB7:0 23:16 23:16[G]
28 B:7:0 B:23:16 VPA7:0 15:8 15:8[B]
29 */
30 .swap_a = 2,
31 .swap_b = 3,
32 .swap_c = 4,
33 .swap_d = 5,
34 .swap_e = 0,
35 .swap_f = 1,
36 .audio_cfg = BIT(2),
37 .audio_frame[1] = 1,
38 .audio_format = AFMT_SPDIF,
39 .audio_sample_rate = 44100,
40};
41
42static const struct armada_drm_slave_config tda19988_config = {
43 .i2c_adapter_id = 0,
44 .crtcs = 1 << 0, /* Only LCD0 at the moment */
45 .polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT,
46 .interlace_allowed = true,
47 .info = {
48 .type = "tda998x",
49 .addr = 0x70,
50 .platform_data = &params,
51 },
52};
53#endif
54
19static void armada_drm_unref_work(struct work_struct *work) 55static void armada_drm_unref_work(struct work_struct *work)
20{ 56{
21 struct armada_private *priv = 57 struct armada_private *priv =
@@ -134,6 +170,12 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
134 goto err_kms; 170 goto err_kms;
135 } 171 }
136 172
173#ifdef CONFIG_DRM_ARMADA_TDA1998X
174 ret = armada_drm_connector_slave_create(dev, &tda19988_config);
175 if (ret)
176 goto err_kms;
177#endif
178
137 ret = drm_vblank_init(dev, n); 179 ret = drm_vblank_init(dev, n);
138 if (ret) 180 if (ret)
139 goto err_kms; 181 goto err_kms;