From patchwork Wed Oct 31 23:03:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149888 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp97220ljp; Wed, 31 Oct 2018 16:06:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5cWWncgQF3/yI3UcIfHM/RBrgj1zPtXCCCO+Y15fkVPSvdcC0DEhL5eH9ng8CGeN8RhKD6+ X-Received: by 2002:a62:4784:: with SMTP id p4-v6mr5162073pfi.257.1541027181500; Wed, 31 Oct 2018 16:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027181; cv=none; d=google.com; s=arc-20160816; b=nyBKuKydzSuGndKmWBhQp/QgJgaQ9EroPQgGwnLCHteT2GHAMCnYlbCy75MGeQZc14 50RfTSku5SOs+pCdGklWHm6aHhUIA76vMnmkbhANt3wRxeaxj1CLYXiAKAEOdQ2mV8EN kPc/Cc4u41QY5v44A3WV6WBn/TkFAhg/u31ndCXlaKTHkPsEMOQXwJ8bDJzzyi3LQ/iK zL3XyYFFMyJPo7RkQ5bXuOCGrY/bct89D5aNeBEMw09DIl+KUjZDIkyc9+aZ/Mj4LvbU ecqCGORNPSLMoA9w+UlVE2Uk2/55CvpTfk0SuPXcOfKV0EqaPFpdIlldkgOrSyeTd9F0 6JTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DkHASvWaQzP46fVNTllqBG+7zWgY5xyiIuvOH1yIhgI=; b=o06+56JOY5XOYEQ3HcHQk9LXAf+DLed5UHmCbewqCGS0o+9U0yBv4anBTDls/attYJ 50DvTTRUicEcxSN2KA/9jvmBa1G5ulUI97b7W2U2rTAwYf3NZfw/DrTTuh/gu5MpiGvN YMJXqP7pPR5ymNNJGX2uHDX8kszi3+aYEys5neZEGxwDx2V6BlbS0IXnZU11CYXZpb3v PlZl8KpCW2mmv680sMAimOiCaoCJK6/zuSsH9fkWVU5wrDd45lIqMLOQfKyXMr3zctCA SsiHmwLcZ0lYEr7DO555uBF9FhKd6pis0kuFC2aldRhOocO5f8BG5KMwE6f+z90bctvh qiCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=REo4rJFk; 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 cf14-v6si28182542plb.422.2018.10.31.16.06.20; Wed, 31 Oct 2018 16:06:21 -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=REo4rJFk; 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 S1728039AbeKAIG2 (ORCPT + 32 others); Thu, 1 Nov 2018 04:06:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:53388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbeKAIG2 (ORCPT ); Thu, 1 Nov 2018 04:06:28 -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 1A2BF2081B; Wed, 31 Oct 2018 23:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027177; bh=xixfP+2xcVyJj/LcGiNejEQLYC1PYTYpBTx80WWdXr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=REo4rJFkAAWx9+4hH/19eixCsQTgajzWU9F5x3HONd37GsUDVFr1te/pml9h9cBHc n0mVSuPdlYGOf2HX6zwNssOJV+zcpb+1Yzl6+lB/Y4/8QiYpma7InJJ3ip0OSE+UWk VsoZjpHLVoCqagjCQN2a+IKjOYHP3Xyn5k4P8e14= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.19 039/146] regulator: fixed: Default enable high on DT regulators Date: Wed, 31 Oct 2018 19:03:54 -0400 Message-Id: <20181031230541.28822-39-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 28be5f15df2ee6882b0a122693159c96a28203c7 ] commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") switched to use gpiod_get() to look up the regulator from the gpiolib core whether that is device tree or boardfile. This meant that we activate the code in a603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags") which means the descriptors coming from the device tree already have the right inversion and open drain semantics set up from the gpiolib core. As the fixed regulator was inspected again we got the inverted inversion and things broke. Fix it by ignoring the config in the device tree for now: the later patches in the series will push all inversion handling over to the gpiolib core and set it up properly in the boardfiles for legacy devices, but I did not finish that for this kernel cycle. Fixes: commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") Reported-by: Leonard Crestez Reported-by: Fabio Estevam Reported-by: John Stultz Reported-by: Anders Roxell Signed-off-by: Linus Walleij Tested-by: John Stultz Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/fixed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 988a7472c2ab..d68ff65a5adc 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -84,9 +84,14 @@ of_get_fixed_voltage_config(struct device *dev, of_property_read_u32(np, "startup-delay-us", &config->startup_delay); - config->enable_high = of_property_read_bool(np, "enable-active-high"); - config->gpio_is_open_drain = of_property_read_bool(np, - "gpio-open-drain"); + /* + * FIXME: we pulled active low/high and open drain handling into + * gpiolib so it will be handled there. Delete this in the second + * step when we also remove the custom inversion handling for all + * legacy boardfiles. + */ + config->enable_high = 1; + config->gpio_is_open_drain = 0; if (of_find_property(np, "vin-supply", NULL)) config->input_supply = "vin";