public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/5] dm: video: bridge: add operation to read EDID
Date: Wed, 20 Sep 2017 23:29:07 -0700	[thread overview]
Message-ID: <20170921062911.26724-2-anarsoul@gmail.com> (raw)
In-Reply-To: <20170921062911.26724-1-anarsoul@gmail.com>

Add an operation to read EDID, since bridge may have ability to read
EDID from the panel that is connected to it, for example LCD<->eDP bridge.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
v2: - no changes

 drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++
 include/video_bridge.h                     | 20 ++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c
index 07270bac9e..79facd02a6 100644
--- a/drivers/video/bridge/video-bridge-uclass.c
+++ b/drivers/video/bridge/video-bridge-uclass.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <edid.h>
 #include <video_bridge.h>
 
 int video_bridge_set_backlight(struct udevice *dev, int percent)
@@ -45,6 +46,15 @@ int video_bridge_check_attached(struct udevice *dev)
 	return ops->check_attached(dev);
 }
 
+int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
+{
+	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+	if (!ops || !ops->read_edid)
+		return -ENOSYS;
+	return ops->read_edid(dev, buf, buf_size);
+}
+
 static int video_bridge_pre_probe(struct udevice *dev)
 {
 	struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
diff --git a/include/video_bridge.h b/include/video_bridge.h
index c7b8681849..0699a8dda8 100644
--- a/include/video_bridge.h
+++ b/include/video_bridge.h
@@ -53,6 +53,16 @@ struct video_bridge_ops {
 	 * @return 0 if OK, -ve on error
 	 */
 	int (*set_backlight)(struct udevice *dev, int percent);
+
+	/**
+	 * read_edid() - Read information from EDID
+	 *
+	 * @dev:	Device to read from
+	 * @buf:	Buffer to read into
+	 * @buf_size:	Buffer size
+	 * @return number of bytes read, <=0 for error
+	 */
+	int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
 };
 
 #define video_bridge_get_ops(dev) \
@@ -89,4 +99,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_read_edid() - Read information from EDID
+ *
+ * @dev:	Device to read from
+ * @buf:	Buffer to read into
+ * @buf_size:	Buffer size
+ * @return number of bytes read, <=0 for error
+ */
+int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size);
+
 #endif
-- 
2.14.1

  reply	other threads:[~2017-09-21  6:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21  6:29 [U-Boot] [PATCH v2 0/5] sunxi: video: add DE2 LCD and ANX6345 drivers Vasily Khoruzhick
2017-09-21  6:29 ` Vasily Khoruzhick [this message]
2017-10-26 16:10   ` [U-Boot] [PATCH v2 1/5] dm: video: bridge: add operation to read EDID Anatolij Gustschin
2017-09-21  6:29 ` [U-Boot] [PATCH v2 2/5] video: anx9804: split out registers definitions into a separate header Vasily Khoruzhick
2017-10-26 16:26   ` [U-Boot] [PATCH v3 " Anatolij Gustschin
2017-10-27  9:58     ` Anatolij Gustschin
2017-10-26 16:29   ` [U-Boot] [PATCH v3 3/5] video: add anx6345 DM driver Anatolij Gustschin
2017-10-27  9:59     ` Anatolij Gustschin
2017-09-21  6:29 ` [U-Boot] [PATCH v2 " Vasily Khoruzhick
2017-09-21  6:29 ` [U-Boot] [PATCH v2 4/5] sunxi: video: split out PLL configuration code Vasily Khoruzhick
2017-10-26 21:02   ` Anatolij Gustschin
2017-10-26 21:14     ` Vasily Khoruzhick
2017-10-27  4:51       ` [U-Boot] [PATCH v4 " Vasily Khoruzhick
2017-10-27  4:51         ` [U-Boot] [PATCH v4 5/5] sunxi: video: add LCD support to DE2 driver Vasily Khoruzhick
2017-10-27 10:02           ` Anatolij Gustschin
2017-10-27 10:00         ` [U-Boot] [PATCH v4 4/5] sunxi: video: split out PLL configuration code Anatolij Gustschin
2017-09-21  6:29 ` [U-Boot] [PATCH v2 5/5] sunxi: video: add LCD support to DE2 driver Vasily Khoruzhick
2017-10-26 16:33   ` [U-Boot] [PATCH v3 " Anatolij Gustschin

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=20170921062911.26724-2-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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