Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5638993img; Wed, 27 Mar 2019 12:13:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcNZonaikcp1sTDistVHvHjDWM/hu5tB6EbPnrfj4UOLHI3T0ecI+ClDiOj1HqnCwN3Z/K X-Received: by 2002:a17:902:2bab:: with SMTP id l40mr38584061plb.273.1553714012509; Wed, 27 Mar 2019 12:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714012; cv=none; d=google.com; s=arc-20160816; b=QcaHl1Zh++VQXVKZt6P8azb8kdLyexNILtqBVYVvYcWgWeuLoACSaSVgj76w6Uutfu 5at5Qdr+ETTJwEgVJFVkKHwcnvsDVmdDZCc5kPcrqws1FUqyQeAdfvOAQcPj7n99ZsSg qjGwDQvWIpC7wNGGJJ6ZwxIBvNBiQu7CVgLeSo2dBuA3rTxqtkhbw00EqpUoyejyMmDN zP6mnumNd2NXuHMH+mDEX5qZEMKrXZosHsIMLcP6lUgz6RXRfsNBOc2b7AlZyEAitSoF LyTigZzt3cDZL76vvXHsxZxZbClZ+QLp0KxY0ObaCfhcIzgvoJaa4wdYZxk6n6YTvazs gwUQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+UqjhveaUexQpn/X+bt737tyZeb00oTe4L8is57tlkQ=; b=z/+UPsIHaDfCZmx6vyJuGPsxnRFlJF87ei/r3inDsTW3rvF+2RVIjPAdGfgxx/cCF8 j7v3PtHbQx/kVWHpaCIfb7U3nA6LzEDyjNdW08t9nxX1vlrvvFXb8CqC+zgoV8B3ZRaZ sWIllClyHlZSQDNd7jlLjgC3rkZvFVwyJThQuKZ0SlJ16umYS1DrMkChUoaxiPJyGda4 9SZhk6ba6sdkaLeA2SEqFcR6sz79PCTljGu+YKtLOu724umGR3DQcr7t2cIO6uWMAmK7 +Yi6SC9EBYWJLH7aVNrQS/FYk64KKoKGlW8mK0aqQE5nFtMFAwj98+bGlFOmwj/kmwY+ shmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p0WpfBFA; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si18585373pgq.287.2019.03.27.12.13.16; Wed, 27 Mar 2019 12:13:32 -0700 (PDT) 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=@kernel.org header.s=default header.b=p0WpfBFA; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389357AbfC0TMm (ORCPT + 99 others); Wed, 27 Mar 2019 15:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:52360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388793AbfC0SKW (ORCPT ); Wed, 27 Mar 2019 14:10:22 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A76CE21738; Wed, 27 Mar 2019 18:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710221; bh=dzPmHAisZQ9Aa/+kR3y+zmkkQOgFcm9IXQzOqOP/EWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p0WpfBFAh8jEciq4uA08wRdkZb/HtkIvlBHMy65ETeiZmVYjVP6f003ig9G2o5LC+ iv1HDR8g29wp8/kS6aaIwxmrkGWiVb7zroRuASqOkWHT78ztalJXAvcsvWF08ulIXe WE5oPamy2Byy3TjeY9ChDDdKoWlRSUcGLVuCmFf4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thierry Reding , Linus Walleij , Sasha Levin , linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 260/262] gpio: of: Restrict enable-gpio quirk to regulator-gpio Date: Wed, 27 Mar 2019 14:01:55 -0400 Message-Id: <20190327180158.10245-260-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore 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 [ Upstream commit 692ef26e72fcce0c1e73c41683fd3512f3719d55 ] 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 Tested-by: Marek Vasut Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- 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 30542a10014f..a1dd2f1c0d02 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.19.1