/** @file

Copyright (c) 2013-2015 Intel Corporation.

SPDX-License-Identifier: BSD-2-Clause-Patent

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)
    }
}

