From patchwork Thu Jul 20 06:06:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13319796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A32EB64DA for ; Thu, 20 Jul 2023 06:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjGTGGc (ORCPT ); Thu, 20 Jul 2023 02:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjGTGGb (ORCPT ); Thu, 20 Jul 2023 02:06:31 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2068.outbound.protection.outlook.com [40.107.6.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE091724; Wed, 19 Jul 2023 23:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kvlDqWXBPZNfgrNgVZbt3ZSbpTk9BQoY5sc+w/nwftCmyo7HHhZGUA+SnZRQhHxj20FpzqusqeuNWrrys0u66ZdjpA0gI+Ii7wwVPQTyxl80+IppTQTA+aMZmBWPfLgB99ZcpN7571K8S1/GDPo7+wu6sLYcp5D/Zke7axdoqonNeV+0gJph+Ld+DjrEXc+UNkJWBurA7KydTOLuP0TnfCc4MfZIzdA3Jlk8qVGMFX4q/ISgY4s/9p9jz7cvxty8A0nxZKKwkxJeiV+NOY/HbnLVYZgpkbY08VN3poIQJ/qWbmk44j/u5X/JvgcraiznDDQE/3wDXhwlfNPPUrHF+A== 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=BHJPWdL78sSkoFuC/6QHVME2DCCrM0TbAMUbGDrwSPA=; b=aPQdqbNCBgP4oOH69CW4kjy+0gRTGXfmKckAY3fB5xH31WWllAzsZLHoK1vLMLT5JAvIQsbP99jBaNDaPFkOk7jDFYDAYOmuIDeoiFHsq1uvZ2GbRB+BK1XcY/k46HfL54gZ0aK3O+3oBUNsZV2eNqC77WHfTrd2L+UPDxlrQd1DlIsEiajxMGP0GCNoGf8jMahAvgQmon1jJ0aCYVSeSwJS09EVXY43LUDRq9WYnQLmd5T+EBNX4Xhzq9/WsGgCcq9IxCWPOn2BX5PbaO6i9C1Smbp7xNRb1yFMukfOavWz5tXN9TTzCJ2NAAxKauQ2WAscWqjTvzb1pe5bOlA5cg== 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=BHJPWdL78sSkoFuC/6QHVME2DCCrM0TbAMUbGDrwSPA=; b=HhUtO1VG/00jBrE2ZmlkV8cM0pKPyaOXkpzFwenZw9kaho3BjqVkLlIUxl48lw50gvoVB4XbMYe68B4RLglXyT/Qur9y+8e5cgFA541mTUrRL5FsBU9EGVJWXbLlsp60Ghi+0AeAokcM/HedqvcltwHCDJBqEQPOHgdsR07ITwM= Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM8PR04MB7923.eurprd04.prod.outlook.com (2603:10a6:20b:24b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul 2023 06:06:27 +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; Thu, 20 Jul 2023 06:06:27 +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" Subject: [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: Adm60FHbZeccRsgE2UutMj3nHgFTFQ== Date: Thu, 20 Jul 2023 06:06:27 +0000 Message-ID: <20230720061105.154821-1-victor.liu@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SI2PR01CA0019.apcprd01.prod.exchangelabs.com (2603:1096:4:192::12) 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_|AM8PR04MB7923:EE_ x-ms-office365-filtering-correlation-id: baa8725a-638e-4f07-15f1-08db88e7745d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nb0lXK+fGls430LWnWkfI5wr6kDq0JX5bFYRL9uIN4KFzOYZJ3TCFCjGLSpOq6c70kznkBtwV6pH4cbkk76rcicXsSEpi+CsXJ+Yp9tooVZFK8Rrs+2YHzy4Lo0iFE107lfAfNuI4SzsnpgXP3igwjG3lLX4nua+mdpzG5DkJD+eZJKBteKqZ48REVXdOxk/vHYJYVHMKDafUbgz9+xAlxfA8SuJ5hNLjV+wHmkYV3XH+emRZbfa4igtirXeGNFZn3BkwP3mocAHVFTrlS1S8Np0Mam77aNa5K0Z0Aen23gOK5Rrjwhx3pox7JSWNaqSC3G/RvgGbgcPC2Sy4Th95+IPBCx8GlhcTHnRB6N6BOxhkEh4TcEb/KkQOxqVmxWNJSFZG3Z2TIDTvAiOeel/Dt9b/7yqZhE0awmhNMPlFfBVNlVbnRYREswia4MINJIe67rYyQzZupdu/ti6jY3XfwmFYe6VNYOKfk2Ux8xWxSdrzHq5nK3K87zZMoOJ8J3lsqiR154rrNyyXyAgX6fkmbzqIThqa6RxXz0LoaujQGaT2EpcloHYVLs14Hh/PvG/Mg+FF0ef6XYfZux2us4R/DIxyK11ndnpWSwmvSskgZUDITsLp/DIFXqo8qQ/STB5 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)(366004)(376002)(136003)(346002)(39860400002)(396003)(451199021)(186003)(2616005)(71200400001)(83380400001)(26005)(1076003)(6512007)(6506007)(2906002)(64756008)(41300700001)(66946007)(316002)(66556008)(66446008)(66476007)(4326008)(5660300002)(8676002)(8936002)(478600001)(6486002)(54906003)(52116002)(110136005)(38350700002)(122000001)(36756003)(38100700002)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?F+kezKhQvfjE7O7PoVgx2n/?= =?iso-8859-1?q?HvE+EKRU3/fOUojW7HSSmPBi3fyJn83zM92l0+Il9BWRsgV+8zzBq0Q3HJaI?= =?iso-8859-1?q?+FMpxZZlVHKuf0xcFFwm09daPdJJN487JIDnNTDAcGwCMXjGrNciA8FWDhwk?= =?iso-8859-1?q?eN/pudcxQGW4AECd7xHL/0eAENNbaviHFX4rvvm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8859-1?q?kw3WPrted1xwpdgN7ArB3gGvzvU4txzPgHdhro79T6sKWPyvuy/hpWHNkXPT?= =?iso-8859-1?q?nggMJmyM5+oi9sO/wdnoIgCU/D/xczPdUVR6DqGoX9FDttMPeoeaWTUlo+j3?= =?iso-8859-1?q?TO0ijOvzrNSO5t+2b2FguvZNUu+q2LiQDrCV5Bb1RHWQrbSuOjx5aHypS3Dt?= =?iso-8859-1?q?sjSbbsS55qAEdU06ROsZFcPyb11vOOw4Ml9yK1okvEOlshd7vUaSJ2aNy2Df?= =?iso-8859-1?q?cr24vCuVz9LbLrDz8LMbw2WDIRxL92GUkdrYXgz1VCFiF1gEjELFlQx0BQVN?= =?iso-8859-1?q?NkObm+SWo4jfiYB8R4gm9yq2Lxem4UHvrvRNOn2s+IpJ2CMhNtSz8DWrILWZ?= =?iso-8859-1?q?VyqE86w6qjHVbIIbMt8JJLB9zL83PbPDsAvkQ25GM1p89ax9/VyI2POr/aoH?= =?iso-8859-1?q?ThtJom0HFu1tLyixv1oiEwNOyq3wcsHUPSgiD6t02kVgcjHr3Ti2sqJapkdS?= =?iso-8859-1?q?Oz+B9u7w6Moy/ShlHSuk2ZWbCDNTahx0l8DpHoOfYbsPtYnBDyqRjaaANmIZ?= =?iso-8859-1?q?+e30cjDLJ9Q4aDBZy?= 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: baa8725a-638e-4f07-15f1-08db88e7745d X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 06:06:27.4071 (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: ThPnhan1QMttfz+cGMSJLzZyL0KUWxHxYHQNPabgS6BLIxQRA8MQ+e5Cn9X5HDNq/J9WoT4ebmdgZQJgk6bkXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7923 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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. So, let's drop output gpio direction check and only check gpio value to set the initial power state. Signed-off-by: Liu Ying --- 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/backlight/gpio_backlight.c index d3bea42407f1..d28c30b2a35d 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 = def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; - else if (gpiod_get_direction(gbl->gpiod) == 0 && - gpiod_get_value_cansleep(gbl->gpiod) == 0) + else if (gpiod_get_value_cansleep(gbl->gpiod) == 0) bl->props.power = FB_BLANK_POWERDOWN; else bl->props.power = FB_BLANK_UNBLANK;