public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: linux-kernel@vger.kernel.org, cbou@mail.ru, dwmw2@infradead.org
Subject: Re: [PATCH] Add support for power_supply on tosa
Date: Tue, 1 Jul 2008 14:32:32 -0700	[thread overview]
Message-ID: <20080701143232.cca14c86.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080620084917.GA20577@doriath.ww600.siemens.net>

On Fri, 20 Jun 2008 12:49:17 +0400
Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:

> Support the battery management on Sharp Zaurus SL-6000.
> 
> This patch depends on the tc6393xb support as found in the arm:devel
> or linux-next trees.

Which means that Anton can't really merge it into his tree, I guess. 
I'll babysit it untilthe appropriate time.


> +static unsigned long tosa_read_bat(struct tosa_bat *bat)
> +{
> +	unsigned long value = 0;
> +
> +	if (bat->gpio_bat < 0 || bat->adc_bat < 0)
> +		return 0;
> +
> +	mutex_lock(&bat_lock);
> +	gpio_set_value(bat->gpio_bat, 1);
> +	mdelay(5);

msleep() is preferred over a busywait.

> +	value = wm97xx_read_aux_adc(bat->psy.dev->parent->driver_data,
> +			bat->adc_bat);
> +	gpio_set_value(bat->gpio_bat, 0);
> +	mutex_unlock(&bat_lock);
> +
> +	value = value * 1000000 / bat->adc_bat_divider;
> +
> +	return value;
> +}
> +
> +static unsigned long tosa_read_temp(struct tosa_bat *bat)
> +{
> +	unsigned long value = 0;
> +
> +	if (bat->gpio_temp < 0 || bat->adc_temp < 0)
> +		return 0;
> +
> +	mutex_lock(&bat_lock);
> +	gpio_set_value(bat->gpio_temp, 1);
> +	mdelay(5);

ditto. (and elsewhere)


  parent reply	other threads:[~2008-07-01 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20  8:49 [PATCH] Add support for power_supply on tosa Dmitry Baryshkov
2008-06-22 15:21 ` Dmitry Baryshkov
2008-06-23  6:19 ` Anton Vorontsov
2008-06-24 14:51   ` Dmitry Baryshkov
2008-06-30 15:32     ` Dmitry Baryshkov
2008-06-30 19:04       ` Anton Vorontsov
2008-07-01 11:52         ` Dmitry Baryshkov
2008-07-01 21:32 ` Andrew Morton [this message]
2008-07-01 21:52   ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080701143232.cca14c86.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cbou@mail.ru \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox