Message ID | 20230107-sam-video-backlight-drop-fb_blank-v1-9-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 p1csp1406977wrt; Sat, 7 Jan 2023 10:28:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2bqQrOIqQBex79vGtOyJGc4DaL3M3oTI+BpDQXRJ9TjKAfmaq7U38PQfm8myvdQ8d8OCz X-Received: by 2002:a17:90a:fb4b:b0:225:e99e:e37d with SMTP id iq11-20020a17090afb4b00b00225e99ee37dmr47747614pjb.40.1673116085519; Sat, 07 Jan 2023 10:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116085; cv=none; d=google.com; s=arc-20160816; b=z2D1PonP9CJe74xGINZ+tWun2LxxNGmIUPPwhwI+IrqhxsRe5Aqy0U0XHS0m+WlTW9 UJ9pJcElWICxSonuZMYmD6+V+jOcFJ1l5jdRck1kxZjieqU+02PIrXoQ4K2Zqgnk1Oot Zdx3D7+SIkHA236cgE/i1JZPi8azVjZOnG5bfTloPY5FQKZskN1yFmyJgQStJ3ydw2XI nGnwOO/hquDuvb2gjwOxo96C/LiAJsmS1JG1h0kgGjZI/tHeIgh/hsEUETQe/QfXQskR YmtVDZMjjLe8r3CmPI0CpDSr+nmVnOBHwqqz5FDGOT18TmAkds3sNVKIF2KPnqAvSoHv sVmQ== 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=b+Dy+HUfiPVI8QvkiiFZhDot2+DEC/Dup3gWn9iKNdM=; b=GRHKolOhQbPc9UoZemH+88/zLFV8Vobdqwtmv9xwB285j4sHwvCyxXCt+g8Jx/QYt0 SluTxY7cTZpJdHYaIdauZTJvrMZiSJohhralIo7mKsDa4KI8CazR3sex+cZg5wOFMeeR wP+y0QGr120yKMUnttUKFUS1v6NqXmUL47EuOqbLrjtWbujVzoIhwMpof8cbe97CqNLY ARdtksUIvC85y2CrDJlbO73Bv1Ssf9vagDEMzFD5GsyZtIRqqf7GX5UhAJ0w94NGAGIO /LdEGhhk0AdGkKerD0xMEIQ4XB/Rfl46rY+5e6OXBWfryG3qKqq5zTnLrR3Id98zKYRi g/Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ibafoQF9; 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 m9-20020a17090a2c0900b0022645e2a88csi4325336pjd.56.2023.01.07.10.27.53; Sat, 07 Jan 2023 10:28:05 -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=ibafoQF9; 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 S233006AbjAGS1M (ORCPT <rfc822;dolce.eric@gmail.com> + 99 others); Sat, 7 Jan 2023 13:27:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbjAGS0Y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 7 Jan 2023 13:26:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340D43F13B; 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9364360B9B; Sat, 7 Jan 2023 18:26:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B24DAC43445; 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=FpJgYKX0WvqOM6qXNZm3orw83KtE8CnVdKskuu7Bxj8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ibafoQF9RQ0654p7+XrOtYyy0N7e1+Wqbgurr/s3R0c31xlvWMaiv1rE43GmUD0ax 1uKtvH80Di1rpSHQJe+XRgjTJHrofPadAh/ODHSirpNZAFmmMTVoFeMkhMqF2M+/Qu WixKllalmm7bZbY2IRu/nqJzf6pqWuaniQUtGDhj54eKNMlAEYrq6fZ1KlFl1OT+YX VlpA1g/VS6yYLtn1NxEKn3c6ox3/JuoX4jCkSLY1e0Gw/W5jtHzqrJqEjbuhLSPnHx vYPFsreIQl0LgDBkgFOOLtrp9vDAjIyfpPUWOJji2EM4Q4MDv7NkHov4t04dpqNoph XMqhiOwWLdVzg== 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 9DC36C63797; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> Date: Sat, 07 Jan 2023 19:26:23 +0100 Subject: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() 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-9-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>, Andy Shevchenko <andriy.shevchenko@linux.intel.com> X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1470; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=G6rOZdtEwpeQEO+0r3oVVgedO7Rz1feTEQR8eX27nq4=; =?utf-8?q?b=3D+S7h4F0wUNPp?= =?utf-8?q?/JDzVLZhorRrHoeXoMU92DpeyUhmf+Ru9VbwxZ4HQL+EQ45PgrZJYvAfns99nGaz?= +nssZXN1Aj803PnEukV8/v1tXrrRhgpXnDQN/jH9brZR1cK2eNGw 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?1754389372580953717?= X-GMAIL-MSGID: =?utf-8?q?1754389372580953717?= |
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> Avoiding direct access to backlight_properties.props. Access to the deprecated props.fb_blank replaced by backlight_is_blank(). Access to props.power is dropped - it was only used for debug. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Stephen Kitt <steve@sk2.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-fbdev@vger.kernel.org --- drivers/staging/fbtft/fb_ssd1351.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Comments
On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: > From: Sam Ravnborg <sam@ravnborg.org> > > Avoiding direct access to backlight_properties.props. > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > Access to props.power is dropped - it was only used for debug. > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > Cc: Stephen Kitt <steve@sk2.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Daniel Thompson <daniel.thompson@linaro.org> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Cc: linux-fbdev@vger.kernel.org > --- > drivers/staging/fbtft/fb_ssd1351.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644 > --- a/drivers/staging/fbtft/fb_ssd1351.c > +++ b/drivers/staging/fbtft/fb_ssd1351.c > @@ -190,15 +190,12 @@ static struct fbtft_display display = { > static int update_onboard_backlight(struct backlight_device *bd) > { > struct fbtft_par *par = bl_get_data(bd); > - bool on; > + bool blank = backlight_is_blank(bd); > > - fbtft_par_dbg(DEBUG_BACKLIGHT, par, > - "%s: power=%d, fb_blank=%d\n", > - __func__, bd->props.power, bd->props.fb_blank); > + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, > blank); > - on = !backlight_is_blank(bd); > /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ > - write_reg(par, 0xB5, on ? 0x03 : 0x02); > + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); > > return 0; > } > > -- > 2.34.1 For debugging purposes here, would there be any point in logging props.state? As in fbtft_par_dbg(DEBUG_BACKLIGHT, par, - "%s: power=%d, fb_blank=%d\n", - __func__, bd->props.power, bd->props.fb_blank); + "%s: power=%d, state=%u\n", + __func__, bd->props.power, bd->props.state); In any case, Reviewed-by: Stephen Kitt <steve@sk2.org> Regards, Stephen
Hi Stephen, On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote: > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint > <devnull+sam.ravnborg.org@kernel.org> wrote: > > > From: Sam Ravnborg <sam@ravnborg.org> > > > > Avoiding direct access to backlight_properties.props. > > > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > > Access to props.power is dropped - it was only used for debug. > > > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > > Cc: Stephen Kitt <steve@sk2.org> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Cc: linux-fbdev@vger.kernel.org > > --- > > drivers/staging/fbtft/fb_ssd1351.c | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c > > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644 > > --- a/drivers/staging/fbtft/fb_ssd1351.c > > +++ b/drivers/staging/fbtft/fb_ssd1351.c > > @@ -190,15 +190,12 @@ static struct fbtft_display display = { > > static int update_onboard_backlight(struct backlight_device *bd) > > { > > struct fbtft_par *par = bl_get_data(bd); > > - bool on; > > + bool blank = backlight_is_blank(bd); > > > > - fbtft_par_dbg(DEBUG_BACKLIGHT, par, > > - "%s: power=%d, fb_blank=%d\n", > > - __func__, bd->props.power, bd->props.fb_blank); > > + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, > > blank); > > - on = !backlight_is_blank(bd); > > /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ > > - write_reg(par, 0xB5, on ? 0x03 : 0x02); > > + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); > > > > return 0; > > } > > > > -- > > 2.34.1 > > For debugging purposes here, would there be any point in logging props.state? > As in > > fbtft_par_dbg(DEBUG_BACKLIGHT, par, > - "%s: power=%d, fb_blank=%d\n", > - __func__, bd->props.power, bd->props.fb_blank); > + "%s: power=%d, state=%u\n", > + __func__, bd->props.power, bd->props.state); Thanks for the suggestion - and the reviews! I was tempted to just remove the debugging. If we require debugging, then this could be added in the backlight core, thus everyone would benefit from it. The solution above avoid any direct use of backlight_properties which I consider a layer violation outside the backlight core. (We cannot avoid it today with the current interface - but we can minimize it). Sam
Hi Sam, On Sun, 8 Jan 2023 21:29:43 +0100, Sam Ravnborg <sam@ravnborg.org> wrote: > On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote: > > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission > > Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote: > > > > > From: Sam Ravnborg <sam@ravnborg.org> > > > > > > Avoiding direct access to backlight_properties.props. > > > > > > Access to the deprecated props.fb_blank replaced by > > > backlight_is_blank(). Access to props.power is dropped - it was only > > > used for debug. > > > > > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > > > Cc: Stephen Kitt <steve@sk2.org> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > Cc: linux-fbdev@vger.kernel.org > > > --- > > > drivers/staging/fbtft/fb_ssd1351.c | 9 +++------ > > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c > > > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 > > > 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c > > > +++ b/drivers/staging/fbtft/fb_ssd1351.c > > > @@ -190,15 +190,12 @@ static struct fbtft_display display = { > > > static int update_onboard_backlight(struct backlight_device *bd) > > > { > > > struct fbtft_par *par = bl_get_data(bd); > > > - bool on; > > > + bool blank = backlight_is_blank(bd); > > > > > > - fbtft_par_dbg(DEBUG_BACKLIGHT, par, > > > - "%s: power=%d, fb_blank=%d\n", > > > - __func__, bd->props.power, bd->props.fb_blank); > > > + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, > > > blank); > > > - on = !backlight_is_blank(bd); > > > /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 > > > unused */ > > > - write_reg(par, 0xB5, on ? 0x03 : 0x02); > > > + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); > > > > > > return 0; > > > } > > > > > > -- > > > 2.34.1 > > > > For debugging purposes here, would there be any point in logging > > props.state? As in > > > > fbtft_par_dbg(DEBUG_BACKLIGHT, par, > > - "%s: power=%d, fb_blank=%d\n", > > - __func__, bd->props.power, bd->props.fb_blank); > > + "%s: power=%d, state=%u\n", > > + __func__, bd->props.power, bd->props.state); > > Thanks for the suggestion - and the reviews! > > I was tempted to just remove the debugging. > If we require debugging, then this could be added in the backlight core, > thus everyone would benefit from it. > > The solution above avoid any direct use of backlight_properties > which I consider a layer violation outside the backlight core. > (We cannot avoid it today with the current interface - but we can > minimize it). Ah yes, ideally backlight_properties should be viewed as an opaque structure, that makes sense. Regards, Stephen
On Sat, Jan 07, 2023 at 07:26:23PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg <sam@ravnborg.org> > > Avoiding direct access to backlight_properties.props. > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > Access to props.power is dropped - it was only used for debug. > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > Cc: Stephen Kitt <steve@sk2.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Daniel Thompson <daniel.thompson@linaro.org> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Cc: linux-fbdev@vger.kernel.org Not sure why you have this (at least) explicitly mentioned as get_maintainer.pl can generate it and git send-email can utilize the script output... ... > - write_reg(par, 0xB5, on ? 0x03 : 0x02); > + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); Why not positive conditional? write_reg(par, 0xB5, blank ? 0x02 : 0x03);
On Sun, Jan 08, 2023 at 09:29:43PM +0100, Sam Ravnborg wrote: > Hi Stephen, > > On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote: > > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint > > <devnull+sam.ravnborg.org@kernel.org> wrote: > > > > > From: Sam Ravnborg <sam@ravnborg.org> > > > > > > Avoiding direct access to backlight_properties.props. > > > > > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > > > Access to props.power is dropped - it was only used for debug. > > > > > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org> > > > Cc: Stephen Kitt <steve@sk2.org> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > > Cc: Daniel Thompson <daniel.thompson@linaro.org> > > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > Cc: linux-fbdev@vger.kernel.org > > > --- > > > drivers/staging/fbtft/fb_ssd1351.c | 9 +++------ > > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c > > > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644 > > > --- a/drivers/staging/fbtft/fb_ssd1351.c > > > +++ b/drivers/staging/fbtft/fb_ssd1351.c > > > @@ -190,15 +190,12 @@ static struct fbtft_display display = { > > > static int update_onboard_backlight(struct backlight_device *bd) > > > { > > > struct fbtft_par *par = bl_get_data(bd); > > > - bool on; > > > + bool blank = backlight_is_blank(bd); > > > > > > - fbtft_par_dbg(DEBUG_BACKLIGHT, par, > > > - "%s: power=%d, fb_blank=%d\n", > > > - __func__, bd->props.power, bd->props.fb_blank); > > > + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, > > > blank); > > > - on = !backlight_is_blank(bd); > > > /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ > > > - write_reg(par, 0xB5, on ? 0x03 : 0x02); > > > + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); > > > > > > return 0; > > > } > > > > > > -- > > > 2.34.1 > > > > For debugging purposes here, would there be any point in logging props.state? > > As in > > > > fbtft_par_dbg(DEBUG_BACKLIGHT, par, > > - "%s: power=%d, fb_blank=%d\n", > > - __func__, bd->props.power, bd->props.fb_blank); > > + "%s: power=%d, state=%u\n", > > + __func__, bd->props.power, bd->props.state); > > Thanks for the suggestion - and the reviews! > > I was tempted to just remove the debugging. > If we require debugging, then this could be added in the backlight core, > thus everyone would benefit from it. I had the same instinct to remove the debug print here (esp. ones with __func__ in them) but I think that's probably a much more widely scoped clean up for fbtft ;-). On that basis: Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Daniel.
diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c +++ b/drivers/staging/fbtft/fb_ssd1351.c @@ -190,15 +190,12 @@ static struct fbtft_display display = { static int update_onboard_backlight(struct backlight_device *bd) { struct fbtft_par *par = bl_get_data(bd); - bool on; + bool blank = backlight_is_blank(bd); - fbtft_par_dbg(DEBUG_BACKLIGHT, par, - "%s: power=%d, fb_blank=%d\n", - __func__, bd->props.power, bd->props.fb_blank); + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, blank); - on = !backlight_is_blank(bd); /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ - write_reg(par, 0xB5, on ? 0x03 : 0x02); + write_reg(par, 0xB5, !blank ? 0x03 : 0x02); return 0; }