From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Hector Martin <hector@marcansoft.com>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Work around negative s16 battery current on Acer
Date: Wed, 01 Jul 2009 22:27:15 +0400 [thread overview]
Message-ID: <4A4BAA83.8090600@suse.de> (raw)
In-Reply-To: <4A4BA8F9.9070803@marcansoft.com>
Hector Martin пишет:
> My Acer Aspire 8930G laptop reports the battery current as a 16-bit
> signed negative when it is charging. It also reports it as 0x10000 when
> the current is 0. This patch adds a quirk for this which takes the
> absolute value of the reported current cast to an s16. This is a DSDT
> bug present in the latest BIOS revision (the EC register is 16 bits
> signed and the DSDT attempts to take the 16-bit two's complement of
> this, which works for discharge but not charge. It also breaks zero
> values because a 32-bit register is used and the high bits aren't thrown
> away).
>
> I've enabled this for all Acer systems which report in mA units. This
> should be safe since it won't break compliant systems unless they report
> a current above 32A, which is insane.
>
>
Could you please use bitfields? Please take a look at drivers/acpi/ec.c as an example.
Thanks,
Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-07-01 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 18:20 [PATCH] Work around negative s16 battery current on Acer Hector Martin
2009-07-01 18:27 ` Alexey Starikovskiy [this message]
2009-07-01 18:29 ` Andrew Morton
2009-07-01 18:38 ` Alexey Starikovskiy
2009-07-01 20:19 ` Hector Martin
2009-07-02 3:51 ` Hector Martin
2009-07-02 22:56 ` Andrew Morton
2009-07-02 23:46 ` [PATCH] Work around negative s16 battery current on Acer (take 3) Hector Martin
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=4A4BAA83.8090600@suse.de \
--to=astarikovskiy@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hector@marcansoft.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.