All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Jyri Sarha <jsarha@ti.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/13] drm/omap: panel-dpi: remove non-DT support
Date: Fri, 12 May 2017 15:08:14 +0300	[thread overview]
Message-ID: <2320991.GzJmasvvia@avalon> (raw)
In-Reply-To: <1494585702-9665-2-git-send-email-tomi.valkeinen@ti.com>

Hi Tomi,

Thank you for the patch.

On Friday 12 May 2017 13:41:30 Tomi Valkeinen wrote:
> Non-DT booting is no longer supported, so remove legacy code.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 78 +++----------------------
>  1 file changed, 6 insertions(+), 72 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c index
> 04ce8c5f2954..75b98bb81de2 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> @@ -18,7 +18,6 @@

I think you can drop linux/of_gpio.h.

>  #include <linux/regulator/consumer.h>
>  #include <linux/backlight.h>
> 
> -#include <video/omap-panel-data.h>
>  #include <video/of_display_timing.h>
> 
>  #include "../dss/omapdss.h"
> @@ -33,9 +32,6 @@ struct panel_drv_data {
> 
>  	struct backlight_device *backlight;
> 
> -	/* used for non-DT boot, to be removed */
> -	int backlight_gpio;
> -
>  	struct gpio_desc *enable_gpio;
>  	struct regulator *vcc_supply;
>  };
> @@ -97,9 +93,6 @@ static int panel_dpi_enable(struct omap_dss_device
> *dssdev)
> 
>  	gpiod_set_value_cansleep(ddata->enable_gpio, 1);
> 
> -	if (gpio_is_valid(ddata->backlight_gpio))
> -		gpio_set_value_cansleep(ddata->backlight_gpio, 1);
> -
>  	if (ddata->backlight) {
>  		ddata->backlight->props.power = FB_BLANK_UNBLANK;
>  		backlight_update_status(ddata->backlight);
> @@ -118,9 +111,6 @@ static void panel_dpi_disable(struct omap_dss_device
> *dssdev) if (!omapdss_device_is_enabled(dssdev))
>  		return;
> 
> -	if (gpio_is_valid(ddata->backlight_gpio))
> -		gpio_set_value_cansleep(ddata->backlight_gpio, 0);
> -
>  	if (ddata->backlight) {
>  		ddata->backlight->props.power = FB_BLANK_POWERDOWN;
>  		backlight_update_status(ddata->backlight);
> @@ -177,47 +167,6 @@ static struct omap_dss_driver panel_dpi_ops = {
>  	.get_resolution	= omapdss_default_get_resolution,
>  };
> 
> -static int panel_dpi_probe_pdata(struct platform_device *pdev)
> -{
> -	const struct panel_dpi_platform_data *pdata;
> -	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
> -	struct omap_dss_device *dssdev, *in;
> -	int r;
> -
> -	pdata = dev_get_platdata(&pdev->dev);
> -
> -	in = omap_dss_find_output(pdata->source);
> -	if (in == NULL) {
> -		dev_err(&pdev->dev, "failed to find video source '%s'\n",
> -				pdata->source);
> -		return -EPROBE_DEFER;
> -	}
> -
> -	ddata->in = in;
> -
> -	ddata->data_lines = pdata->data_lines;
> -
> -	videomode_from_timing(pdata->display_timing, &ddata->vm);
> -
> -	dssdev = &ddata->dssdev;
> -	dssdev->name = pdata->name;
> -
> -	r = devm_gpio_request_one(&pdev->dev, pdata->enable_gpio,
> -					GPIOF_OUT_INIT_LOW, "panel enable");
> -	if (r)
> -		goto err_gpio;
> -
> -	ddata->enable_gpio = gpio_to_desc(pdata->enable_gpio);
> -
> -	ddata->backlight_gpio = pdata->backlight_gpio;
> -
> -	return 0;
> -
> -err_gpio:
> -	omap_dss_put_device(ddata->in);
> -	return r;
> -}
> -
>  static int panel_dpi_probe_of(struct platform_device *pdev)
>  {
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
> @@ -248,8 +197,6 @@ static int panel_dpi_probe_of(struct platform_device
> *pdev) if (IS_ERR(ddata->vcc_supply))
>  		return PTR_ERR(ddata->vcc_supply);
> 
> -	ddata->backlight_gpio = -ENOENT;
> -
>  	bl_node = of_parse_phandle(node, "backlight", 0);
>  	if (bl_node) {
>  		ddata->backlight = of_find_backlight_by_node(bl_node);
> @@ -291,30 +238,18 @@ static int panel_dpi_probe(struct platform_device
> *pdev) struct omap_dss_device *dssdev;
>  	int r;
> 
> +	if (!pdev->dev.of_node)
> +		return -ENODEV;
> +

This can't happen.

>  	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
>  	if (ddata == NULL)
>  		return -ENOMEM;
> 
>  	platform_set_drvdata(pdev, ddata);
> 
> -	if (dev_get_platdata(&pdev->dev)) {
> -		r = panel_dpi_probe_pdata(pdev);
> -		if (r)
> -			return r;
> -	} else if (pdev->dev.of_node) {
> -		r = panel_dpi_probe_of(pdev);
> -		if (r)
> -			return r;
> -	} else {
> -		return -ENODEV;
> -	}
> -
> -	if (gpio_is_valid(ddata->backlight_gpio)) {
> -		r = devm_gpio_request_one(&pdev->dev, ddata->backlight_gpio,
> -				GPIOF_OUT_INIT_LOW, "panel backlight");
> -		if (r)
> -			goto err_gpio;
> -	}
> +	r = panel_dpi_probe_of(pdev);
> +	if (r)
> +		return r;
> 
>  	dssdev = &ddata->dssdev;
>  	dssdev->dev = &pdev->dev;
> @@ -333,7 +268,6 @@ static int panel_dpi_probe(struct platform_device *pdev)
> return 0;
> 
>  err_reg:
> -err_gpio:
>  	omap_dss_put_device(ddata->in);
>  	return r;
>  }

-- 
Regards,

Laurent Pinchart

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

  reply	other threads:[~2017-05-12 12:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 10:41 [PATCH 00/13] drm/omap: legacy cleanup Tomi Valkeinen
2017-05-12 10:41 ` [PATCH 01/13] drm/omap: panel-dpi: remove non-DT support Tomi Valkeinen
2017-05-12 12:08   ` Laurent Pinchart [this message]
2017-05-12 12:29     ` Tomi Valkeinen
2017-05-12 12:30       ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 02/13] drm/omap: acx565akm: " Tomi Valkeinen
2017-05-12 12:10   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 03/13] drm/omap: connector-analog-tv: " Tomi Valkeinen
2017-05-12 10:41 ` [PATCH 04/13] drm/omap: connector-dvi/hdmi: remove extra include Tomi Valkeinen
2017-05-12 12:14   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 05/13] drm/omap: sdi: remove legacy set_datapairs Tomi Valkeinen
2017-05-12 12:14   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 06/13] drm/omap: venc: remove set_type & invert_vid_out_polarity Tomi Valkeinen
2017-05-12 12:15   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 07/13] drm/omap: remove recommended_bpp Tomi Valkeinen
2017-05-12 12:16   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 08/13] drm/omap: dpi: remove legacy data_lines Tomi Valkeinen
2017-05-12 12:17   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 09/13] drm/omap: remove rfbi Tomi Valkeinen
2017-05-12 12:18   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 10/13] drm/omap: remove unused get_dimensions() Tomi Valkeinen
2017-05-12 12:19   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 11/13] drm/omap: remove legacy get_resolution Tomi Valkeinen
2017-05-12 12:20   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 12/13] drm/omap: remove unused fields Tomi Valkeinen
2017-05-12 12:21   ` Laurent Pinchart
2017-05-12 10:41 ` [PATCH 13/13] drm/omap: remove omap_overlay & omap_overlay_manager Tomi Valkeinen
2017-05-12 12:25   ` Laurent Pinchart
2017-05-12 12:33 ` [PATCH 14/13] drm: omapdrm: Remove unused omap_dss_find_output() function Laurent Pinchart
2017-05-12 12:40   ` Tomi Valkeinen

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=2320991.GzJmasvvia@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.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.