dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Han <jerry.han.hq@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Jerry Han <jerry.han.hq@gmail.com>
Subject: [PATCH] drm/panel: boe-himax8279d: use drm_panel backlight support
Date: Thu, 12 Dec 2019 10:26:14 +0800	[thread overview]
Message-ID: <20191212022614.14728-1-jerry.han.hq@gmail.com> (raw)

Use the backlight support in drm_panel to simplify the driver

Signed-off-by: Jerry Han <jerry.han.hq@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 65ea6f673cdb..3a6ee2069158 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/backlight.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -47,7 +46,6 @@ struct panel_info {
 	struct mipi_dsi_device *link;
 	const struct panel_desc *desc;
 
-	struct backlight_device *backlight;
 	struct gpio_desc *enable_gpio;
 	struct gpio_desc *pp33_gpio;
 	struct gpio_desc *pp18_gpio;
@@ -93,8 +91,6 @@ static int boe_panel_disable(struct drm_panel *panel)
 	if (!pinfo->enabled)
 		return 0;
 
-	backlight_disable(pinfo->backlight);
-
 	err = mipi_dsi_dcs_set_display_off(pinfo->link);
 	if (err < 0) {
 		DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
@@ -218,13 +214,6 @@ static int boe_panel_enable(struct drm_panel *panel)
 		return ret;
 	}
 
-	ret = backlight_enable(pinfo->backlight);
-	if (ret) {
-		DRM_DEV_ERROR(panel->drm->dev,
-			      "Failed to enable backlight %d\n", ret);
-		return ret;
-	}
-
 	pinfo->enabled = true;
 
 	return 0;
@@ -899,9 +888,9 @@ static int panel_add(struct panel_info *pinfo)
 		return ret;
 	}
 
-	pinfo->backlight = devm_of_find_backlight(dev);
-	if (IS_ERR(pinfo->backlight))
-		return PTR_ERR(pinfo->backlight);
+	ret = drm_panel_of_backlight(&pinfo->base);
+	if (ret)
+		return ret;
 
 	drm_panel_init(&pinfo->base, dev, &panel_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
-- 
2.17.1

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

             reply	other threads:[~2019-12-12  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12  2:26 Jerry Han [this message]
2019-12-12  9:54 ` [PATCH] drm/panel: boe-himax8279d: use drm_panel backlight support Sam Ravnborg

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=20191212022614.14728-1-jerry.han.hq@gmail.com \
    --to=jerry.han.hq@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox