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 5/7] fbdev: nvidia: Use backlight helper
Date: Tue, 7 Jun 2022 21:23:33 +0200 [thread overview]
Message-ID: <20220607192335.1137249-6-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/nvidia/nv_backlight.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/nvidia/nv_backlight.c b/drivers/video/fbdev/nvidia/nv_backlight.c
index 2ce53529f636..503a7a683855 100644
--- a/drivers/video/fbdev/nvidia/nv_backlight.c
+++ b/drivers/video/fbdev/nvidia/nv_backlight.c
@@ -49,17 +49,11 @@ static int nvidia_bl_update_status(struct backlight_device *bd)
{
struct nvidia_par *par = bl_get_data(bd);
u32 tmp_pcrt, tmp_pmc, fpcontrol;
- int level;
+ int level = backlight_get_brightness(bd);
if (!par->FlatPanel)
return 0;
- if (bd->props.power != FB_BLANK_UNBLANK ||
- bd->props.fb_blank != FB_BLANK_UNBLANK)
- level = 0;
- else
- level = bd->props.brightness;
-
tmp_pmc = NV_RD32(par->PMC, 0x10F0) & 0x0000FFFF;
tmp_pcrt = NV_RD32(par->PCRTC0, 0x081C) & 0xFFFFFFFC;
fpcontrol = NV_RD32(par->PRAMDAC, 0x0848) & 0xCFFFFFCC;
--
2.30.2
next prev parent reply other threads:[~2022-06-08 1:30 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 ` Stephen Kitt [this message]
2022-06-07 19:23 ` [PATCH 6/7] fbdev: omapfb: panel-dsi-cm: " Stephen Kitt
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-6-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
all inboxes | Powered by JetHome®