[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080701143232.cca14c86.akpm@linux-foundation.org>
Date: Tue, 1 Jul 2008 14:32:32 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dmitry Baryshkov <dbaryshkov@...il.com>
Cc: linux-kernel@...r.kernel.org, cbou@...l.ru, dwmw2@...radead.org
Subject: Re: [PATCH] Add support for power_supply on tosa
On Fri, 20 Jun 2008 12:49:17 +0400
Dmitry Baryshkov <dbaryshkov@...il.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)
--
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