Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755573AbcLOK5Y (ORCPT ); Thu, 15 Dec 2016 05:57:24 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:33748 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbcLOK5U (ORCPT ); Thu, 15 Dec 2016 05:57:20 -0500 MIME-Version: 1.0 In-Reply-To: <54679B04-3A57-4F0E-8EE6-BB37785F8E10@jic23.retrosnub.co.uk> References: <1481494905-18037-1-git-send-email-bgolaszewski@baylibre.com> <1481494905-18037-2-git-send-email-bgolaszewski@baylibre.com> <20161213192712.gbaw4t4awayybnta@rob-hp-laptop> <54679B04-3A57-4F0E-8EE6-BB37785F8E10@jic23.retrosnub.co.uk> From: Bartosz Golaszewski Date: Thu, 15 Dec 2016 11:57:18 +0100 Message-ID: Subject: Re: [PATCH 1/2] devicetree: power: add bindings for GPIO-driven power switches To: Jonathan Cameron Cc: Rob Herring , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Mark Rutland , linux-iio@vger.kernel.org, linux-devicetree , LKML , Kevin Hilman , Patrick Titiano , Neil Armstrong , Linus Walleij , Alexandre Courbot , linux-gpio , Sebastian Reichel , linux-pm , Mark Brown , Liam Girdwood Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2323 Lines: 60 2016-12-14 18:36 GMT+01:00 Jonathan Cameron : > > > On 14 December 2016 16:58:21 GMT+00:00, Bartosz Golaszewski > wrote: >>2016-12-13 20:27 GMT+01:00 Rob Herring : >>> On Sun, Dec 11, 2016 at 11:21:44PM +0100, Bartosz Golaszewski wrote: >>>> Some boards are equipped with simple, GPIO-driven power load >>switches. >>>> An example of such ICs is the TI tps229* series. >>> >>> How is this different than a GPIO regulator? The input and output >>> voltages just happen to be the same. I could be convinced this is >>> different enough to have a different compatible, but it somewhat >>seems >>> you want to use this for IIO, so you are creating a different binding >>> for that usecase. >>> >> >>It's more of a fixed regulator I suppose. Do you mean adding a new >>compatible to the fixed-regulator binding (e.g. "gpio-power-switch" or >>"simple-power-switch") and then providing an iio driver for toggling >>the switch? > > I am rather torn on whether the IIO interface makes any sense beyond that of > convenience. > The question is: will the iio maintainers be ok with adding support for interfaces different than iio (I guess so since Lars already mentioned wanting to support the GPIO chardev)? If so, I'm ok with not using the iio framework in the kernel. > A bridge to a regulator in general might make sense to cover the case of a > reg effectively > acting as a DAC at the edge of the known hardware. > > Lars' point about perhaps adding support for the new gpio userspace stuff to > libiio would in > this case also be rather papering over the issue. > There is known hardware there so we should describe it! > > I think we should be considering this as the general case of the Linux > controlled power supply. > How do we want to represent that? > Ultimately does a general regulator userspace interface make sense? > > Classic case of people cutting our hardware in half and making boundaries > beyond which lie dragons. > > I would love to see the general case covered. > It seems as if this is already covered by the userspace-consumer regulator driver, but it doesn't speak device tree yet. I guess we could reuse it by merging the proposed gpio-power-switch binding and extending it to parse DT. Best regards, Bartosz Golaszewski