[PATCH v2 29/60] drm/omap: dss: Split omapdss_register_display()
Sebastian Reichel
sre at kernel.org
Sun Jun 10 20:24:39 UTC 2018
Hi,
On Sat, May 26, 2018 at 08:24:47PM +0300, Laurent Pinchart wrote:
> Split the function into omapdss_display_init() to perform
> display-specific initialization of the omap_dss_device, and
> omapdss_register_display() to register the device. The latter will then
> be replaced by more generic registration.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.co.uk>
-- Sebastian
> drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 1 +
> drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 1 +
> drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 1 +
> drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 1 +
> drivers/gpu/drm/omapdrm/dss/display.c | 6 +++++-
> drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 +
> 13 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> index f579bd9ce7cb..fb23fae7fbf4 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> @@ -171,6 +171,7 @@ static int tvc_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_VENC;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&pdev->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> index 48dbb9df76b5..5333fb166c83 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> @@ -390,6 +390,7 @@ static int dvic_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_DVI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&pdev->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> index 4acb53788862..2c5e8cf70c9f 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> @@ -350,6 +350,7 @@ static int hdmic_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&pdev->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> index 32af5b11b448..87f11618e85f 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> @@ -218,6 +218,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&pdev->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> index 353510af58e7..94275fc931be 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> @@ -1328,6 +1328,7 @@ static int dsicm_probe(struct platform_device *pdev)
> dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
> OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> index 5bea3eadd7d2..88c075414b7c 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> @@ -270,6 +270,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&spi->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> index d03339034f18..fafb3e43f390 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> @@ -293,6 +293,7 @@ static int nec_8048_probe(struct spi_device *spi)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&spi->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> index 93f1a0e89861..bb28994cedc0 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> @@ -269,6 +269,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&pdev->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> index ce32ad974ae8..46ede08ce65b 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> @@ -800,6 +800,7 @@ static int acx565akm_probe(struct spi_device *spi)
> dssdev->type = OMAP_DISPLAY_TYPE_SDI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&spi->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> index 3224502016f4..a76387dfc0e2 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> @@ -394,6 +394,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&spi->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> index e3212e476b91..dbb1abf1459a 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> @@ -537,6 +537,7 @@ static int tpo_td043_probe(struct spi_device *spi)
> dssdev->type = OMAP_DISPLAY_TYPE_DPI;
> dssdev->owner = THIS_MODULE;
>
> + omapdss_display_init(dssdev);
> r = omapdss_register_display(dssdev);
> if (r) {
> dev_err(&spi->dev, "Failed to register panel\n");
> diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c
> index 0c94d5208398..057069b7a6cf 100644
> --- a/drivers/gpu/drm/omapdrm/dss/display.c
> +++ b/drivers/gpu/drm/omapdrm/dss/display.c
> @@ -32,7 +32,7 @@ static LIST_HEAD(panel_list);
> static DEFINE_MUTEX(panel_list_mutex);
> static int disp_num_counter;
>
> -int omapdss_register_display(struct omap_dss_device *dssdev)
> +void omapdss_display_init(struct omap_dss_device *dssdev)
> {
> int id;
>
> @@ -52,7 +52,11 @@ int omapdss_register_display(struct omap_dss_device *dssdev)
> if (dssdev->name == NULL)
> dssdev->name = devm_kasprintf(dssdev->dev, GFP_KERNEL,
> "display%u", id);
> +}
> +EXPORT_SYMBOL_GPL(omapdss_display_init);
>
> +int omapdss_register_display(struct omap_dss_device *dssdev)
> +{
> mutex_lock(&panel_list_mutex);
> list_add_tail(&dssdev->panel_list, &panel_list);
> mutex_unlock(&panel_list_mutex);
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> index 94a3f98bdd3d..e42821583b91 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -487,6 +487,7 @@ static inline bool omapdss_is_initialized(void)
> return !!omapdss_get_dss();
> }
>
> +void omapdss_display_init(struct omap_dss_device *dssdev);
> int omapdss_register_display(struct omap_dss_device *dssdev);
> void omapdss_unregister_display(struct omap_dss_device *dssdev);
> #define for_each_dss_display(d) \
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180610/8fab2f81/attachment.sig>
More information about the dri-devel
mailing list