linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Kitt <steve@sk2.org>
To: Antonino Daplas <adaplas@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Helge Deller <deller@gmx.de>, Paul Mackerras <paulus@samba.org>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Kitt <steve@sk2.org>,
	linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 6/7] fbdev: omapfb: panel-dsi-cm: Use backlight helper
Date: Tue,  7 Jun 2022 21:23:34 +0200	[thread overview]
Message-ID: <20220607192335.1137249-7-steve@sk2.org> (raw)
In-Reply-To: <20220607192335.1137249-1-steve@sk2.org>

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-omap@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
index a2c7c5cb1523..236430b5dc52 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
@@ -331,13 +331,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
 	struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
 	struct omap_dss_device *in = ddata->in;
 	int r;
-	int level;
-
-	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-			dev->props.power == FB_BLANK_UNBLANK)
-		level = dev->props.brightness;
-	else
-		level = 0;
+	int level = backlight_get_brightness(dev);
 
 	dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);
 
-- 
2.30.2


  parent reply	other threads:[~2022-06-08  1:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 19:23 [PATCH 0/7] fbdev: Use backlight helpers Stephen Kitt
2022-06-07 19:23 ` [PATCH 1/7] fbdev: aty128fb: Use backlight helper Stephen Kitt
2022-06-10 20:29   ` Sam Ravnborg
2022-06-07 19:23 ` [PATCH 2/7] fbdev: atyfb: " Stephen Kitt
2022-06-07 19:23 ` [PATCH 3/7] fbdev: radeon: " Stephen Kitt
2022-06-07 19:23 ` [PATCH 4/7] fbdev: mx3fb: " Stephen Kitt
2022-06-07 19:23 ` [PATCH 5/7] fbdev: nvidia: " Stephen Kitt
2022-06-07 19:23 ` Stephen Kitt [this message]
2022-06-07 19:23 ` [PATCH 7/7] fbdev: riva: " Stephen Kitt
2022-06-08 14:40 ` [PATCH 0/7] fbdev: Use backlight helpers Daniel Thompson

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=20220607192335.1137249-7-steve@sk2.org \
    --to=steve@sk2.org \
    --cc=adaplas@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).