From patchwork Thu Oct 27 06:55:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 11616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp72968wru; Thu, 27 Oct 2022 00:01:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YF+wD0PPTHpATLGTABDo/WDw1I/3l1b4GlOdCqRZqLwnyK8cH1eIl3GXqtt36bBeF2/K2 X-Received: by 2002:a17:906:eeca:b0:730:6880:c398 with SMTP id wu10-20020a170906eeca00b007306880c398mr40994247ejb.706.1666854076511; Thu, 27 Oct 2022 00:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666854076; cv=none; d=google.com; s=arc-20160816; b=FkV6vHMW2BgU2ggKvcn05gXPYyD5rorR5b9wcF5b6u/mxkEhMfNUVjsDKSRIxOCes0 FnaRNM0F2lFC4roB3chv4ChzxlNHKguoO8az7Byd/KQUcoIOscY6+XduJQFPyEWv/Bgr WbmN3nlznlVca9P0smSdnMMbtRgrC3+PCRGoTcPclt2gUi1Zl1nD/SntFxkgDBwcF+K5 YWufOQIZVbfyeRKztW0NGbEbDxVBd7MAD+ml6TV5l6kzJ4A0w8N78+1pTVTQvRqkN8hW QWltukQj4GdtGjrVQF6eXJUucSh6f8ygrLGgJk2IReVo9TaHMw3Gk8+N3+zeG/56ioSd PruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5caREDVOfT0kOXjQKhISr51b9vOW0WUHzcpIRu8O1ag=; b=W/XPpLPjWtWj6EMW1T42BZsJ0RQQsyGiVwdhfP1wWVIhUXXcaoUkY5yDAYkZX75Vqb +xwbm+DFmPpk8LVLdA85t8k8RBBI6+4N0cfdGb7S+B7KXnNhW4Y8Q0kfqZ+d3q2lKzYD 853He47BJ75xwaqYNK9x2IkiA5VNCYGV9hvvEg9Ih7JJ+c4QhxqIjn8mdKTr3er42nq1 ntTh4SrLQy21MsufFNA5VWeA5zW+X1sEOgk5mvVYsJ7pxQUBeDg09vXHRyJHqpZkKn+0 OdNa6H7iLoju0GGI94wtwzsP6vZaxhuU6XeaC1S4WFar+ppV9E474j73/0sIqdMIbMmo ePGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NnevMi5+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a50c8cd000000b0045d4015cdcesi837973edh.51.2022.10.27.00.00.50; Thu, 27 Oct 2022 00:01:16 -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=@gmail.com header.s=20210112 header.b=NnevMi5+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233865AbiJ0G6I (ORCPT + 99 others); Thu, 27 Oct 2022 02:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233099AbiJ0G5i (ORCPT ); Thu, 27 Oct 2022 02:57:38 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1889A15F308; Wed, 26 Oct 2022 23:55:58 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso5441515pjc.0; Wed, 26 Oct 2022 23:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5caREDVOfT0kOXjQKhISr51b9vOW0WUHzcpIRu8O1ag=; b=NnevMi5+lNqoI31gdky5PsDyRMQqxvujv4E4p0KZ6jRnnVDhU1FLMQ8OoVpt0cBeQn PtFkqs+XQXBeoWSXACPrhF/NfYCx3UMbU5f3TxkmX/FGykOH6tHUa5mlkIvIe/IvCLpQ YLxmM8Hh2mUenQq7aOqwFNjtq2vlBCO//pYLmmB9jHw1NEZ/stkU6gOilikXfbg8BNJz bZ4L5Q+P+Xv/j+PoWEi1mnxlFa1y0TAeC4BkVczGHeana/Aau9XABk1JMUG3eo3ZLb0h Q7hhdgLq3nRIIb70izKbZi1BVtVi1UJq1aeKGKpglYUQhqXLe7v+mkEQq5xLASXvvS5j s+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5caREDVOfT0kOXjQKhISr51b9vOW0WUHzcpIRu8O1ag=; b=3LvsSkadUX6ihMztYiH+1DGPKu4HkHa/pOxkVJM0arYW4tKjxoHqGkt3VasYjonw0z W5MYioSLaOksGDLMDvzolsy5vQ1MUzi0BRDgynVjFWRArEAJSV+qFzaGuEiAUHmgX9cw EBUkbWpVoMz8KEYGc9OUUbJW3stLKs35k77YN6k/YGyHZrS3QpVpK5CspP6ILWWgZNxX nX0pqnfRzmaghU8IOu2Boo8O5tshUhTP6IIGiA+1DQVhyZjY38cpvTylkxZ+DUfCI2w1 hkOHdd+l7IunTe0D8cphCU/qlieBYK643UkKyoMn7VBLlzBK4e09jJOMsEmJwJnpfyxO +hEg== X-Gm-Message-State: ACrzQf1kNoGP9cVGh4XDk8bXfzPzdQi+uLsincskx3DOhsPOxEGfNzoj XR3XBpNUyCJ9KeIair1OmirRoEXzLSc= X-Received: by 2002:a17:902:e80b:b0:183:7463:f628 with SMTP id u11-20020a170902e80b00b001837463f628mr48204663plg.19.1666853757533; Wed, 26 Oct 2022 23:55:57 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:99d6:ae15:f9aa:1819]) by smtp.gmail.com with ESMTPSA id h7-20020a17090a710700b00213202d77d9sm405482pjk.43.2022.10.26.23.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 23:55:56 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] gpiolib: of: factor out quirk setting polarity via separate property Date: Wed, 26 Oct 2022 23:55:52 -0700 Message-Id: <20221027065553.801153-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747823180202653367?= X-GMAIL-MSGID: =?utf-8?q?1747823180202653367?= Several legacy bindings use a separate property to specify polarity of GPIOs instead of specifying it directly in the GPIO property. Factor out this code to make it easier to add more such cases. Signed-off-by: Dmitry Torokhov --- drivers/gpio/gpiolib-of.c | 98 +++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 52616848a37c..331744c75faf 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -186,33 +186,68 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np, } } -static void of_gpio_flags_quirks(const struct device_node *np, - const char *propname, - enum of_gpio_flags *flags, - int index) +static void of_gpio_set_polarity_by_property(const struct device_node *np, + const char *propname, + enum of_gpio_flags *flags) { - of_gpio_try_fixup_polarity(np, propname, flags); + static const struct { + const char *compatible; + const char *gpio_propname; + const char *polarity_propname; + } gpios[] = { +#if IS_ENABLED(CONFIG_FEC) + /* Freescale Fast Ethernet Controller */ + { "fsl,imx25-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx27-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx28-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx6q-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,mvf600-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx6sx-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx6ul-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx8mq-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,imx8qm-fec", "phy-reset-gpios", "phy-reset-active-high" }, + { "fsl,s32v234-fec", "phy-reset-gpios", "phy-reset-active-high" }, +#endif - /* - * Some GPIO fixed regulator quirks. - * Note that active low is the default. - */ - if (IS_ENABLED(CONFIG_REGULATOR) && - (of_device_is_compatible(np, "regulator-fixed") || - of_device_is_compatible(np, "reg-fixed-voltage") || - (!(strcmp(propname, "enable-gpio") && - strcmp(propname, "enable-gpios")) && - of_device_is_compatible(np, "regulator-gpio")))) { - bool active_high = of_property_read_bool(np, - "enable-active-high"); /* * The regulator GPIO handles are specified such that the * presence or absence of "enable-active-high" solely controls * the polarity of the GPIO line. Any phandle flags must * be actively ignored. */ - of_gpio_quirk_polarity(np, active_high, flags); +#if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE) + { "regulator-fixed", "gpios", "enable-active-high" }, + { "regulator-fixed", "gpio", "enable-active-high" }, + { "reg-fixed-voltage", "gpios", "enable-active-high" }, + { "reg-fixed-voltage", "gpio", "enable-active-high" }, +#endif +#if IS_ENABLED(CONFIG_REGULATOR_GPIO) + { "regulator-gpio", "enable-gpio", "enable-active-high" }, + { "regulator-gpio", "enable-gpios", "enable-active-high" }, +#endif + }; + unsigned int i; + bool active_high; + + for (i = 0; i < ARRAY_SIZE(gpios); i++) { + if (of_device_is_compatible(np, gpios[i].compatible) && + !strcmp(propname, gpios[i].gpio_propname)) { + active_high = of_property_read_bool(np, + gpios[i].polarity_propname); + of_gpio_quirk_polarity(np, active_high, flags); + break; + } } +} + +static void of_gpio_flags_quirks(const struct device_node *np, + const char *propname, + enum of_gpio_flags *flags, + int index) +{ + of_gpio_try_fixup_polarity(np, propname, flags); + of_gpio_set_polarity_by_property(np, propname, flags); + /* * Legacy open drain handling for fixed voltage regulators. */ @@ -267,33 +302,6 @@ static void of_gpio_flags_quirks(const struct device_node *np, !strcmp(propname, "snps,reset-gpio") && of_property_read_bool(np, "snps,reset-active-low")) *flags |= OF_GPIO_ACTIVE_LOW; - - /* - * Freescale Fast Ethernet Controller uses a separate property to - * describe polarity of the phy reset line. - */ - if (IS_ENABLED(CONFIG_FEC)) { - static const char * const fec_devices[] = { - "fsl,imx25-fec", - "fsl,imx27-fec", - "fsl,imx28-fec", - "fsl,imx6q-fec", - "fsl,mvf600-fec", - "fsl,imx6sx-fec", - "fsl,imx6ul-fec", - "fsl,imx8mq-fec", - "fsl,imx8qm-fec", - "fsl,s32v234-fec", - NULL - }; - - if (!strcmp(propname, "phy-reset-gpios") && - of_device_compatible_match(np, fec_devices)) { - bool active_high = of_property_read_bool(np, - "phy-reset-active-high"); - of_gpio_quirk_polarity(np, active_high, flags); - } - } } /** From patchwork Thu Oct 27 06:55:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 11617 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp73265wru; Thu, 27 Oct 2022 00:01:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6AzQ3G1RIf1UhEX9fS4AlwelqPNJoghDYPC5FbuSfeS6BefMWktdLZ4Cv5/9NeVZWW7uoc X-Received: by 2002:a05:6402:268f:b0:462:7cbe:953a with SMTP id w15-20020a056402268f00b004627cbe953amr4012056edd.385.1666854115764; Thu, 27 Oct 2022 00:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666854115; cv=none; d=google.com; s=arc-20160816; b=CZnum3OLcer+O4yLChWDSYxhgpCjA5IvZbCzO/tH2g30yEVMuJjSPMYWGbJeQtdQEE rNZN0xc+8nQCj6kHl69ggJpVIUSiwiB6QqREk3kmMBjAyuu7+qaIqEXhUNn97enwQHra CMn4lIrEihD+ycu0FyDi95jk97knq+1cJEYRRTG8bCKu7KSuyltFXCKc5B+m/uZAYGcD ky/6Za52f9zOlYvgEKCWdsLA9FisWaZVPQnr6cDPNb+JY4ZuH1tRQfmWXurGCIHFOLP8 QHNsXrEI884n3BQ8nnrcN/K3PLkt2iZyVkieFUD+0hAFx6jnezaGNfITgVdpZebG8mgG tLfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jf24NLbsU8ask7SM9WbvKjapzt603tSoicBq9TM59p0=; b=C7qZykui1CAdOl5ra2rqsCzJm8a3cReSlxzW8CFSs1/cUeAey7CYMKVA6gDDq/0REt ab23QI8Rs5GnhBEC9+ud8ngGywldNWdEnbjqQXCG83NdfeSnLVobcsKVWDAJ0vm5Zr4m DzpEkh/aeMWpvO+WXcYm4BzmhNo/pZTVxSMDWgIIBl45b8WRMkGNAKWSXITlTq2mx9a6 eRyCF0r/2Lry5SZRjhtFjtj2w9DuTs4p69ovu87NLs4oSpx2OmMapCCNpVdAsSLQmm7c 2xXPGViF4bkZnAcPJRBnT2iVUQIi2RTd+wphkkxzZJ31OZwFMG8NWgDKEe7M26SGHwd7 9ZJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j9TwfG7t; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg9-20020a170907a40900b007a7b4b41ccasi720390ejc.562.2022.10.27.00.01.29; Thu, 27 Oct 2022 00:01:55 -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=@gmail.com header.s=20210112 header.b=j9TwfG7t; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234698AbiJ0G6O (ORCPT + 99 others); Thu, 27 Oct 2022 02:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbiJ0G5m (ORCPT ); Thu, 27 Oct 2022 02:57:42 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCD21633A3; Wed, 26 Oct 2022 23:55:59 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id m6-20020a17090a5a4600b00212f8dffec9so646916pji.0; Wed, 26 Oct 2022 23:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jf24NLbsU8ask7SM9WbvKjapzt603tSoicBq9TM59p0=; b=j9TwfG7tRhD0JT9otRxnwA5Tb6uM8vQKwVRSDS/zeOrXoAkCjAe1YbjSmLBZ39V1p0 BsD7khiVnQq3fOkT1vJfl6bwIfk3U888ldYxOhHvkuTtzWGzUZ0NBgI6ErTw0S5SlhH9 Yk48LLK4rKMBsTWkxyPZfPuJKecacf3GJ52cf9sFQUfuTvLcxkv71zlKHx/XzGuy3ZVr 4evoXXXRls0jdzdj5CX9cUy1Vp0zhorJDl6ThzDKbfWgRC4ny0qmCOJAq0pbV/u12WK4 Fu+VlvyerziKPgIDMR/jYE5TICvIW3aC/Xyz0YxgL199XulbUDxtVDoCbhOXjeFh41Jc t05g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jf24NLbsU8ask7SM9WbvKjapzt603tSoicBq9TM59p0=; b=gNABhg2KJrkeHdCyyBr6M6gfQZ4vGY7hm2Fo/KPQOjSMeIMXXckcnw+5DdECsbnDdw nteFcSXwysxXuj+Lfw4OEyvCBkbSaKt5cWEAdCfSfgutun5gILmMk3qnAUinB48OS2ol Q7UlXCGkvmsGPmreZPjUlMxi/53y5K0muuni6okNZztEOW4muJwnlnNZxMuzIiQrvCcT vVWoVN6Gr576+QDJOKE8ZxkQwE/49I70OzXCLZJp8wwdXuUHmBCRSZXCzSQOfFk4HsI6 Zqs4OHXfTTANRyeWymx7XBfwfO1HQnPtH0B0Ozq4UqMq61JjsWdwQUn9472wdA+NUzGi fJ1g== X-Gm-Message-State: ACrzQf0P3fE7ULfqwZaf8MgoQ29Br2E9bEl/E19ZZ3aGi/9T7A6ZbtN4 YGcCGdQV+1GDEq1tWOtnflQ= X-Received: by 2002:a17:90a:d50e:b0:213:7a2e:8991 with SMTP id t14-20020a17090ad50e00b002137a2e8991mr394348pju.113.1666853759073; Wed, 26 Oct 2022 23:55:59 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:99d6:ae15:f9aa:1819]) by smtp.gmail.com with ESMTPSA id h7-20020a17090a710700b00213202d77d9sm405482pjk.43.2022.10.26.23.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 23:55:58 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] gpiolib: of: add polarity quirk for Freescale PCIe controller Date: Wed, 26 Oct 2022 23:55:53 -0700 Message-Id: <20221027065553.801153-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221027065553.801153-1-dmitry.torokhov@gmail.com> References: <20221027065553.801153-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747823221169696527?= X-GMAIL-MSGID: =?utf-8?q?1747823221169696527?= Bindings for Freescale PCIe controller use a separate property called "reset-gpio-active-high" to control polarity of its reset line, add it to the list of quirks in gpiolib so that gpiod API can be used in the driver. Signed-off-by: Dmitry Torokhov --- drivers/gpio/gpiolib-of.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 331744c75faf..1d37172579d1 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -208,6 +208,15 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np, { "fsl,imx8qm-fec", "phy-reset-gpios", "phy-reset-active-high" }, { "fsl,s32v234-fec", "phy-reset-gpios", "phy-reset-active-high" }, #endif +#if IS_ENABLED(CONFIG_PCI_IMX6) + { "fsl,imx6q-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx6sx-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx6qp-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx7d-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx8mq-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx8mm-pcie", "reset-gpio", "reset-gpio-active-high" } + { "fsl,imx8mp-pcie", "reset-gpio", "reset-gpio-active-high" } +#endif /* * The regulator GPIO handles are specified such that the