From mboxrd@z Thu Jan 1 00:00:00 1970 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 C41D0C433EF for ; Thu, 9 Jun 2022 18:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235822AbiFISzp (ORCPT ); Thu, 9 Jun 2022 14:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbiFISzo (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 439964F1EF 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> Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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