From: Luiz Sampaio <sampaio.ime@gmail.com>
To: Ben Skeggs <bskeggs@redhat.com>,
Karol Herbst <kherbst@redhat.com>, Lyude Paul <lyude@redhat.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org,
Luiz Sampaio <sampaio.ime@gmail.com>
Subject: [Nouveau] [PATCH 01/31] gpu: nouveau: nouveau_led: changing LED_FULL to actual value
Date: Fri, 21 Jan 2022 13:54:06 -0300 [thread overview]
Message-ID: <20220121165436.30956-2-sampaio.ime@gmail.com> (raw)
In-Reply-To: <20220121165436.30956-1-sampaio.ime@gmail.com>
The enum led_brightness, which contains the declaration of LED_OFF,
LED_ON, LED_HALF and LED_FULL is obsolete, as the led class now supports
max_brightness.
---
drivers/gpu/drm/nouveau/nouveau_led.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_led.c b/drivers/gpu/drm/nouveau/nouveau_led.c
index 2c5e0628da12..df4a734510e1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_led.c
+++ b/drivers/gpu/drm/nouveau/nouveau_led.c
@@ -45,7 +45,7 @@ nouveau_led_get_brightness(struct led_classdev *led)
duty = nvif_rd32(device, 0x61c884) & 0x00ffffff;
if (div > 0)
- return duty * LED_FULL / div;
+ return duty * 255 / div;
else
return 0;
}
@@ -62,7 +62,7 @@ nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value)
u32 div, duty;
div = input_clk / freq;
- duty = value * div / LED_FULL;
+ duty = value * div / 255;
/* for now, this is safe to directly poke those registers because:
* - A: nvidia never puts the logo led to any other PWM controler
--
2.34.1
next parent reply other threads:[~2022-01-21 21:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220121165436.30956-1-sampaio.ime@gmail.com>
2022-01-21 16:54 ` Luiz Sampaio [this message]
2022-01-22 13:33 ` [Nouveau] [PATCH 01/31] gpu: nouveau: nouveau_led: changing LED_FULL to actual value Fabio Estevam
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=20220121165436.30956-2-sampaio.ime@gmail.com \
--to=sampaio.ime@gmail.com \
--cc=airlied@linux.ie \
--cc=bskeggs@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kherbst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=nouveau@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;
as well as URLs for NNTP newsgroup(s).