From patchwork Sat Jan 7 18:26:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 13092279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82095C54EBD for ; Sat, 7 Jan 2023 18:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232955AbjAGS06 (ORCPT ); Sat, 7 Jan 2023 13:26:58 -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 ); 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 Date: Sat, 07 Jan 2023 19:26:26 +0100 Subject: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness() MIME-Version: 1.0 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 , Helge Deller , Alexandre Belloni , Claudiu Beznea , Antonino Daplas , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Robin van der Gracht , Miguel Ojeda , Lee Jones , Daniel Thompson , Jingoo Han 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 , Sam Ravnborg , Geert Uytterhoeven 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 Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Sam Ravnborg Introduce backlight_get_brightness() to simplify logic and avoid direct access to backlight properties. Signed-off-by: Sam Ravnborg Cc: Robin van der Gracht Cc: Miguel Ojeda Cc: Geert Uytterhoeven --- 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); }