From: Wolfram Sang <wsa@the-dreams.de>
To: Lan Tianyu <tianyu.lan@intel.com>
Cc: rjw@rjwysocki.net, mika.westerberg@linux.intel.com,
awilliam@redhat.com, lenb@kernel.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [Patch V3 4/5] I2C/ACPI: Add i2c ACPI operation region support
Date: Fri, 27 Jun 2014 13:03:34 +0200 [thread overview]
Message-ID: <20140627110333.GC2641@katana> (raw)
In-Reply-To: <1400590764-11108-5-git-send-email-tianyu.lan@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3132 bytes --]
On Tue, May 20, 2014 at 08:59:23PM +0800, Lan Tianyu wrote:
> ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region.
> It allows ACPI aml code able to access such kind of devices to implement
> some ACPI standard method.
>
> ACPI Spec defines some access attribute to associate with i2c protocol.
> AttribQuick Read/Write Quick Protocol
> AttribSendReceive Send/Receive Byte Protocol
> AttribByte Read/Write Byte Protocol
> AttribWord Read/Write Word Protocol
> AttribBlock Read/Write Block Protocol
> AttribBytes Read/Write N-Bytes Protocol
> AttribProcessCall Process Call Protocol
> AttribBlockProcessCall Write Block-Read Block Process Call Protocol
> AttribRawBytes Raw Read/Write N-BytesProtocol
> AttribRawProcessBytes Raw Process Call Protocol
>
> On the Asus T100TA, Bios use GenericSerialBus operation region to access
> i2c device to get battery info.
>
> Sample code From Asus T100TA
>
> Scope (_SB.I2C1)
> {
> Name (UMPC, ResourceTemplate ()
> {
> I2cSerialBus (0x0066, ControllerInitiated, 0x00061A80,
> AddressingMode7Bit, "\\_SB.I2C1",
> 0x00, ResourceConsumer, ,
> )
> })
>
> ...
>
> OperationRegion (DVUM, GenericSerialBus, Zero, 0x0100)
> Field (DVUM, BufferAcc, NoLock, Preserve)
> {
> Connection (UMPC),
> Offset (0x81),
> AccessAs (BufferAcc, AttribBytes (0x3E)),
> FGC0, 8
> }
> ...
> }
>
> Device (BATC)
> {
> Name (_HID, EisaId ("PNP0C0A")) // _HID: Hardware ID
> Name (_UID, One) // _UID: Unique ID
> ...
>
> Method (_BST, 0, NotSerialized) // _BST: Battery Status
> {
> If (LEqual (AVBL, One))
> {
> Store (FGC0, BFFG)
> If (LNotEqual (STAT, One))
> {
> ShiftRight (CHST, 0x04, Local0)
> And (Local0, 0x03, Local0)
> If (LOr (LEqual (Local0, One), LEqual (Local0, 0x02)))
> {
> Store (0x02, Local1)
> }
> ...
>
> }
>
> The i2c operation region is defined under I2C1 scope. _BST method under
> battery device BATC read battery status from the field "FCG0". The request
> would be sent to i2c operation region handler.
>
> This patch is to add i2c ACPI operation region support. Due to there are
> only "Byte" and "Bytes" protocol access on the Asus T100TA, other protocols
> have not been tested.
>
> About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret
> reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10).
> So far, not found such case and will add when find real case.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Added Mika's review tag and applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-06-27 11:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 12:59 [Patch V3 0/5] I2C ACPI operation region handler Lan Tianyu
[not found] ` <1400590764-11108-1-git-send-email-tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-05-20 12:59 ` [Patch V3 1/5] ACPICA: Export acpi_buffer_to_resource symbol Lan Tianyu
2014-05-20 12:59 ` Lan Tianyu
[not found] ` <1400590764-11108-2-git-send-email-tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-05-20 21:24 ` Rafael J. Wysocki
2014-05-20 21:24 ` Rafael J. Wysocki
2014-05-21 2:06 ` Lan Tianyu
2014-05-21 2:06 ` Lan Tianyu
2014-05-20 12:59 ` [Patch V3 3/5] ACPI/Thermal: Use acpi_bus_attach_private_data() to attach private data Lan Tianyu
2014-05-20 12:59 ` Lan Tianyu
2014-05-20 21:25 ` [Patch V3 0/5] I2C ACPI operation region handler Rafael J. Wysocki
2014-05-20 21:25 ` Rafael J. Wysocki
2014-05-21 2:16 ` Lan Tianyu
2014-05-21 2:16 ` Lan Tianyu
2014-05-30 6:00 ` Lan Tianyu
2014-05-30 6:00 ` Lan Tianyu
2014-05-30 12:24 ` Rafael J. Wysocki
[not found] ` <10091506.iBigojlNVE-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-05-30 12:10 ` Wolfram Sang
2014-05-30 12:10 ` Wolfram Sang
2014-05-30 12:37 ` Lan Tianyu
2014-06-06 12:28 ` Wolfram Sang
2014-06-06 22:42 ` Rafael J. Wysocki
2014-06-06 22:42 ` Rafael J. Wysocki
2014-06-24 7:02 ` Lan Tianyu
2014-06-24 7:02 ` Lan Tianyu
2014-05-20 12:59 ` [Patch V3 2/5] ACPI: Add acpi_bus_attach_private_data() to facilitate to attach data to ACPI handle Lan Tianyu
2014-05-20 12:59 ` [Patch V3 4/5] I2C/ACPI: Add i2c ACPI operation region support Lan Tianyu
2014-06-06 22:48 ` Rafael J. Wysocki
[not found] ` <17324514.CZVTFJVpea-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2014-06-09 7:56 ` Mika Westerberg
2014-06-09 7:56 ` Mika Westerberg
2014-06-27 11:03 ` Wolfram Sang [this message]
2014-05-20 12:59 ` [Patch V3 5/5] I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config Lan Tianyu
2014-06-27 11:03 ` Wolfram Sang
2014-06-30 1:32 ` Lan Tianyu
2014-06-30 1:32 ` Lan Tianyu
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=20140627110333.GC2641@katana \
--to=wsa@the-dreams.de \
--cc=awilliam@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
--cc=tianyu.lan@intel.com \
/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.