drm/omap: Switch the HDMI and VENC outputs to drm_bridge
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 26 Feb 2020 11:24:59 +0000 (13:24 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 26 Feb 2020 11:32:00 +0000 (13:32 +0200)
The TPD12S015, OPA362 and analog and HDMI connectors are now supported
by DRM bridge drivers, and the omapdrm HDMI and VENC outputs can be
handled through the drm_bridge API. Switch the outputs to drm_bridge by
making the next bridge mandatory and removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-40-laurent.pinchart@ideasonboard.com
12 files changed:
arch/arm/configs/omap2plus_defconfig
drivers/gpu/drm/omapdrm/displays/Kconfig
drivers/gpu/drm/omapdrm/displays/Makefile
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c [deleted file]
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c [deleted file]
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c [deleted file]
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c [deleted file]
drivers/gpu/drm/omapdrm/dss/hdmi4.c
drivers/gpu/drm/omapdrm/dss/hdmi5.c
drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
drivers/gpu/drm/omapdrm/dss/output.c
drivers/gpu/drm/omapdrm/dss/venc.c

index c32c338f770426bcb6c97e7a36ca2bd34b241b00..b9698e217aa7d311139c416eaae330c5141142e1 100644 (file)
@@ -350,14 +350,13 @@ CONFIG_DRM_OMAP=m
 CONFIG_OMAP5_DSS_HDMI=y
 CONFIG_OMAP2_DSS_SDI=y
 CONFIG_OMAP2_DSS_DSI=y
-CONFIG_DRM_OMAP_ENCODER_OPA362=m
-CONFIG_DRM_OMAP_ENCODER_TPD12S015=m
-CONFIG_DRM_OMAP_CONNECTOR_HDMI=m
-CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=m
 CONFIG_DRM_OMAP_PANEL_DSI_CM=m
 CONFIG_DRM_TILCDC=m
 CONFIG_DRM_PANEL_SIMPLE=m
+CONFIG_DRM_DISPLAY_CONNECTOR=m
+CONFIG_DRM_SIMPLE_BRIDGE=m
 CONFIG_DRM_TI_TFP410=m
+CONFIG_DRM_TI_TPD12S015=m
 CONFIG_DRM_PANEL_LG_LB035Q02=m
 CONFIG_DRM_PANEL_NEC_NL8048HL11=m
 CONFIG_DRM_PANEL_SHARP_LS037V7DW01=m
index b562a8cd61bfaec12d6e8e9d85ee1c56a33741a0..f2be594c7eff8fa58bbdbf49566dc074b1fb5cc7 100644 (file)
@@ -1,28 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 menu "OMAPDRM External Display Device Drivers"
 
-config DRM_OMAP_ENCODER_OPA362
-       tristate "OPA362 external analog amplifier"
-       help
-         Driver for OPA362 external analog TV amplifier controlled
-         through a GPIO.
-
-config DRM_OMAP_ENCODER_TPD12S015
-       tristate "TPD12S015 HDMI ESD protection and level shifter"
-       help
-         Driver for TPD12S015, which offers HDMI ESD protection and level
-         shifting.
-
-config DRM_OMAP_CONNECTOR_HDMI
-       tristate "HDMI Connector"
-       help
-         Driver for a generic HDMI connector.
-
-config DRM_OMAP_CONNECTOR_ANALOG_TV
-       tristate "Analog TV Connector"
-       help
-         Driver for a generic analog TV connector.
-
 config DRM_OMAP_PANEL_DSI_CM
        tristate "Generic DSI Command Mode Panel"
        depends on BACKLIGHT_CLASS_DEVICE
index cb76859dc574d31d2ff4700b69dec0d7a2ad3a2a..488ddf15361380dee9b549752a645387e01a3dc1 100644 (file)
@@ -1,6 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_DRM_OMAP_ENCODER_OPA362) += encoder-opa362.o
-obj-$(CONFIG_DRM_OMAP_ENCODER_TPD12S015) += encoder-tpd12s015.o
-obj-$(CONFIG_DRM_OMAP_CONNECTOR_HDMI) += connector-hdmi.o
-obj-$(CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV) += connector-analog-tv.o
 obj-$(CONFIG_DRM_OMAP_PANEL_DSI_CM) += panel-dsi-cm.o
diff --git a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
deleted file mode 100644 (file)
index f36aa18..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Analog TV Connector driver
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- */
-
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/of.h>
-
-#include "../dss/omapdss.h"
-
-struct panel_drv_data {
-       struct omap_dss_device dssdev;
-
-       struct device *dev;
-};
-
-#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
-
-static int tvc_connect(struct omap_dss_device *src,
-                      struct omap_dss_device *dst)
-{
-       return 0;
-}
-
-static void tvc_disconnect(struct omap_dss_device *src,
-                          struct omap_dss_device *dst)
-{
-}
-
-static const struct omap_dss_device_ops tvc_ops = {
-       .connect                = tvc_connect,
-       .disconnect             = tvc_disconnect,
-};
-
-static int tvc_probe(struct platform_device *pdev)
-{
-       struct panel_drv_data *ddata;
-       struct omap_dss_device *dssdev;
-
-       ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
-       if (!ddata)
-               return -ENOMEM;
-
-       platform_set_drvdata(pdev, ddata);
-       ddata->dev = &pdev->dev;
-
-       dssdev = &ddata->dssdev;
-       dssdev->ops = &tvc_ops;
-       dssdev->dev = &pdev->dev;
-       dssdev->type = OMAP_DISPLAY_TYPE_VENC;
-       dssdev->display = true;
-       dssdev->owner = THIS_MODULE;
-       dssdev->of_port = 0;
-
-       omapdss_display_init(dssdev);
-       omapdss_device_register(dssdev);
-
-       return 0;
-}
-
-static int __exit tvc_remove(struct platform_device *pdev)
-{
-       struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-
-       omapdss_device_unregister(&ddata->dssdev);
-
-       return 0;
-}
-
-static const struct of_device_id tvc_of_match[] = {
-       { .compatible = "omapdss,svideo-connector", },
-       { .compatible = "omapdss,composite-video-connector", },
-       {},
-};
-
-MODULE_DEVICE_TABLE(of, tvc_of_match);
-
-static struct platform_driver tvc_connector_driver = {
-       .probe  = tvc_probe,
-       .remove = __exit_p(tvc_remove),
-       .driver = {
-               .name   = "connector-analog-tv",
-               .of_match_table = tvc_of_match,
-               .suppress_bind_attrs = true,
-       },
-};
-
-module_platform_driver(tvc_connector_driver);
-
-MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
-MODULE_DESCRIPTION("Analog TV Connector driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
deleted file mode 100644 (file)
index 37c2124..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * HDMI Connector driver
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- */
-
-#include <linux/gpio/consumer.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-
-#include "../dss/omapdss.h"
-
-struct panel_drv_data {
-       struct omap_dss_device dssdev;
-       void (*hpd_cb)(void *cb_data, enum drm_connector_status status);
-       void *hpd_cb_data;
-       struct mutex hpd_lock;
-
-       struct device *dev;
-
-       struct gpio_desc *hpd_gpio;
-};
-
-#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
-
-static int hdmic_connect(struct omap_dss_device *src,
-                        struct omap_dss_device *dst)
-{
-       return 0;
-}
-
-static void hdmic_disconnect(struct omap_dss_device *src,
-                            struct omap_dss_device *dst)
-{
-}
-
-static bool hdmic_detect(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       return gpiod_get_value_cansleep(ddata->hpd_gpio);
-}
-
-static void hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
-                                 void (*cb)(void *cb_data,
-                                           enum drm_connector_status status),
-                                 void *cb_data)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       mutex_lock(&ddata->hpd_lock);
-       ddata->hpd_cb = cb;
-       ddata->hpd_cb_data = cb_data;
-       mutex_unlock(&ddata->hpd_lock);
-}
-
-static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       mutex_lock(&ddata->hpd_lock);
-       ddata->hpd_cb = NULL;
-       ddata->hpd_cb_data = NULL;
-       mutex_unlock(&ddata->hpd_lock);
-}
-
-static const struct omap_dss_device_ops hdmic_ops = {
-       .connect                = hdmic_connect,
-       .disconnect             = hdmic_disconnect,
-
-       .detect                 = hdmic_detect,
-       .register_hpd_cb        = hdmic_register_hpd_cb,
-       .unregister_hpd_cb      = hdmic_unregister_hpd_cb,
-};
-
-static irqreturn_t hdmic_hpd_isr(int irq, void *data)
-{
-       struct panel_drv_data *ddata = data;
-
-       mutex_lock(&ddata->hpd_lock);
-       if (ddata->hpd_cb) {
-               enum drm_connector_status status;
-
-               if (hdmic_detect(&ddata->dssdev))
-                       status = connector_status_connected;
-               else
-                       status = connector_status_disconnected;
-
-               ddata->hpd_cb(ddata->hpd_cb_data, status);
-       }
-       mutex_unlock(&ddata->hpd_lock);
-
-       return IRQ_HANDLED;
-}
-
-static int hdmic_probe(struct platform_device *pdev)
-{
-       struct panel_drv_data *ddata;
-       struct omap_dss_device *dssdev;
-       struct gpio_desc *gpio;
-       int r;
-
-       ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
-       if (!ddata)
-               return -ENOMEM;
-
-       platform_set_drvdata(pdev, ddata);
-       ddata->dev = &pdev->dev;
-
-       mutex_init(&ddata->hpd_lock);
-
-       /* HPD GPIO */
-       gpio = devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN);
-       if (IS_ERR(gpio)) {
-               dev_err(&pdev->dev, "failed to parse HPD gpio\n");
-               return PTR_ERR(gpio);
-       }
-
-       ddata->hpd_gpio = gpio;
-
-       if (ddata->hpd_gpio) {
-               r = devm_request_threaded_irq(&pdev->dev,
-                               gpiod_to_irq(ddata->hpd_gpio),
-                               NULL, hdmic_hpd_isr,
-                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
-                               IRQF_ONESHOT,
-                               "hdmic hpd", ddata);
-               if (r)
-                       return r;
-       }
-
-       dssdev = &ddata->dssdev;
-       dssdev->ops = &hdmic_ops;
-       dssdev->dev = &pdev->dev;
-       dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
-       dssdev->display = true;
-       dssdev->owner = THIS_MODULE;
-       dssdev->of_port = 0;
-       dssdev->ops_flags = ddata->hpd_gpio
-                         ? OMAP_DSS_DEVICE_OP_DETECT | OMAP_DSS_DEVICE_OP_HPD
-                         : 0;
-
-       omapdss_display_init(dssdev);
-       omapdss_device_register(dssdev);
-
-       return 0;
-}
-
-static int __exit hdmic_remove(struct platform_device *pdev)
-{
-       struct panel_drv_data *ddata = platform_get_drvdata(pdev);
-
-       omapdss_device_unregister(&ddata->dssdev);
-
-       return 0;
-}
-
-static const struct of_device_id hdmic_of_match[] = {
-       { .compatible = "omapdss,hdmi-connector", },
-       {},
-};
-
-MODULE_DEVICE_TABLE(of, hdmic_of_match);
-
-static struct platform_driver hdmi_connector_driver = {
-       .probe  = hdmic_probe,
-       .remove = __exit_p(hdmic_remove),
-       .driver = {
-               .name   = "connector-hdmi",
-               .of_match_table = hdmic_of_match,
-               .suppress_bind_attrs = true,
-       },
-};
-
-module_platform_driver(hdmi_connector_driver);
-
-MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
-MODULE_DESCRIPTION("HDMI Connector driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
deleted file mode 100644 (file)
index 2527052..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * OPA362 analog video amplifier with output/power control
- *
- * Copyright (C) 2014 Golden Delicious Computers
- * Author: H. Nikolaus Schaller <hns@goldelico.com>
- *
- * based on encoder-tfp410
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- */
-
-#include <linux/gpio/consumer.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-
-#include "../dss/omapdss.h"
-
-struct panel_drv_data {
-       struct omap_dss_device dssdev;
-
-       struct gpio_desc *enable_gpio;
-};
-
-#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
-
-static int opa362_connect(struct omap_dss_device *src,
-                         struct omap_dss_device *dst)
-{
-       return omapdss_device_connect(dst->dss, dst, dst->next);
-}
-
-static void opa362_disconnect(struct omap_dss_device *src,
-                             struct omap_dss_device *dst)
-{
-       omapdss_device_disconnect(dst, dst->next);
-}
-
-static void opa362_enable(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       if (ddata->enable_gpio)
-               gpiod_set_value_cansleep(ddata->enable_gpio, 1);
-}
-
-static void opa362_disable(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       if (ddata->enable_gpio)
-               gpiod_set_value_cansleep(ddata->enable_gpio, 0);
-}
-
-static const struct omap_dss_device_ops opa362_ops = {
-       .connect        = opa362_connect,
-       .disconnect     = opa362_disconnect,
-       .enable         = opa362_enable,
-       .disable        = opa362_disable,
-};
-
-static int opa362_probe(struct platform_device *pdev)
-{
-       struct panel_drv_data *ddata;
-       struct omap_dss_device *dssdev;
-       struct gpio_desc *gpio;
-
-       dev_dbg(&pdev->dev, "probe\n");
-
-       ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
-       if (!ddata)
-               return -ENOMEM;
-
-       platform_set_drvdata(pdev, ddata);
-
-       gpio = devm_gpiod_get_optional(&pdev->dev, "enable", GPIOD_OUT_LOW);
-       if (IS_ERR(gpio))
-               return PTR_ERR(gpio);
-
-       ddata->enable_gpio = gpio;
-
-       dssdev = &ddata->dssdev;
-       dssdev->ops = &opa362_ops;
-       dssdev->dev = &pdev->dev;
-       dssdev->type = OMAP_DISPLAY_TYPE_VENC;
-       dssdev->owner = THIS_MODULE;
-       dssdev->of_port = 1;
-
-       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;
-}
-
-static int __exit opa362_remove(struct platform_device *pdev)
-{
-       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);
-
-       opa362_disable(dssdev);
-
-       return 0;
-}
-
-static const struct of_device_id opa362_of_match[] = {
-       { .compatible = "omapdss,ti,opa362", },
-       {},
-};
-MODULE_DEVICE_TABLE(of, opa362_of_match);
-
-static struct platform_driver opa362_driver = {
-       .probe  = opa362_probe,
-       .remove = __exit_p(opa362_remove),
-       .driver = {
-               .name   = "amplifier-opa362",
-               .of_match_table = opa362_of_match,
-               .suppress_bind_attrs = true,
-       },
-};
-
-module_platform_driver(opa362_driver);
-
-MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
-MODULE_DESCRIPTION("OPA362 analog video amplifier with output/power control");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
deleted file mode 100644 (file)
index 857ae84..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * TPD12S015 HDMI ESD protection & level shifter chip driver
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- */
-
-#include <linux/completion.h>
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
-#include <linux/mutex.h>
-
-#include "../dss/omapdss.h"
-
-struct panel_drv_data {
-       struct omap_dss_device dssdev;
-       void (*hpd_cb)(void *cb_data, enum drm_connector_status status);
-       void *hpd_cb_data;
-       struct mutex hpd_lock;
-
-       struct gpio_desc *ct_cp_hpd_gpio;
-       struct gpio_desc *ls_oe_gpio;
-       struct gpio_desc *hpd_gpio;
-};
-
-#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
-
-static int tpd_connect(struct omap_dss_device *src,
-                      struct omap_dss_device *dst)
-{
-       struct panel_drv_data *ddata = to_panel_data(dst);
-       int r;
-
-       r = omapdss_device_connect(dst->dss, dst, dst->next);
-       if (r)
-               return r;
-
-       gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1);
-       gpiod_set_value_cansleep(ddata->ls_oe_gpio, 1);
-
-       /* DC-DC converter needs at max 300us to get to 90% of 5V */
-       udelay(300);
-
-       return 0;
-}
-
-static void tpd_disconnect(struct omap_dss_device *src,
-                          struct omap_dss_device *dst)
-{
-       struct panel_drv_data *ddata = to_panel_data(dst);
-
-       gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0);
-       gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0);
-
-       omapdss_device_disconnect(dst, dst->next);
-}
-
-static bool tpd_detect(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       return gpiod_get_value_cansleep(ddata->hpd_gpio);
-}
-
-static void tpd_register_hpd_cb(struct omap_dss_device *dssdev,
-                               void (*cb)(void *cb_data,
-                                         enum drm_connector_status status),
-                               void *cb_data)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       mutex_lock(&ddata->hpd_lock);
-       ddata->hpd_cb = cb;
-       ddata->hpd_cb_data = cb_data;
-       mutex_unlock(&ddata->hpd_lock);
-}
-
-static void tpd_unregister_hpd_cb(struct omap_dss_device *dssdev)
-{
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
-
-       mutex_lock(&ddata->hpd_lock);
-       ddata->hpd_cb = NULL;
-       ddata->hpd_cb_data = NULL;
-       mutex_unlock(&ddata->hpd_lock);
-}
-
-static const struct omap_dss_device_ops tpd_ops = {
-       .connect                = tpd_connect,
-       .disconnect             = tpd_disconnect,
-       .detect                 = tpd_detect,
-       .register_hpd_cb        = tpd_register_hpd_cb,
-       .unregister_hpd_cb      = tpd_unregister_hpd_cb,
-};
-
-static irqreturn_t tpd_hpd_isr(int irq, void *data)
-{
-       struct panel_drv_data *ddata = data;
-
-       mutex_lock(&ddata->hpd_lock);
-       if (ddata->hpd_cb) {
-               enum drm_connector_status status;
-
-               if (tpd_detect(&ddata->dssdev))
-                       status = connector_status_connected;
-               else
-                       status = connector_status_disconnected;
-
-               ddata->hpd_cb(ddata->hpd_cb_data, status);
-       }
-       mutex_unlock(&ddata->hpd_lock);
-
-       return IRQ_HANDLED;
-}
-
-static int tpd_probe(struct platform_device *pdev)
-{
-       struct omap_dss_device *dssdev;
-       struct panel_drv_data *ddata;
-       int r;
-       struct gpio_desc *gpio;
-
-       ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
-       if (!ddata)
-               return -ENOMEM;
-
-       platform_set_drvdata(pdev, ddata);
-
-       gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0,
-                GPIOD_OUT_LOW);
-       if (IS_ERR(gpio))
-               return PTR_ERR(gpio);
-
-       ddata->ct_cp_hpd_gpio = gpio;
-
-       gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1,
-                GPIOD_OUT_LOW);
-       if (IS_ERR(gpio))
-               return PTR_ERR(gpio);
-
-       ddata->ls_oe_gpio = gpio;
-
-       gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2,
-               GPIOD_IN);
-       if (IS_ERR(gpio))
-               return PTR_ERR(gpio);
-
-       ddata->hpd_gpio = gpio;
-
-       mutex_init(&ddata->hpd_lock);
-
-       r = devm_request_threaded_irq(&pdev->dev, gpiod_to_irq(ddata->hpd_gpio),
-               NULL, tpd_hpd_isr,
-               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-               "tpd12s015 hpd", ddata);
-       if (r)
-               return r;
-
-       dssdev = &ddata->dssdev;
-       dssdev->ops = &tpd_ops;
-       dssdev->dev = &pdev->dev;
-       dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
-       dssdev->owner = THIS_MODULE;
-       dssdev->of_port = 1;
-       dssdev->ops_flags = OMAP_DSS_DEVICE_OP_DETECT
-                         | OMAP_DSS_DEVICE_OP_HPD;
-
-       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;
-}
-
-static int __exit tpd_remove(struct platform_device *pdev)
-{
-       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);
-
-       return 0;
-}
-
-static const struct of_device_id tpd_of_match[] = {
-       { .compatible = "omapdss,ti,tpd12s015", },
-       {},
-};
-
-MODULE_DEVICE_TABLE(of, tpd_of_match);
-
-static struct platform_driver tpd_driver = {
-       .probe  = tpd_probe,
-       .remove = __exit_p(tpd_remove),
-       .driver = {
-               .name   = "tpd12s015",
-               .of_match_table = tpd_of_match,
-               .suppress_bind_attrs = true,
-       },
-};
-
-module_platform_driver(tpd_driver);
-
-MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
-MODULE_DESCRIPTION("TPD12S015 driver");
-MODULE_LICENSE("GPL");
index 73f1fab346e9b0f81471debd2a31aa550a87d612..52daae36935a644c6be9a39ed5cefbc7d1edac19 100644 (file)
@@ -444,8 +444,8 @@ static int hdmi4_bridge_attach(struct drm_bridge *bridge,
 {
        struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
-       if (!hdmi->output.next_bridge)
-               return 0;
+       if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+               return -EINVAL;
 
        return drm_bridge_attach(bridge->encoder, hdmi->output.next_bridge,
                                 bridge, flags);
index 52184797c858694a0a18874d1bff63e0b9f4deff..f07fd5c6dc39347963f6ad4294377d62ad19c7bc 100644 (file)
@@ -422,8 +422,8 @@ static int hdmi5_bridge_attach(struct drm_bridge *bridge,
 {
        struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
-       if (!hdmi->output.next_bridge)
-               return 0;
+       if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+               return -EINVAL;
 
        return drm_bridge_attach(bridge->encoder, hdmi->output.next_bridge,
                                 bridge, flags);
index ce67891eedd467e8e4a913a75c9d4854fcb17f3b..00372f4ce711e90ccde9c653c0492907b9ba8289 100644 (file)
@@ -174,12 +174,7 @@ static const struct of_device_id omapdss_of_match[] __initconst = {
 };
 
 static const struct of_device_id omapdss_of_fixups_whitelist[] __initconst = {
-       { .compatible = "composite-video-connector" },
-       { .compatible = "hdmi-connector" },
        { .compatible = "panel-dsi-cm" },
-       { .compatible = "svideo-connector" },
-       { .compatible = "ti,opa362" },
-       { .compatible = "ti,tpd12s015" },
        {},
 };
 
index 9ba7cc8539a1d8e813993d4dc5f851775ffc1c44..ce21c798cca64d2ffcd3a0962049e48cba8990bf 100644 (file)
@@ -60,6 +60,11 @@ int omapdss_device_init_output(struct omap_dss_device *out,
        }
 
        if (local_bridge) {
+               if (!out->bridge) {
+                       ret = -EPROBE_DEFER;
+                       goto error;
+               }
+
                out->next_bridge = out->bridge;
                out->bridge = local_bridge;
        }
index cb9a689ed6124a21363820ad5d11b2d43b4e9215..c8c19967a42f9bf211540d9b990fdfb9da021009 100644 (file)
@@ -626,8 +626,8 @@ static int venc_bridge_attach(struct drm_bridge *bridge,
 {
        struct venc_device *venc = drm_bridge_to_venc(bridge);
 
-       if (venc->output.next_bridge)
-               return 0;
+       if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+               return -EINVAL;
 
        return drm_bridge_attach(bridge->encoder, venc->output.next_bridge,
                                 bridge, flags);