From patchwork Tue Oct 18 05:41:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 3951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1789431wrs; Mon, 17 Oct 2022 22:42:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65qyWJaUdUnzRfsCAuPK71kBLxjAlEKr8XA2K8a1iZkGeakkM8xwpDYEOcfBqernigLV3l X-Received: by 2002:a17:902:e0c1:b0:180:1aec:1f12 with SMTP id e1-20020a170902e0c100b001801aec1f12mr1303818pla.155.1666071743640; Mon, 17 Oct 2022 22:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666071743; cv=none; d=google.com; s=arc-20160816; b=NCPl3JoXdSrq3MbulDcLdx/8zwDUFd+3smfoAg5MiE93v133MLquxMMo/gAMxx4QHP CHFYXUAJpz0UShDlYSVEEVE2wG7BQsLR4rCimsdLM5CrXL9cd4p09mz92x77Slf0Ddsz EszLbQdFX4dwZYTrPc7Say3W8QuoiM0R0gt7zJT9zi4t6tw7V5Iqb/RQs3dsIK7PWtqO hhgSZBWz2Sl33AkhLi0CfY9h9KPb6aOr2xO6kKnIIKnXNiClJtXJ10XtSibt4XbQ/1aQ XkyR/BaBkCCR4MyRs7wXQWB9urv6RQ+03XhdkxtQ6hYgXiaFg9CIiqLW3Y1QuDt/CNLw 2+Hg== 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=ch1kkg4DviDr6cISnBueqNw+RVHy+3iDkYpvZ9QTu+8=; b=xmkBQLREJANfbWDQbRLL50sd9AAMuoPAMCE78wJXH3/dDGZtPDLjFr6kBbuFpS+vpn y16cZPLMtDCg+8ZNpUE6hUqGILDidVdXDTBSCW8OHIm5IbUeUwxD/9X0s6vqsxRvV53c 0CLrQwJ4484oLSqrnk5YbGy2iwR6Vte32qbaLZXYvA0yTnu/lvExPxFEQgrCQKUMdEdw STJQw3MWlqWLnSVNXpd7e21nshFoaejWuvLE33Nyzx4AeMtWMb817ACSh7chNxQU8SeS Tqqm98FisTLuwjzmbxQ9WrpW7/OhdM4zh9mugnd6KKdiaYIcANb0YNOZpbxdg5LF+Z5j sNVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mHve54bc; 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 125-20020a630583000000b0043ac3ec9d9esi13760364pgf.595.2022.10.17.22.42.11; Mon, 17 Oct 2022 22:42:23 -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=mHve54bc; 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 S230239AbiJRFlg (ORCPT + 99 others); Tue, 18 Oct 2022 01:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbiJRFlc (ORCPT ); Tue, 18 Oct 2022 01:41:32 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B6AEA344C; Mon, 17 Oct 2022 22:41:22 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id t12-20020a17090a3b4c00b0020b04251529so12986102pjf.5; Mon, 17 Oct 2022 22:41:22 -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=ch1kkg4DviDr6cISnBueqNw+RVHy+3iDkYpvZ9QTu+8=; b=mHve54bc7ls4cCd6C+WM3vdDSNGdw+8I7tX818Y+FQd+0A1EfGoZp1Cu9SjKAkb8s3 Mz6bLG0nCRdSFm8PoxRktOPdBxTSH/1gJ+psd/3tNwGufenYlwBHOHRkanuiFHnkpNbi qKTDWws9xj62X8nQs4UY3tIbcymrjuUmf4ng7BiDtgNfN/5CNBFnDncwzG+tmQfasCo8 EMOl9ry8ZHYazcKg0NtcFqpURBiE/IcwXyv8od3GcSZ50/ViCKHX4Hv5ukC0a5reOb+Y EBu8Ag4Up1LyZ87fjL4Y/Qg9Hic/ClAL2eYp5ytA96PKAALHcXOMXHT+Xf1Vr8VqLTbg bVtw== 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=ch1kkg4DviDr6cISnBueqNw+RVHy+3iDkYpvZ9QTu+8=; b=V25XIWm/413y8fw38/c/kKYX6ci7odKjkkukbkCWklhpkwSm00I8DQL8F0mgFAeh7f ry8FZfMxDKiaiLFu7rdTxy1lTTyEKQ4j5Klp7l2k5J5cyA0p6ON9AeyBAtzvusZqp3rv 2im2sLjOutA3K3b+V0r5Qh84VnWQh6ds6Eph3kPlo+86ejBGr/oL7e/nwZiBqmgYck6G TzoMDUpd75gnQIi+JuQautlHUs8Z/p1WRUBUtxesMl8QIQTRMcRg3QZBwUEZFYuXFWDB ud+O7M9kvtEqpYqSrTQ5cYjJAqa/yGMhjWt3CoxUOhpdIqmGwYekdxpyg/ufbX1Wf1bS WAyQ== X-Gm-Message-State: ACrzQf0yMio64LMOBScbZRmbYLrk119bd3MKtSt9b7HtA5LWgAGsimUj VwNPFy2ePt4hncs6VOkVcY0= X-Received: by 2002:a17:903:11c3:b0:17a:e62:16e8 with SMTP id q3-20020a17090311c300b0017a0e6216e8mr1354374plh.137.1666071681430; Mon, 17 Oct 2022 22:41:21 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:f7bc:1bb5:e0b1:92cb]) by smtp.gmail.com with ESMTPSA id z7-20020a1709027e8700b00172f4835f53sm7597435pla.192.2022.10.17.22.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 22:41:20 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: Alexander Stein , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, Andy Shevchenko , Daniel Thompson , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 03/10] gpiolib: of: tighten selection of gpio renaming quirks Date: Mon, 17 Oct 2022 22:41:04 -0700 Message-Id: <20221011-gpiolib-quirks-v3-3-eae9cc2ed0a1@gmail.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221011-gpiolib-quirks-v3-0-eae9cc2ed0a1@gmail.com> References: <20221011-gpiolib-quirks-v3-0-eae9cc2ed0a1@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.11.0-dev-5166b 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?1747002844989712448?= X-GMAIL-MSGID: =?utf-8?q?1747002844989712448?= Tighten selection of legacy gpio renaming quirks so that they only considered on more relevant configurations. Suggested-by: Daniel Thompson Reviewed-by: Daniel Thompson Reviewed-by: Linus Walleij Signed-off-by: Dmitry Torokhov --- drivers/gpio/gpiolib-of.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 63c6fa3086f3..7d4bbf6484bc 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -385,18 +385,21 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np, #if IS_ENABLED(CONFIG_MFD_ARIZONA) { "wlf,reset", NULL, NULL }, #endif -#if IS_ENABLED(CONFIG_REGULATOR) + /* * Some regulator bindings happened before we managed to * establish that GPIO properties should be named * "foo-gpios" so we have this special kludge for them. */ +#if IS_ENABLED(CONFIG_REGULATOR_ARIZONA_LDO1) { "wlf,ldoena", NULL, NULL }, /* Arizona */ +#endif +#if IS_ENABLED(CONFIG_REGULATOR_WM8994) { "wlf,ldo1ena", NULL, NULL }, /* WM8994 */ { "wlf,ldo2ena", NULL, NULL }, /* WM8994 */ #endif -#if IS_ENABLED(CONFIG_SPI_MASTER) +#if IS_ENABLED(CONFIG_SPI_GPIO) /* * The SPI GPIO bindings happened before we managed to * establish that GPIO properties should be named @@ -405,6 +408,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np, { "miso", "gpio-miso", "spi-gpio" }, { "mosi", "gpio-mosi", "spi-gpio" }, { "sck", "gpio-sck", "spi-gpio" }, +#endif /* * The old Freescale bindings use simply "gpios" as name @@ -412,10 +416,14 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np, * all other SPI hardware. Allow this specifically for * Freescale and PPC devices. */ +#if IS_ENABLED(CONFIG_SPI_FSL_SPI) { "cs", "gpios", "fsl,spi" }, { "cs", "gpios", "aeroflexgaisler,spictrl" }, +#endif +#if IS_ENABLED(CONFIG_SPI_PPC4xx) { "cs", "gpios", "ibm,ppc4xx-spi" }, #endif + #if IS_ENABLED(CONFIG_TYPEC_FUSB302) /* * Fairchild FUSB302 host is using undocumented "fcs,int_n"