Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp517948imm; Mon, 1 Oct 2018 13:49:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV60flRug+s+5i/dURTkm3dReZ3D5jRRN1GoZejQgUaMiybTHIowSOpGZHBbYtmkG6sBK7zqD X-Received: by 2002:a17:902:b947:: with SMTP id h7-v6mr11471171pls.231.1538426969940; Mon, 01 Oct 2018 13:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538426969; cv=none; d=google.com; s=arc-20160816; b=W2xGMl3EGZlncco2Q8rvOQA+IAqYObMvxdbtn+ICks5vNZRMYVp8mMvG9m7NnkMiEV rqcdhXQG3nw1e8Zq9cX8om3FNywvC3nPQxghtGL5Bqva2O7h/ZBmPcx5yXe7+SBg5xNk nDBJpF0nGU1mE8Lh1ZQW0qlsbtzheCYRhSEAyBZFjQzT1jlU2ltALm1hiyeGUkom7Kzt lS/R+OopeIrwPz+QcCRj84qxWClebRd9xVjoMY75mNLscjNKN5WtmM3FYdz2xEzRx+ga aUOoLXxfwjgLnJy9+ejIMVRQ0Qo6UFwSa3QrvVnklMst2WXCcVZ3W2/ZFqrI5AQwCzeI Th3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4OfcV+qZLMIHL0EjvmHunbQ/HRLmYv01teHcTeDRTbI=; b=KGsIAW59Voh06HRXEg9/zVrGU8dLar2edTlEwr6z4EAsqM4jbii1OyLjSlzoOa/sC6 bnBcIpMTdAt4kJyMFHtBB1dYXhbYbxEJW7D/vTAwGuCO0bTjBiSRd+FvYquCtmWfufe9 iDz4nDeYAn//3Xxicr2n5nG0Cjhe/dZOlspxJva/pUqqi5Ob9XOD38YtId81/S+AmF/Y YsfNDV0APrWlgTrUDf4kgB/E8Uik1AiEeS8mIW1iZ3OqI1tCsxTd4gfBC+NJjNi9n1w5 QG+mdYShNXlUYh4RTIgO1/PHIo0FWX7wYKqIB1bGRRP7vl7sWKnRy3dCmcnbbfvhnxlM sWrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f5pB6hEV; 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 j20-v6si3487479pgh.535.2018.10.01.13.49.13; Mon, 01 Oct 2018 13:49: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=@linaro.org header.s=google header.b=f5pB6hEV; 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 S1726304AbeJBD2o (ORCPT + 99 others); Mon, 1 Oct 2018 23:28:44 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:55865 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbeJBD2o (ORCPT ); Mon, 1 Oct 2018 23:28:44 -0400 Received: by mail-it1-f193.google.com with SMTP id c23-v6so218614itd.5 for ; Mon, 01 Oct 2018 13:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4OfcV+qZLMIHL0EjvmHunbQ/HRLmYv01teHcTeDRTbI=; b=f5pB6hEV5wI4VMTrQL6NUG/beoCy4UOhi2xEu6XT9b1gix4iQSu0Su5SvyyDZRsH3q PHVOWcrWCzWOmseiuUD74Puc4ldNvcjJLsHiu1gXXoddgTGsqhMT+ObMyyIWY87SyLvM oFcljqrveQktFe2FyHiRfq6hyfjl/LLSWuOo0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4OfcV+qZLMIHL0EjvmHunbQ/HRLmYv01teHcTeDRTbI=; b=llGjTKHhNrD4OSiWSsSg3uUySW+DyNeLe72EPQFe5y3qi9KQmx6vl+aePHiCwLA3rX bxSoCAtXEurr2AWl/a9aOhS7YIbq8EPrp/LgSMKE193KfHusL9uKl+/Yzsk69boazZsl xJv45/JWhNAkzEoaFXUooQ1SyOJQT31jTyvO4o77644+DV6m4s6GaTeIxmPIgcBVG8Bg 973ruyRRHLmjkZ8qTMUNwDi9Qo4VNMSYO4qoPhqIub+UWSvZTR0aNVLTvi0acQs5SRHx FFp+XRZTy8kUdfS2p5N0TelhVs0O0h67KR5zZOOIprS6RvaprHD/qnZjFPXpUbK2kTyI 65rg== X-Gm-Message-State: ABuFfoiIcbhcBjZkbIXcRhUhvgXynu22T12a+ZHsBONAtX5u2CfpMYOp 0SHO3SSb+iYMNjUuaH6xe/MWo0wc08Q4NKwpMRd0iQ== X-Received: by 2002:a24:7605:: with SMTP id z5-v6mr10609142itb.62.1538426946702; Mon, 01 Oct 2018 13:49:06 -0700 (PDT) MIME-Version: 1.0 References: <20180906122436.25610-1-linus.walleij@linaro.org> In-Reply-To: From: Linus Walleij Date: Mon, 1 Oct 2018 22:48:54 +0200 Message-ID: Subject: Re: [PATCH v7] regulator: fixed: Convert to use GPIO descriptor only To: Fabio Estevam Cc: leonard.crestez@nxp.com, John Stultz , Mark Brown , "linux-kernel@vger.kernel.org" , Andy Duan , Fabio Estevam , "open list:GPIO SUBSYSTEM" , Liam Girdwood , Shawn Guo , Anson Huang , ext Tony Lindgren , Mike Rapoport , Janusz Krzysztofik Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 1, 2018 at 10:36 PM Fabio Estevam wrote: > On Mon, Oct 1, 2018 at 5:17 PM Linus Walleij wrote: > > > > reg_enet_3v3: regulator-enet-3v3 { > > > compatible = "regulator-fixed"; > > > pinctrl-names = "default"; > > > pinctrl-0 = <&pinctrl_enet_3v3>; > > > regulator-name = "enet_3v3"; > > > regulator-min-microvolt = <3300000>; > > > regulator-max-microvolt = <3300000>; > > > gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; > > > }; > > > > This is a bit odd actually, the GPIO_ACTIVE_LOW flag will > > be ignored as you see: > > Yes, the flag will be ignored by the regulator driver, but the dts > description is correct: it is an active low GPIO that turns on the > reg_enet_3v3 regulator. > > The 'enable-active-high' flag needs to be passed to indicate an active > high polarity. Yes. > > > [ 0.153171] reg_fixed_voltage_probe(179): regulator-enet-3v3 call gpiod_get_optional gflags=0x7 ena_gpio_invert > > > [ 0.153218] regulator-enet-3v3 GPIO handle specifies active low - ignored > > > [ 0.153233] of_gpio_flags_quirks(83): regulator-enet-3v3 set active low because !enable-active-high > > > > Because regulators don't specify active high/low in the second > > cell because of legacy bindings. > > > > So this should not be in the device tree anyway, it should be > > GPIO_ACTIVE_HIGH or just 0. > > Then it would provide a wrong description that does not describe the reality. OK my bad, by all means keep it. :) The warning message does not say the description is wrong, just that it will be ignored, and it is there for the users to be aware of that setting GPIO_ACTIVE_LOW will have no semantic effect. We introduced it because we were worried that if we don't print that, users will tend to think that their GPIO_ACTIVE_LOW flags are respected, so it was the best we could think of. The real problem, of course, is that the bindings are ambiguous with the elder binding taking precedence. Sorry about that, we were young and didn't know how to do it the right way. Lesson learnt. Yours, Linus Walleij