Message ID | 20230107-sam-video-backlight-drop-fb_blank-v1-12-1bd9bafb351f@ravnborg.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 p1csp1407032wrt; Sat, 7 Jan 2023 10:28:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvg4tNY0Zz0Y0YNs9tlw9mNC8j7n3+bGj/xei3vEhpJ+a5Q3GeTuV2wNdURSj8Kb51pmEzV X-Received: by 2002:a17:902:f08a:b0:189:efe8:1e with SMTP id p10-20020a170902f08a00b00189efe8001emr56898707pla.68.1673116095480; Sat, 07 Jan 2023 10:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116095; cv=none; d=google.com; s=arc-20160816; b=JacmVCOUFHAOs6Lpx/1bsIZlDDQCPntqaY9dioJgQEi+ELvCyZjTrqBvfrQooxnL4j abx9yr283TQZmRxdSMkctXSGTcSo0Qoq2wVrn3oPEx0yPbP65NOaCz8WPCqSO4iTNXCA x+/Iu8iHDYx9g3gme2tlpts+9jW5Zf8L3sZIvjLswX11kq37JCskwI5Xqerx1hkPQRLc OVETP7oYvZNXKKaqNXDbfOUjzl4eqFRx46T+gSV4YTzDTNwu5hLTfe0T4fqqfRS/cMx5 fbFqCTB24YrufYe+L2N1yBlhdGsQWM4bGjy6nAwFpHcNPnOHoI51JldNHAM55519n1Gf p+9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=EvRH9Y1HBPH2cv0MDlT18FmF4Puw4egsd9d5IWyzqyQ=; b=qSXFO/Lu0+uth9Db8FJHwH21X5ZAlZGU2LDlAnpQftHZ+ZlENxHPQgRhmKA/Z/i5A7 OmCsEBmYyPhc6oXTdE0dAy8g/ebEfy/Q/Yw1XIoYoh9ZsK5cagumq/9UKQpQu3cGpkEe Agh46hMtKzucpVzBESFDQuS+Jbz5qOHOR/x5CCyciy5W3j2VIlVQ4K4HEbOYnk8LaYKh 4XyfQmoNUbjrL7hEZjOffTqLl/yIlZPhmab000FeYAVf8H6GdDov82/E5goDVNeqQOkT Mhnb2H3O1akzPmL+8HRi2ZQyd0m6uDxMxhjTI6SjJyqfag3xfF4mnB0W/Kie7RCgAQU7 Qxfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s2d5eUac; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a170902834900b0018010c3d7e3si2528840pln.404.2023.01.07.10.28.02; Sat, 07 Jan 2023 10:28:15 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s2d5eUac; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234817AbjAGS1Q (ORCPT <rfc822;dolce.eric@gmail.com> + 99 others); Sat, 7 Jan 2023 13:27:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbjAGS0Y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 7 Jan 2023 13:26:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4593FA08; Sat, 7 Jan 2023 10:26:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0DA6760BAF; Sat, 7 Jan 2023 18:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id E7C93C4331F; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673115981; bh=k6GhPkgGzFPXhbpSbgYgfWurCn/PwPN46xikLiDVBGI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=s2d5eUacCnjXmq03ZUK+XQNzk+qYMHUhpitWDD9vRY1/+gN3cnh5gH/smgeRXj+F4 nY3qr4AhGIwfxGxaRbyOgVSz/z+JzDqqzGHD7FWlqsTI4oD+mpVhuAda7fAGZ+W8Ut No1zWZz3JQpUHMZHCIfnp0qNKBOWrISPtMSN7l0Y9C7kJGyAElAXgK2IChEpUVrcYf PDDXiScLEWvM2n1tXgPGhHMYmf/ic+JTvobZEU6b0EXNsz7r9Mjg5KFFnFQDs83Yoq CNvW7VkgZYu/ywR/LHe+a18zS1vnyY4gm9eEoKHTCPXeiaxzz80KSSQjx/8LHCiulz RYljxm6+3xXog== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5B19C54EBD; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> Date: Sat, 07 Jan 2023 19:26:26 +0100 Subject: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230107-sam-video-backlight-drop-fb_blank-v1-12-1bd9bafb351f@ravnborg.org> References: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> In-Reply-To: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> To: Nicolas Ferre <nicolas.ferre@microchip.com>, Helge Deller <deller@gmx.de>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, Antonino Daplas <adaplas@gmail.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Robin van der Gracht <robin@protonic.nl>, Miguel Ojeda <ojeda@kernel.org>, Lee Jones <lee@kernel.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com> Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, Stephen Kitt <steve@sk2.org>, Sam Ravnborg <sam@ravnborg.org>, Geert Uytterhoeven <geert@linux-m68k.org> X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1102; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=kjBoW0w8G4MLxd8tLQs7ggdCYZkvfjXTRMQ+r94GOdY=; =?utf-8?q?b=3D0kWokjMYRuMZ?= =?utf-8?q?fLaCdD4imFEpA4wcUDa+Xj2qmv4HJ40saoFGwVXUtDMJ9OE5NEw8o8Fe16McI0pJ?= f+So/WcWDu7T91QYTw2iTMWidajyr5qNRhSvSdK9HUs9qckprcMR X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Submission Endpoint for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg <sam@ravnborg.org> Reply-To: <sam@ravnborg.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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?1754389382829716485?= X-GMAIL-MSGID: =?utf-8?q?1754389382829716485?= |
Series |
backlight: Drop use of deprecated fb_blank property
|
|
Commit Message
Sam Ravnborg via B4 Relay
Jan. 7, 2023, 6:26 p.m. UTC
From: Sam Ravnborg <sam@ravnborg.org> Introduce backlight_get_brightness() to simplify logic and avoid direct access to backlight properties. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Robin van der Gracht <robin@protonic.nl> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> --- drivers/auxdisplay/ht16k33.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
Comments
On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> 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 <ojeda@kernel.org> Though it would be nice to have Robin test the change. Thanks! [1] https://lore.kernel.org/lkml/20230106143002.1434266-1-steve@sk2.org/ [2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/ Cheers, Miguel
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 > <devnull+sam.ravnborg.org@kernel.org> 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 <ojeda@kernel.org> > > 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/20230106143002.1434266-1-steve@sk2.org/ > [2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/ > > Cheers, > Miguel
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 >> <devnull+sam.ravnborg.org@kernel.org> 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 <ojeda@kernel.org> >> >> 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/0b16391f997e6ed005a326e4e48f2033@protonic.nl/ - Robin
Hi, On Mon, 09 Jan 2023 11:12:02 +0100, Robin van der Gracht <robin@protonic.nl> 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 > >> <devnull+sam.ravnborg.org@kernel.org> 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 <ojeda@kernel.org> > >> > >> 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/0b16391f997e6ed005a326e4e48f2033@protonic.nl/ 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
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 <robin@protonic.nl> > 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 > > >> <devnull+sam.ravnborg.org@kernel.org> 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 <ojeda@kernel.org> > > >> > > >> 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/0b16391f997e6ed005a326e4e48f2033@protonic.nl/ > > 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
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); }