lkml.org 
[lkml]   [2011]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] power: Charger-Manager: add initial Charger-Manager driver
On Tue, Dec 27, 2011 at 06:47:48PM +0900, Donggeun Kim wrote:

> + /*
> + * Abnormal battery state - Stop charging forcibly,
> + * even if charger was enabled at the other places
> + */
> + err = regulator_bulk_disable(desc->num_charger_regulators,
> + desc->charger_regulators);
> +
> + for (i = 0; i < desc->num_charger_regulators; i++) {
> + if (regulator_is_enabled(
> + desc->charger_regulators[i].consumer)) {
> + regulator_force_disable(
> + desc->charger_regulators[i].consumer);
> + dev_warn(cm->dev,
> + "Disable regulator(%s) forcibly.\n",
> + desc->charger_regulators[i].supply);
> + }

Just implement a regulator_bulk_force_disable() operation; this is a
totally reasonable thing to want to do and other drivers may have the
same need. Actually, looking at what you've written here it's totally
sensible and we should probably also roll the attempt to do a normal
disable() into force_disable() - there can't be many situations in which
trying a clean shutdown first isn't the right thing to do.


\
 
 \ /
  Last update: 2011-12-27 12:39    [W:0.113 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site