dssdev->owner = THIS_MODULE;
dssdev->of_ports = BIT(1) | BIT(0);
+ dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1);
+ if (IS_ERR(dssdev->next)) {
+ if (PTR_ERR(dssdev->next) != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "failed to find video sink\n");
+ return PTR_ERR(dssdev->next);
+ }
+
omapdss_device_register(dssdev);
return 0;
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev;
+ if (dssdev->next)
+ omapdss_device_put(dssdev->next);
omapdss_device_unregister(&ddata->dssdev);
WARN_ON(omapdss_device_is_enabled(dssdev));
dssdev->owner = THIS_MODULE;
dssdev->of_ports = BIT(1) | BIT(0);
+ dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1);
+ if (IS_ERR(dssdev->next)) {
+ if (PTR_ERR(dssdev->next) != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "failed to find video sink\n");
+ return PTR_ERR(dssdev->next);
+ }
+
omapdss_device_register(dssdev);
return 0;
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev;
+ if (dssdev->next)
+ omapdss_device_put(dssdev->next);
omapdss_device_unregister(&ddata->dssdev);
WARN_ON(omapdss_device_is_enabled(dssdev));
dssdev->owner = THIS_MODULE;
dssdev->of_ports = BIT(1) | BIT(0);
+ dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1);
+ if (IS_ERR(dssdev->next)) {
+ if (PTR_ERR(dssdev->next) != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "failed to find video sink\n");
+ return PTR_ERR(dssdev->next);
+ }
+
omapdss_device_register(dssdev);
return 0;
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev;
+ if (dssdev->next)
+ omapdss_device_put(dssdev->next);
omapdss_device_unregister(&ddata->dssdev);
WARN_ON(omapdss_device_is_enabled(dssdev));
.set_timings = dpi_set_timings,
};
-static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
+static int dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
{
struct omap_dss_device *out = &dpi->output;
u32 port_num = 0;
out->ops = &dpi_ops;
out->owner = THIS_MODULE;
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void dpi_uninit_output_port(struct device_node *port)
struct dpi_data *dpi = port->data;
struct omap_dss_device *out = &dpi->output;
+ if (out->next)
+ omapdss_device_put(out->next);
omapdss_device_unregister(out);
}
mutex_init(&dpi->lock);
- dpi_init_output_port(dpi, port);
-
- return 0;
+ return dpi_init_output_port(dpi, port);
}
void dpi_uninit_port(struct device_node *port)
* Probe & Remove, Suspend & Resume
*/
-static void dsi_init_output(struct dsi_data *dsi)
+static int dsi_init_output(struct dsi_data *dsi)
{
struct omap_dss_device *out = &dsi->output;
out->owner = THIS_MODULE;
out->of_ports = BIT(0);
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void dsi_uninit_output(struct dsi_data *dsi)
{
struct omap_dss_device *out = &dsi->output;
+ if (out->next)
+ omapdss_device_put(out->next);
omapdss_device_unregister(out);
}
else
dsi->num_lanes_supported = 3;
- dsi_init_output(dsi);
+ r = dsi_init_output(dsi);
+ if (r)
+ goto err_pm_disable;
r = dsi_probe_of(dsi);
if (r) {
err_uninit_output:
dsi_uninit_output(dsi);
+err_pm_disable:
pm_runtime_disable(dev);
return r;
}
* Probe & Remove, Suspend & Resume
*/
-static void hdmi4_init_output(struct omap_hdmi *hdmi)
+static int hdmi4_init_output(struct omap_hdmi *hdmi)
{
struct omap_dss_device *out = &hdmi->output;
out->owner = THIS_MODULE;
out->of_ports = BIT(0);
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void hdmi4_uninit_output(struct omap_hdmi *hdmi)
{
struct omap_dss_device *out = &hdmi->output;
+ if (out->next)
+ omapdss_device_put(out->next);
omapdss_device_unregister(out);
}
pm_runtime_enable(&pdev->dev);
- hdmi4_init_output(hdmi);
+ r = hdmi4_init_output(hdmi);
+ if (r)
+ goto err_pm_disable;
r = component_add(&pdev->dev, &hdmi4_component_ops);
if (r)
err_uninit_output:
hdmi4_uninit_output(hdmi);
+err_pm_disable:
pm_runtime_disable(&pdev->dev);
err_free:
kfree(hdmi);
* Probe & Remove, Suspend & Resume
*/
-static void hdmi5_init_output(struct omap_hdmi *hdmi)
+static int hdmi5_init_output(struct omap_hdmi *hdmi)
{
struct omap_dss_device *out = &hdmi->output;
out->owner = THIS_MODULE;
out->of_ports = BIT(0);
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void hdmi5_uninit_output(struct omap_hdmi *hdmi)
{
struct omap_dss_device *out = &hdmi->output;
+ if (out->next)
+ omapdss_device_put(out->next);
omapdss_device_unregister(out);
}
pm_runtime_enable(&pdev->dev);
- hdmi5_init_output(hdmi);
+ r = hdmi5_init_output(hdmi);
+ if (r)
+ goto err_pm_disable;
r = component_add(&pdev->dev, &hdmi5_component_ops);
if (r)
err_uninit_output:
hdmi5_uninit_output(hdmi);
+err_pm_disable:
pm_runtime_disable(&pdev->dev);
err_free:
kfree(hdmi);
struct dss_device *dss;
struct omap_dss_device *src;
struct omap_dss_device *dst;
+ struct omap_dss_device *next;
struct list_head list;
.set_timings = sdi_set_timings,
};
-static void sdi_init_output(struct sdi_device *sdi)
+static int sdi_init_output(struct sdi_device *sdi)
{
struct omap_dss_device *out = &sdi->output;
out->ops = &sdi_ops;
out->owner = THIS_MODULE;
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 1);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void sdi_uninit_output(struct sdi_device *sdi)
{
+ if (sdi->output.next)
+ omapdss_device_put(sdi->output.next);
omapdss_device_unregister(&sdi->output);
}
sdi->pdev = pdev;
port->data = sdi;
- sdi_init_output(sdi);
+ r = sdi_init_output(sdi);
+ if (r)
+ goto err_free;
return 0;
* Probe & Remove, Suspend & Resume
*/
-static void venc_init_output(struct venc_device *venc)
+static int venc_init_output(struct venc_device *venc)
{
struct omap_dss_device *out = &venc->output;
out->owner = THIS_MODULE;
out->of_ports = BIT(0);
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ if (IS_ERR(out->next)) {
+ if (PTR_ERR(out->next) != -EPROBE_DEFER)
+ dev_err(out->dev, "failed to find video sink\n");
+ return PTR_ERR(out->next);
+ }
+
omapdss_device_register(out);
+
+ return 0;
}
static void venc_uninit_output(struct venc_device *venc)
{
+ if (venc->output.next)
+ omapdss_device_put(venc->output.next);
omapdss_device_unregister(&venc->output);
}
pm_runtime_enable(&pdev->dev);
- venc_init_output(venc);
+ r = venc_init_output(venc);
+ if (r)
+ goto err_pm_disable;
r = component_add(&pdev->dev, &venc_component_ops);
if (r)
err_uninit_output:
venc_uninit_output(venc);
+err_pm_disable:
pm_runtime_disable(&pdev->dev);
err_free:
kfree(venc);