Message ID | 20230107-sam-video-backlight-drop-fb_blank-v1-1-1bd9bafb351f@ravnborg.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1406904wrt; Sat, 7 Jan 2023 10:27:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtoUSk4PkKBOJ7POI4ENIimbOrtCIUmvGolN2rLvx47BYZDghxGkMW0miBE29zFLuwP1ssc X-Received: by 2002:a17:90a:3042:b0:226:c364:2d1d with SMTP id q2-20020a17090a304200b00226c3642d1dmr11473847pjl.41.1673116070391; Sat, 07 Jan 2023 10:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116070; cv=none; d=google.com; s=arc-20160816; b=ORnTgp4YGKA/vv059dncQ2rGdRPQ8QpSHA5nYPYMHy67lUL7JYOO5NO9ho0diXtuvx SYbW6nbRb5KsZM8PgG65ugmUYvyItOkGl4tTtLpwPxWcHmgNewrTpEDcnoEEaVcM3DpD fgxuPpmY6EbI1zudd4KbCYLT9BpXW+wC9jnKT7ibv6s+SXjI6nmOXXIqQ7l3p+AR9ZYY Wn240nzx4CpaSXsfjHFNVhyQWKZ2f/GcNWvJLIm2EJtiVly+FHUuCG1UG7RS23aIeF3a dCwHFjMxr7bKHexRYhceGNKtdqy5QDnPZtxodnX6XQ5F7+T5PlhUdd3pCFBNvfoqXaLQ JhYQ== 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=fnz/t/wHpzNTOF1mGgzXCGhf6h4UYlzAmoY073Z7EQ8=; b=LTh9XvZ3C5CCN6H3Bduc1ThA1X0HhrLY5YvyZy5kvPMO9BrLvnEH8il3QfsIAhG1vl RHBZHL3jBn1w+MqLYQ3ks57AbZbo885hAozAU+g0XndfWhiYYz0GlSu3BndgdwhTXDW0 DdM2lDtE5Ki4YKnQsbHra2lLqA/8Taj1eXP8hHdsslSmBID1ICef4qE7aVBNVRQg1ZPC T6fJ7/t5jM0Zrkiy8yz2qRwjMTvlZy++DgFujr3NYWTxBwBHbGV18UMQeegXm2YB/bDb swDO0bwiHb1XR03ENxmOkYz/ONwYPeTBfx7I33/gVvOvg6475RvHqbuUc4+piTgH0fgQ UJYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rlMftI1J; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a17090a6b0b00b00209a3e49f63si7927182pjj.94.2023.01.07.10.27.38; Sat, 07 Jan 2023 10:27:50 -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=rlMftI1J; 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 S232937AbjAGS06 (ORCPT <rfc822;dolce.eric@gmail.com> + 99 others); Sat, 7 Jan 2023 13:26:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbjAGS0Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 7 Jan 2023 13:26:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57AF73FA25; 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 ams.source.kernel.org (Postfix) with ESMTPS id 71F18B8047E; Sat, 7 Jan 2023 18:26:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 15737C433F0; 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=2NgRSukIsXpmr4ezznzNGR723w5oZTyOcLNPLclIT8w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rlMftI1JL5hJ/vKUK6hgp9gjqtc3W7HcF+9QURm5qT53z5i/VXxG69OkwpfgZGbTR ZVpNJGFKTfRa8zjCHKjYYcs7m7TmL7OEfI7xyG9CsORNNiOvUsNUjEI7IXpd05JSHG YTt3BDLf1OGm6npZG9f0n1bFdbh0u/PprR0zcYL/enO+X84iEaGLlAktqThawoxhkj /R/4nBSt0qLZJ/AU5ssdZjnZKdozQqiZtjlXmta12H7oTa7Oqfbenh8YDkr2AnwMfK AzuPmmFgkbijCVt5UPeuA+6c0oh4f6aexZ0PqPZi2LyYYJVIfTWVwsKXqjoFJWGH7e v5dB2Z0T0y+iA== 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 EB3F6C54EBC; Sat, 7 Jan 2023 18:26:20 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> Date: Sat, 07 Jan 2023 19:26:15 +0100 Subject: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling 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-1-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 <nicolas.ferre@microchip.com>, Helge Deller <deller@gmx.de>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, Antonino Daplas <adaplas@gmail.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Robin van der Gracht <robin@protonic.nl>, Miguel Ojeda <ojeda@kernel.org>, Lee Jones <lee@kernel.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com> 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 <steve@sk2.org>, Sam Ravnborg <sam@ravnborg.org>, Ludovic Desroches <ludovic.desroches@microchip.com> X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=2641; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=00kGRCWi8cuXpKBxkvC737vLzE0DLWF6H/syUZozYj0=; =?utf-8?q?b=3Dn0gLcHxryjYg?= =?utf-8?q?M/3rj8DxmkGGgj+kqUIxzuWt9FYoauHAwjD31UB8ShIRk/2wtjXq9fNHAF2YAhlJ?= YGxA/gk7AfjT/Ak1jBRmIYhfO1fh+3b+KaplQZMvBeYtU5vrsyPE 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 <sam@ravnborg.org> Reply-To: <sam@ravnborg.org> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754389356170514481?= X-GMAIL-MSGID: =?utf-8?q?1754389356170514481?= |
Series |
backlight: Drop use of deprecated fb_blank property
|
|
Commit Message
Sam Ravnborg via B4 Relay
Jan. 7, 2023, 6:26 p.m. UTC
From: Sam Ravnborg <sam@ravnborg.org> The atmel_lcdfb had code to save/restore power state. This is not needed so drop it. Introduce backlight_is_brightness() to make logic simpler. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Cc: linux-fbdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org --- drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-)
Comments
On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: >From: Sam Ravnborg <sam@ravnborg.org> > >The atmel_lcdfb had code to save/restore power state. >This is not needed so drop it. > >Introduce backlight_is_brightness() to make logic simpler. > >Signed-off-by: Sam Ravnborg <sam@ravnborg.org> >Cc: Nicolas Ferre <nicolas.ferre@microchip.com> >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> >Cc: Ludovic Desroches <ludovic.desroches@microchip.com> >Cc: linux-fbdev@vger.kernel.org >Cc: linux-arm-kernel@lists.infradead.org >--- > drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- > 1 file changed, 3 insertions(+), 21 deletions(-) > >diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c >index 1fc8de4ecbeb..d297b3892637 100644 >--- a/drivers/video/fbdev/atmel_lcdfb.c >+++ b/drivers/video/fbdev/atmel_lcdfb.c >@@ -49,7 +49,6 @@ struct atmel_lcdfb_info { > struct clk *lcdc_clk; > > struct backlight_device *backlight; >- u8 bl_power; > u8 saved_lcdcon; > > u32 pseudo_palette[16]; >@@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 > static int atmel_bl_update_status(struct backlight_device *bl) > { > struct atmel_lcdfb_info *sinfo = bl_get_data(bl); >- int power = sinfo->bl_power; >- int brightness = bl->props.brightness; >+ int brightness; > >- /* REVISIT there may be a meaningful difference between >- * fb_blank and power ... there seem to be some cases >- * this doesn't handle correctly. >- */ >- if (bl->props.fb_blank != sinfo->bl_power) >- power = bl->props.fb_blank; >- else if (bl->props.power != sinfo->bl_power) >- power = bl->props.power; >- >- if (brightness < 0 && power == FB_BLANK_UNBLANK) >- brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); >- else if (power != FB_BLANK_UNBLANK) >- brightness = 0; >+ brightness = backlight_get_brightness(bl); > > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); >+ > if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE) > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, > brightness ? contrast_ctr : 0); > else > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); > >- bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; >- > return 0; > } > >@@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) > struct backlight_properties props; > struct backlight_device *bl; > >- sinfo->bl_power = FB_BLANK_UNBLANK; >- > if (sinfo->backlight) > return; > >@@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) > sinfo->backlight = bl; > > bl->props.power = FB_BLANK_UNBLANK; >- bl->props.fb_blank = FB_BLANK_UNBLANK; > bl->props.brightness = atmel_bl_get_brightness(bl); > } > > Hi Sam, I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use. Regards, Stephen
Hi Stephen. On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: > On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: > >From: Sam Ravnborg <sam@ravnborg.org> > > > >The atmel_lcdfb had code to save/restore power state. > >This is not needed so drop it. > > > >Introduce backlight_is_brightness() to make logic simpler. > > > >Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > >Cc: Nicolas Ferre <nicolas.ferre@microchip.com> > >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > >Cc: Ludovic Desroches <ludovic.desroches@microchip.com> > >Cc: linux-fbdev@vger.kernel.org > >Cc: linux-arm-kernel@lists.infradead.org > >--- > > drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- > > 1 file changed, 3 insertions(+), 21 deletions(-) ... > > Hi Sam, > > I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use. The patches from yesterday was what triggered me to resurrect an old branch of mine where I had done something similar. I had lost all memory of reviewing similar patches from you. Helge - could you pick the reviewed patches from: https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ [This is the same mail as Stephen refer to above - looked up via lore]. Stephen - I expect Daniel/Lee to take care of the patches from yesterday. If you can look up other pending patches from you please do so, so we can have them applied. Preferably with links to lore - as this makes it easier to apply them. Review of what is unique in this set would be appreciated. Sam
On 7 January 2023 21:53:46 CET, Sam Ravnborg <sam@ravnborg.org> wrote: >Hi Stephen. > >On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: >> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: >> >From: Sam Ravnborg <sam@ravnborg.org> >> > >> >The atmel_lcdfb had code to save/restore power state. >> >This is not needed so drop it. >> > >> >Introduce backlight_is_brightness() to make logic simpler. >> > >> >Signed-off-by: Sam Ravnborg <sam@ravnborg.org> >> >Cc: Nicolas Ferre <nicolas.ferre@microchip.com> >> >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> >> >Cc: Ludovic Desroches <ludovic.desroches@microchip.com> >> >Cc: linux-fbdev@vger.kernel.org >> >Cc: linux-arm-kernel@lists.infradead.org >> >--- >> > drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- >> > 1 file changed, 3 insertions(+), 21 deletions(-) >... >> >> Hi Sam, >> >> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use. > >The patches from yesterday was what triggered me to resurrect an old >branch of mine where I had done something similar. I had lost all >memory of reviewing similar patches from you. > > >Helge - could you pick the reviewed patches from: >https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ >[This is the same mail as Stephen refer to above - looked up via lore]. > >Stephen - I expect Daniel/Lee to take care of the patches from yesterday. >If you can look up other pending patches from you please do so, so we >can have them applied. >Preferably with links to lore - as this makes it easier to apply them. > >Review of what is unique in this set would be appreciated. > > Sam Hi Sam, Here are my pending patches from last June on lore: * https://lore.kernel.org/lkml/20220607190925.1134737-1-steve@sk2.org/ * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/ * https://lore.kernel.org/lkml/20220607192335.1137249-1-steve@sk2.org/ * https://lore.kernel.org/lkml/20220616170425.1346081-1-steve@sk2.org/ I’ll send reviews of your other patches later today or tomorrow. Regards, Stephen
On 8 January 2023 08:45:46 CET, Stephen Kitt <steve@sk2.org> wrote: >On 7 January 2023 21:53:46 CET, Sam Ravnborg <sam@ravnborg.org> wrote: >>Hi Stephen. >> >>On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: >>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: >>> >From: Sam Ravnborg <sam@ravnborg.org> >>> > >>> >The atmel_lcdfb had code to save/restore power state. >>> >This is not needed so drop it. >>> > >>> >Introduce backlight_is_brightness() to make logic simpler. >>> > >>> >Signed-off-by: Sam Ravnborg <sam@ravnborg.org> >>> >Cc: Nicolas Ferre <nicolas.ferre@microchip.com> >>> >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> >>> >Cc: Ludovic Desroches <ludovic.desroches@microchip.com> >>> >Cc: linux-fbdev@vger.kernel.org >>> >Cc: linux-arm-kernel@lists.infradead.org >>> >--- >>> > drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- >>> > 1 file changed, 3 insertions(+), 21 deletions(-) >>... >>> >>> Hi Sam, >>> >>> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use. >> >>The patches from yesterday was what triggered me to resurrect an old >>branch of mine where I had done something similar. I had lost all >>memory of reviewing similar patches from you. >> >> >>Helge - could you pick the reviewed patches from: >>https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ >>[This is the same mail as Stephen refer to above - looked up via lore]. >> >>Stephen - I expect Daniel/Lee to take care of the patches from yesterday. >>If you can look up other pending patches from you please do so, so we >>can have them applied. >>Preferably with links to lore - as this makes it easier to apply them. >> >>Review of what is unique in this set would be appreciated. >> >> Sam > >Hi Sam, > >Here are my pending patches from last June on lore: > >* https://lore.kernel.org/lkml/20220607190925.1134737-1-steve@sk2.org/ >* https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/ >* https://lore.kernel.org/lkml/20220607192335.1137249-1-steve@sk2.org/ >* https://lore.kernel.org/lkml/20220616170425.1346081-1-steve@sk2.org/ > >I’ll send reviews of your other patches later today or tomorrow. > >Regards, > >Stephen And the auxdisplay patch, v1: https://lore.kernel.org/lkml/20220607180406.1116277-1-steve@sk2.org/ and v2: https://lore.kernel.org/lkml/20230106143002.1434266-1-steve@sk2.org/ Regards, Stephen
On 1/7/23 21:53, Sam Ravnborg wrote: > Hi Stephen. > > On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: >> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: >>> From: Sam Ravnborg <sam@ravnborg.org> >>> >>> The atmel_lcdfb had code to save/restore power state. >>> This is not needed so drop it. >>> >>> Introduce backlight_is_brightness() to make logic simpler. >>> >>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> >>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> >>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> >>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> >>> Cc: linux-fbdev@vger.kernel.org >>> Cc: linux-arm-kernel@lists.infradead.org >>> --- >>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- >>> 1 file changed, 3 insertions(+), 21 deletions(-) > ... >> >> Hi Sam, >> >> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use. > > The patches from yesterday was what triggered me to resurrect an old > branch of mine where I had done something similar. I had lost all > memory of reviewing similar patches from you. > > > Helge - could you pick the reviewed patches from: > https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ > [This is the same mail as Stephen refer to above - looked up via lore]. I just pulled those 7 patches into fbdev/for-next. If you need more, please let me know, Thanks! Helge > > Stephen - I expect Daniel/Lee to take care of the patches from yesterday. > If you can look up other pending patches from you please do so, so we > can have them applied. > Preferably with links to lore - as this makes it easier to apply them. > > Review of what is unique in this set would be appreciated. > > Sam
Hi Stephen. > Here are my pending patches from last June on lore: > All patches are handled I think except this: > * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/ Can I ask you to drop the assignment that is not needed, and resend with the collected acks/r-b. With this, then all fbdev patches are handled. Sam
Hi Helge, > > > > Helge - could you pick the reviewed patches from: > > https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ > > [This is the same mail as Stephen refer to above - looked up via lore]. > > I just pulled those 7 patches into fbdev/for-next. > If you need more, please let me know, Thanks, we have one pending patch for atmel_lcdfb, but it need a small adjustment before it is ready. With this all fbdev drivers have the backlight_properties.fb_blank removed. Sam
On Sat, 07 Jan 2023, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: > From: Sam Ravnborg <sam@ravnborg.org> > > The atmel_lcdfb had code to save/restore power state. > This is not needed so drop it. > > Introduce backlight_is_brightness() to make logic simpler. backlight_is_brightness? BR, Jani. > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: Ludovic Desroches <ludovic.desroches@microchip.com> > Cc: linux-fbdev@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- > 1 file changed, 3 insertions(+), 21 deletions(-) > > diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c > index 1fc8de4ecbeb..d297b3892637 100644 > --- a/drivers/video/fbdev/atmel_lcdfb.c > +++ b/drivers/video/fbdev/atmel_lcdfb.c > @@ -49,7 +49,6 @@ struct atmel_lcdfb_info { > struct clk *lcdc_clk; > > struct backlight_device *backlight; > - u8 bl_power; > u8 saved_lcdcon; > > u32 pseudo_palette[16]; > @@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 > static int atmel_bl_update_status(struct backlight_device *bl) > { > struct atmel_lcdfb_info *sinfo = bl_get_data(bl); > - int power = sinfo->bl_power; > - int brightness = bl->props.brightness; > + int brightness; > > - /* REVISIT there may be a meaningful difference between > - * fb_blank and power ... there seem to be some cases > - * this doesn't handle correctly. > - */ > - if (bl->props.fb_blank != sinfo->bl_power) > - power = bl->props.fb_blank; > - else if (bl->props.power != sinfo->bl_power) > - power = bl->props.power; > - > - if (brightness < 0 && power == FB_BLANK_UNBLANK) > - brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); > - else if (power != FB_BLANK_UNBLANK) > - brightness = 0; > + brightness = backlight_get_brightness(bl); > > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); > + > if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE) > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, > brightness ? contrast_ctr : 0); > else > lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); > > - bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; > - > return 0; > } > > @@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) > struct backlight_properties props; > struct backlight_device *bl; > > - sinfo->bl_power = FB_BLANK_UNBLANK; > - > if (sinfo->backlight) > return; > > @@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) > sinfo->backlight = bl; > > bl->props.power = FB_BLANK_UNBLANK; > - bl->props.fb_blank = FB_BLANK_UNBLANK; > bl->props.brightness = atmel_bl_get_brightness(bl); > }
Hi Sam, On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg <sam@ravnborg.org> wrote: > > Here are my pending patches from last June on lore: > > > > All patches are handled I think except this: > > * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/ > > Can I ask you to drop the assignment that is not needed, and resend with > the collected acks/r-b. > > With this, then all fbdev patches are handled. Ah yes, it was revised as https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/ which only got one ack (from you, https://lore.kernel.org/lkml/YqJCKQmQEuVsbspK@ravnborg.org/). Should I resend that or is that usable as-is? Or would it be better if I sent all the fbdev patches again (collecting all the acks and reviews)? Regards, Stephen
On Mon, 9 Jan 2023 20:53:44 +0100, Stephen Kitt <steve@sk2.org> wrote: > On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg <sam@ravnborg.org> wrote: > > > Here are my pending patches from last June on lore: > > > > > > > All patches are handled I think except this: > > > * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/ > > > > > > > Can I ask you to drop the assignment that is not needed, and resend with > > the collected acks/r-b. > > > > With this, then all fbdev patches are handled. > > Ah yes, it was revised as > https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/ which > only got one ack (from you, > https://lore.kernel.org/lkml/YqJCKQmQEuVsbspK@ravnborg.org/). Should I > resend that or is that usable as-is? Or would it be better if I sent all the > fbdev patches again (collecting all the acks and reviews)? Since the others are already in fbdev/for-next, I’ve just resent v2 of this patch with your ack. Regards, Stephen
On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller <deller@gmx.de> wrote: > On 1/7/23 21:53, Sam Ravnborg wrote: > > Hi Stephen. > > > > On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: > >> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint > >> <devnull+sam.ravnborg.org@kernel.org> wrote: > >>> From: Sam Ravnborg <sam@ravnborg.org> > >>> > >>> The atmel_lcdfb had code to save/restore power state. > >>> This is not needed so drop it. > >>> > >>> Introduce backlight_is_brightness() to make logic simpler. > >>> > >>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > >>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> > >>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > >>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> > >>> Cc: linux-fbdev@vger.kernel.org > >>> Cc: linux-arm-kernel@lists.infradead.org > >>> --- > >>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- > >>> 1 file changed, 3 insertions(+), 21 deletions(-) > > ... > >> > >> Hi Sam, > >> > >> I’d submitted quite a few more of these previously (and you’d reviewed > >> them), see e.g. the thread starting at > >> https://lkml.org/lkml/2022/6/7/4365, and yesterday, > >> https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, > >> https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, > >> and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find > >> them if it’s any use. > > > > The patches from yesterday was what triggered me to resurrect an old > > branch of mine where I had done something similar. I had lost all > > memory of reviewing similar patches from you. > > > > > > Helge - could you pick the reviewed patches from: > > https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ > > [This is the same mail as Stephen refer to above - looked up via lore]. > > I just pulled those 7 patches into fbdev/for-next. > If you need more, please let me know, Please pull https://lore.kernel.org/lkml/20230109200239.1850611-1-steve@sk2.org/ too, it completes the fbdev set. (It’s a re-send of https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/). Thanks, Stephen
On 1/9/23 21:18, Stephen Kitt wrote: > On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller <deller@gmx.de> wrote: > >> On 1/7/23 21:53, Sam Ravnborg wrote: >>> Hi Stephen. >>> >>> On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: >>>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint >>>> <devnull+sam.ravnborg.org@kernel.org> wrote: >>>>> From: Sam Ravnborg <sam@ravnborg.org> >>>>> >>>>> The atmel_lcdfb had code to save/restore power state. >>>>> This is not needed so drop it. >>>>> >>>>> Introduce backlight_is_brightness() to make logic simpler. >>>>> >>>>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> >>>>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> >>>>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> >>>>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> >>>>> Cc: linux-fbdev@vger.kernel.org >>>>> Cc: linux-arm-kernel@lists.infradead.org >>>>> --- >>>>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++--------------------- >>>>> 1 file changed, 3 insertions(+), 21 deletions(-) >>> ... >>>> >>>> Hi Sam, >>>> >>>> I’d submitted quite a few more of these previously (and you’d reviewed >>>> them), see e.g. the thread starting at >>>> https://lkml.org/lkml/2022/6/7/4365, and yesterday, >>>> https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, >>>> https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, >>>> and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find >>>> them if it’s any use. >>> >>> The patches from yesterday was what triggered me to resurrect an old >>> branch of mine where I had done something similar. I had lost all >>> memory of reviewing similar patches from you. >>> >>> >>> Helge - could you pick the reviewed patches from: >>> https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/ >>> [This is the same mail as Stephen refer to above - looked up via lore]. >> >> I just pulled those 7 patches into fbdev/for-next. >> If you need more, please let me know, > > Please pull > https://lore.kernel.org/lkml/20230109200239.1850611-1-steve@sk2.org/ too, it > completes the fbdev set. (It’s a re-send of > https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/). Done. Thanks! Helge
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 1fc8de4ecbeb..d297b3892637 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -49,7 +49,6 @@ struct atmel_lcdfb_info { struct clk *lcdc_clk; struct backlight_device *backlight; - u8 bl_power; u8 saved_lcdcon; u32 pseudo_palette[16]; @@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8 static int atmel_bl_update_status(struct backlight_device *bl) { struct atmel_lcdfb_info *sinfo = bl_get_data(bl); - int power = sinfo->bl_power; - int brightness = bl->props.brightness; + int brightness; - /* REVISIT there may be a meaningful difference between - * fb_blank and power ... there seem to be some cases - * this doesn't handle correctly. - */ - if (bl->props.fb_blank != sinfo->bl_power) - power = bl->props.fb_blank; - else if (bl->props.power != sinfo->bl_power) - power = bl->props.power; - - if (brightness < 0 && power == FB_BLANK_UNBLANK) - brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); - else if (power != FB_BLANK_UNBLANK) - brightness = 0; + brightness = backlight_get_brightness(bl); lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness); + if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE) lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, brightness ? contrast_ctr : 0); else lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr); - bl->props.fb_blank = bl->props.power = sinfo->bl_power = power; - return 0; } @@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) struct backlight_properties props; struct backlight_device *bl; - sinfo->bl_power = FB_BLANK_UNBLANK; - if (sinfo->backlight) return; @@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) sinfo->backlight = bl; bl->props.power = FB_BLANK_UNBLANK; - bl->props.fb_blank = FB_BLANK_UNBLANK; bl->props.brightness = atmel_bl_get_brightness(bl); }