Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6088575rwl; Mon, 9 Jan 2023 04:10:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoRYfi6QfVChPsjyW6Bbee21VN3JbVgXcx5Xcxh6aMQXiCPIgum6WtQFs62yep+ovmygAN X-Received: by 2002:a17:90a:5d08:b0:219:4578:6409 with SMTP id s8-20020a17090a5d0800b0021945786409mr67679312pji.41.1673266218244; Mon, 09 Jan 2023 04:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266218; cv=none; d=google.com; s=arc-20160816; b=huMcE2JkkGih/3dRmjhhhNaDHnExQxV7b39GCGfhFdqV739D0sY0sapzqbWRjeVfG3 yS/d6Y280oEwbZo2pBa9fL6M0rBw+IikRwEiaXW+muVEUDq8pyON9JezW+6uEJhYJ28k UlWVuN6jbV3XDNUMoKfDr7lygvH71P6QQB07zaoRP61ZQD6UNuMJ/iqvk4P1p+BfvOzT P6ZP/3Xla8F1NWzsT5l/el3H/Nu6zO+h8edT6lsPAMmL+Zol75TaVkHsho9YmRk02sbD ldP3blNU+jYT20c6yMFvk8jg3wEeH7X2BpS8h3Yg4FjOgutzKmfwOhnIDtDHEr+kIjBG 61ZA== 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; bh=IGLyI5wEcgXuRG4qKgW9nkQD5uda7Ch20RGMOQU2FOU=; b=jOk7R291ZcoH+bJEaSs+Z9Bbf1ELoe2G2QU2cjcftvBlY8VieFNEr17byVQdebknFN 78jnLZVXoAXB1RJNsPiIX6Ipdo4nF48+qkX0qgCHed7N8z4cKilxYyN4oUqW/rNcfjVr 1pOucmlvz48qbcY1cVG6Rxlp+mJ/zI5b6RWIe5AuUOcCk5tnHdx2+n59cv/KwcQZT0MH 6MvNfCkNvhIVDLBgHWTnuoCc4FymoFgZ684O3JC2k1Hu66K/q32M/7i2fMWmj/uP/y2/ xUgsL8JuAOx5HIkgbqaHU/ImEskudzC37C9PqSBqgQazRrEXX/nSgo4e3Msont1xCdb0 4RxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BpjMQVSS; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp2-20020a17090b4a8200b00212def0cbedsi14013076pjb.8.2023.01.09.04.10.11; Mon, 09 Jan 2023 04:10:18 -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=@linaro.org header.s=google header.b=BpjMQVSS; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234756AbjAILQw (ORCPT + 53 others); Mon, 9 Jan 2023 06:16:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233917AbjAILQc (ORCPT ); Mon, 9 Jan 2023 06:16:32 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 230A315F32 for ; Mon, 9 Jan 2023 03:16:27 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id ay40so6006649wmb.2 for ; Mon, 09 Jan 2023 03:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IGLyI5wEcgXuRG4qKgW9nkQD5uda7Ch20RGMOQU2FOU=; b=BpjMQVSSiInIzATUSKHKx/TB0PAgHuhGpwqrg0yOvpFaOf45mvS+GWvnx67CEXA3H3 OpJ86BZFVR7wQA+dlKnprx63GQ+n3TtIT3gNtfcwYquJrtGnekG3nzORos283svZUVJ1 gD/voD8Adfh6f/kRlsfptOQ3FzAtRI57WQUlj9somGfISffT5ucUlRw1oEWN9hMSp8+8 7Ymx/sq7ntQJ876T0aADIjQ39k6t/AHX2eKWzPuJzBVyDGLq9X87LBaBoOHW3GDSWjSu LM5WVxU8BDTwndJbIqjxOt9sHE+yUYYLgWXJYDdzFtoZBGdEV5Y6eR7kko+fa21emUGA j1kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IGLyI5wEcgXuRG4qKgW9nkQD5uda7Ch20RGMOQU2FOU=; b=YbG2kgRFtzZwgcC734Kts5eV2XdZC8en2xxdxcWRUyg2TRTN3PHrBYdqO0fkQ4+U7k 9bIaq8nWtRgpxxjrhz7mmaQD9USUGxUp8Y2RKv9ZapiKapOkFT8Dm3OHEf3ZN+cC8/W/ 6YlxauuMVGuYYLPJ0HuYIh3oUg9BnzzZs/49dcmq5foDbOKstkPPsoDdncsKol9fxld3 XjR5quNmsM0LeEuUg3tvlxGKA6kJGHu9lmczDRBWlCk+oKL9G+/MylCcW9a4JfxCpL0/ 4gElaCCpwqivvfw51vaCCq/TNDO+hJ0b/S9aiMSFZ9ysFvay1XFKg+ZyCpixiiW2mROA nlMw== X-Gm-Message-State: AFqh2kpsRl7dQteGMrPUeCOciVObTP8INFk0athI+aW2KkrdvBjzF1PY yAsYM0/n3tDxa9TjEHbrwmuvpQ== X-Received: by 2002:a05:600c:4a90:b0:3d2:3ae8:886a with SMTP id b16-20020a05600c4a9000b003d23ae8886amr49681406wmp.17.1673262985605; Mon, 09 Jan 2023 03:16:25 -0800 (PST) Received: from aspen.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id u21-20020a7bc055000000b003d9aa76dc6asm18341780wmc.0.2023.01.09.03.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 03:16:24 -0800 (PST) Date: Mon, 9 Jan 2023 11:16:22 +0000 From: Daniel Thompson To: Sam Ravnborg Cc: Stephen Kitt , Sam Ravnborg via B4 Submission Endpoint , Alexandre Belloni , linux-staging@lists.linux.dev, Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Mackerras , Andy Shevchenko , Helge Deller , Lee Jones , Miguel Ojeda , Antonino Daplas , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Robin van der Gracht , Nicolas Ferre , Jingoo Han , linuxppc-dev@lists.ozlabs.org, Claudiu Beznea Subject: Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Message-ID: References: <20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org> <20230107-sam-video-backlight-drop-fb_blank-v1-9-1bd9bafb351f@ravnborg.org> <20230108202817.7890f85c@heffalump.sk2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE,SPF_PASS 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 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 > > wrote: > > > > > From: Sam Ravnborg > > > > > > 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 > > > Cc: Stephen Kitt > > > Cc: Greg Kroah-Hartman > > > Cc: Daniel Thompson > > > Cc: Andy Shevchenko > > > 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.