Message ID | 20230106143002.1434266-1-steve@sk2.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp873376wrt; Fri, 6 Jan 2023 07:12:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXuRS3a2xq75jN+nWNzhizuzMwwrkzsfC3/BNNyUVjAyJFB1S01EqhTJ0lUmfrbISkVfzrfN X-Received: by 2002:aa7:c053:0:b0:482:e3b9:f46e with SMTP id k19-20020aa7c053000000b00482e3b9f46emr38315564edo.39.1673017950898; Fri, 06 Jan 2023 07:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673017950; cv=none; d=google.com; s=arc-20160816; b=o5bP1OCmt5Z4i9J3sxQqhV1Jk+f4cu118fLN16fCEF3S7U4itCA02fYLfF7l/reUAd 1HXf1TvllSlPEH2QGQAX94qL6v8OyrCIo8LCe5SviMInfLFXTajlXAtRyh7oykUqRe/X G4PgtpveLuGfMTXVmRIciijiHNfCSmhD4kJm0lakiT9TDOFQxOF0w2gAQ6alVMPIhpxu pHIKjBBl1rJqkfEB8dM3/VBUX5GU1nEBExpNkwZBrmvjAuj9EhDFtlf/HFYeKQ9jOiaq FFj5Qm9D5n3cykQKh7/wjGqWbJ/aCwJl71zLVELCyr0QNRMYMvsv6vHt1IcHFinJCQ1y Yzbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cqpfB1Q4iA3dhDrj7wSO+PwOvZCRjy4Ms46Fc4V5jww=; b=Q4enEcm7yA8M7JF0VSFBqo34YGzzHF9Voj3Szna2UjAOGRgnohuPgcf20KQmhNRFoo oIFyGtqR30XF+NdchOmy1axav9GYNHsZT/zEadQUVe38THvZPXTKRGVrEMWKfGCrhkbC SzdEf/SfkHXuiJYQO//LblqpDLHIzf/g9OVfwTLvJbiVujD1EM/f9N2SRo7uPQQfbK04 7YARFB/15GOyRh0vDf/PSdxNotnjZLEoTDQldQMhJ+EWEeUF2sKb1ov28eewtzmy4ImZ YX/zBorbsfxVmvym5dIfGlJzbl8yWDM8/dnAWrJIUfl9kef2bpaDzQ5/KpO/+94JAIZK 8TaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b0046aee4c4ebbsi1458787edv.521.2023.01.06.07.12.06; Fri, 06 Jan 2023 07:12:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233967AbjAFPIS (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Fri, 6 Jan 2023 10:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbjAFPHw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 10:07:52 -0500 X-Greylist: delayed 2230 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 06 Jan 2023 07:07:36 PST Received: from 10.mo575.mail-out.ovh.net (10.mo575.mail-out.ovh.net [46.105.79.203]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514C0777D9 for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 07:07:36 -0800 (PST) Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.146.76]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 272CA25ACD for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 14:30:25 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rqjmb (unknown [10.111.172.194]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 700B11FF2C; Fri, 6 Jan 2023 14:30:24 +0000 (UTC) Received: from sk2.org ([37.59.142.97]) by ghost-submission-6684bf9d7b-rqjmb with ESMTPSA id lBj7FYAwuGPZygAAJ5VTDA (envelope-from <steve@sk2.org>); Fri, 06 Jan 2023 14:30:24 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G0024d129192-3f53-40a5-8aba-33e6275bc708, 9FE29456621203A27B372E1E0503D45BE0167874) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt <steve@sk2.org> To: Robin van der Gracht <robin@protonic.nl>, Miguel Ojeda <ojeda@kernel.org> Cc: Stephen Kitt <steve@sk2.org>, linux-kernel@vger.kernel.org Subject: [PATCH v2] auxdisplay: ht16k33: Use backlight helper Date: Fri, 6 Jan 2023 15:30:01 +0100 Message-Id: <20230106143002.1434266-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3495074787925264091 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrkedtgdeiiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeoshhtvghvvgesshhkvddrohhrgheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754286470898100990?= X-GMAIL-MSGID: =?utf-8?q?1754286470898100990?= |
Series |
[v2] auxdisplay: ht16k33: Use backlight helper
|
|
Commit Message
Stephen Kitt
Jan. 6, 2023, 2:30 p.m. UTC
backlight_properties.fb_blank is deprecated. The states it represents
are handled by other properties; but instead of accessing those
properties directly, drivers should use the helpers provided by
backlight.h.
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.
This means that BL_CORE_SUSPENDED is now taken into account, as it
should be.
Signed-off-by: Stephen Kitt <steve@sk2.org>
---
Notes:
Changes since v1: mention BL_CORE_SUSPENDED.
drivers/auxdisplay/ht16k33.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Comments
On Fri, Jan 6, 2023 at 3:30 PM Stephen Kitt <steve@sk2.org> wrote: > > Changes since v1: mention BL_CORE_SUSPENDED. Thanks Stephen. Robin, it would be great to get your ack/review (or if you can give it a quick test, that would be great too). Cheers, Miguel
On Fri, Jan 6, 2023 at 4:10 PM Stephen Kitt <steve@sk2.org> wrote: > backlight_properties.fb_blank is deprecated. The states it represents > are handled by other properties; but instead of accessing those > properties directly, drivers should use the helpers provided by > backlight.h. > > 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. > > This means that BL_CORE_SUSPENDED is now taken into account, as it > should be. > > Signed-off-by: Stephen Kitt <steve@sk2.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On Sun, Jan 8, 2023 at 11:03 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> This will likely go through drm-misc as part of a bigger series: https://lore.kernel.org/lkml/20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org/ So you may want to copy-paste your tag there. Cheers, Miguel
Hi Miguel, On Sun, Jan 8, 2023 at 3:57 PM Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > On Sun, Jan 8, 2023 at 11:03 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> > > This will likely go through drm-misc as part of a bigger series: > > https://lore.kernel.org/lkml/20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org/ > > So you may want to copy-paste your tag there. Oh, I sent it here because of https://lore.kernel.org/all/Y7qM+ZlG5gQiOW4K@ravnborg.org ? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
On Sun, Jan 8, 2023 at 7:32 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Oh, I sent it here because of > https://lore.kernel.org/all/Y7qM+ZlG5gQiOW4K@ravnborg.org ? Yeah, sorry. I mentioned it just in case, since Sam asked for Robin's Ack in that thread, but I should have probably just Cc'd him here (done!)... Cheers, Miguel
Hi all. On Sun, Jan 08, 2023 at 08:11:52PM +0100, Miguel Ojeda wrote: > On Sun, Jan 8, 2023 at 7:32 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > > Oh, I sent it here because of > > https://lore.kernel.org/all/Y7qM+ZlG5gQiOW4K@ravnborg.org ? > > Yeah, sorry. I mentioned it just in case, since Sam asked for Robin's > Ack in that thread, but I should have probably just Cc'd him here > (done!)... Stephen notified me that the patch is already applied - so no need for anything now. Sorry for the noise! Sam
On Sun, 8 Jan 2023 21:17:43 +0100, Sam Ravnborg <sam@ravnborg.org> wrote: > On Sun, Jan 08, 2023 at 08:11:52PM +0100, Miguel Ojeda wrote: > > On Sun, Jan 8, 2023 at 7:32 PM Geert Uytterhoeven <geert@linux-m68k.org> > > wrote: > > > > > > Oh, I sent it here because of > > > https://lore.kernel.org/all/Y7qM+ZlG5gQiOW4K@ravnborg.org ? > > > > Yeah, sorry. I mentioned it just in case, since Sam asked for Robin's > > Ack in that thread, but I should have probably just Cc'd him here > > (done!)... > > Stephen notified me that the patch is already applied - so no need for > anything now. Sorry for the noise! That was the via-pmu-backlight patch; AFAIK the ht16k33 patch hasn’t been applied anywhere yet. Regards, Stephen
On 2023-01-06 15:30, Stephen Kitt wrote: > backlight_properties.fb_blank is deprecated. The states it represents > are handled by other properties; but instead of accessing those > properties directly, drivers should use the helpers provided by > backlight.h. > > 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. > > This means that BL_CORE_SUSPENDED is now taken into account, as it > should be. > > Signed-off-by: Stephen Kitt <steve@sk2.org> > --- > > Notes: > Changes since v1: mention BL_CORE_SUSPENDED. > > 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); > } Thank you Stephen (and Sam), looks good! Reviewed-by: Robin van der Gracht <robin@protonic.nl>
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); }