Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9131805rwp; Wed, 19 Jul 2023 23:22:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbhw0L8aCKTQWh3TetYMiHkQOtpkqHUmikobx3gxamWZlWMc50kpuKtLHPlKQnESYkv6rf X-Received: by 2002:a05:6e02:219e:b0:347:4683:e5b8 with SMTP id j30-20020a056e02219e00b003474683e5b8mr9717096ila.18.1689834166286; Wed, 19 Jul 2023 23:22:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689834166; cv=pass; d=google.com; s=arc-20160816; b=BhJGTRqxkN+BW+neI1uEBIJ1QrrnPJiArzQpOePSaM6mP2Yw7gL/jq6T+rJpMzVcjF QjkSOMCV3VjgVSWzWBvNpR4rtqKgAHIyM/mr+n2k9i3ZPWzl/3i9lGOnBxDspEYPbp6e qzIzrjT2YouateWBdmL/IDbJW+8JaxbNKB6ytf3dDjFqHuLGMslQXUNCggx8FHwlj3gm oGhrqSmBN5R70qfdNCW+q0HJmP+rHRFuGaHXS3FGuuAoqQJ2NMkJdsf5EilD/CJP90Jm NgQ37u5En60P4lnk+Aum/d0Jy0NmZlW6Jrw40PmKR3HzHnuCT+rP4eXte6bfM0SHtIkg M4fQ== 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=BHJPWdL78sSkoFuC/6QHVME2DCCrM0TbAMUbGDrwSPA=; fh=RnGZa84EaretWgtFpHuPH1HvOavUHsbawmXAxtmRs3o=; b=c/ASpdXrP0dqCeLUfLBlNCcy36CgQW2JJeGxyFtfy6ng1neiblD1KRBf5OpWWRO9ik ILFojWRsgFMQkwCyHojfyT8NIL7hd0TuNcnPwbSSrWAHLGre0OztvcwSENgIPYs6kWcR bvE5fEOR+RPhY7YZ8ldrQaks0Grs97ozXDRw9CLJSSWYJydiZqkY/l/VOLUxWZ4do7Bb PYKfMcKRIwWq6PtXOeNhEuILEIqksPbK5JaEHRXyveqT7wSirZNk0decC+4g0KzHjC3h 99RL8zRyI/qx3hNVW30H9HPXPtSAqijyifRRYtCWhWp1bICVNJhMDzdMQeQ2NAoqw61v wA8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=HhUtO1VG; 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 qe10-20020a17090b4f8a00b00263463c02d4si3091750pjb.52.2023.07.19.23.22.34; Wed, 19 Jul 2023 23:22:46 -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=HhUtO1VG; 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 S229814AbjGTGGd (ORCPT + 99 others); Thu, 20 Jul 2023 02:06:33 -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/HvE+EKRU3/fOUojW7HSSmPBi3fyJn83zM92?= =?iso-8859-1?Q?l0+Il9BWRsgV+8zzBq0Q3HJaI+FMpxZZlVHKuf0xcFFwm09daPdJJN487J?= =?iso-8859-1?Q?IDnNTDAcGwCMXjGrNciA8FWDhwkeN/pudcxQGW4AECd7xHL/0eAENNbavi?= =?iso-8859-1?Q?HFX4rvvmhj/+q3rjbi9Q91jP9jJQeZdHa6CPe5j2O7jPshUo1VlsNHFH5g?= =?iso-8859-1?Q?AmDEoQiV7eT7IRj4kCZyICRQHNlY/bvZEw80myOc3c5fUxaiacT3bqdoRo?= =?iso-8859-1?Q?C+Yn5CSqmO98YPQRoQ8V9ZOLOq2XtbDpZ79CtUJ9ym52QGkmxZHjCEnkEA?= =?iso-8859-1?Q?rzArM1wVV+WcHe44SF9hZKqhcJyzpRETVOo5m60dbmnPRgXgDtcZRUDFXK?= =?iso-8859-1?Q?G3GMywdje7JZvJDEmx1MnNw6lYxTXCN9JNS7cVEALSMwAF6W/zEtvWMzwg?= =?iso-8859-1?Q?PM9AVUmhzWmffgPiTyVGQxINFR6Dlk6XpRMQqCaydWDq7Vsarw/lfxHysG?= =?iso-8859-1?Q?qV5ITwvKxCX+TnzUAhmcejMfcsp5byg5XbGxAd/xz9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VyqE86w6qjHVbIIbMt8JJLB9zL83PbPDsAvkQ25GM1p89ax?= =?iso-8859-1?Q?9/VyI2POr/aoHThtJom0HFu1tLyixv1oiEwNOyq3wcsHUPSgiD6t02kVgc?= =?iso-8859-1?Q?jHr3Ti2sqJapkdSOz+B9u7w6Moy/ShlHSuk2ZWbCDNTahx0l8DpHoOfYbs?= =?iso-8859-1?Q?PtYnBDyqRjaaANmIZ+e30cjDLJ9Q4aDBZy?= 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: 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 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 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 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/backl= ight/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 *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