[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110329224017.GB15535@sirena.org.uk>
Date: Tue, 29 Mar 2011 23:40:18 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: David Collins <collinsd@...eaurora.org>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm-owner@...r.kernel.org
Subject: Re: [PATCH v2 2/2] regulator: Propagate uA_load requirements up
supply chain
On Mon, Mar 28, 2011 at 04:53:52PM -0700, David Collins wrote:
Some more specific comments on the code:
> + if (rdev->desc->ops->get_current_required) {
> + err = rdev->desc->ops->get_current_required(rdev, input_uV,
> + output_uV, current_uA);
> + if (err < 0)
> + return;
> + rdev->uA_load = err;
> + }
I think we need something to handle misssing data here if there is a
supply connected, otherwise we'll end up failing silently. Off the top
of my head we could either just complain loudly if there's no operation
and there should be one or make a pessimistic assumption about
efficiency by default.
> + /* get supply current required for load */
> + int (*get_current_required) (struct regulator_dev *, int input_uV,
> + int output_uV, int load_uA);
> +
I like the interface for the driver but possibly call it something like
get_supply_current() or something to make it a little clearer which
current is being requested? Also needs to have kerneldoc added for the
new function - ideally the documentation would say this is for sustained
rather than peak load.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists