From patchwork Sat Jan 7 18:26:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 640519 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 B4A6CC678D5 for ; Sat, 7 Jan 2023 18:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232480AbjAGS1A (ORCPT ); Sat, 7 Jan 2023 13:27:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbjAGS00 (ORCPT ); Sat, 7 Jan 2023 13:26:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87E240C0D; Sat, 7 Jan 2023 10:26:24 -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 481B5B8069E; Sat, 7 Jan 2023 18:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id C762EC433F2; 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=QCUNFz0znSG4dFhceksvrEhuu6q18JaC/eU7eQcVMhs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gNCmrHkcPqnUS0a3xVSYftIawDJL6WdNZqVopye1CwTMJj+OhmtcQYMLORNIz1FOo S97tPD0HherWzF5Kwps1d8EAJxEhyUXvwpLBl/h5GGtdVQoVjd2DT3CgfL1IeGxijp snFUERcxs8PBMKNIMpS3HePYw3vZejQWMRJJwDJlwBV/xBj1KLy1uAxFeW5XxMSQTs rGUfWMHLMEYk4qDrkJ699dpdgnxHQmp6LgXcA3g/E9PzRQVGY8PoSwAFEQTJ5M9LVL gizeOLkHxcMldONRUSdVHL+ZgJ7gDSv/UrELN9hk8nJSzZK5th0Fx7sDpSCD4AgI6w BljwABlVUmJ3w== 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 AE3BBC46467; Sat, 7 Jan 2023 18:26:21 +0000 (UTC) From: Sam Ravnborg via B4 Submission Endpoint Date: Sat, 07 Jan 2023 19:26:24 +0100 Subject: [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank() MIME-Version: 1.0 Message-Id: <20230107-sam-video-backlight-drop-fb_blank-v1-10-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 , Helge Deller , Alexandre Belloni , Claudiu Beznea , Antonino Daplas , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Robin van der Gracht , Miguel Ojeda , Lee Jones , Daniel Thompson , Jingoo Han 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 , Sam Ravnborg , Thomas Zimmermann , Andy Shevchenko , Javier Martinez Canillas , Peter Suti X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673115978; l=1663; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=Wny8vn8SDkRFcw+Qd/s3t358GYJs/Zyqd9rf2tuHfYI=; =?utf-8?q?b=3DpUFPIy6NmR07?= =?utf-8?q?yB69L54dJFCXBLLZDCl3QadyGkyvIJRXwpp/cDw+au/L/QLDJM/P3+uhQAXfQqQh?= c5dV85FVDaufnLt7Gjhp/q9XLr2r6KxOVyTl6bK1oMF8wdtfOS7s 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 Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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: Thomas Zimmermann Cc: Andy Shevchenko Cc: Javier Martinez Canillas Cc: Greg Kroah-Hartman Cc: Sam Ravnborg Cc: Stephen Kitt Cc: Peter Suti Cc: linux-fbdev@vger.kernel.org Reviewed-by: Stephen Kitt --- drivers/staging/fbtft/fbtft-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index afaba94d1d1c..1746327e1939 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -132,15 +132,15 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) { struct fbtft_par *par = bl_get_data(bd); bool polarity = par->polarity; + bool blank = backlight_is_blank(bd); - fbtft_par_dbg(DEBUG_BACKLIGHT, par, - "%s: polarity=%d, power=%d, fb_blank=%d\n", - __func__, polarity, bd->props.power, bd->props.fb_blank); + fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, blank=%d\n", + __func__, polarity, blank); - if (!backlight_is_blank(bd)) - gpiod_set_value(par->gpio.led[0], polarity); - else + if (blank) gpiod_set_value(par->gpio.led[0], !polarity); + else + gpiod_set_value(par->gpio.led[0], polarity); return 0; }