Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10737086rwp; Fri, 21 Jul 2023 04:19:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFuLEaNXkimi0tFyqzBOO3BANiQkSuxNmvaH+qHWjwXAxU/8VkE258gVcX5FtUdVApXlb8j X-Received: by 2002:a05:6a00:2ea8:b0:682:f529:6d69 with SMTP id fd40-20020a056a002ea800b00682f5296d69mr1767186pfb.7.1689938344703; Fri, 21 Jul 2023 04:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689938344; cv=none; d=google.com; s=arc-20160816; b=kvksqsqVdsPszDDX0PNk1VzVSfSOs3eSxxCzw5ryd0VpVrcld7tJGi+V0OCHp3UneK DoKmOuPWoDK4H7Eh+twOzqZsWkFt568hX6Twezj+TIz77lav9JEvAjko0tCc29pP+F6Y 1RdrxNO+kxdw8j1ALcX2bsYqp20nOydwqNOMYMVYtgdq6mFjRMaDdUgITMG5OLKf8XcJ aAjC1/pr+upHDDJayBBCNVwtEvi8tl6XzOuwACmTsUAcVFLdcJGOwioCF8Rt+YDC+l7K IzHhDnYyja+6nZwYuR77wPHu0zwCT6hmzqQcNwh3B5dwbc4+UKCwhEl9kmE3ayZrCYTb nDLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=r5tB76GjvqrYC+DTRCo2UQKFWIgvLZ4XI2pYbsVGhys=; fh=FOgGMhdIwM1BqUXNF3UP2CRtY00UAGP6IToPRJMSmRs=; b=RTt7O0CLws8ikPnCe6nxJ3rVfdhcfAJ62uuLgTeMNKfFpabFEWC32sRK6bsdFlNz9h jaYTf9HFM3jBIghxSvnZo1dqPZu3PlhS2cpfC7HZt3Vmn5ocX81Urm+/Ad5N7kgRKx7q lpI2Tp0TQtM5W4GAQg5BRTdaCus4QMjpbjY1+FMian8PJEAlxgr/CdkGR930kcMD5qCX gk3wMiiCylbJWPH05JAlj68pcmNh/odTh/2I7zDk+uQwHHRmtpGlc7QPrRFn/9Czrc8H B0wwLN4oz+IfIpje/p4QkPaVgKMeEzItFmesKE1KkFYoR4FVUaCJbV2g7/LXk3CXdvJB V6zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="s8I6ZrL/"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a056a00240200b0068657e3767csi2980451pfh.154.2023.07.21.04.18.50; Fri, 21 Jul 2023 04:19:04 -0700 (PDT) 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=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="s8I6ZrL/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231857AbjGULJY (ORCPT + 99 others); Fri, 21 Jul 2023 07:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbjGULIh (ORCPT ); Fri, 21 Jul 2023 07:08:37 -0400 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE0F35BF for ; Fri, 21 Jul 2023 04:07:46 -0700 (PDT) Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-4438f623370so766466137.3 for ; Fri, 21 Jul 2023 04:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1689937665; x=1690542465; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r5tB76GjvqrYC+DTRCo2UQKFWIgvLZ4XI2pYbsVGhys=; b=s8I6ZrL/nSmSOh9gkg0xEc4qZagaDjutE3xd71QcIAObHXuZykrTAcjoDNIXBituuI HfWx90BqkwyI2tmkd4+4t2d0qvVkPcI1SCuYhkbCYwC4t/HXUkjJS+nLT3ZsI1BdxJXg mzzCGAV3b64Pwwl1dViRpl330WXavnDX/B+vZqT0QTHiHBuOBE77zkRjBSeele2dVpNn ZYDxjjev13elrGGo9CRNfZtuWdLytrcXtf6/zgMxxjdJwCsZQm9flKvxcWws3e+iAHYX SVkbDdsTg5RziOdyfdZGrrsI6tqgfTCMf8oo4whzYo2tQAG+gnfTcBIz5g3q8zdfHdoD ribA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689937665; x=1690542465; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r5tB76GjvqrYC+DTRCo2UQKFWIgvLZ4XI2pYbsVGhys=; b=G6J/CxY9WiL/95mLIrnT0XhVvWklPkReomEYZ0y9hiPTnyp/0i1sy7sCJtuFi7Kna2 2xfZfKNytwfUS0VjlqxE6H1SNq2++xorkg6+Bf248PYjpZrVCuk27ebKWUq1v7yo6jkp cOZZvDAgGWpNSzP+KuifPmm8tym+1PHLa2i2ecktOrO6H65iIeHKgv/JmeppW/7LzFyJ 76pgZ8WekfJ7gx+/1feavUhRtsPcxQBqlWkBBg0hQaJQdhPhAyDWZwVxUP3hIQuC+iZ6 jrZr36bhm2YaTOoYXkyKSxqR3ztFTJ4Yl2LtfrYhWxI6DhfD4ibJsTU4LO6xXZmAyce8 /rlA== X-Gm-Message-State: ABy/qLbFJaW+l/5reQzwdjyVrZY3jxDZICwsgrQ6pXKyN6OgipoiBUiS wfBHInuiPbf8+csok8OWnfJc2xJFYMkxEWxJnsf54w== X-Received: by 2002:a67:b34a:0:b0:446:bf73:771a with SMTP id b10-20020a67b34a000000b00446bf73771amr659018vsm.20.1689937665364; Fri, 21 Jul 2023 04:07:45 -0700 (PDT) MIME-Version: 1.0 References: <20230721093342.1532531-1-victor.liu@nxp.com> In-Reply-To: <20230721093342.1532531-1-victor.liu@nxp.com> From: Bartosz Golaszewski Date: Fri, 21 Jul 2023 13:07:34 +0200 Message-ID: Subject: Re: [PATCH v4] backlight: gpio_backlight: Drop output GPIO direction check for initial power state To: Ying Liu Cc: "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lee@kernel.org" , "daniel.thompson@linaro.org" , "jingoohan1@gmail.com" , "deller@gmx.de" , "andy@kernel.org" , "linus.walleij@linaro.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Fri, Jul 21, 2023 at 11:29=E2=80=AFAM Ying Liu wrot= e: > > If GPIO pin is in input state but backlight is currently off due to > default pull downs, then initial power state is set to FB_BLANK_UNBLANK > in DT boot mode with phandle link and the backlight is effectively > turned on in gpio_backlight_probe(), which is undesirable according to > patch description of commit ec665b756e6f ("backlight: gpio-backlight: > Correct initial power state handling"). > > Quote: > ---8<--- > If in DT boot we have phandle link then leave the GPIO in a state which t= he > bootloader left it and let the user of the backlight to configure it furt= her. > ---8<--- > > So, let's drop output GPIO direction check and only check GPIO value to s= et > the initial power state. > > Fixes: 706dc68102bc ("backlight: gpio: Explicitly set the direction of th= e GPIO") > Signed-off-by: Liu Ying > --- > v3->v4: > * Capitalize words 'gpio' in patch description. (Andy) > * Capitalize word 'gpio' in patch title. > * Quote appropriately in patch description. (Andy) > > v2->v3: > * Add Fixes tag. (Daniel) > > v1->v2: > * Improve patch description. (Daniel, Bartosz, Andy) > > drivers/video/backlight/gpio_backlight.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/bac= klight/gpio_backlight.c > index 6f78d928f054..38c46936fdcd 100644 > --- a/drivers/video/backlight/gpio_backlight.c > +++ b/drivers/video/backlight/gpio_backlight.c > @@ -87,8 +87,7 @@ static int gpio_backlight_probe(struct platform_device = *pdev) > /* Not booted with device tree or no phandle link to the = node */ > bl->props.power =3D def_value ? FB_BLANK_UNBLANK > : FB_BLANK_POWERDOWN; > - else if (gpiod_get_direction(gbl->gpiod) =3D=3D 0 && > - gpiod_get_value_cansleep(gbl->gpiod) =3D=3D 0) > + else if (gpiod_get_value_cansleep(gbl->gpiod) =3D=3D 0) > bl->props.power =3D FB_BLANK_POWERDOWN; > else > bl->props.power =3D FB_BLANK_UNBLANK; > -- > 2.37.1 > Acked-by: Bartosz Golaszewski