Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4074713rwl; Sat, 7 Jan 2023 10:32:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXso96UqCTwHcrGiBl1u8822VNlnaQfRd1w8ZcVtpiyY0I3SfPrMM0+WBWWjeitZCUgQfS15 X-Received: by 2002:aa7:90c3:0:b0:580:9e9e:c442 with SMTP id k3-20020aa790c3000000b005809e9ec442mr18923466pfk.24.1673116352004; Sat, 07 Jan 2023 10:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116351; cv=none; d=google.com; s=arc-20160816; b=JoHmZCuIUxL2eRQGCWCZDkbcXXnAcQaK3myv+iom9gDXaLobehLcn0wtOkL/MqFOoy NlRuo8xqVAdDMSuMhtsOvDQ1DFOor0xoLcJoeH9zvEi5ub+4461m8t5RA8OwQE9k/SoQ nY2psmX1amHkfO2VSG/4Hck74i0OuAEXwVR4AGQn/qKSyyVmNP2xR4KCZ1E2gbDejUs+ kzotqwzHyuxS3RCOatPngGCEslfPuiLHtkk7zGi5ugaOIaXvfx2jxTeFM0lIGXZIf7Hb 7Uzbcnwt7P0ityJR5uePlMmRyqF562belTHOEhbSutD3ree3hU+Mf36iDTNMMWivKGN+ P/zw== 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=nKeiAgCwg7P9T7GPewDBy+tMEI5B6xIycaLik7TB0Rk=; b=Mi+rUf3ebYFkphsjvKjWM3v3MLWNubGTPr8VTP3HbBB6eAsw0V7qyiC9C4TSQCp2Jq pRovKAOz5abQ09V4KiOV3jKDMJIij7SspKMCcqLjyTonP3hG0YGLo8dV0AYMnptbrTqR dI6Dzri5VGd5n0uswpb+0DDuwJbq+yPVTZ1DEc3a+7f/BQJNvzEfz+8qexqMaYiJ1R+d 4DP9dptsuV1/q3JTgRug8CL8yYMQCHBsuJiS77ET9QBx+XB7GpQdXym/uurm8LFW2jkw 9SC1Q5018PTGxQj+OUwVkZ7SJqySGm4YFOjLdvt4CoEYMfiLVlVRDTZZJkDIlMJk3WGp zqSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sqHpySDJ; 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 b4-20020a056a00114400b00577c17000dasi4823563pfm.166.2023.01.07.10.32.24; Sat, 07 Jan 2023 10:32:31 -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=sqHpySDJ; 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 S232588AbjAGS0Z (ORCPT + 54 others); Sat, 7 Jan 2023 13:26:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjAGS0X (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 3271A37260; 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 CDB2660BAA; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 2B12AC433F1; 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=depPTI0dNs82ApYntY0i9Fl7bNR8n2arzj755GfE+VQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sqHpySDJ4n/IvhYXU+F523jhEHOhqF8OXLnJ1KVhBjw6MsYmVPxBA3GWpI4ZTxX/h 3slaQf4N6FlYYLCMGS6SsHKcFqFm2iQN6yl0+uJ0YJrczFqN/mJdF6Xpq/esTZCiF8 /sJ/XpUSZd5AX2SxI6Ae+AQPJjAmMwG3QEWFxkFxd5BmKij53BVTIXuPVdZLX4Z3M2 ukQRhfuPmhzgFXr511aG/5FcFew0Dd8pkJ+bNkzge2sroS+TIULToXWF9DxidfQpx4 5p04DVFnIXze6NSUxgCCWL97ZOwFRn+IYK5XEcKC2E+qEuU582m5EMDmpiU0XLowFI M+hlRGyJmclow== 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 12A75C63797; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint Date: Sat, 07 Jan 2023 19:26:16 +0100 Subject: [PATCH 02/15] video: fbdev: atyfb: 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-2-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 , Bartlomiej Zolnierkiewicz , Daniel Vetter , Souptick Joarder , Maarten Lankhorst , Jason Yan , Jani Nikula , Arnd Bergmann X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1311; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=/QbAHY615CfNfGpaP64/mhOeeFjzqofmnLkwjP8TdRk=; =?utf-8?q?b=3DpeFAXztHf+aX?= =?utf-8?q?nZ041+ByYlSGJcH0uIKJtmc9ze5LMo7+ev8qRdSy4KAZF/gFoJO2KCg5E2PIfxSr?= qiX2RHJjC5aAXbbBDBuJbQRpdONkZhL0a8wWkB85MFUIRjBShkmE 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: Bartlomiej Zolnierkiewicz Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Souptick Joarder Cc: Maarten Lankhorst Cc: Jason Yan Cc: Jani Nikula Cc: Arnd Bergmann --- drivers/video/fbdev/aty/atyfb_base.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 0ccf5d401ecb..ca361e215904 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2219,13 +2219,7 @@ static int aty_bl_update_status(struct backlight_device *bd) { struct atyfb_par *par = bl_get_data(bd); unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par); - int level; - - if (bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK) - level = 0; - else - level = bd->props.brightness; + int level = backlight_get_brightness(bd); reg |= (BLMOD_EN | BIASMOD_EN); if (level > 0) { -- 2.34.1