From: Pavel Machek <pavel@ucw.cz>
To: Anton Vorontsov <cbou@mail.ru>
Cc: Greg KH <gregkh@suse.de>,
linux-kernel@vger.kernel.org, kernel-discuss@handhelds.org,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 8/8] One Laptop Per Child power/battery driver
Date: Mon, 7 May 2007 14:04:54 +0000 [thread overview]
Message-ID: <20070507140453.GD3868@ucw.cz> (raw)
In-Reply-To: <20070503213303.GH20067@zarina>
Hi!
> This probably should be marked as BROKEN because, according
> to David Woodhouse, EC-acccess method will change. Plus currently
> it lacks mutexes. So this driver is just for reference. Converted
> from the battery-2.6 repository, 1:1.
>
> But nevertheless it should work.
>
> Signed-off-by: Anton Vorontsov <cbou@mail.ru>
> ---
> drivers/power/Kconfig | 6 +
> drivers/power/Makefile | 1 +
> drivers/power/olpc_battery.c | 300 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 307 insertions(+), 0 deletions(-)
> create mode 100644 drivers/power/olpc_battery.c
>
> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
> index 051724f..3ac79c3 100644
> --- a/drivers/power/Kconfig
> +++ b/drivers/power/Kconfig
> @@ -42,4 +42,10 @@ config BATTERY_PMU
> Say Y here to expose battery information on Apple machines
> through the generic battery class.
>
> +config BATTERY_OLPC
> + tristate "One Laptop Per Child battery"
> + depends on X86_32
> + help
> + Say Y to enable support for the battery on the $100 laptop.
> +
> endif # POWER_SUPPLY
> diff --git a/drivers/power/Makefile b/drivers/power/Makefile
> index 0ebdc6d..62b58ca 100644
> --- a/drivers/power/Makefile
> +++ b/drivers/power/Makefile
> @@ -19,3 +19,4 @@ obj-$(CONFIG_APM_POWER) += apm_power.o
>
> obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
> obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
> +obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
> diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
> new file mode 100644
> index 0000000..40f76bb
> --- /dev/null
> +++ b/drivers/power/olpc_battery.c
> @@ -0,0 +1,300 @@
> +/*
> + * Battery driver for One Laptop Per Child ($100 laptop) board.
> + *
> + * Copyright ?? 2006 David Woodhouse <dwmw2@infradead.org>
Can we stick to ascii in sources?
> +#define wBAT_VOLTAGE 0xf900 /* *9.76/32, mV */
> +#define wBAT_CURRENT 0xf902 /* *15.625/120, mA */
> +#define wBAT_TEMP 0xf906 /* *256/1000, ??C */
> +#define wAMB_TEMP 0xf908 /* *256/1000, ??C */
Ascii? And those defines seem affected by hungarian convention.
> +#define sMBAT_STATUS 0xfaa4
> +#define sBAT_PRESENT 1
> +#define sBAT_FULL 2
> +#define sBAT_DESTROY 4 /* what is this exactly? */
> +#define sBAT_LOW 32
> +#define sBAT_DISCHG 64
> +#define sMCHARGE_STATUS 0xfaa5
> +#define sBAT_CHARGE 1
> +#define sBAT_OVERTEMP 4
> +#define sBAT_NiMH 8
> +#define sPOWER_FLAG 0xfa40
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2007-05-07 14:05 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 21:33 [PATCH 8/8] One Laptop Per Child power/battery driver Anton Vorontsov
2007-05-07 14:04 ` Pavel Machek [this message]
2007-05-07 14:12 ` Anton Vorontsov
2007-05-07 15:10 ` David Woodhouse
2007-05-07 19:49 ` Pavel Machek
2007-05-07 19:51 ` David Woodhouse
2007-05-07 20:38 ` Pavel Machek
2007-05-07 21:43 ` Alan Cox
2007-05-08 5:39 ` Willy Tarreau
2007-05-07 20:04 ` Satyam Sharma
2007-05-08 17:45 ` Maciej W. Rozycki
2007-05-08 17:52 ` Stephen Clark
2007-05-08 17:52 ` David Woodhouse
2007-05-09 14:23 ` Maciej W. Rozycki
2007-05-09 14:46 ` David Woodhouse
2007-05-09 20:33 ` Pavel Machek
2007-05-11 12:43 ` David Woodhouse
2007-05-11 13:21 ` Pavel Machek
2007-05-12 21:11 ` Adrian Bunk
2007-05-12 23:20 ` Pavel Machek
2007-05-13 4:45 ` David Woodhouse
2007-05-13 16:40 ` Krzysztof Halasa
2007-05-11 13:21 ` Alan Cox
2007-05-11 13:45 ` Satyam Sharma
2007-05-12 16:35 ` Pete Zaitcev
2007-05-13 5:39 ` David Woodhouse
2007-05-13 6:03 ` Pete Zaitcev
2007-05-13 6:21 ` David Woodhouse
2007-05-07 21:23 ` Alan Cox
2007-05-07 21:55 ` Dmitry Torokhov
2007-05-07 22:02 ` Alan Cox
2007-05-08 12:18 ` Stephen Clark
2007-05-12 17:03 ` Pete Zaitcev
2007-05-12 19:27 ` Alan Cox
2007-05-12 19:31 ` Russell King
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=20070507140453.GD3868@ucw.cz \
--to=pavel@ucw.cz \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=gregkh@suse.de \
--cc=kernel-discuss@handhelds.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