Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10460777rwp; Thu, 20 Jul 2023 22:42:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlGrv1N3Mwl3JRm6WoTpvdCLCU7OB3lp1wDmHnpOSS5vMI2Eljam5MqdqQ5VBRn1QK2rwkp0 X-Received: by 2002:a17:90b:1d10:b0:25b:be3a:e6ae with SMTP id on16-20020a17090b1d1000b0025bbe3ae6aemr720710pjb.18.1689918142965; Thu, 20 Jul 2023 22:42:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689918142; cv=pass; d=google.com; s=arc-20160816; b=lFzn4V+VlxG5KStAhtq+cSn5BIRtYs6vPSePWi0chCNrvDuPzF8KCe5cOzIZlqMNzm g6EAElJVy6OrfbPhifkT058aAYdbllOn2RhyoN5rtZKy3RXfyy7A4Nl7w+ZGz2YOBvnw XHDiI3kobJ7TsX7ntk5amZ5r++Q49RBkisrwgz+rCdB2h0ASNlhkEq3kL+NIaC9Zngf+ 42lGBCPtaKneiTkYMBVfO+z0xgyy5CqvZvbzWeoXhCTSD7JAURWUDD73JOuM0owSpa09 jC3nH7jSymvQeiRPD1Jo9/S5CYYbKsWWQJonRw57SMDVXI3r7MbHZemVIewXJ6ACdLaH OZ1Q== 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:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=MIT1hkDVji6kib6LELR8TOgdiHm5tySbXzu8mvBLHok=; fh=5FtOyRlE5JyfwegJ9EATmnYYHzhbzilwWL0s77S0K1s=; b=BfXdccnzX1hbbaQt3rePkKKERO6cuVjqGemrwmvsJP8g9QWdYbxQdMHDVTn8fqp2HK VqnbSG1fk1k8QQj0jN9UsgneYGlx0N4ehpJlF2P0XI69t/W1kbkxQN2dPT8rGIu0n1i3 b8Rk5KJjZVTE2K2q+NJ+F3Utc7O44tPgnYdrokrXeLWjtQ6ZmTZh2MnAOihY6H4PXTBN yADZfF2mmNRLPZjJXxDfJtD1KC5FMc1nLvIZJr+FHT94A6VK8okq+Z88lOsspHVnI/nA KHVEXwUSes3wKMVbLwzzygYjgIc0JJU+ugmqFg0V2mO3s3+KvIajCxSzB5NP/ju/Sen9 bc/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=jSuGD8OC; 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 my18-20020a17090b4c9200b00259b2afc651si5498578pjb.62.2023.07.20.22.42.11; Thu, 20 Jul 2023 22:42:22 -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=jSuGD8OC; 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 S229477AbjGUFRG (ORCPT + 99 others); Fri, 21 Jul 2023 01:17:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGUFRF (ORCPT ); Fri, 21 Jul 2023 01:17:05 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2040.outbound.protection.outlook.com [40.107.6.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DF4E52; Thu, 20 Jul 2023 22:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FtPUNNYrV/3dNPAC9bEJrqnMRd9z5721e3ptGLdOfxyofi5RzYVbr3edk/dl30HO3JEMunLxkLp+Q/C9CXV2XtFhdoO5I3frFNbScvGm2y9vRIBBtZdNPblm53isZt9rBaE51xlZJ6UYPCanIo7DrUBb/vBpamUUF2BDBun+aGkuhbpKb3p0VWFnGeolDkOSqNOWQNk+yCdrbSGRc2t0nWQmIgDq/WR3A4ZlODjbFz753KwBxbp0kBLw7tqafvLCUAHVMpqIQyqwLxyOpIsn95btxIg+inOBy/SVkwplCb6VH1DLrPhhKqOogdrUzRSH8Tzu+uxdh4CEApUZ8u4ccQ== 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=MIT1hkDVji6kib6LELR8TOgdiHm5tySbXzu8mvBLHok=; b=e1aW7Uy28FsdgXwlYba616UiO1YjVS2mOnlW5xwRkFt4bu7jcTqAd91HYbl/KGARHvaTWQEI+WFrwuy3AZclO/P1zZXCOoJcHmPFQ8SSOzymcPlQr93qwanzgZ61NNt0ftaIslPZ8zO6x5jXv/jXBJYbM/mWuy9xmC6CMHvmce8WhtRXP1Stl4d/qSIHPBvCdeOIxfb/NvHF3fd/uzqDgO8yN+m474VGRsyF6u7+8XjaldYOOOWmTICyU8/v3akqauNcviTxGSGve+Elc6PYoPCYUz8w3pceeycm3fIDsc+JiOoCfskF6RrW8dpSzIcQcyeCpJYBGSwyhvylr19X9w== 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=MIT1hkDVji6kib6LELR8TOgdiHm5tySbXzu8mvBLHok=; b=jSuGD8OCm98o15COD7qz8oRq7InfoDjHCIugPjjaFgL6BaMrLXYRlRYkQg4NdZ6+1egwFjMfkd+9gwDNLRMBPVrVfiPy9P8CE0Ops8yZhqdxTIqDg2wkp6NC//qoAU+NJMNYt8TU3dhzHEHBMCN1qD1ANAxlC4BdHf5ILN77ueM= Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AS1PR04MB9455.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul 2023 05:16:57 +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 05:16:57 +0000 From: Ying Liu To: Daniel Thompson CC: "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lee@kernel.org" , "jingoohan1@gmail.com" , "deller@gmx.de" , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Subject: RE: [PATCH] backlight: gpio_backlight: Drop output gpio direction check for initial power state Thread-Topic: [PATCH] backlight: gpio_backlight: Drop output gpio direction check for initial power state Thread-Index: Adm60FHbZeccRsgE2UutMj3nHgFTFQALOCUAACT+sfA= Date: Fri, 21 Jul 2023 05:16:57 +0000 Message-ID: References: <20230720061105.154821-1-victor.liu@nxp.com> <20230720112742.GA2525277@aspen.lan> In-Reply-To: <20230720112742.GA2525277@aspen.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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_|AS1PR04MB9455:EE_ x-ms-office365-filtering-correlation-id: 5245475b-6cec-44e0-cf1d-08db89a9b4ad x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TOWDeUZSHgAev40SsOnzECNfjnRf5QHp2UdPgnDK/pgO/LffO4huF+R/h09rXqX7vzfNP2u67Rt/0IX6y43jVnLVqc0vj4Jtfxdq07SlAukcRGSwJuAWxhambvUKE2x7RS9v7acLEtXulG3MrOHawOv6MyG2QUkjzUYVC0m4wNccdk9mmKj+BIt/uT71qcsOmJX0g1qJ0G29IZecCO3/n1CznSXwMZfZHq/XUOcVImKSPWDzahqwpqmgTqV8jJfhXFtkKOK0A8NGBVTFktZ7XN0w1lwebZh3tzUCNDjMlA4bjgS1IIiOJk0fdOPzmLFJen8fBh8xZeS3U0SOPQU1GlO5XCf8oV93cNeW1i23NnEZjXeIofbN1KPIAAk3MLo/lHkSC3Nn3b6LicoA4yeNM14tXVQAKDpaqDZjVvD744oWE2ASya8fnTo7VJHrW/qS9CsR8HK7OeoUTHThtHjDEq6Ohq0kBKWwJ2izHz7ULcUqpBjtYAwMPsBVV3PK4bn2DNPvZlZ+wIsw4VvN95YPutxDiQFcFBggq/XIeBJN2Vl8AebeJ1WhTSg/7WCdCYJ1agRUGyyw0u0D/7iNTtwWj+nza1V1MVo3odQ28T4vFxxjpmiNd9YxtG0JKU8JcQKj 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)(376002)(346002)(136003)(39860400002)(366004)(451199021)(2906002)(38070700005)(86362001)(33656002)(122000001)(38100700002)(55016003)(41300700001)(6506007)(53546011)(9686003)(66446008)(66476007)(76116006)(66556008)(66946007)(6916009)(316002)(71200400001)(4326008)(64756008)(7696005)(186003)(26005)(7416002)(8936002)(8676002)(478600001)(54906003)(5660300002)(52536014);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Z/LEiR+t88Bp64LXdEobK92xcc5ekac8CRDeIT1gYA7hdhgy2VggeJy49nFQ?= =?us-ascii?Q?xQSBaBKhRzLEN3so72FoSpJ3JnVTHTKe4PiwgLcpG2oIt8cTI298TZQJfatp?= =?us-ascii?Q?iF3XuTtf7rxD16P70UA6Bzl+h7JUIZjxpHhRFddV3lQNdAd+HJRM0ODhWEql?= =?us-ascii?Q?6B4wGf7/sgVPr+I7T5X6gQDIIvO5uCGoholLDTIRlP0NbsAD/s1BS66Cddhs?= =?us-ascii?Q?12DewbW519FQNjMZR4DPZnWOikA1WYJ4dhERnlGSifgthFXCq+U+HHddo6sS?= =?us-ascii?Q?pY6S8AZimMKph8boFhyuxXSFUQNXX3Dszg/wh3ck+/OYVCcsLSD0etZm6zuG?= =?us-ascii?Q?waomOHcDZQmVNtKWg4BH6HN4Hbs3CXjh+oFpmOYZMamCbE9fh44oRRVXnxLA?= =?us-ascii?Q?ImfDlHzkY4lZvTK39++VuAzjzgYCltfYzKldmF3slPeqKpVO4Lr5E0eu2C/B?= =?us-ascii?Q?jLkRgtAbJOmJIcgEDJkuHaJccqcw6aJz39TgATYKi+V6nhu/AbFWBiUmPwik?= =?us-ascii?Q?8gVlYpKVFRr+3XgiR7Y2+2Z7xC+WQA90jv8jv8Tm68f2S2M/kfOw6W247/zJ?= =?us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ykWtTZIWbY4LHz?= =?us-ascii?Q?PFKFedCQ3ljHuzV1RliDxwSvAMcq5F+Hokz01Qdr4qF4X4b75mr+qnr294YS?= =?us-ascii?Q?ZsfA0iSuDDyuEoLb/6huuYAJk6mlNCX4tmmNoLUz?= Content-Type: text/plain; charset="us-ascii" 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: 5245475b-6cec-44e0-cf1d-08db89a9b4ad X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 05:16:57.6208 (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: S4uKR5zTo4lJqxfsyI2Fi5s/4Xn5VSHN6TVto3iuw8cC8RW76fYWJfiokVqkamCfK4QecDeLwDJiqBhDNWdavw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9455 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_BLOCKED, 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 Hi Daniel, On Thursday, July 20, 2023 7:28 PM Daniel Thompson wrote: >=20 > On Thu, Jul 20, 2023 at 06:06:27AM +0000, Ying Liu wrote: > > Bootloader may leave gpio direction as input and gpio value as logical = low. > > It hints that initial backlight power state should be > FB_BLANK_POWERDOWN > > since the gpio value is literally logical low. >=20 > To be honest this probably "hints" that the bootloader simply didn't > consider the backlight at all :-) . I'd rather the patch description > focus on what circumstances lead to the current code making a bad > decision. More like: >=20 > If the GPIO pin is in the input state but the backlight is currently > off due to default pull downs then ... How about this patch description? ---------------------------------8<----------------------------------------= --- Without this patch, if gpio pin is in input state but backlight is currentl= y 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. ---------------------------------8<----------------------------------------= --- Regards, Liu Ying