Re: [Patch V3 4/5] I2C/ACPI: Add i2c ACPI operation region support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Added Mika's review tag and applied to for-next, thanks!

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux