diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-11-03 20:16:37 -0700 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-12-14 20:01:49 +0100 |
commit | b7ec002c05d8e01b961bf5d915cf2e42a4cff4dd (patch) | |
tree | 97fa5a24e5d5ef38ff9aa5196deeba28b3be1fd1 /drivers/video/fbdev/omap2 | |
parent | 39630e0f138a4821cd219a83fd727cf39d304201 (diff) | |
download | linux-stable-b7ec002c05d8e01b961bf5d915cf2e42a4cff4dd.tar.gz linux-stable-b7ec002c05d8e01b961bf5d915cf2e42a4cff4dd.tar.bz2 linux-stable-b7ec002c05d8e01b961bf5d915cf2e42a4cff4dd.zip |
fbdev: omapfb: panel-dpi: remove support for platform data
There are no users of panel_dpi_platform_data in the mainline
kernel so support for it can be removed from the panel driver.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev/omap2')
-rw-r--r-- | drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c | 83 |
1 files changed, 7 insertions, 76 deletions
diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c index ff3d1e8e1e7b..9790053c5877 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c @@ -6,15 +6,13 @@ * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> */ -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/of.h> -#include <linux/of_gpio.h> #include <video/omapfb_dss.h> -#include <video/omap-panel-data.h> #include <video/of_display_timing.h> struct panel_drv_data { @@ -25,9 +23,6 @@ struct panel_drv_data { struct omap_video_timings videomode; - /* used for non-DT boot, to be removed */ - int backlight_gpio; - struct gpio_desc *enable_gpio; }; @@ -77,9 +72,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); - dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; return 0; @@ -93,9 +85,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); - gpiod_set_value_cansleep(ddata->enable_gpio, 0); in->ops.dpi->disable(in); @@ -146,49 +135,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; - struct videomode vm; - 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, &vm); - videomode_to_omap_video_timings(&vm, &ddata->videomode); - - 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); @@ -205,8 +151,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev) ddata->enable_gpio = gpio; - ddata->backlight_gpio = -ENOENT; - r = of_get_display_timing(node, "panel-timing", &timing); if (r) { dev_err(&pdev->dev, "failed to get video timing\n"); @@ -233,30 +177,18 @@ static int panel_dpi_probe(struct platform_device *pdev) struct omap_dss_device *dssdev; int r; + if (!pdev->dev.of_node) + return -ENODEV; + 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; @@ -275,7 +207,6 @@ static int panel_dpi_probe(struct platform_device *pdev) return 0; err_reg: -err_gpio: omap_dss_put_device(ddata->in); return r; } |