Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp733920iol; Thu, 9 Jun 2022 12:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFWmRVYv3luuqDFCPPjX5uyDAlDvIplU0HucYE3SzfBnzHH/1oj87Vt9uJbY96vp4MbW5G X-Received: by 2002:a17:90a:94cb:b0:1e3:4295:9c18 with SMTP id j11-20020a17090a94cb00b001e342959c18mr4804779pjw.53.1654804161025; Thu, 09 Jun 2022 12:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654804161; cv=none; d=google.com; s=arc-20160816; b=T/PWKTgb2UNeVT6cj2ENl3IUuus0J4PUM/3ARwErI3XF20lEajhos0t/WGMw4sjlwK T7Cekl5O3bc7RCpdTAR9YFQ6rY42sp89i+siO9ZRZ4ayMkBDi+Ej0LFRC98nYCw/7kDK 1fKxLgSER/DkheHeYNOoIXJGBGepbkc8MvWEV6e1pzkPwoDiuuy2BufDO9Uy9nsMDokk RxCX3q2rHRQCY/jQVS1IlTDrhUi6tDgA+BkIJiQyC5LE2e0MWQqCvv8FtuRJtsFQFy3U pc8IIU0fQ6t/kvhxNmx9kyNUw2zy4pu3q9ElRbC2KCbyLOimJhUTo4dbQ8aFPu8NCvn0 466w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=jKbDcZ4FhDibO8JxQCv+QTocgVRW/U4XOgTC8XfUUug=; b=rHwflTIPWZwq+2e4qOWal2wj8P8Tx0t3lOhaB/viEBVKNtWBSHhqoyHZZgOK1rje/Z 2GHW8R0ewIiyd48KsLPbWCspZ3vQ8DRhPt9ztTyti3rqyk+DMveuI/VgZunbtWrAdBT2 QL73vFj2tIovCQw/KlAPQCv7T8sdvqytA1rkO5c0638Jnpowy5QoDZGAevW7KP08aYyk LogccqytwGV5xs0I/1WKLRFI3ykqekX0K3tjApUEH1ObbxHaj5+qtL214lvRZadM6J4/ 8WiaGpyukRrQ8P1/oADMXDcXlO7LVk9tTzJRrFUFac2Y3+VeTQY3BZIlRHf6igRcQX+g T7pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=hB40xZ4h; dkim=neutral (no key) header.i=@ravnborg.org; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y72-20020a638a4b000000b003fda87688a9si17622383pgd.589.2022.06.09.12.49.08; Thu, 09 Jun 2022 12:49:21 -0700 (PDT) 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=@ravnborg.org header.s=rsa1 header.b=hB40xZ4h; dkim=neutral (no key) header.i=@ravnborg.org; 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 S1344430AbiFISzq (ORCPT + 99 others); Thu, 9 Jun 2022 14:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234314AbiFISzo (ORCPT ); Thu, 9 Jun 2022 14:55:44 -0400 Received: from mailrelay4-1.pub.mailoutpod1-cph3.one.com (mailrelay4-1.pub.mailoutpod1-cph3.one.com [46.30.210.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439E04F1F9 for ; Thu, 9 Jun 2022 11:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=jKbDcZ4FhDibO8JxQCv+QTocgVRW/U4XOgTC8XfUUug=; b=hB40xZ4hyPPam4Fq/YieoN0twbebpXGTVjxxVs1G+S+8a9iH9D8i0u3i+AMp8/RLibzAcma9Vlt7v VyO6DO4zilHHgBE2VUs2eADzCQ5C/q6dQqPCKNR4iCwX8ge4AdqSQkqi5sSjaapMCA7XLkmGPSY7sW epNdmDZ3KYvcvm5DO25vTWp9w/uRRpcYqwX12wYXCOO/IgXaIwiYYcPBqnB3nKlV9atmQM8kstFqwp tpSeGRj0hDrBQuiizXznNkHJ3TETssMxo//Rk6pbLM7V6caV93KqPdX/yHx3UQPQsKs8o1QtEqdWq7 jjGblP9Qw5uY2Mg3/ncc6DnA2XjU0ag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=jKbDcZ4FhDibO8JxQCv+QTocgVRW/U4XOgTC8XfUUug=; b=h+XYNB6d3kMH4x9JO6z2R7yz+scQXKcFoWGqN5h9JQ+W64bMGdDm5wYYLMKC72jEHdyxVuWYMau7f 8sh55jeCA== X-HalOne-Cookie: b7de46776df3454b5a3e685c6072709fa563f076 X-HalOne-ID: c0b9d5a1-e825-11ec-8231-d0431ea8bb10 Received: from mailproxy3.cst.dirpod4-cph3.one.com (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id c0b9d5a1-e825-11ec-8231-d0431ea8bb10; Thu, 09 Jun 2022 18:55:39 +0000 (UTC) Date: Thu, 9 Jun 2022 20:55:37 +0200 From: Sam Ravnborg To: Stephen Kitt Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Daniel Thompson , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] fbdev: atmel_lcdfb: Rework backlight status updates Message-ID: References: <20220609180440.3138625-1-steve@sk2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609180440.3138625-1-steve@sk2.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Hi Stephen, thanks! On Thu, Jun 09, 2022 at 08:04:40PM +0200, Stephen Kitt wrote: > Instead of checking the state of various backlight_properties fields > against the memorised state in atmel_lcdfb_info.bl_power, > atmel_bl_update_status() should retrieve the desired state using > backlight_get_brightness (which takes into account the power state, > blanking etc.). This means the explicit checks using props.fb_blank > and props.power can be dropped. > > The backlight framework ensures that backlight is never negative, so > the test before reading the brightness from the hardware always ends > up false and the whole block can be removed. The framework retrieves > the brightness from the hardware through atmel_bl_get_brightness() > when necessary. > > As a result, bl_power in struct atmel_lcdfb_info is no longer > necessary, so remove that while we're at it. Since we only ever care > about reading the current state in backlight_properties, drop the > updates at the end of the function. > > Signed-off-by: Stephen Kitt > Cc: Nicolas Ferre > Cc: Helge Deller > Cc: Alexandre Belloni > Cc: Claudiu Beznea > Cc: linux-fbdev@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linux-arm-kernel@lists.infradead.org Acked-by: Sam Ravnborg Sam