Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4070809rwl; Sat, 7 Jan 2023 10:28:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuiAYVeKeLBoqCcBzEnXur08o6qKpluV1Zl0i8JPSYEhglplAB6Qm7kKXzqATgDaMvei1DF X-Received: by 2002:a17:90a:a408:b0:226:f790:4de0 with SMTP id y8-20020a17090aa40800b00226f7904de0mr2303592pjp.17.1673116116667; Sat, 07 Jan 2023 10:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673116116; cv=none; d=google.com; s=arc-20160816; b=Uolh3Duz6xHDno3ljYiC8DIbW8kIkdb7rCPlU4TlJlf6+3VAOKalH/K30UhDUGy4VH ApdgrRMje4E7NWrngHDpHIqgS/LSRJS2UsyDAMpYXo5cGgqc1x1wTbh9bUmya2TIxcI+ +HVqSFVzATdp8XhKstpkXVAOFEynGk+keOY9U5e9oIkmTBSE+PEM/q78yEhiSr9I778X EZHSzxSwLUirRYRvxy6LR5thb5GCdSr8er7FgGtzJ06VyLp++qWnSG/QzwOhHTB2LBf0 DkGDvdyZOnNj7HZTV1uP5CXTCUaUaHXa5QqOrDpTbOrE6s9yW5U1kiM/QPm4Tr31HFtu GHwQ== 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 Return-Path: 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.28.29; Sat, 07 Jan 2023 10:28:36 -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 + 54 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 ); 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 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 , 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 , Andy Shevchenko 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 Reply-To: 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: X-Mailing-List: linux-kernel@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: 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