Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp434826imp; Wed, 20 Feb 2019 02:54:21 -0800 (PST) X-Google-Smtp-Source: AHgI3IbNNnsqY7Mcj+lV74GQWbt8KKFrKrSwjYo4Noz1do21q47hlOWfMqei99jzxhfkZ2qTET3i X-Received: by 2002:a63:4509:: with SMTP id s9mr27555801pga.420.1550660061688; Wed, 20 Feb 2019 02:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550660061; cv=none; d=google.com; s=arc-20160816; b=lZEXwdxCw7X4kzqdheOjOutk3bkVC3C6f3DD1MfYYASAlT97eVxLTyaZMwX7jGq7+q Cprem5e20KxPFbAfVOHokNhnQFT9A9kMuUMnv9cgArzJcepEDoNqtUGSUiisi3sacI/s k4a3k0GOzru92R0RzQAQ2Mip9LQwi8Uus08pglgX+TiDFvMjj9YZnFVWQq+Py/skPwmT sV+Nd9evLp0ei/sGJyuImtE0H+bQNAwtlmZYC1MZiyZ4/ANwBzyl9kkZJ4wMAtvrDOZR oeTx91OJeRmwEN3wyw9aZ3T1kmZrM8y9+SXFZeZf04LdcT4tZjfMs6rCVjrSFlUkhpI8 oG/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lYnBEEmpFBDz1hV5pZ2bsdS3p6zU1mRjCvzLhQfwBdU=; b=BoSVZ96Q1RSWvMTqXk6rbdmC2TOL3rpfeaGxSF+hijc9CPwsP+MkZxrcljTBo9eGo6 J9yKkEZVT4oA3/KZSv6FDYT9UQ9tmie5qTGcf5TV27D6WutgZOQW5wuKQiutg46SXygT IMip7Y1NKeOUG/3MygzE7Z7qAcnTL9R7bLqFmPMLPI0EHRAFv5gaLaIdhLyr0vm3dRg+ dnedZzD1EiiD7byOY/hEmJjb6CUzQjWNT8l5U/6jVDcHE9D+JdnY0Y7PpsJCCOwfOHdd 3vTobyYT/NPE+EAkCwPHGo6CgtNIP5SFPf6mEJD9DL8ttA1cqPkdvsKtVKhw2KVjS1Zu iL0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JdZkluLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si16571147pgb.383.2019.02.20.02.54.06; Wed, 20 Feb 2019 02:54:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JdZkluLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727636AbfBTKwS (ORCPT + 99 others); Wed, 20 Feb 2019 05:52:18 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52387 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfBTKwS (ORCPT ); Wed, 20 Feb 2019 05:52:18 -0500 Received: by mail-wm1-f66.google.com with SMTP id m1so6145797wml.2; Wed, 20 Feb 2019 02:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lYnBEEmpFBDz1hV5pZ2bsdS3p6zU1mRjCvzLhQfwBdU=; b=JdZkluLz++Mx1C8JiA/Y2HkZRRrTukTquhr1Bc06g67MGdllzRv3YMEEw4PaAxmG87 6v50islDKr6LIYHEvsb1vHlOPhKZPPedQmHNJhBVMFkKM6oouKGHCX/flTCxLyo5/flS z5zxh0ILplOBybnUXjZ8yn3BxwvX/iYECqw2lrRxk/JOydZmQchxQR6APeOwaHBlSJ1v f4/xjvmGsyHIUfEO5kLpSKrgTTvEa9/sseCa6orotADkdQf5SUQ5TNg2a1Qu5zq4qQMV hopl1QXwCGK1S/QueLT1P4LGfxCCjmcb8OPvB4qPcSbq9XyiuoNlB3PP2L6CfdCKtXr1 H2kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lYnBEEmpFBDz1hV5pZ2bsdS3p6zU1mRjCvzLhQfwBdU=; b=H/fTGdbQ4/Kfko+XtHL//bwWW6PKKaANAhiRSBbbIU46sEqO3NhXK8TYZ8r8O/ULNI ziROzx3BnVlZg9QyQqN/7AMMzZU3Hqm0CVVKTMZ4J0jpeaxX4Tdv91HFj4PjpJbs1gng 6T3BGCX9W/5Xg22B/JzR8eGHG34/OA0jb8bUIIG/l5/Yy8D0g6AjeHNb2rzWLvB2WUlC PJlIVWZc3OljTPWv6FLPK66o8j9Ri68BG1yXA4z0IjuJxXylWonhZYGJJZx1ukvIIgkS NRk61SgXfbPr6NI8YccGFz6nTKa2zZnjYaf5oYGLHETPrDsw+ciSvd1KnPgxTaGSZL+W NyUA== X-Gm-Message-State: AHQUAuZz5G3I9omtQRSr6NVELKUp7uiDfs/+I6JOPrEr6A9VdJ+BlYU9 K6ZLj6WIMy99Dwa4SfK/imw= X-Received: by 2002:a1c:6789:: with SMTP id b131mr6172877wmc.22.1550659935752; Wed, 20 Feb 2019 02:52:15 -0800 (PST) Received: from localhost (pD9E51D2D.dip0.t-ipconnect.de. [217.229.29.45]) by smtp.gmail.com with ESMTPSA id 12sm10391904wme.25.2019.02.20.02.52.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 02:52:15 -0800 (PST) From: Thierry Reding To: Linus Walleij , Bartosz Golaszewski Cc: Marek Vasut , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpio: of: Restrict enable-gpio quirk to regulator-gpio Date: Wed, 20 Feb 2019 11:52:14 +0100 Message-Id: <20190220105214.26618-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thierry Reding Commit 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") breaks the device tree ABI specified in the device tree bindings for fixed regulators (compatible "regulator-fixed"). According to these bindings the polarity of the GPIO is exclusively controlled by the presence or absence of the enable-active-high property. As such the polarity quirk implemented in of_gpio_flags_quirks() must be applied to the GPIO specified for fixed regulators. However, commit 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") restricted the quirk to the enable-gpios property for fixed regulators as well, whereas according to the commit message itself it should only apply to "regulator-gpio" compatible device tree nodes. Fix this by actually implementing what the offending commit intended, which is to ensure that the quirk is applied to the GPIO specified by the "enable-gpio" property for the "regulator-gpio" bindings only. This fixes a regression on Jetson TX1 where the fixed regulator for the HDMI +5V pin relies on the flags quirk for the proper polarity. Fixes: 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") Signed-off-by: Thierry Reding --- drivers/gpio/gpiolib-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 1b4c741e0635..bddfc6102a50 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -84,10 +84,10 @@ static void of_gpio_flags_quirks(struct device_node *np, * Note that active low is the default. */ if (IS_ENABLED(CONFIG_REGULATOR) && - !strcmp(propname, "enable-gpio") && (of_device_is_compatible(np, "regulator-fixed") || of_device_is_compatible(np, "reg-fixed-voltage") || - of_device_is_compatible(np, "regulator-gpio"))) { + (of_device_is_compatible(np, "regulator-gpio") && + strcmp(propname, "enable-gpio") == 0))) { /* * The regulator GPIO handles are specified such that the * presence or absence of "enable-active-high" solely controls -- 2.20.1