From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253Ab1CJPnw (ORCPT ); Thu, 10 Mar 2011 10:43:52 -0500 Received: from mail-qy0-f174.google.com ([209.85.216.174]:36922 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932Ab1CJPnv (ORCPT ); Thu, 10 Mar 2011 10:43:51 -0500 MIME-Version: 1.0 In-Reply-To: <20110310134953.GE22195@opensource.wolfsonmicro.com> References: <1299764621-2532-1-git-send-email-linus.walleij@stericsson.com> <20110310134953.GE22195@opensource.wolfsonmicro.com> Date: Thu, 10 Mar 2011 16:43:50 +0100 Message-ID: Subject: Re: [PATCH 2/4] regulator: add ab8500 per-regulator startup delay From: Linus Walleij To: Mark Brown Cc: Linus Walleij , Liam Girdwood , linux-kernel@vger.kernel.org, Lee Jones , Bengt Jonsson Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 10, 2011 at 2:49 PM, Mark Brown wrote: > On Thu, Mar 10, 2011 at 02:43:41PM +0100, Linus Walleij wrote: >> From: Bengt Jonsson >> >> Since some regulators can take some time to come online, we >> define a per-regulator millisecond delay value and assign >> to the slow TV-out regulator. > > You should be implementing the enable_time() operation for the regulator > for this. I looked into it, but the core implicitly only does delays after enable(), and our delays affect disable() and set_voltage() as well. disable() may look superfluous but I bet there may be cases where not having a voltage fully disabled before doing something will cause immesurable harm. I was thinking about extending the present mechanism in core by refactoring the signature of the enable_time() as such: /* Operations that we want to enumerate to the enable_time() call */ enum regulator_op { REGULATOR_ENABLE, REGULATOR_DISABLE, REGULATOR_SET_VOLTAGE, REGULATOR_SET_MODE, }; /* Time taken to enable the regulator */ int (*enable_time) (struct regulator_dev *, enum regulator_op op); Then I'll have to break out the delay code and refactor a bit, altering the few drivers using it I guess. Sounds like a plan? Yours, Linus Walleij