Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1009170yba; Thu, 4 Apr 2019 02:19:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSRqpHXQOMavNI9zvRz6qoDmoG6VN3wxVXzFpWQf21EvubdzDanmO/sSYEUnjPxpfKZD6v X-Received: by 2002:a63:2ace:: with SMTP id q197mr4490954pgq.371.1554369569273; Thu, 04 Apr 2019 02:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369569; cv=none; d=google.com; s=arc-20160816; b=XEpw7DeTK2ViLjpSC9qlrb+2eUjQ/JRzVqgeqfcwvS1r3X2VpX0UGML+yeIm+/hVz5 /hUyymilTb1/WIdhyjiIrdLMSTUD/KNlxlJks3n0O4//CI/8nT2PDOn6n052GVutYVn1 EqS2EwYQKwr0x1purjvruQT3DRMQQthsH3dHI2aRAOVuToeVO+f5DKgyFeeCiltLIPCn Hpe7oCv5P46Z9IF58Zaqi4j9gTxt0ubcyBVg/RHdGVqkcGBB3iAfHnFPZmzl8SznTvsm npHcdWnwvhbCzQODd5WPW+B1k1abj6zXyJjT2pGU79aw/lzMZNHbXIGi3KXC+CtiOFks bnog== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nSBIp21Y0K6A4yaBK0ZURYox31C/KcVzw6hNh7GDQro=; b=Op6oiG8Yqto2jIBUajwQ4iSJQH5QdOLxRC3yVyJCqnbdU9eUTMgYW17Rk77w5tHj2t fdISSolorW70qqNjF6WFoHahQGW1ZERBRZDVjd6dz1S4ge4rD5rynyWNmu59nBgd4wSX tozo+2ObQIm2X5H3o60U0oRORruET/PDHzO5xXgMetqsj2WB3p7SR19wsZeL5LuHR6pQ QXxYgq3/p7WOAg5lQADje/II7hXuaGf2ycJWJR4DQ0WpBUeznHA5lc5rLBuaKtBLb5Nu mEjiWYHtrUdMcXpiMYY7BUyK9/pqzVtLSHKdIZAvZSR2mLIxUYVHAsbsV/iiMajn3+T2 5bfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FckXAn4D; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si15626680plm.25.2019.04.04.02.19.13; Thu, 04 Apr 2019 02:19:29 -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=FckXAn4D; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388407AbfDDJSg (ORCPT + 99 others); Thu, 4 Apr 2019 05:18:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:60742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388394AbfDDJSe (ORCPT ); Thu, 4 Apr 2019 05:18:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1EA42147C; Thu, 4 Apr 2019 09:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369513; bh=LH9KQATYIcfvbALTVvNg2xwxOYgCX8D/+++btrLgnXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FckXAn4DX3jDFLRXtR15EZh8afx+SY1zrYTYm9hkbAnZDJypKeJa9ILyb/ygeIZSn l/DkV1yXgzuLON7HKHe7GyumJrYuzhNYH9+oduq8Aqw4V3+r3xDI7sX7GqiiYPyTzV p+eRpMiklK0Wrq/MvjNgO8AFMmDJePex4DpADTwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thierry Reding , Marek Vasut , Linus Walleij , Sasha Levin Subject: [PATCH 5.0 244/246] gpio: of: Restrict enable-gpio quirk to regulator-gpio Date: Thu, 4 Apr 2019 10:49:04 +0200 Message-Id: <20190404084627.847159451@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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