From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757675AbbDVU4v (ORCPT ); Wed, 22 Apr 2015 16:56:51 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:35641 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753977AbbDVU4t (ORCPT ); Wed, 22 Apr 2015 16:56:49 -0400 Date: Wed, 22 Apr 2015 13:56:44 -0700 From: Dmitry Torokhov To: Mark Brown Cc: Doug Anderson , LKML Subject: Re: Enabling regulators form userspace Message-ID: <20150422205644.GB29953@dtor-ws> References: <20150422201112.GN22845@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150422201112.GN22845@sirena.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2015 at 09:11:12PM +0100, Mark Brown wrote: > On Wed, Apr 22, 2015 at 12:56:21PM -0700, Dmitry Torokhov wrote: > > Please keep the list in the Ccs unless there's a reason not to, other > people could benefit from the discussion or even answer. [ resending with LKML on CC ] > > > I am considering adding a debugs feature/attribute "enable" to allow > > doing "regulatror_enable" and "regulator_disable" from userspace, how > > do you feel about it? > > There's already a userspace consumer driver you can bind for test > purposes which could be used here. Thanks for the pointer, but I do not think this would work for this use case, mainly because the controllers in question often impose timing constraints on the supplies. I.e. while holding reset GPIO you turn on vdd and then, after at least X msec, avdd, and then release reset GPIO. > I guess ideally the I2C userspace > interface would have code to do something like enumerate all supplies on > the device and keep them enabled while the device is open from > userspace, though that won't help things running as shell scripts which > are probably a common case. Same as above, the interactions are quite often a bit more complex to be easily described generically, but is no problem to implement in a userspace utility that is already product-specific. > > I'm not keen on having something in there as a standard feature, it's > just this massive "abuse me" flag - there's not really much of a > production use case for it but lots of "let's just hack around our buggy > drivers" use case. I would contend that the drivers are not necessarily buggy: we just do not want to encumber the kernel driver with all the details about test interface that is very much controller specific (i.e. we can't easily generalize it for all permutations of Atmel/Cypress/Eantech/Stnaptics etc controllers) and that is not going to be used during normal operation. However it is very much a production issue as these test utilities are used during factory runs to ensure quality of produced hardware. Thanks. -- Dmitry