Subject: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

From: Sam Ravnborg <[email protected]>

Introduce backlight_get_brightness() to simplify logic
and avoid direct access to backlight properties.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Robin van der Gracht <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
---
drivers/auxdisplay/ht16k33.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 02425991c159..15ab118c80f5 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -314,14 +314,9 @@ static int ht16k33_initialize(struct ht16k33_priv *priv)

static int ht16k33_bl_update_status(struct backlight_device *bl)
{
- int brightness = bl->props.brightness;
+ int brightness = backlight_get_brightness(bl);
struct ht16k33_priv *priv = bl_get_data(bl);

- if (bl->props.power != FB_BLANK_UNBLANK ||
- bl->props.fb_blank != FB_BLANK_UNBLANK ||
- bl->props.state & BL_CORE_FBBLANK)
- brightness = 0;
-
return ht16k33_brightness_set(priv, brightness);
}


--
2.34.1


2023-01-07 21:40:18

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
<[email protected]> wrote:
>
> Introduce backlight_get_brightness() to simplify logic
> and avoid direct access to backlight properties.

Note: Stephen sent this one too a while ago (with some more details in
the commit message, which is always nice); and then he sent yesterday
v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
[2]).

Anyway, if it goes via drm-misc, feel free to have my:

Acked-by: Miguel Ojeda <[email protected]>

Though it would be nice to have Robin test the change.

Thanks!

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/

Cheers,
Miguel

2023-01-08 09:51:38

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

Hi Robin.

On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> <[email protected]> wrote:
> >
> > Introduce backlight_get_brightness() to simplify logic
> > and avoid direct access to backlight properties.
>
> Note: Stephen sent this one too a while ago (with some more details in
> the commit message, which is always nice); and then he sent yesterday
> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> [2]).
Thanks for the pointers. I will try to move forward with Stephen's
patches.
>
> Anyway, if it goes via drm-misc, feel free to have my:
>
> Acked-by: Miguel Ojeda <[email protected]>
>
> Though it would be nice to have Robin test the change.

Robin - can I get your ack to apply Stephen's original v2 patch to
drm-misc?

Sam

>
> Thanks!
>
> [1] https://lore.kernel.org/lkml/[email protected]/
> [2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/
>
> Cheers,
> Miguel

2023-01-09 11:07:24

by Robin van der Gracht

[permalink] [raw]
Subject: Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

Hi Sam,

On 2023-01-08 10:29, Sam Ravnborg wrote:
> Hi Robin.
>
> On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
>> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
>> <[email protected]> wrote:
>> >
>> > Introduce backlight_get_brightness() to simplify logic
>> > and avoid direct access to backlight properties.
>>
>> Note: Stephen sent this one too a while ago (with some more details in
>> the commit message, which is always nice); and then he sent yesterday
>> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
>> [2]).
> Thanks for the pointers. I will try to move forward with Stephen's
> patches.
>>
>> Anyway, if it goes via drm-misc, feel free to have my:
>>
>> Acked-by: Miguel Ojeda <[email protected]>
>>
>> Though it would be nice to have Robin test the change.
>
> Robin - can I get your ack to apply Stephen's original v2 patch to
> drm-misc?

done! see:
https://lore.kernel.org/lkml/[email protected]/

- Robin

2023-03-19 16:10:31

by Stephen Kitt

[permalink] [raw]
Subject: Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

Hi,

On Mon, 09 Jan 2023 11:12:02 +0100, Robin van der Gracht <[email protected]>
wrote:
> On 2023-01-08 10:29, Sam Ravnborg wrote:
> > On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
> >> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> >> <[email protected]> wrote:
> >> >
> >> > Introduce backlight_get_brightness() to simplify logic
> >> > and avoid direct access to backlight properties.
> >>
> >> Note: Stephen sent this one too a while ago (with some more details in
> >> the commit message, which is always nice); and then he sent yesterday
> >> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> >> [2]).
> > Thanks for the pointers. I will try to move forward with Stephen's
> > patches.
> >>
> >> Anyway, if it goes via drm-misc, feel free to have my:
> >>
> >> Acked-by: Miguel Ojeda <[email protected]>
> >>
> >> Though it would be nice to have Robin test the change.
> >
> > Robin - can I get your ack to apply Stephen's original v2 patch to
> > drm-misc?
>
> done! see:
> https://lore.kernel.org/lkml/[email protected]/

As far as I can tell, this never got applied to drm-misc, and I don’t see it
anywhere else. I guess it slipped through the cracks ;-)

Regards,

Stephen

2023-03-19 18:44:31

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

On Sun, Mar 19, 2023 at 02:44:08PM +0100, Stephen Kitt wrote:
> Hi,
>
> On Mon, 09 Jan 2023 11:12:02 +0100, Robin van der Gracht <[email protected]>
> wrote:
> > On 2023-01-08 10:29, Sam Ravnborg wrote:
> > > On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
> > >> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> > >> <[email protected]> wrote:
> > >> >
> > >> > Introduce backlight_get_brightness() to simplify logic
> > >> > and avoid direct access to backlight properties.
> > >>
> > >> Note: Stephen sent this one too a while ago (with some more details in
> > >> the commit message, which is always nice); and then he sent yesterday
> > >> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> > >> [2]).
> > > Thanks for the pointers. I will try to move forward with Stephen's
> > > patches.
> > >>
> > >> Anyway, if it goes via drm-misc, feel free to have my:
> > >>
> > >> Acked-by: Miguel Ojeda <[email protected]>
> > >>
> > >> Though it would be nice to have Robin test the change.
> > >
> > > Robin - can I get your ack to apply Stephen's original v2 patch to
> > > drm-misc?
> >
> > done! see:
> > https://lore.kernel.org/lkml/[email protected]/
>
> As far as I can tell, this never got applied to drm-misc, and I don’t see it
> anywhere else. I guess it slipped through the cracks ;-)

Yes, I have been busy with a lot of other stuff lately, and cannot
promise when I get back to do Linux work.
So if someone else could pick it up that would be nice.

Sam