All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Sean Paul <sean@poorly.run>
Subject: [PATCH 44/60] drm/omap: Switch the HDMI and VENC outputs to drm_bridge
Date: Sun,  7 Jul 2019 21:19:21 +0300	[thread overview]
Message-ID: <20190707181937.6250-41-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20190707181937.6250-1-laurent.pinchart@ideasonboard.com>

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_brdige by
making the next bridge mandatory and removing the related
omapdrm-specific display drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/displays/Kconfig      |  22 --
 drivers/gpu/drm/omapdrm/displays/Makefile     |   4 -
 .../omapdrm/displays/connector-analog-tv.c    | 100 --------
 .../gpu/drm/omapdrm/displays/connector-hdmi.c | 186 ---------------
 .../gpu/drm/omapdrm/displays/encoder-opa362.c | 140 -----------
 .../drm/omapdrm/displays/encoder-tpd12s015.c  | 220 ------------------
 drivers/gpu/drm/omapdrm/dss/hdmi4.c           |   4 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c           |   4 +-
 .../gpu/drm/omapdrm/dss/omapdss-boot-init.c   |   5 -
 drivers/gpu/drm/omapdrm/dss/output.c          |   5 +
 drivers/gpu/drm/omapdrm/dss/venc.c            |   4 +-
 11 files changed, 11 insertions(+), 683 deletions(-)
 delete mode 100644 drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
 delete mode 100644 drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
 delete mode 100644 drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
 delete mode 100644 drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c

diff --git a/drivers/gpu/drm/omapdrm/displays/Kconfig b/drivers/gpu/drm/omapdrm/displays/Kconfig
index c2566da32ac4..bb73d49fc3e0 100644
--- a/drivers/gpu/drm/omapdrm/displays/Kconfig
+++ b/drivers/gpu/drm/omapdrm/displays/Kconfig
@@ -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
diff --git a/drivers/gpu/drm/omapdrm/displays/Makefile b/drivers/gpu/drm/omapdrm/displays/Makefile
index 1db34d4fed64..58ddfa9917f8 100644
--- a/drivers/gpu/drm/omapdrm/displays/Makefile
+++ b/drivers/gpu/drm/omapdrm/displays/Makefile
@@ -1,8 +1,4 @@
 # 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
 obj-$(CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
 obj-$(CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.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
index 2ab18744a5d7..000000000000
--- a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Analog TV Connector driver
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-
-#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
index 5d2dc103c6b1..000000000000
--- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * HDMI Connector driver
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-
-#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
index fa2ff7174259..000000000000
--- a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-
-#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
index b0e62ed3fce4..000000000000
--- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * 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>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-
-#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");
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index df56acb5cb27..b65afa8b93c6 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -451,8 +451,8 @@ static int hdmi4_bridge_attach(struct drm_bridge *bridge, bool create_connector)
 {
 	struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
-	if (!hdmi->output.next_bridge)
-		return 0;
+	if (create_connector)
+		return -EINVAL;
 
 	return drm_bridge_attach(bridge->encoder, hdmi->output.next_bridge,
 				 bridge, false);
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index d03f2a415fd4..fd386e189ab4 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -429,8 +429,8 @@ static int hdmi5_bridge_attach(struct drm_bridge *bridge, bool create_connector)
 {
 	struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
-	if (!hdmi->output.next_bridge)
-		return 0;
+	if (create_connector)
+		return -EINVAL;
 
 	return drm_bridge_attach(bridge->encoder, hdmi->output.next_bridge,
 				 bridge, false);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
index e02aa8e70968..24e36d68f3c4 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
@@ -185,16 +185,11 @@ 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 = "lgphilips,lb035q02" },
 	{ .compatible = "nec,nl8048hl11" },
 	{ .compatible = "panel-dsi-cm" },
 	{ .compatible = "sharp,ls037v7dw01" },
 	{ .compatible = "sony,acx565akm" },
-	{ .compatible = "svideo-connector" },
-	{ .compatible = "ti,opa362" },
-	{ .compatible = "ti,tpd12s015" },
 	{ .compatible = "toppoly,td028ttec1" },
 	{ .compatible = "tpo,td028ttec1" },
 	{ .compatible = "tpo,td043mtea1" },
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
index 71693d1abea8..258c326a5098 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -72,6 +72,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;
 	}
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index d9f8208e0ee9..66cd75e71939 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -638,8 +638,8 @@ static int venc_bridge_attach(struct drm_bridge *bridge, bool create_connector)
 {
 	struct venc_device *venc = drm_bridge_to_venc(bridge);
 
-	if (venc->output.next_bridge)
-		return 0;
+	if (create_connector)
+		return -EINVAL;
 
 	return drm_bridge_attach(bridge->encoder, venc->output.next_bridge,
 				 bridge, false);
-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-07-07 18:36 UTC|newest]

Thread overview: 166+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07 18:07 [PATCH 00/60] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Laurent Pinchart
2019-07-07 18:07 ` [PATCH 01/60] drm/edid: Add flag to drm_display_info to identify HDMI sinks Laurent Pinchart
2019-07-09 13:20   ` Andrzej Hajda
2019-07-10 15:41     ` Daniel Vetter
2019-07-10 15:59   ` Ville Syrjälä
2019-07-07 18:07 ` [PATCH 02/60] video: hdmi: Change return type of hdmi_avi_infoframe_init() to void Laurent Pinchart
2019-07-07 18:14   ` Laurent Pinchart
2019-07-07 18:21     ` Ilia Mirkin
2019-07-09 13:22   ` Andrzej Hajda
2019-07-07 18:07 ` [PATCH 03/60] drm/bridge: dumb-vga-dac: Rename internal symbols to simple-bridge Laurent Pinchart
2019-07-09 13:34   ` Andrzej Hajda
2019-07-07 18:18 ` [PATCH 04/60] drm/bridge: dumb-vga-dac: Rename driver " Laurent Pinchart
2019-07-07 18:18   ` [PATCH 05/60] drm/bridge: simple-bridge: Add support for non-VGA bridges Laurent Pinchart
2019-07-09 14:08     ` Andrzej Hajda
2019-07-26 13:24     ` Stefan Agner
2019-07-07 18:18   ` [PATCH 06/60] drm/bridge: simple-bridge: Add support for enable GPIO Laurent Pinchart
2019-07-09 14:32     ` Andrzej Hajda
2019-07-26 13:19     ` Stefan Agner
2019-07-07 18:18   ` [PATCH 07/60] drm/bridge: simple-bridge: Add support for the TI OP362 Laurent Pinchart
2019-07-09 14:32     ` Andrzej Hajda
2019-08-27  6:16     ` Tomi Valkeinen
2019-07-07 18:18   ` [PATCH 08/60] drm/bridge: Extend bridge API to disable connector creation Laurent Pinchart
2019-07-17  6:39     ` Andrzej Hajda
2019-08-08 14:25       ` Laurent Pinchart
2019-08-08 17:36         ` Andrzej Hajda
2019-08-08 18:50           ` Laurent Pinchart
2019-08-14  8:18           ` Daniel Vetter
2019-08-14  9:55             ` Laurent Pinchart
2019-08-14 12:24               ` Daniel Vetter
2019-07-07 18:18   ` [PATCH 09/60] drm/bridge: Add connector-related bridge operations and data Laurent Pinchart
2019-07-10 12:12     ` Andrzej Hajda
2019-07-11  7:35       ` Daniel Vetter
2019-07-11 12:41         ` Andrzej Hajda
2019-07-11 13:18           ` Daniel Vetter
2019-07-11 15:12             ` Andrzej Hajda
2019-07-11 15:50               ` Daniel Vetter
2019-07-12  9:01                 ` Andrzej Hajda
2019-07-16  9:00                   ` Daniel Vetter
2019-07-16 13:57                     ` Andrzej Hajda
2019-08-08 19:32                       ` Laurent Pinchart
2019-08-09 11:55                         ` Andrzej Hajda
2019-08-10 22:43                           ` Laurent Pinchart
2019-08-14  6:23                             ` Andrzej Hajda
2019-08-14 10:04                               ` Laurent Pinchart
2019-08-14 12:40                                 ` Daniel Vetter
2019-08-19  8:38                                   ` Andrzej Hajda
2019-08-19 22:45                                     ` Laurent Pinchart
2019-08-22 12:17                                       ` Andrzej Hajda
2019-08-26 16:27                                         ` Laurent Pinchart
2019-08-29 16:48                                           ` Andrzej Hajda
2019-12-02 15:40                                             ` Laurent Pinchart
2019-08-14 12:35                         ` Daniel Vetter
2019-08-19 22:32                           ` Laurent Pinchart
2019-08-20  8:30                             ` Daniel Vetter
2019-08-26 15:57                               ` Laurent Pinchart
2019-08-08 18:19         ` Laurent Pinchart
2019-08-08 18:36           ` Laurent Pinchart
2019-08-14 13:03             ` Daniel Vetter
2019-08-14 13:30               ` Laurent Pinchart
2019-08-14 17:02                 ` Daniel Vetter
2019-08-16 23:30                   ` Laurent Pinchart
2019-08-17  0:14                     ` Laurent Pinchart
2019-08-19  2:37                       ` Laurent Pinchart
2019-08-20  8:41                         ` Daniel Vetter
2019-08-14 12:43           ` Daniel Vetter
2019-08-14 12:56             ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 10/60] drm/bridge: Add bridge driver for display connectors Laurent Pinchart
2019-07-16  9:28     ` Sam Ravnborg
2019-08-08 16:41       ` Laurent Pinchart
2019-09-30 11:15     ` Tomi Valkeinen
2019-10-01 20:08       ` Laurent Pinchart
2019-10-02 12:38         ` Tomi Valkeinen
2019-07-07 18:18   ` [PATCH 11/60] drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter Laurent Pinchart
     [not found]     ` <3347b6c8-6f2d-17d6-3dc8-e62a3bac634b@ti.com>
2019-08-27  7:30       ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 12/60] drm/bridge: panel: Implement bridge connector operations Laurent Pinchart
2019-07-16 11:08     ` drm_panel_get_modes() should take the connector as an argument [Was: drm/bridge: panel: Implement bridge ...] Sam Ravnborg
2019-08-08 16:07       ` Laurent Pinchart
2019-08-08 16:52         ` Sam Ravnborg
2019-08-08 18:37           ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 13/60] drm/bridge: tfp410: Don't include drmP.h Laurent Pinchart
     [not found]     ` <3bb82dc4-434a-aaac-8ea1-3aff0991e790@ti.com>
2019-08-27  7:47       ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 14/60] drm/bridge: tfp410: Replace manual connector handling with bridge Laurent Pinchart
2019-07-07 18:18   ` [PATCH 15/60] drm/bridge: tfp410: Allow operation without drm_connector Laurent Pinchart
2019-07-07 18:18   ` [PATCH 16/60] dt-bindings: Add vendor prefix for LG Display Laurent Pinchart
2019-07-24 16:22     ` Rob Herring
2019-07-07 18:18   ` [PATCH 17/60] dt-bindings: Add legacy 'toppoly' vendor prefix Laurent Pinchart
2019-07-08 19:00     ` Rob Herring
2019-07-09  1:00       ` Laurent Pinchart
2019-07-09  1:35         ` Rob Herring
2019-07-07 18:18   ` [PATCH 18/60] dt-bindings: display: panel: Add bindings for NEC NL8048HL11 panel Laurent Pinchart
2019-07-07 18:18   ` [PATCH 19/60] drm/panel: Add driver for the LG Philips LB035Q02 panel Laurent Pinchart
2019-07-08 18:51     ` Sam Ravnborg
2019-07-09  0:56       ` Laurent Pinchart
2019-07-09  5:47         ` Sam Ravnborg
2019-07-07 18:18   ` [PATCH 20/60] drm/panel: Add driver for the NEC NL8048HL11 panel Laurent Pinchart
2019-07-08 19:10     ` Sam Ravnborg
2019-07-08 19:26       ` Sam Ravnborg
2019-08-08 15:17       ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 21/60] drm/panel: Add driver for the Sharp LS037V7DW01 panel Laurent Pinchart
2019-07-08 19:44     ` Sam Ravnborg
2019-07-08 19:47       ` Sam Ravnborg
2019-08-08 15:31       ` Laurent Pinchart
2019-07-07 18:18   ` [PATCH 22/60] drm/panel: Add driver for the Sony ACX565AKM panel Laurent Pinchart
2019-07-07 18:19   ` [PATCH 23/60] drm/panel: Add driver for the Toppology TD028TTEC1 panel Laurent Pinchart
2019-07-10  7:48     ` Sam Ravnborg
2019-08-08 15:43       ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 24/60] drm/panel: Add driver for the Toppology TD043MTEA1 panel Laurent Pinchart
2019-07-10 13:09     ` Sam Ravnborg
2019-08-08 15:54       ` Laurent Pinchart
2019-08-09 13:33         ` Sam Ravnborg
2019-08-09 17:51           ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 25/60] drm: Add helper to create a connector for a chain of bridges Laurent Pinchart
2019-07-18 17:01     ` Daniel Vetter
2019-08-08 19:48       ` Laurent Pinchart
2019-08-14 15:01         ` Daniel Vetter
2019-08-19 22:16           ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 26/60] drm/omap: Detach from panels at remove time Laurent Pinchart
2019-08-13  7:28     ` Tomi Valkeinen
2019-08-13 13:50       ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 27/60] drm/omap: Simplify HDMI mode and infoframe configuration Laurent Pinchart
2019-08-13  7:29     ` Tomi Valkeinen
2019-07-07 18:19   ` [PATCH 28/60] drm/omap: Factor out display type to connector type conversion Laurent Pinchart
2019-08-13  7:32     ` Tomi Valkeinen
2019-08-13 15:18       ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 29/60] drm/omap: Use the drm_panel_bridge API Laurent Pinchart
2019-08-13  7:36     ` Tomi Valkeinen
2019-07-07 18:19   ` [PATCH 30/60] drm/omap: dss: Fix output next device lookup in DT Laurent Pinchart
2019-08-13  7:38     ` Tomi Valkeinen
2019-07-07 18:19   ` [PATCH 31/60] drm/omap: Add infrastructure to support drm_bridge local to DSS outputs Laurent Pinchart
2019-07-07 18:19   ` [PATCH 32/60] drm/omap: dss: Make omap_dss_device_ops optional Laurent Pinchart
2019-08-13  7:48     ` Tomi Valkeinen
2019-08-13 13:55       ` Laurent Pinchart
2019-07-07 18:19   ` [PATCH 33/60] drm/omap: hdmi: Allocate EDID in the .read_edid() operation Laurent Pinchart
2019-08-13  7:52     ` Tomi Valkeinen
2019-07-07 18:19   ` [PATCH 34/60] drm/omap: hdmi4: Rework EDID read to isolate data read Laurent Pinchart
2019-07-07 18:19   ` [PATCH 35/60] drm/omap: hdmi5: " Laurent Pinchart
2019-07-07 18:19   ` [PATCH 36/60] drm/omap: hdmi4: Register a drm_bridge for EDID read Laurent Pinchart
2019-07-07 18:19   ` [PATCH 37/60] drm/omap: hdmi5: " Laurent Pinchart
2019-07-07 18:19   ` [PATCH 38/60] drm/omap: hdmi4: Move mode set, enable and disable operations to bridge Laurent Pinchart
2019-07-07 18:19   ` [PATCH 39/60] drm/omap: hdmi5: " Laurent Pinchart
2019-07-07 18:19   ` [PATCH 40/60] drm/omap: hdmi4: Implement drm_bridge .lost_hotplug() operation Laurent Pinchart
2019-07-07 18:19   ` [PATCH 41/60] drm/omap: dss: Remove .set_hdmi_mode() and .set_infoframe() operations Laurent Pinchart
2019-07-07 18:19   ` [PATCH 42/60] drm/omap: venc: Register a drm_bridge Laurent Pinchart
2019-07-07 18:19   ` [PATCH 43/60] drm/omap: Create connector for bridges Laurent Pinchart
2019-07-07 18:19   ` Laurent Pinchart [this message]
2019-07-07 18:19   ` [PATCH 45/60] drm/omap: Remove HPD, detect and EDID omapdss operations Laurent Pinchart
2019-07-07 18:19   ` [PATCH 46/60] drm/omap: hdmi: Remove omap_dss_device operations Laurent Pinchart
2019-07-07 18:19   ` [PATCH 47/60] drm/omap: venc: " Laurent Pinchart
2019-07-07 18:19   ` [PATCH 48/60] drm/omap: hdmi4: Simplify EDID read Laurent Pinchart
2019-07-07 18:19   ` [PATCH 49/60] drm/omap: hdmi5: " Laurent Pinchart
2019-07-07 18:19   ` [PATCH 50/60] drm/omap: displays: Remove unused panel drivers Laurent Pinchart
2019-07-07 18:19   ` [PATCH 51/60] drm/omap: dpi: Sort includes alphabetically Laurent Pinchart
2019-07-07 18:19   ` [PATCH 52/60] drm/omap: dpi: Reorder functions in sections Laurent Pinchart
2019-07-07 18:19   ` [PATCH 53/60] drm/omap: dpi: Simplify clock setting API Laurent Pinchart
2019-07-07 18:19   ` [PATCH 54/60] drm/omap: dpi: Register a drm_bridge Laurent Pinchart
2019-07-07 18:19   ` [PATCH 55/60] drm/omap: sdi: Sort includes alphabetically Laurent Pinchart
2019-07-07 18:19   ` [PATCH 56/60] drm/omap: sdi: Register a drm_bridge Laurent Pinchart
2019-07-07 18:19   ` [PATCH 57/60] drm/omap: Simplify connector implementation Laurent Pinchart
2019-07-07 18:19   ` [PATCH 58/60] drm/omap: dss: Remove unused omap_dss_device operations Laurent Pinchart
2019-07-07 18:19   ` [PATCH 59/60] drm/omap: dss: Inline the omapdss_display_get() function Laurent Pinchart
2019-07-07 18:19   ` [PATCH 60/60] drm/omap: dss: Remove unused omapdss_of_find_connected_device() function Laurent Pinchart
2019-07-09 13:35   ` [PATCH 04/60] drm/bridge: dumb-vga-dac: Rename driver to simple-bridge Andrzej Hajda
2019-07-11  7:37 ` [PATCH 00/60] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Daniel Vetter
2019-07-11 11:59   ` Sebastian Reichel
2019-08-08 14:26     ` Laurent Pinchart
2019-08-08 14:31   ` Laurent Pinchart

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=20190707181937.6250-41-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=sean@poorly.run \
    --cc=sebastian.reichel@collabora.com \
    --cc=tomi.valkeinen@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.