From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757375AbbEWDtO (ORCPT ); Fri, 22 May 2015 23:49:14 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:45132 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756977AbbEWDtJ (ORCPT ); Fri, 22 May 2015 23:49:09 -0400 Message-ID: <555FF8AD.5010502@roeck-us.net> Date: Fri, 22 May 2015 20:49:01 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "linux-kernel@vger.kernel.org" CC: Mark Brown , Liam Girdwood Subject: Implementing a gpio based regulator with status pins Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I have a system with a gpio based regulator which does not only have an enable pin, but also a status pin to report the actual power status. In some cases there may be a secondary status pin, making it possible to report on/off/error. Some twist of this is that power activation time is not exactly well defined; activation can vary from board to board. I could of course use the existing (fixed) timeout supported by the regulator core, but it would be nice to be able to use an interrupt on the status pin(s), possibly with a timeout, to achieve a dynamic activation time. The gpio pin(s) support interrupts, making it possible to report status updates, which might be useful if the power source goes bad or to support a dynamic power enable time. As far as I can see, the existing gpio regulators don't implement status pins. What would be the best way to implement this ? - Add status support to the 'fixed' regulator - Add status support to gpio-regulator.c - Add (gpio) status support to the regulator core - Write a new regulator driver - Something else Thanks, Guenter