mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
drm/imx: parallel-display: fix drm_panel support
The parallel-display driver used an undocumented, non-standard property
"fsl,panel" to optionally associate with a drm_panel device. This patch
fixes the driver to use the same OF graph bindings as the LDB driver
instead:
parallel-display {
compatible = "fsl,imx-parallel-display";
...
port@1 {
reg = <1>;
parallel_out: endpoint {
remote_endpoint = <&panel_in>;
};
};
};
panel {
...
port {
panel_in: endpoint {
remote-endpoint = <¶llel_out>;
};
};
};
Signed-off-by: Philipp Zabel <[email protected]>
Tested-by: Gary Bisson <[email protected]>
This commit is contained in:
parent
d770e558e2
commit
553a59fc8f
2 changed files with 39 additions and 8 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include <drm/drm_panel.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <video/of_display_timing.h>
|
||||
#include <linux/of_graph.h>
|
||||
|
||||
#include "imx-drm.h"
|
||||
|
||||
|
|
@ -208,7 +209,7 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
|
|||
{
|
||||
struct drm_device *drm = data;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct device_node *panel_node;
|
||||
struct device_node *port;
|
||||
const u8 *edidp;
|
||||
struct imx_parallel_display *imxpd;
|
||||
int ret;
|
||||
|
|
@ -234,11 +235,19 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
|
|||
imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
|
||||
}
|
||||
|
||||
panel_node = of_parse_phandle(np, "fsl,panel", 0);
|
||||
if (panel_node) {
|
||||
imxpd->panel = of_drm_find_panel(panel_node);
|
||||
if (!imxpd->panel)
|
||||
return -EPROBE_DEFER;
|
||||
/* port@1 is the output port */
|
||||
port = of_graph_get_port_by_id(np, 1);
|
||||
if (port) {
|
||||
struct device_node *endpoint, *remote;
|
||||
|
||||
endpoint = of_get_child_by_name(port, "endpoint");
|
||||
if (endpoint) {
|
||||
remote = of_graph_get_remote_port_parent(endpoint);
|
||||
if (remote)
|
||||
imxpd->panel = of_drm_find_panel(remote);
|
||||
if (!imxpd->panel)
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
}
|
||||
|
||||
imxpd->dev = dev;
|
||||
|
|
|
|||
Loading…
Reference in a new issue