Skip to content
Snippets Groups Projects
Commit fdb55255 authored by Vasily Khoruzhick's avatar Vasily Khoruzhick Committed by Anatolij Gustschin
Browse files

dm: video: bridge: add operation to read EDID


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: default avatarVasily Khoruzhick <anarsoul@gmail.com>
parent be5b96f0
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <common.h> #include <common.h>
#include <dm.h> #include <dm.h>
#include <errno.h> #include <errno.h>
#include <edid.h>
#include <video_bridge.h> #include <video_bridge.h>
int video_bridge_set_backlight(struct udevice *dev, int percent) int video_bridge_set_backlight(struct udevice *dev, int percent)
...@@ -45,6 +46,15 @@ int video_bridge_check_attached(struct udevice *dev) ...@@ -45,6 +46,15 @@ int video_bridge_check_attached(struct udevice *dev)
return ops->check_attached(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) static int video_bridge_pre_probe(struct udevice *dev)
{ {
struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev); struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
......
...@@ -53,6 +53,16 @@ struct video_bridge_ops { ...@@ -53,6 +53,16 @@ struct video_bridge_ops {
* @return 0 if OK, -ve on error * @return 0 if OK, -ve on error
*/ */
int (*set_backlight)(struct udevice *dev, int percent); 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) \ #define video_bridge_get_ops(dev) \
...@@ -89,4 +99,14 @@ int video_bridge_set_active(struct udevice *dev, bool active); ...@@ -89,4 +99,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
*/ */
int video_bridge_check_attached(struct udevice *dev); 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 #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment