From patchwork Fri Oct 14 17:54:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 2774 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp308897wrs; Fri, 14 Oct 2022 10:57:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Vr1JovZS0zevcA6Bt9ke7BGV/4wacmJi4POOHarir37pTmV/1NaO4UDdSSD1m/5DVjPOk X-Received: by 2002:a17:907:7d87:b0:783:fb5:1899 with SMTP id oz7-20020a1709077d8700b007830fb51899mr4345667ejc.456.1665770248014; Fri, 14 Oct 2022 10:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665770248; cv=none; d=google.com; s=arc-20160816; b=GjhXNIUUYI5JwUdrU3LJ7oizW9e3JG7L2dC65UPxciXiGoJj958tVZ8fIQWWphyeVD 9BTUCpzjdoLEU2NPtmnMDNxKUSqPzTu0N/4Jw883syke4Hd9rgo3sDqy5VQ+QymzGl8F CvAW7EWnD7sTiAIJv89X5eR6jQWe2M/0UC53Ufj3Kcg/Puf3x+vloGxsZHWdxpMX3Otw JGjU+HFikAMDwY6LLZSAZFlVDusx4FuHgREEUlN3dAHe+dxC3OZUaoMZ7yrANrYHEo4b 0XGHZXpZZxLQPLYkTr79/WfthkwJ+Tc83vre/ftMOFaSenhWGN9uEWtRQZ5aWAymOhNx UrLg== 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=bWZ+aGOI9zXRffRicNGgT9n+AHk/SzmN5RkqWoKLfug=; b=sb4DZENJfrkBSEqdfe+Q6B1G+rRtVZUKD8njPPCZvnsNNby/B7dMcuf4v3s/iDha8F rZ184dS7ibv9gkqND2s9cm3iWKUhtdUE9GlXBeaNv4ur+EyBbSZLkH72YJTwcguQww2f zybZc9vuxMVKBFieoNw0kYx91CvKm8b9U5fcyHkVcpTm0whGfpiYY14V+OT1omPg7HhO l2oniyDRgtlMJm7P+M7XHJloGVoL3gvVnvNHr1Wkeq7te5JilKWQPO1AkwzXsVaNaEUl vO/23mwE5rzThaRX5kGQxtWQGmJBqe77drOWekk32M4uWQ8L2bp0zJknE0EAC+GsKQ0n Xmhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fOuoZbM/"; 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 dr8-20020a170907720800b0078b3edae43csi3381954ejc.37.2022.10.14.10.57.01; Fri, 14 Oct 2022 10:57:28 -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="fOuoZbM/"; 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 S230169AbiJNRy5 (ORCPT + 99 others); Fri, 14 Oct 2022 13:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiJNRyp (ORCPT ); Fri, 14 Oct 2022 13:54:45 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2281A237; Fri, 14 Oct 2022 10:54:43 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id f193so4976653pgc.0; Fri, 14 Oct 2022 10:54:43 -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=bWZ+aGOI9zXRffRicNGgT9n+AHk/SzmN5RkqWoKLfug=; b=fOuoZbM/KjXQtLJpXmlUZdf0h5Nn6/Px2oC5XUiQn9ZydwR3x4nYk6bH+rwzR5dPbm SgLxRAhCzrDPIM3ABgllWBkdEDMqpe5P1q/j05LWtiH0IfnlVlLfJHV/CEKctMuVLmBX lljNk27Nac8Jm7tB01ebLFIokCWjW11F5iEqF9Zuk+LBAhVz3BCQoeoPTYRVPS66tSoO LvzjCgHO1oX1UamlmU1uoelQkiPDHKmsc37EsElMWeAigXtFJivGPnFeO2fgDpAR0byB rqNp0sp1B8ZTfSi9hmmlN16nYt5/899wmkZgmqHf4qC65cD5+UsaCrhffmMgJK3cDIa/ PD6g== 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=bWZ+aGOI9zXRffRicNGgT9n+AHk/SzmN5RkqWoKLfug=; b=M0MwgGtQckY6WlVSVW8+StNAzo9uTTvSb/vBYZkJLgYWTmlk1rd0HIm+YSB24yc+4O /yWqZkh/NQjzudGXrPlE9nyKyLytOuxZHfkuWc9H6G4JkVfiC6jOQeGfPZXzDBu8Ggni XMOR7Rz3ifJQvsma17ypYZyt7cy9paOWOOIfeNq5botf2QBVxMRPc1ZtLP3k6L2JpaF4 N3onaivtTSHaD/+q7DiULPBpYynSgcZACbulkgh2wBETVCGgeSuD/dfvicGqnAUJRln3 rHbjUqqiPK6VeQc08TqVZBGhaDKGQbdEBKby0lo7tN9+mvVtwNkIXwkCu1QrcuRWOD5E 8Zuw== X-Gm-Message-State: ACrzQf0kLhzFQzJZRiBkA1xWVRu0tZvi6w9XGf55R4sby+zHYHrNgYdk DGM/TozxeAoz/+naWH0VDyrnw4TuMhQ= X-Received: by 2002:a63:4e18:0:b0:43c:2fc7:2eea with SMTP id c24-20020a634e18000000b0043c2fc72eeamr5688379pgb.119.1665770082916; Fri, 14 Oct 2022 10:54:42 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:da06:5604:594f:f6af]) by smtp.gmail.com with ESMTPSA id jj19-20020a170903049300b0017f7819732dsm2011780plb.77.2022.10.14.10.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 10:54:42 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Alexander Stein , linux-kernel@vger.kernel.org, Daniel Thompson , Andy Shevchenko , linux-gpio@vger.kernel.org Subject: [PATCH v2 3/9] gpiolib: of: tighten selection of gpio renaming quirks Date: Fri, 14 Oct 2022 10:54:27 -0700 Message-Id: <20221011-gpiolib-quirks-v2-3-73cb7176fd94@gmail.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221011-gpiolib-quirks-v2-0-73cb7176fd94@gmail.com> References: <20221011-gpiolib-quirks-v2-0-73cb7176fd94@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?1746686703664403857?= X-GMAIL-MSGID: =?utf-8?q?1746686703664403857?= Tighten selection of legacy gpio renaming quirks so that they only considered on more relevant configurations. Suggested-by: Daniel Thompson Signed-off-by: Dmitry Torokhov Reviewed-by: Daniel Thompson --- 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"