From patchwork Sun Oct 30 04:40:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1644043wru; Sat, 29 Oct 2022 22:09:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68yK3gFY4mikJsHLRSMQ6okb68V5WxcHIbvXIl6CYu5o+H/qMhFpdO3rsjfFlAL/2ZFGbE X-Received: by 2002:a17:907:8a15:b0:7ad:c2ee:ad94 with SMTP id sc21-20020a1709078a1500b007adc2eead94mr1769663ejc.238.1667106552454; Sat, 29 Oct 2022 22:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667106552; cv=none; d=google.com; s=arc-20160816; b=QjRdeC7gvgCkPUxQ0h9tcRq+4sw8xlP8D/Mn9ZPfjgHrLy206kfTfDnbpHpc1TQdyG GFSuT5RJevKRfx1XnydU58+es//OW9ueREsBerH4lVveuMHzThH67l1w01tIS3D0wdMt 3rqC+yN2YEv1MYlZ2R1v3izr8BZgasPd5zCska+3bsXvlIUiMEGNLRp6NkyvOrYMw7Y/ U2NuhnE3you/D7WOzvtqIXrVft3Q/z5l4oCAthJp1/2EpNAyvEHY5PB8Z/iXNxrLU517 S/TRhaJMcTbSDxBp8UgS9p5tkOnHYhSazNuJAFrr0UvTx5P+oB26zsUqz4fo37C9UYrC YoBQ== 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=pRAS1l5HUBJOvjS7imdI68KIF+eyQhg+QZ+KkL+P+2g=; b=ercAZXM1AHLvvKAPbx7dy4ET5udd9HBjqS2eCt5oN1T5Wtp7bHa41gkBmf5qpP4FIU aaRclfGUBKjNHoGOWnApU+DC6CZF3KtOFSuZS3NLb5zUxVxvKGX95D+2U2VTfgpSkcrL xCnPX6JLpUF/wHvpte1cf2Qi+GzUHImREeNyS8TLkw0xhSI+7umWje00UulTdKLjU455 u3pkZtBunpgG62AJOanD9S2dVO5AiO4DjpDyMqPWR3CI/cTY0KtZDdfz5ymp7JvWZo6/ GtuGpWXaQBdq3+d+4/8G5fh/VYyONjBiFf/FdBYOTfmuWsHRXpgSI+nYgVt72R84n2Q1 Ig8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IW9IszOF; 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 lb26-20020a170907785a00b0077ccad52420si3117550ejc.275.2022.10.29.22.08.45; Sat, 29 Oct 2022 22:09:12 -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=IW9IszOF; 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 S229714AbiJ3Eky (ORCPT + 99 others); Sun, 30 Oct 2022 00:40:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiJ3Ekw (ORCPT ); Sun, 30 Oct 2022 00:40:52 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3A1813E9A; Sat, 29 Oct 2022 21:40:51 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id c15-20020a17090a1d0f00b0021365864446so7742137pjd.4; Sat, 29 Oct 2022 21:40:51 -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=pRAS1l5HUBJOvjS7imdI68KIF+eyQhg+QZ+KkL+P+2g=; b=IW9IszOFSfXje3HQJOXnxwyZYF4wUAUfPHNakB1YleZg72SbG1Pz/OFHDVUHJ5zTwT QCpemUlLKZUFcy/eIzKNGrNTQ2uLfqjXYI2PzecUs5XAqioyZpqeGv9dIGYe3pXXyR/O st+Op5VRNYQovygrZ4vkNObGPhpR2MDfC38CZLdV4qktwd0Wa6aewwuwDMPLfH2T2rFC H9EUvsIZRFe0TMBUXoToVielRXiXtxc3BIpWZRErAZks0S9t33pgegBdqK2GCDpoPE5z A1iqiR5o3hhNgSEZR0MQDby7yfwSbFH6CCYaty/K2HLynacTs0ojFjISpJLI052wAq1j LHpg== 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=pRAS1l5HUBJOvjS7imdI68KIF+eyQhg+QZ+KkL+P+2g=; b=qApEGcqw+Xbnj7UUMSkY7UzVM53HDDmtGU/B0S4THNZ2qfS/k/Gtpm3t8QiE191OEG BBj4tb3VeRgc3zHOrXS4w9VDgQtIGpN3L1pzsOTttQ23C3NA3Hc3/3wOdWKGFsJq23Ms 8yrQPwOOLs/ddoda5gFFAH+Nt6FxeqrnKriYsVOAJcXkKSpy6q3JoiLg7lmglNpAsyeA kLrWMU7IU9qT5AGlRYSNJkfdrw4QBibPKGJGNHDEWpO/iJewtlF/eY3vfh+7gJIB0m/S Zxb8wQAe0tMhKzk17fr2zaH52/TxDl2qGqUaB7ftQlx82CQ8895h/3jPFUVGlOVtjELm 0c/Q== X-Gm-Message-State: ACrzQf1PvYZnI91lskM9jBB39q71aIFJLFKZDz5eOpiBjYDFgdEJXueK QtNCLvNmoS7JYMX9ya7vq2pudPdWCao= X-Received: by 2002:a17:902:ab89:b0:186:7cfc:cde8 with SMTP id f9-20020a170902ab8900b001867cfccde8mr7693100plr.9.1667104851363; Sat, 29 Oct 2022 21:40:51 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id l5-20020a170903120500b0018123556931sm2029632plh.204.2022.10.29.21.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 21:40:50 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] gpiolib: of: factor out quirk setting polarity via separate property Date: Sat, 29 Oct 2022 21:40:46 -0700 Message-Id: <20221030044047.423859-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-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?1748087920715267956?= X-GMAIL-MSGID: =?utf-8?q?1748087920715267956?= 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 --- v2: no changes 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 Sun Oct 30 04:40:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1640983wru; Sat, 29 Oct 2022 21:57:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IAr5O6tk0QxW4bZKyHnIro9zz8HviO7FwdPTcpdyqTRI1TNRSfr547RF8lG+TgznjB1do X-Received: by 2002:a17:907:2be9:b0:7a1:11a9:1334 with SMTP id gv41-20020a1709072be900b007a111a91334mr6470155ejc.131.1667105873524; Sat, 29 Oct 2022 21:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667105873; cv=none; d=google.com; s=arc-20160816; b=Q+rMnEGNteiHxUVa/HB/he27kqSjGCbQOKLnUljPg8fj1uSEfJLQvciMn8cCvvhbXL CITpkRG+HAxGdSAZVCe36djWcQUq3vqi2QMMmxeXiSVxm6x4JocLXlDkA2bt+z/6JzYs 2LFHu9D6G76TpU9HqXL5gWM4HtOmhj3jecI0iDTf0OD8/TVCKQ8KDjBw0SWWVvHfPRjz JL+5rXiPSico299q/23TJ/3IZOQUi5J3PWE77UMz9QQI5ojMqsxr+XQ+IbInrTI/E3c8 WDGOWrPhc1IDsgFly4uPfthxk9oapyPHbBUjf6gn+X2cGp+Qv++f69wkaAL1dzNezwvC xCBA== 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=n5DCWOE96cYEzH6EecCbh3f/7PYy8DU5D8wpQ1RpsyU=; b=PRtf5/mo7++Sg92iMDkgUTHxVGEbi6b/svSclyIlBNDTl8l5TkoyZgyEg9OMQqU0rP GcJVu5uJMW+aWrpSnDWkambQQa/VnzJa2UhZf9KVmqMbsULgdGEMGZuAMQrzeJxNirQX uvhl3uSsHECbjuih/CbOkUl+mJCMWDOOUWgdCJysOERv2r6fhOKKLGsMNXy+58QJ10dn A+ZqAF1/nOyBv+jCXG57BIOngL59x8l+gtshWeKGhFmQCfvsQq/BXCS5KWO+7hkaTKEP kS9qY3wbue7e5E/S72JjcHTpNVSrFXiISptZx/mZ5V7xn+lJBxNka+56XzzOpu7qCKRq tJkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IySmURz8; 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 nb1-20020a1709071c8100b007316ac034acsi4302116ejc.834.2022.10.29.21.57.16; Sat, 29 Oct 2022 21:57:53 -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=IySmURz8; 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 S229750AbiJ3ElE (ORCPT + 99 others); Sun, 30 Oct 2022 00:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiJ3Ek7 (ORCPT ); Sun, 30 Oct 2022 00:40:59 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A143F13E9A; Sat, 29 Oct 2022 21:40:53 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id q1so8096274pgl.11; Sat, 29 Oct 2022 21:40:53 -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=n5DCWOE96cYEzH6EecCbh3f/7PYy8DU5D8wpQ1RpsyU=; b=IySmURz88rctW9YDMc+3u2/p1+WoDnyxJ3j5G9B9/SE4W8skp5pET1FkoCjfGPSQ+6 rYcCPtHLo5Z7J5LOeFozXftT8dD2W/stvU3T2ptN8BQVxwp2C5Yu9acYLlh5qztQjoTi 5dALitDl4y69Y+9JiI3bObMJ1mpY7jvvyqswTHD5eAX2bvqh6vhDkfVnr+XziPNSQbUV KwcDLPT3yK6wWDh7ZjsAbd82jVv3q5xwhaY/KCs3w+COIJh3d6kU5BfW9aeiQmzluyD0 UPr8zJTI4ab9ZaTmkcNgRHcDJfuQtGWd71ANsYcsAiSHw7JhcZ+B0egOcE8AWS2k2HFD 7jZA== 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=n5DCWOE96cYEzH6EecCbh3f/7PYy8DU5D8wpQ1RpsyU=; b=0b/DvNCA9JcEYj0pE0pqb8pWQC0U55iYXEpXsIOFjCxOVmDEG52O9LsYIWDtK5fajG X4nkpSEH/5M8AfY4jF4BJwNQluCBPZshwu25sl9zlsBWgdMRzWJwGUSLTWhSFAyKlurc JMqhGrbU2TUMhqh5leJCj08LLyfjrhWdzCbihbuYx+GNICCr8E9L1RNFhhhQQ22P4tCZ OCtGceIgvGKTBo+MTV4WyABrhYQICL24AgWsRxO0Kk7EcYamt1GzlXRqFNGw40hwUAQf v3wZDVHcOS9Kj93jX5AT73gf78iKZ9JPJBdgkrgXyfjjJfFy4y7Sk2Vpo668lDgf7HDX 46Aw== X-Gm-Message-State: ACrzQf35q3UWV6qgmGgaZ9gKbTjFBcL3OAXfhIeF6YkttzJzZk9dFA9v Gw5Vnqozid5YT50RyNku0X8= X-Received: by 2002:aa7:88c9:0:b0:56b:e851:5b67 with SMTP id k9-20020aa788c9000000b0056be8515b67mr7328688pff.78.1667104852964; Sat, 29 Oct 2022 21:40:52 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id l5-20020a170903120500b0018123556931sm2029632plh.204.2022.10.29.21.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 21:40:52 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] gpiolib: of: add polarity quirk for Freescale PCIe controller Date: Sat, 29 Oct 2022 21:40:47 -0700 Message-Id: <20221030044047.423859-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221030044047.423859-1-dmitry.torokhov@gmail.com> References: <20221030044047.423859-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?1748087208608258827?= X-GMAIL-MSGID: =?utf-8?q?1748087208608258827?= 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 --- v2: make it actually compile 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..206100d62db5 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