Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10637314rwp; Fri, 21 Jul 2023 02:26:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlEO+b06UwUJvdDX7l08lZ/TZHrEQztj+cwTqgGTp+fvYEAlwvU+v4wbncVPYF3BhhebeXyC X-Received: by 2002:a05:6512:34d4:b0:4fb:73ce:8e7d with SMTP id w20-20020a05651234d400b004fb73ce8e7dmr803564lfr.15.1689931589391; Fri, 21 Jul 2023 02:26:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689931589; cv=pass; d=google.com; s=arc-20160816; b=wmleFQrbu9FeSnB/EBYHJkmvhaE9CaFbc5HsfYziT/kRCJ21Lot8I20W4uNxgdaOFx lYQdecOFzrXkEWVji0DmOreqZPUQDhmG8ltyil2B0Wbk8k2tUoDvB+XMciWlPS3/O3y+ pgheh3sYfyZ0dqu/UWQLVzfAfazDX0NkELCkxpW5cADfuFgVnaUXrEj4z74kW0UWR4Ru SXBgWo3Jehqrp7Hlfx5aKVf+q1RjZVAhsA6h0vG+2JhSy2GbUa06rcKTi4UiAy41hElr zzRGlNlT7cTQU6/XAhHAkaV87i7vQxAmEw09c+kJcnOMfei8uNlkUuH7ksP5Dgydu55S /DBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=brNKtdgr5/RDVTk3kxKzAONwKOFSrLcxc1cvYN3wT7M=; fh=JjrxNEoPAioc1w1P6PWbeVrAbJ4DTKvD7s67NCSML84=; b=Vh5XXTMM+mHaZ/WF9DjrgjYWoPu3Xx4hDDSMG6Vh4xXf1N8MnOWQjdQHASpyv2cM83 6eKfZGhycLqrJFTGbr5rnFB2GAIjRJS7dfpkSt68RmkVqQjkpZxHW+FyVqbqAvx5BaeV GdPmly43o1q3wHgQLPWkpAh2xwVp6VgAtD26z+GbzN98AZzn+wieePBYrYKnbq2ohYLj xj+ScaFs02d40PdsQFOcXOgzeUSZwoAD3CEy0R26Il9tvd44Ec+h03Un4WI4f6gNHKU6 xmEBk63V03kNyM6+u/OGwR2VeGxtsybab1ZxQv58M7rdXp5J79gcMdeM5ItHstDurZn0 gj2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=EhpbrAUb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020aa7c7c9000000b0051e065bbc3csi2059945eds.8.2023.07.21.02.26.05; Fri, 21 Jul 2023 02:26:29 -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=@nxp.com header.s=selector2 header.b=EhpbrAUb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbjGUI6x (ORCPT + 99 others); Fri, 21 Jul 2023 04:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbjGUI6v (ORCPT ); Fri, 21 Jul 2023 04:58:51 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9679E; Fri, 21 Jul 2023 01:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhh3ykt4Gfy25yA2m/JaHhG0nmDB9xkQWES98EowDxnSM02sZqNQCr6WdyL5O6kEg6n8+xtSPMlBaSOVPWyEFgbpbc4tIte/HPdBhZd++gwbLNcjinJ37N51S4kpqMdxe3ua3pOhKZ8Pbc0v8z9c3HYR1NbnFb2N2tag7JpdHUuzCNX+fsPXYPkdEXXgnRXc6tBdK4ZwZFtDKy8mvX1MN/qdCwRFGEZ/t20tx8Rzgtq11eHbeCHNhhk3TJG5a/atGbfiZu0RWCyfrJLJc+UMY2BrfNMB5vbvKcYc+1aAlpqsQfZRsQ77EfG5ma35gddiRvZyaJgXXEVtNZfG1aY48Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=brNKtdgr5/RDVTk3kxKzAONwKOFSrLcxc1cvYN3wT7M=; b=YyZcqSFfsi8f6zubh1ou0KVFwlNLWy+aR9NjZ/p55qYDLNo0v47xXAFzgm9XCQQVo0ltJ4dVpvaFOmi1uSnp9mqQqoGRXap/acYava9BGvNzelfd00K9WkUbBb7AXTxtHZo40AXWrNoPK5JuBLB2acBnR+hX/9LWYWQMqKhpV/YjPkaO4OJ2R1+vInOd/R0/ryHMwlyjxUEi9thYop5lVkKqLBBeGVb+fp2kTC1ejF/g59rkTp4dkUrMG0cHUvXdDlbTQPFgST1Di9P3ndYssqf1eI+j08wZB/Zeea5DfyvSeR82S61jCpascQW7p3D1CKCYRkW9eVu6uq47RS+Nxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=brNKtdgr5/RDVTk3kxKzAONwKOFSrLcxc1cvYN3wT7M=; b=EhpbrAUb+VZZ2nhhadtVrEo0+tTItDGgeFGANCXfpBns1e4VZDFdJflEtYnPKkOpMDM5eJN48BHBm8nupzsN9gcurB7Ncrkceu2Iu10RuMBsbVTA/pcboOz+o83KjKbQMTCTyLbX2iWN/cPl6dCh+bWFSyV6uV/aRt3MAs3CUqw= Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM9PR04MB8684.eurprd04.prod.outlook.com (2603:10a6:20b:43f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul 2023 08:58:46 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::9018:e395:332c:e24b]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::9018:e395:332c:e24b%4]) with mapi id 15.20.6609.022; Fri, 21 Jul 2023 08:58:46 +0000 From: Ying Liu To: "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "lee@kernel.org" , "daniel.thompson@linaro.org" , "jingoohan1@gmail.com" , "deller@gmx.de" , "andy@kernel.org" , "linus.walleij@linaro.org" , "brgl@bgdev.pl" Subject: [PATCH v3] backlight: gpio_backlight: Drop output gpio direction check for initial power state Thread-Topic: [PATCH v3] backlight: gpio_backlight: Drop output gpio direction check for initial power state Thread-Index: Adm7sY7YALfa08QfDUG/0iqESGxZGA== Date: Fri, 21 Jul 2023 08:58:46 +0000 Message-ID: <20230721090332.1528569-1-victor.liu@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SI1PR02CA0029.apcprd02.prod.outlook.com (2603:1096:4:1f4::20) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) x-mailer: git-send-email 2.37.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM7PR04MB7046:EE_|AM9PR04MB8684:EE_ x-ms-office365-filtering-correlation-id: e4cb94b7-a601-404b-d2be-08db89c8b15a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Wfd27YR7EDUkP3KJR3eTNzXOAJddIPOgCTSrhcsJ7RpiraAp/HwCP6RnAhFgS8DwWQqFzZwjQpMWlmBw92mVFD871tjvgIeMVov5SekQ85kymMPrI2iS1QZnPsY7UU4TZFxQ39gpDwciFKzWYR7xiqyajo4Yz9Gp1cBuArxLEqEUZkxZIOG/Vyx/ryxLSvohlqmfFiHa9Dc8lnnnGm+fWrwjh8iHumdOCBYLQoB6j2ctWFpYFH42V9xCUY295PUqrzv38VMmgphVfiJXoWftEtTAXdKCDnTClf+Php4Qy7EbgD8pcb/TNeMVezmNRIyE+o9X+t705PYz+OCGUh7a0uCD+A9Ffo+M7wtROgm32/KVC3KLflmAb+k8ebTJeeTif4tVbGMfGbXP2Q0oJw4X17nalewqp03/Bk3RnrJ7qxVTFDlbAQ+9gxfWeKh0/vJNGpnvmVONTJgGYtnjYgem2+Fk8e8CMMYvddo1/A6+e6oDdKEUJiSapt1yd0vXS7OkxnYfC4Tr5t2W2bQfRFfNgkokHrsy7zWGtedpuHEw+jQGVw126c0RDvcRTUZ4U4YzMb0EGM5KVWdxsuKE90hfOcbqwgB/7AjKUzNLgVbcN7q5Z2HJ2kBPL5bzwPS4MZDl x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(366004)(136003)(451199021)(6506007)(1076003)(186003)(26005)(7416002)(8936002)(8676002)(5660300002)(41300700001)(86362001)(2906002)(36756003)(110136005)(478600001)(4326008)(54906003)(316002)(66446008)(66476007)(66556008)(64756008)(66946007)(38350700002)(38100700002)(71200400001)(52116002)(6486002)(6512007)(83380400001)(2616005)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?zZZq2XhEqnN37IEGt7BAOD3uaX+0u1ftcoChmiFAUYlaky6dGMuxbtJlEr?= =?iso-8859-1?Q?oZ+ztG5x/456xcUTwUNkvKjr3KWG6kaPlY2uojwTespyUtENtX3ltI3nhc?= =?iso-8859-1?Q?vR/ka25mr1EKmD0BXDXjCnzwcg5bx2jX6j8Un3aXG/nSDYMB+R1v0RRgCY?= =?iso-8859-1?Q?VYq8ajKEmfT2soSidmNiBpGikH/W4/A3/6Vbe/U/+fADfjBzmnoGFy+CNF?= =?iso-8859-1?Q?Xmu70CkHSh7hMwEgcPXb4nh/TjxCIFi8VaBmiyPUNF8QNWa1Sf7GFqGq21?= =?iso-8859-1?Q?jYhbN931UPUFXSWrdAUD9lLR4ivUKZNiHK1XrPZUFHx3OOMZUIE/FhqU2k?= =?iso-8859-1?Q?kjm2eP/QTPeJjmFQe2cm53eahMAALG03WFeUMcFZL5Cncomk9c1j4/8tjJ?= =?iso-8859-1?Q?BVDNKTFTxjJ7ykJEFQZAicdsxWdRNaUxANSZNjJfXVFXNZhYFIpSPKm7dq?= =?iso-8859-1?Q?rkROv0A+X6C59R6OH5pUmBvB1FYvx3Ggd19kqsnHQdJGkYaJbD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hQ7x5ZrL1HYSyhiI0Ijdw2I+fTC2X/5knQHVS85mO5?= =?iso-8859-1?Q?YfhKpBdj3rjNRXWNJo7bHVvGNpvJ1RTBURhzd389Yw4GqeLK8hruX1M04r?= =?iso-8859-1?Q?dUMV2jPaaXjvEvt33hjuTIO/KEYoAC/kpUrferDuVzUlON/Ihd4I68y1V+?= =?iso-8859-1?Q?aW6zZ4OKcw4aSr5b1h79hMqGoSTWmYVyX4QZhgAjajYr9dmpG/ZwazIvM3?= =?iso-8859-1?Q?GDEqfb+N3BJ7NXw0sEWMAz4KrJng8C66pH?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4cb94b7-a601-404b-d2be-08db89c8b15a X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 08:58:46.5013 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /O1Hft2yG93Glg7qgoBFIdKrhBibK/kA+4EHwPa6fm6+bYHVddlyIymw8k7mz9x71Rycs61D5w3IkKFjVwJuSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8684 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, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 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: --- If in DT boot we have phandle link then leave the GPIO in a state which the bootloader left it and let the user of the backlight to configure it furthe= r. --- So, let's drop output gpio direction check and only check gpio value to set the initial power state. Fixes: 706dc68102bc ("backlight: gpio: Explicitly set the direction of the = GPIO") Signed-off-by: Liu Ying --- 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/backl= ight/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 *p= dev) /* 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; --=20 2.37.1