Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10728937rwp; Fri, 21 Jul 2023 04:11:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlGOoL6NEFnP43E5XySfd4zSmXByRoj/n4w2hnAJQeZmzdJ09gKJxYOzY2vBG5mbaj6xZB8/ X-Received: by 2002:a05:6512:2390:b0:4fd:d538:b97b with SMTP id c16-20020a056512239000b004fdd538b97bmr1262097lfv.29.1689937886693; Fri, 21 Jul 2023 04:11:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689937886; cv=pass; d=google.com; s=arc-20160816; b=B+Em3CmMJOmLUkG2qzkQ2cQx2HrSNb+/ntv3POzKC/5YVUiR6Wl1147ejPR63fj+n2 OgoVefEgnmfdsSSRKZSROZoOX8j17MDXan9k8AVNjym+5WlqYkAMT5L3TZa741KwsR9l TYwu7Cte8JZ/B9eQUqbShIHs5Ksc5v7L9DakhXBPoKlB8IAzE8pnh/31x9yL97lRGvla 62jTfXgmjJ3Y0P3cKzP4WVtwtTOj14nMzWz7QbQLurwdbJz+Rm6LEMKPRYn8hOIAN+M4 fuzk9jagPjJrjy5k/33FsPMT+wGu9UgrFEQrBQ++wPqXTP4vFsOPwUrvR+V34mDPWwbW NgnA== 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=u82CGcEKOLENHGQR12gi3yhE30P65VMkTWUyQlisuH4=; fh=JjrxNEoPAioc1w1P6PWbeVrAbJ4DTKvD7s67NCSML84=; b=n0RyoXDWDqmDAw/+bEYkj396BrFPYMIXCfvyoYAyB9Pa2/LWsPInUw/w5wov6wA9xB agtnxqRjLiniEotGZ1PxTUw2RUv3J6Dc8yG3GESdMoXtdLwSJgrWROP3KouxFXMjMmOq FHRMtmJwjXv5izFxAE4hEzeZ52TsCtJQPHFYKgaIeSKc+qxq9SzBDNKQOk9q49Wvyb6P +v0b4EUAjoTWRBa8cAxRhX44GC8VWLVudgXBPF/z8x7JfqZZdXK4i+9qIWrQD/JWU5ow rIsknfKDhDhZ3qDR/+YKlLCdYesKvA2wEFrP4CIqp1Xt59oD2z/O4c9okmcYf0805GQ3 ChtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cpBuwZRu; 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 j15-20020aa7ca4f000000b0052181baa60dsi2297336edt.353.2023.07.21.04.11.01; Fri, 21 Jul 2023 04:11:26 -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=cpBuwZRu; 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 S230149AbjGUJ3J (ORCPT + 99 others); Fri, 21 Jul 2023 05:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjGUJ3I (ORCPT ); Fri, 21 Jul 2023 05:29:08 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2083.outbound.protection.outlook.com [40.107.13.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D35222D57; Fri, 21 Jul 2023 02:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KInPFhvR99mj+41BEW/urRa6Wmx35rwYb2pi40nqX64m+nYLEmwIZtxGrXI2YQ6sTDVN8D7c4ydfmQ3l9LPiPvki4z1HRXeHsFGrHVXMjBRQ7phBjgYbDqroLj2DnAEpBFwbrLQ/RZXNdoabTRQUpUIhJ3pNsqaMQERekMVAtFzu7VSEQnXOIYezJMD/reICtPar7tTf5CEw4OzLDAv7UdpJIjgZthCgFZwmCRzDfbxs8qXVqYzw4uO0bdC+N4l49upj52ZHCWfd/FIJvg0R+q4ChaxwZlzl0qLy4w/wTiGbkcnQW4F8VWAp9EPKqFyr803OvASniHNYRoO2AWV98Q== 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=u82CGcEKOLENHGQR12gi3yhE30P65VMkTWUyQlisuH4=; b=WkvtufiC0al3j0wy0tk10s4062VAa3s/0dRbFYaGv2YKSfVTiCxRF/tN6iqYXbRz14MYwSka4SCxkJ2r1rR0VPQkY4pLVDGz0g1Bbfq1qabxlZO7Rjqborn6NiZbmBPCNGSezoLQYbfbq2Ih5Mw6ElP2M4NS+dk+G1ye0CpLq8AMCMpAazXeFyNadfKYa8Ypf7hn9/J8jV80ADpgI+mE4w/Ltwdqc5Sqb/8+mPBPUdPmlr2VpiIWSxPgft2ECOc9qwlKd1z3+QwmyvQ1g6u4BUjy/veBM8GwmZY8MB9rKS9dcKJYHM0exfu+TYG3i4qaMv5ARApjGs1GknRKLLn4bw== 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=u82CGcEKOLENHGQR12gi3yhE30P65VMkTWUyQlisuH4=; b=cpBuwZRu7UBr0JSc3J2yYm4c07e6ACvM7pzw5vXBuTmin4TpFhOJFEntkubNVF6WxYQII+s6uT7j+6r41OQd1RZob+V44PNZnSOAPPdevEHB4Qk4njNJaZVWzDRfpHqUxuibHZjQ/FyPLrpLUp1fQm3MsQTX9YDSfXLl6zNFNAE= Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by DB9PR04MB9913.eurprd04.prod.outlook.com (2603:10a6:10:4c4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 09:29:04 +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 09:29:03 +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 v4] backlight: gpio_backlight: Drop output GPIO direction check for initial power state Thread-Topic: [PATCH v4] backlight: gpio_backlight: Drop output GPIO direction check for initial power state Thread-Index: Adm7tcocHnotirQkKUSANe2HiNXlhw== Date: Fri, 21 Jul 2023 09:29:03 +0000 Message-ID: <20230721093342.1532531-1-victor.liu@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR02CA0011.apcprd02.prod.outlook.com (2603:1096:3:17::23) 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_|DB9PR04MB9913:EE_ x-ms-office365-filtering-correlation-id: f140bde6-7aa0-4b07-033d-08db89ccec9b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JVwrT/qzocuvjMTgznUVPKcWOq/I0mVGixVOaSTdqOJuhuRmXq4mMiT5yc/sexzkVrdCSp5aru6ib9ra3mili03PHQ5jLquyA3cTC98TL9MDMJcah74XFzbzESwWawZ/HztZ+t6mvgVnqo0iCK4eK0Krf8D9omLbH8NXKym0TwinfSR1jshcLf58TTrrM1roqN2hkeOlZLmd4aliwFSUDpdONz203pRieZrIQ6vMPwkEuRKNMTaQRQscM9pB83uZ9ridjQZRFyiEWLIR22xq78IhyS7aNh+1pILZNUrVOWl2cNU0t7MMPi6tknkYTluQjXuZEAdKNYD0h0LMcqdCdJ8NCmDiHhH2iEQiwoSM8QC2WVLgB5MYOIqQLtUaoEnRqWDCfl9Q6MsG+/xBtUeWtsF4BhpbOY4fC1xhvlKE/e5Vnba+uX48hnIUmOhY6ZDSa2a6U5b1+X2a12lx2d7fCNTbSnMHwZWAQXbcBhoOstxiIwuYxQP8kkgY+WnZEqws1I76FwyzP0HES9bHFOcYWdop7CqFzsMplaaFEujNEFwH+D6MsE/A5Rm92HRPKsGNvLgBFo5il9uLV4ubIjGwZ/VZ7uho1+OvIDFgOEEMg/ZLBeeRemhhh0CDKsDgtgQA 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)(136003)(366004)(396003)(376002)(39860400002)(346002)(451199021)(71200400001)(54906003)(478600001)(6512007)(6486002)(52116002)(110136005)(186003)(2906002)(6506007)(4326008)(26005)(1076003)(7416002)(8936002)(64756008)(5660300002)(66446008)(8676002)(66946007)(66476007)(66556008)(122000001)(38350700002)(38100700002)(316002)(41300700001)(36756003)(83380400001)(2616005)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Ve0rljVe9ah7VMkBaUNXJ69I9CldkIjBWZGlI8XenYctkjEHkDqU1d0hnW?= =?iso-8859-1?Q?xitTUL58IKSJoj9+l6BntGaMTxU6l5e9Ti79eDAHV4GgoOcHFIxXn5YGgf?= =?iso-8859-1?Q?7Sk8/FF+55Iialoz5flA8EGKj+oBrY1D8vE3l0lbl/nHSRxzQq6eTTfY3o?= =?iso-8859-1?Q?QkcarP9ZKurQOWg5Kz+bY60FPU5wiNNBgZg4I65VS+ZGe1GGY3A4QwfPNn?= =?iso-8859-1?Q?iReweLPbclaMGR9hWgd24qf92Fdbo4Kw0Dwy61lAeLh5m3QK15hizRjsZG?= =?iso-8859-1?Q?plr81m+nZIz8A4jgi805J4+7Bum6AbVW8lzrPqNHoGFNx4oL1Vjo+8zxbB?= =?iso-8859-1?Q?t1A1qDCkrR25FYazh96MdCl0V+KhLhhCf72NPngJOPK81R7fmtezkG6cIO?= =?iso-8859-1?Q?QxxacWkncxZcAPqKcPaeuKxzM08EuSRvm91T2NE0rGHV/5XZBOhiBIV9kG?= =?iso-8859-1?Q?eZiBmum2hRMo9juB20MPCy5vLB1yEyamJUO6BYUg79H8Tb55d+CZMjcdYK?= =?iso-8859-1?Q?AannJPmn32PqK7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Vv5u?= =?iso-8859-1?Q?UwV7Y4P2yd9FMFVJiY8usuR5BGA7GNKQCcWY4DjwUxd4fqlaH2Kh+EYK2K?= =?iso-8859-1?Q?gIEZ6G5mfF7MrXrbFzsuYBhwL7cniEh2AkRKEfMQnp7jKSmXbuxYrSTmj8?= =?iso-8859-1?Q?pAoZ7xzlDO6VEbEaxbbqmyz8NtIQ79kAaPpwSi/9Puk4OnrPWih/D/26Fi?= =?iso-8859-1?Q?WLy2A5EV4/zWzCA3eIJRmCds1CfsCr7NGV?= 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: f140bde6-7aa0-4b07-033d-08db89ccec9b X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 09:29:03.8931 (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: Rxlq5poUZSqFDaIec/zOaXvK0aC3/tPvRr4E2mgCQiXjXENfRbkcnTWyYWJOPbHrbSCrsiNdB5C41msK6atX0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9913 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: ---8<--- 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. ---8<--- 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 --- 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/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