/** @file

Copyright (c) 2013-2015 Intel Corporation.

This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

CY8C9540A 40 Bit I/O Expander with EEPROM.

**/

Device(CY8C)
{
    Name(_HID, "INT3490") // Cypress CY8C9540A Io Expander Function.
    Name(_CID, "INT3490")

    Name(RBUF, ResourceTemplate()
    {
        I2CSerialBus(0x20, ControllerInitiated, 100000, AddressingMode7Bit, "\\_SB.PCI0.GIP0.I2C_", 0, ResourceConsumer, , )
        GpioInt (Level, ActiveLow, Exclusive, PullDefault, , "\\_SB.PCI0.GIP0.GPO", 0, ResourceConsumer, , ) {QUARK_GPIO5_MAPPING} /* GPIO<5> is INT_S0 */
    })
    Method(_CRS, 0x0, NotSerialized)
    {
        CreateByteField(RBUF, 16, OB1)
        if (LEqual (ALTS, 0))
        {
            Store(0x20, OB1)
        }
        Else
        {
            Store(0x21, OB1)
        }
        Return(RBUF)
    }
    Method(_STA, 0x0, NotSerialized)
    {
        //
        // Only Galileo platform has this device.
        // EFI_PLATFORM_TYPE enum value Galileo = 6.
        //
        If(LNotEqual(PTYP, 6))
        {
          return (0)
        }
        Return(0xf)
    }
}