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>,
dri-devel@lists.freedesktop.org
Subject: [PATCH 7/7] fbdev: riva: Use backlight helper
Date: Tue, 7 Jun 2022 21:23:35 +0200 [thread overview]
Message-ID: <20220607192335.1137249-8-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: Antonino Daplas <adaplas@gmail.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
---
drivers/video/fbdev/riva/fbdev.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 84d5e23ad7d3..534722b38053 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -292,13 +292,7 @@ static int riva_bl_update_status(struct backlight_device *bd)
{
struct riva_par *par = bl_get_data(bd);
U032 tmp_pcrt, tmp_pmc;
- int level;
-
- if (bd->props.power != FB_BLANK_UNBLANK ||
- bd->props.fb_blank != FB_BLANK_UNBLANK)
- level = 0;
- else
- level = bd->props.brightness;
+ int level = backlight_get_brightness(bd);
tmp_pmc = NV_RD32(par->riva.PMC, 0x10F0) & 0x0000FFFF;
tmp_pcrt = NV_RD32(par->riva.PCRTC0, 0x081C) & 0xFFFFFFFC;
--
2.30.2
next prev parent reply other threads:[~2022-06-08 0: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 ` [PATCH 6/7] fbdev: omapfb: panel-dsi-cm: " Stephen Kitt
2022-06-07 19:23 ` Stephen Kitt [this message]
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-8-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=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).