From patchwork Mon Oct 1 20:43:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 147931 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4353979lji; Mon, 1 Oct 2018 13:43:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV61EVHEg+vUwT5CGMdDe9Gp+kBpQc+5eDmJaJbAKsfGcDpL/9Mn66zsMGkNVHStEWAS39ixV X-Received: by 2002:a65:5147:: with SMTP id g7-v6mr2729057pgq.252.1538426636913; Mon, 01 Oct 2018 13:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538426636; cv=none; d=google.com; s=arc-20160816; b=cjb35XHU+SkGeZdIrnZMiOIIx2UnjfcwWZc0+O7dUmu+2h+wT5wYOQAYdsbhiu/2Z6 +pdKFK0qJwxY+iqV0+607pQFtBTsCpidiy8xyLzK2mrDtX3f9B0vcvvOk4RXr++n2KMf G8QLYXITVWAiLswPP4/G2IgzrtootOczAOZx4jE8CTNC7HVb0zfn9kcJUHOmL1lus6Lj iUWDQShSD5YjGnnRBVtbjvPocSG/+DmQdVCTHg1KItUpN28ZWTZSyN5ZbL88uU77y/S3 T4oYqpr7ndhoI3xwOTTYLOdBwJYtrmfbugBgHPvXmBQuwdD/l03nZEy9auZ/l181tWKV Ro3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=EHFETooOOGtFpaMIHZraXZ0xb8qb6oEsreigPOIAUlo=; b=cP60V89CmNydy/l3OgAVtsy20wMLA23y72bc151DbwK5Nl8sj3n19OHhCBQAWPJZaq 6hrpQVhDWsc1O2fG2dk/5qCYCUjv4Z+tHE1RLikW26wNqsHxTA4xlK7W6Kxp0bGrQ+a2 fd+maeur5E7cGz7YiUAqL5oj8N++FPEsCMNTckF/OoCCXHBakPKhstRNgRsPORIIacNx 1v7ej4WTjzRHMqfvskbuKX9eUkq7CY83JdfkCDEdTFngTucY9CR03HvY95QxA2unW3gk nPtbBSayek4qjhVYVsMTVzT5KeFPKuMegMAMdosPMafGBGpYMgAlH3s5s+JSNQ6Z3PCG pTsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A1zHBEPU; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26-v6si13043581pge.339.2018.10.01.13.43.56; Mon, 01 Oct 2018 13:43:56 -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=@linaro.org header.s=google header.b=A1zHBEPU; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726287AbeJBDX3 (ORCPT + 32 others); Mon, 1 Oct 2018 23:23:29 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42561 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbeJBDX3 (ORCPT ); Mon, 1 Oct 2018 23:23:29 -0400 Received: by mail-lf1-f65.google.com with SMTP id s10-v6so3464930lfc.9 for ; Mon, 01 Oct 2018 13:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=EHFETooOOGtFpaMIHZraXZ0xb8qb6oEsreigPOIAUlo=; b=A1zHBEPUigJbpoAVLzyYohO3KMymc+YuNjwwPeD1uDcrbYjwaqqsNVDzPj8FjyDC/Y 9tMrY/PDnOGKoYFOofAC1F37CcQj09MupEuR8U2CM5CGPD/AkajyWnntRoCgB3foZxAa kGlsTPhZR2iqhLFjEO7ldi+jXUg+d/lmu8PcA= 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; bh=EHFETooOOGtFpaMIHZraXZ0xb8qb6oEsreigPOIAUlo=; b=d/Qmex0l3voLHb+hsZx4R2vMsZyaJfs9INZKL89zlofFgbrMESaoM4xqiINhXUQmcQ 7ZvLQykprBQxFhdYAA67XhJrSecND893oYcl2TrZbgXOHBd6P3Q7Lt8a2HHtuLwXeOjb zQEmPBUqu8c2c5gwOHrP18Agslrh84hO6Y2MeHGKmyj8DEKRm2VL5KPPDW3JnE07AUMr Ien57hDkPg6tzC7p7q6nbhiKi1QmPNu19MpygMCB9s5CQGdbIzXgnSRtxtaB998wL5ub Bev+mp+bb6CFynQ3b5k2ahxd0pKuoQmurGJV5eFwWXIiov/Mgot5VyQqhaMLijwOsQfd 1pNA== X-Gm-Message-State: ABuFfogyI11QHdGPVDui7V8eAMCesf4/8/ftMlJ8yJHYHXlEhvAa2voo Ad/L2DOU+maOjX2VNPormFt15A== X-Received: by 2002:a19:2a8c:: with SMTP id q12-v6mr6314314lfq.95.1538426631965; Mon, 01 Oct 2018 13:43:51 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id b132-v6sm2777655lfe.56.2018.10.01.13.43.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Oct 2018 13:43:49 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Leonard Crestez , Fabio Estevam , John Stultz , Anders Roxell , Linus Walleij Subject: [PATCH] regulator: fixed: Default enable high on DT regulators Date: Mon, 1 Oct 2018 22:43:46 +0200 Message-Id: <20181001204346.4655-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/regulator/fixed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 Tested-by: John Stultz diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 1142f195529b..7d639ad953b6 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -79,9 +79,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";