From: Sean Paul <seanpaul@chromium.org>
To: dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
devicetree@vger.kernel.org, inki.dae@samsung.com
Cc: airlied@linux.ie, Sean Paul <seanpaul@chromium.org>
Subject: [PATCH 4/5] drm/exynos: Initialize ptn3460 if present
Date: Tue, 1 Oct 2013 19:40:59 -0400 [thread overview]
Message-ID: <1380670860-17621-5-git-send-email-seanpaul@chromium.org> (raw)
In-Reply-To: <1380670860-17621-1-git-send-email-seanpaul@chromium.org>
This patch adds code to look for the ptn3460 in the device tree file on
exynos initialization. If ptn node is found, the driver will initialize
the ptn3460 driver and skip creating a DP connector (since the bridge
driver will register its own connector).
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
drivers/gpu/drm/exynos/exynos_drm_core.c | 44 +++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 1bef6dc..9cf4476 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -12,7 +12,9 @@
* option) any later version.
*/
+#include <linux/of_i2c.h>
#include <drm/drmP.h>
+#include <drm/bridge/ptn3460.h>
#include "exynos_drm_drv.h"
#include "exynos_drm_encoder.h"
#include "exynos_drm_connector.h"
@@ -20,6 +22,40 @@
static LIST_HEAD(exynos_drm_subdrv_list);
+struct bridge_init {
+ struct i2c_client *client;
+ struct device_node *node;
+};
+
+static bool find_bridge(const char *name, struct bridge_init *bridge)
+{
+ bridge->client = NULL;
+ bridge->node = of_find_node_by_name(NULL, name);
+ if (!bridge->node)
+ return false;
+
+ bridge->client = of_find_i2c_device_by_node(bridge->node);
+ if (!bridge->client)
+ return false;
+
+ return true;
+}
+
+/* returns the number of bridges attached */
+static int exynos_drm_attach_lcd_bridge(struct drm_device *dev,
+ struct drm_encoder *encoder)
+{
+ struct bridge_init bridge;
+ int ret;
+
+ if (find_bridge("ptn3460-bridge", &bridge)) {
+ ret = ptn3460_init(dev, encoder, bridge.client, bridge.node);
+ if (!ret)
+ return 1;
+ }
+ return 0;
+}
+
static int exynos_drm_create_enc_conn(struct drm_device *dev,
struct exynos_drm_subdrv *subdrv)
{
@@ -36,6 +72,13 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
DRM_ERROR("failed to create encoder\n");
return -EFAULT;
}
+ subdrv->encoder = encoder;
+
+ if (subdrv->manager->display_ops->type == EXYNOS_DISPLAY_TYPE_LCD) {
+ ret = exynos_drm_attach_lcd_bridge(dev, encoder);
+ if (ret)
+ return 0;
+ }
/*
* create and initialize a connector for this sub driver and
@@ -48,7 +91,6 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
goto err_destroy_encoder;
}
- subdrv->encoder = encoder;
subdrv->connector = connector;
return 0;
--
1.8.4
next prev parent reply other threads:[~2013-10-01 23:40 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 23:40 [PATCH 0/5] Add some missing bits for exynos5250-snow Sean Paul
2013-10-01 23:40 ` [PATCH 1/5] ARM: dts: Add fimd display-timings " Sean Paul
2013-10-01 23:40 ` [PATCH 2/5] ARM: dts: Add dp-controller node to exynos5250-snow Sean Paul
2013-10-02 21:10 ` Olof Johansson
2013-10-03 16:06 ` Sean Paul
2013-10-01 23:40 ` Sean Paul [this message]
[not found] ` <1380670860-17621-5-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-10-03 14:43 ` [PATCH 4/5] drm/exynos: Initialize ptn3460 if present Inki Dae
2013-10-03 15:02 ` Sean Paul
2013-10-03 17:18 ` Inki Dae
2013-10-03 17:27 ` Sean Paul
2013-10-03 18:10 ` Inki Dae
2013-10-01 23:41 ` [PATCH 5/5] ARM: dts: Add ptn3460 to exynos5250-snow Sean Paul
[not found] ` <1380670860-17621-1-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-10-01 23:40 ` [PATCH 3/5] drm/bridge: Add PTN3460 bridge driver Sean Paul
2013-10-02 21:20 ` Olof Johansson
2013-10-03 13:55 ` Inki Dae
[not found] ` <CAAQKjZN_r-=-sj=Vb-o-KUS4ab5=cjCq1ni3VZeMeVc3NL=MMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-03 14:57 ` Sean Paul
2013-10-03 17:39 ` Inki Dae
2013-10-03 18:01 ` Olof Johansson
2013-10-04 2:05 ` Inki Dae
2013-10-09 18:29 ` Mark Brown
2013-10-10 4:18 ` Inki Dae
2013-10-10 9:37 ` Mark Brown
2013-10-10 11:40 ` Inki Dae
2013-10-10 12:23 ` Mark Brown
[not found] ` <CAAQKjZPwyKCpju4Ndd+MB_aN24-zA5xTHFsFsun2617h7YT6dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-03 18:09 ` Sean Paul
2013-10-03 18:23 ` Inki Dae
2013-10-03 18:32 ` Sean Paul
2013-10-04 1:59 ` Inki Dae
2013-10-02 21:07 ` [PATCH 0/5] Add some missing bits for exynos5250-snow Olof Johansson
2013-10-03 22:28 ` [PATCH v2 " Sean Paul
2013-10-03 22:28 ` [PATCH v2 1/5] ARM: dts: Add fimd display-timings " Sean Paul
[not found] ` <1380839303-4834-2-git-send-email-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-10-04 2:20 ` Jingoo Han
2013-10-03 22:28 ` [PATCH v2 2/5] ARM: dts: Add dp-controller node to exynos5250-snow Sean Paul
2013-10-04 2:24 ` Jingoo Han
2013-10-03 22:28 ` [PATCH v2 3/5] drm/bridge: Add PTN3460 bridge driver Sean Paul
2013-10-03 22:28 ` [PATCH v2 4/5] drm/exynos: Initialize ptn3460 if present Sean Paul
2013-10-04 2:29 ` Inki Dae
2013-10-04 2:41 ` Sean Paul
2013-10-04 4:18 ` Inki Dae
[not found] ` <CAAQKjZMfP_Cgo5hPPTiwKa_+Ph+GUt2Fbdtipd5V=CQEDy3eSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-04 14:17 ` Sean Paul
[not found] ` <CAOw6vbL_W-8S+htX9KB2ABbtr9+JhfxHuL2ikJG7CrqEkeo9NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-04 15:01 ` Inki Dae
2013-10-04 15:04 ` Sean Paul
[not found] ` <CAOw6vbKm+N8ZNyL8HQNhm2TnQOD8---1DkxE-n1LxWz-Y2=MNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-04 16:01 ` Inki Dae
2013-10-03 22:28 ` [PATCH v2 5/5] ARM: dts: Add ptn3460 to exynos5250-snow Sean Paul
2013-10-03 22:35 ` [PATCH v2 0/5] Add some missing bits for exynos5250-snow Olof Johansson
2013-10-10 22:26 ` [PATCH v3 " Sean Paul
2013-10-10 22:26 ` [PATCH v3 1/5] ARM: dts: Add fimd display-timings " Sean Paul
2013-10-10 22:26 ` [PATCH v3 2/5] ARM: dts: Add dp-controller node to exynos5250-snow Sean Paul
2013-10-10 22:26 ` [PATCH v3 3/5] drm/bridge: Add PTN3460 bridge driver Sean Paul
2013-10-10 22:26 ` [PATCH v3 4/5] drm/exynos: Initialize ptn3460 if present Sean Paul
2013-10-10 22:26 ` [PATCH v3 5/5] ARM: dts: Add ptn3460 to exynos5250-snow Sean Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380670860-17621-5-git-send-email-seanpaul@chromium.org \
--to=seanpaul@chromium.org \
--cc=airlied@linux.ie \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).