Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6034207ybl; Tue, 10 Dec 2019 15:56:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxMgyisMTZuo0iOLvn5unemI0o8U5JaRSjkfWEnpXg0y0ntE0wV9XXULk34j3D6bj0yjJOH X-Received: by 2002:a05:6830:1499:: with SMTP id s25mr285280otq.223.1576022178415; Tue, 10 Dec 2019 15:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576022178; cv=none; d=google.com; s=arc-20160816; b=C9pUB6OnUCzpxjyz0JPVWdMRUbRnyD1OcviEYUsN4SeQmOx+hUAWvq044Przo7YbLh JGIEdUzyK/5WPpUyV/AnQOBfixtPLfvEG0hX6jVNPyZXI5XJjJDPIWVfcI4E8/drsd6c aa5P50pixem42VmdsFEp9PzHNNZnhPXjPcG7SAke+Qx+9FHhGCyGNLys3Ga0DMRY/Hx5 sgzm9CClwp3UzKiOLk2lv/Cgg8/VtFsHrmcRsVJzvT/7TmsUmB388MlzonSCEpaxAOtm +KHTqT/XNVNic3pwVREyYZiiK+E5m70EDhzjHc7g6BApfElG7bYpoNN8JuAADzNLHedk w62A== 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=KNrohwDsHeZAs+ReIm2Q7EwJ5Hy4Jj8HAR5cu/mtLgY=; b=JmbQ3y2WHdnSBxrt173xwNRU55RCW9Lbp+6CGfPTVLDYuW/LH/gMjY5QFEC6kRkUnL LuAma6iKoUvQK7Z4leDHopEFYLWi9Fns7cUld1OruptqvWlqXgBZFgZ38z6FHdZawbab XVl/cLdFDP+aHzKE5iN+B4Bnd9QanGoaUxR4Q/lMA3z+EInOXKr/BzKsr9mV/9erWmoD fiTvm2wWdxq6fxSThIBw5hjO76tQsUZtWQs5VMRKG/9FOHLi8PtdWFIEKZyh8V7wDbN6 3DnonHAvVogSptElIzoBUzWDYxlMfK7Vparux6K9AxBxlehDEkQ8ZCMBXr2nN6H61YiD tHcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hAbRMVrs; 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 t189si108047oie.13.2019.12.10.15.56.06; Tue, 10 Dec 2019 15:56:18 -0800 (PST) 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=hAbRMVrs; 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 S1726785AbfLJXzG (ORCPT + 99 others); Tue, 10 Dec 2019 18:55:06 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43887 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfLJXzG (ORCPT ); Tue, 10 Dec 2019 18:55:06 -0500 Received: by mail-lf1-f67.google.com with SMTP id 9so15183670lfq.10 for ; Tue, 10 Dec 2019 15:55:04 -0800 (PST) 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=KNrohwDsHeZAs+ReIm2Q7EwJ5Hy4Jj8HAR5cu/mtLgY=; b=hAbRMVrsm1W4JYpKwlAZvEdT933tVqy6w6wMCc7wU8/Lzg2mVB1osVcU1cB1VPIwef /CJ1Z+GY10xo0IaUThsb3JldrQHfnpRtZ+VnPK7s3az7eI6tLGGac3UF6CMi+x8B/A/1 8+qpg93GpxCpp1pUX4fIrdIuGw4RKwqJ8QFN70tRaGYx3wAqVnCknrRCklxxZ39x2+Sf YDS5h08LVLC1Bz4+lYzG2wPIQ//3LBMqGB4aSpxRJxEGo7cfDj8zA4SPv6LQrdn4zTsA VHZQaf+j3+knILNMuVh6kZ5BZX6O6cnqzRPCFIPpaNnTzSJnNse3mOlmdzQONBiyngEE dC8Q== 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=KNrohwDsHeZAs+ReIm2Q7EwJ5Hy4Jj8HAR5cu/mtLgY=; b=FBPNG5xqyssiSevE/DSmJCfeuTbG997KPwPcgNrmDvaNs0WGw3UTqbQg7B2IDxUlyA XZt1egOaZ8pS1OFNRJBEjdrkw+jtF8NcoK9tqTs8N3NGSyWxHoSTmgO3GKxm4SrzYSjz gDRxnB57kXr/xD78WtdbJmQwM68XGjiTPJJtavue692I5rJIhmVUuUFd6mDJjqGv5mt7 v1nazQ5BmCk1W7BmDZLx7nIWhXDBNsgckdU1TZSqP3UWmm9J9A6WXvK93VfkbCLd+6TC 5z20uvRzBPOS63gE2fB0jpExf1oJVf033BkV+hCMlQDzSqwwdkWGhvDd9zz6BsRZa7Fn Wvkg== X-Gm-Message-State: APjAAAVqbkrNZU1oIzQnOG5XAAmwRZSvorGPmoPIJGJWlhqg/xgtMzko fJz85maX5XKZsLpUcHjxtd5HeUzdOOqQ6zYa/4MxDw== X-Received: by 2002:a19:c648:: with SMTP id w69mr325542lff.44.1576022103954; Tue, 10 Dec 2019 15:55:03 -0800 (PST) MIME-Version: 1.0 References: <20191120133409.9217-1-peter.ujfalusi@ti.com> <20191120133409.9217-2-peter.ujfalusi@ti.com> <20191203235113.GA12929@bogus> In-Reply-To: <20191203235113.GA12929@bogus> From: Linus Walleij Date: Wed, 11 Dec 2019 00:54:52 +0100 Message-ID: Subject: Re: [RFC 1/2] dt-bindings: gpio: Document shared GPIO line usage To: Rob Herring Cc: Peter Ujfalusi , Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , Marek Szyprowski , Mark Brown , Maxime Ripard , Philipp Zabel , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 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 Wed, Dec 4, 2019 at 12:51 AM Rob Herring wrote: > On Thu, Nov 28, 2019 at 11:06:35AM +0100, Linus Walleij wrote: > > The ambition to use refcounted GPIOs to solve this > > usecase is probably wrong, I would say try to go for a > > GPIO-based reset controller instead. > > Yes, but I think we can have that AND use the existing binding. > > > The fact that some Linux drivers are already using explicit > > GPIO's for their reset handling is maybe unfortunate, > > they will simply have to grow code to deal with a reset > > alternatively to GPIO, like first try to grab a reset > > handle and if that doesn't fall back to use a GPIO. > > I think this could just be all handled within the reset subsystem given > that we've been consistent in using 'reset-gpios' (GPIO regulators are > similar, but we never had such consistency with GPIO names for > regulators). We can implement a reset driver for the 'reset-gpios' > property that deals with the sharing. Drivers to DT nodes doesn't have > to be 1:1. It's convenient when they are, but that's encoding the OS's > (current) driver structure into DT. This seems like a good approach if it can be made to work. reset-gpios should have the right polarity flags (else drivers and/or device trees need to be fixed...) so the driver can simply scan over them and try to build a consensus on how to assert or deassert a shared reset-gpios line. It is also a natural placeholder for the connection to device core that will inevitably need to happen the day the device hierarchy needs to be torn up/down for a reset on some random device. Peter, will you have a go at it? Yours, Linus Walleij