Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4078724rwl; Sat, 7 Jan 2023 10:37:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXu/sFCd5RjrMXJ9FjPkiJH5CqmzjKiUV8fK4ofJJWaOXrlZNK0grSnBzAa0MHq/VBQAIlR4 X-Received: by 2002:a05:6402:5145:b0:475:32d2:7486 with SMTP id n5-20020a056402514500b0047532d27486mr54183867edd.31.1673116633540; Sat, 07 Jan 2023 10:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116633; cv=none; d=google.com; s=arc-20160816; b=hl4oUe9TBPjhCY8R+BQCvZlYklgeGuzT51M6Xhd95kyAjGImis6zYXvihK+eSvr8qk 53Cdt+QXW6airMNZRTKIgqvYeeI3BzrINGHE+T27ejfHFWD8T4BK8NxN2YZnaNM0kbh2 B3avcYINN2fa5tmbS1Sum1hEQnNpYM6Dr9G8PGmck7Mp0XM3VId07etu3wYdKCJ9StLQ zkhWwk2TpT6n7qa3srN6EfmLBFIN/eE8UVR5KmU2v60LQ0iqVasr5ofczQR+O8TaAD7b 1oeKP91I6XUr+EnO13uuJc2I+jiJVPCY7gZHyDIWwbGTXZVgxf4dEXgarzKMoS8FG/4F 2MDA== 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=swA2BpQ13r/Jl07w801NhtxmmtPhRsFMNZ6NwpeFqF8=; b=VgB+PLu8wLVPXpEPNn77TlQ7sLvXQNcGCtNCLHqA4wBImNzKfkdpyQQ8JKCQoyzZaN wRTp4YkdV63YnftAMi7sMHuSrFelIHFBPC/TSIDfcEDlUWg726X41Dxu1yMKUen6Yy2p 6xy97W8otDKd/ZEybT01ik6Dbot7/gZZlaPOp54sOesEVlNWHcxOgFofbGd+53N+3BiL PurojpUefANDhoHPmNrPplkSnt0g/32dDPiRsNm6M9qiYljfotbs+y9C1ay+7eexZ+JR by3GTSMMpE2p/LW0w40vY/1/+JT6YZRLFFRg0VwQ4b1eNizHfPoQKUOKqEpm22Bw7sv+ b/rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HXp0PrAm; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb36-20020a1709076da400b0081feab6d351si5398580ejc.414.2023.01.07.10.37.00; Sat, 07 Jan 2023 10:37:13 -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=HXp0PrAm; 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 S232675AbjAGS03 (ORCPT + 56 others); Sat, 7 Jan 2023 13:26:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbjAGS0X (ORCPT ); Sat, 7 Jan 2023 13:26:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FFDB3F10C; Sat, 7 Jan 2023 10:26:22 -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 F0C5360BAD; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 49F6AC433A0; 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=stKQw4ypuM0c2CGPJsNtwm+f9+XYDr8crV+YAKDS7Qg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HXp0PrAmyat56OZcxRyrQ/u0BelQxizvXcSVJ/N3/uFmiUg6VQTRXJtGXsYB14EHz +nHBE4J5sNIy6jBDIClPyrBAZv3W/RoIFnJbLVPQ7ZAs3VfvliAlE6DuGOKl7zfLq4 44Aif18Fp3M7Ph3Az3wBULTOOFWPfMFSHahDAygGGiAaD97eZnpk68RhtrZLLOzvlV Fx4tAS8UpfshZxo7EQCsGIB068l83dPE5lXJpxr2kxeeQQgEeeOJTWld2h3AY1U/dQ S//nSCeosL5beIgaC+DwF2MMBtoer1V9fbzl7ibWqEo+WbO2HJSpsK4zQDkQ9C2LcC 9dU3qSq2Fb9Tg== 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 399B4C54EBD; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint Date: Sat, 07 Jan 2023 19:26:18 +0100 Subject: [PATCH 04/15] video: fbdev: radeon: 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-4-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 X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1304; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=Go6rR02iCXe+4kQHAFtFCxiJJyvkl/oj7VhzPcU0Z6Y=; =?utf-8?q?b=3DflqgadwX+l3X?= =?utf-8?q?JQBMurYVeZ5lw7jYwnq+fjSaCXLgDVsWCF4QeU+pM/JkNHOUd4eAe48lF762VyAl?= Zy46RGaUDUVM8Rn1neRnITDLjeGxeqHCDC0WSLnf3NCp1XdsYp8r 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: 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: X-Mailing-List: linux-kernel@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: Benjamin Herrenschmidt Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/aty/radeon_backlight.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c index d2c1263ad260..22a39fea7b89 100644 --- a/drivers/video/fbdev/aty/radeon_backlight.c +++ b/drivers/video/fbdev/aty/radeon_backlight.c @@ -54,14 +54,10 @@ static int radeon_bl_update_status(struct backlight_device *bd) return 0; /* We turn off the LCD completely instead of just dimming the - * backlight. This provides some greater power saving and the display - * is useless without backlight anyway. + * backlight if level < 1. This provides some greater power saving + * and the display is useless without backlight anyway. */ - if (bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK) - level = 0; - else - level = bd->props.brightness; + level = backlight_get_brightness(bd); del_timer_sync(&rinfo->lvds_timer); radeon_engine_idle(); -- 2.34.1