Message ID | 20221027065553.801153-2-dmitry.torokhov@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;chrisfriedt@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <dmitry.torokhov@gmail.com> To: Bartosz Golaszewski <brgl@bgdev.pl>, Linus Walleij <linus.walleij@linaro.org> 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
[1/2] gpiolib: of: factor out quirk setting polarity via separate property
|
|
Commit Message
Dmitry Torokhov
Oct. 27, 2022, 6:55 a.m. UTC
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 <dmitry.torokhov@gmail.com>
---
drivers/gpio/gpiolib-of.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
Hi Dmitry, I love your patch! Yet something to improve: [auto build test ERROR on brgl/gpio/for-next] [also build test ERROR on next-20221028] [cannot apply to linus/master v6.1-rc2] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Torokhov/gpiolib-of-factor-out-quirk-setting-polarity-via-separate-property/20221027-145956 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20221027065553.801153-2-dmitry.torokhov%40gmail.com patch subject: [PATCH 2/2] gpiolib: of: add polarity quirk for Freescale PCIe controller config: arm-buildonly-randconfig-r003-20221026 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/5a0b7be6ee388623c4bbd3f9e97249cf0f96096a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Dmitry-Torokhov/gpiolib-of-factor-out-quirk-setting-polarity-via-separate-property/20221027-145956 git checkout 5a0b7be6ee388623c4bbd3f9e97249cf0f96096a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpio/ drivers/thermal/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/gpio/gpiolib-of.c:213:3: error: expected '}' { "fsl,imx6sx-pcie", "reset-gpio", "reset-gpio-active-high" } ^ drivers/gpio/gpiolib-of.c:197:14: note: to match this '{' } gpios[] = { ^ >> drivers/gpio/gpiolib-of.c:241:18: error: invalid application of 'sizeof' to an incomplete type 'const struct (unnamed struct at drivers/gpio/gpiolib-of.c:193:15)[]' for (i = 0; i < ARRAY_SIZE(gpios); i++) { ^~~~~~~~~~~~~~~~~ include/linux/kernel.h:55:32: note: expanded from macro 'ARRAY_SIZE' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^~~~~ 2 errors generated. vim +213 drivers/gpio/gpiolib-of.c 188 189 static void of_gpio_set_polarity_by_property(const struct device_node *np, 190 const char *propname, 191 enum of_gpio_flags *flags) 192 { 193 static const struct { 194 const char *compatible; 195 const char *gpio_propname; 196 const char *polarity_propname; 197 } gpios[] = { 198 #if IS_ENABLED(CONFIG_FEC) 199 /* Freescale Fast Ethernet Controller */ 200 { "fsl,imx25-fec", "phy-reset-gpios", "phy-reset-active-high" }, 201 { "fsl,imx27-fec", "phy-reset-gpios", "phy-reset-active-high" }, 202 { "fsl,imx28-fec", "phy-reset-gpios", "phy-reset-active-high" }, 203 { "fsl,imx6q-fec", "phy-reset-gpios", "phy-reset-active-high" }, 204 { "fsl,mvf600-fec", "phy-reset-gpios", "phy-reset-active-high" }, 205 { "fsl,imx6sx-fec", "phy-reset-gpios", "phy-reset-active-high" }, 206 { "fsl,imx6ul-fec", "phy-reset-gpios", "phy-reset-active-high" }, 207 { "fsl,imx8mq-fec", "phy-reset-gpios", "phy-reset-active-high" }, 208 { "fsl,imx8qm-fec", "phy-reset-gpios", "phy-reset-active-high" }, 209 { "fsl,s32v234-fec", "phy-reset-gpios", "phy-reset-active-high" }, 210 #endif 211 #if IS_ENABLED(CONFIG_PCI_IMX6) 212 { "fsl,imx6q-pcie", "reset-gpio", "reset-gpio-active-high" } > 213 { "fsl,imx6sx-pcie", "reset-gpio", "reset-gpio-active-high" } 214 { "fsl,imx6qp-pcie", "reset-gpio", "reset-gpio-active-high" } 215 { "fsl,imx7d-pcie", "reset-gpio", "reset-gpio-active-high" } 216 { "fsl,imx8mq-pcie", "reset-gpio", "reset-gpio-active-high" } 217 { "fsl,imx8mm-pcie", "reset-gpio", "reset-gpio-active-high" } 218 { "fsl,imx8mp-pcie", "reset-gpio", "reset-gpio-active-high" } 219 #endif 220 221 /* 222 * The regulator GPIO handles are specified such that the 223 * presence or absence of "enable-active-high" solely controls 224 * the polarity of the GPIO line. Any phandle flags must 225 * be actively ignored. 226 */ 227 #if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE) 228 { "regulator-fixed", "gpios", "enable-active-high" }, 229 { "regulator-fixed", "gpio", "enable-active-high" }, 230 { "reg-fixed-voltage", "gpios", "enable-active-high" }, 231 { "reg-fixed-voltage", "gpio", "enable-active-high" }, 232 #endif 233 #if IS_ENABLED(CONFIG_REGULATOR_GPIO) 234 { "regulator-gpio", "enable-gpio", "enable-active-high" }, 235 { "regulator-gpio", "enable-gpios", "enable-active-high" }, 236 #endif 237 }; 238 unsigned int i; 239 bool active_high; 240 > 241 for (i = 0; i < ARRAY_SIZE(gpios); i++) { 242 if (of_device_is_compatible(np, gpios[i].compatible) && 243 !strcmp(propname, gpios[i].gpio_propname)) { 244 active_high = of_property_read_bool(np, 245 gpios[i].polarity_propname); 246 of_gpio_quirk_polarity(np, active_high, flags); 247 break; 248 } 249 } 250 } 251
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