Bug 208423 - I2C touchpad doesn't work because \_SB.PCI0.I2C0._REG doesn't get evaluated
Summary: I2C touchpad doesn't work because \_SB.PCI0.I2C0._REG doesn't get evaluated
Status: RESOLVED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: ACPICA-Core (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Erik Kaneda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-03 11:11 UTC by Kai-Heng Feng
Modified: 2020-11-26 07:43 UTC (History)
1 user (show)

See Also:
Kernel Version: mainline
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Kai-Heng Feng 2020-07-03 11:11:15 UTC
This is _REG for I2C device:

    Scope (_SB.PCI0.I2C0)
    {
..
        Method (_REG, 2, NotSerialized)  // _REG: Region Availability
        {
            If (((Arg0 == 0x09) && (Arg1 == One)))
            {
                If ((ICBM == One))
                {
                    Name (LBUF, Buffer (0x03)
                    {
                         0x00, 0x00, 0x00                                 // ...
                    })
                    CreateByteField (LBUF, Zero, LSTS)
                    CreateByteField (LBUF, 0x02, LDAT)
                    LBUF = SHID /* \_SB_.PCI0.I2C0.SHID */
                    If ((LSTS == Zero))
                    {
                        If ((LDAT == 0x1E))
                        {
                            TPVD = 0x4E
                        }

                        If ((LDAT == Zero))
                        {
                            TPVD = 0x53
                        }
                    }

                    LBUF = EHID /* \_SB_.PCI0.I2C0.EHID */
                    If ((LSTS == Zero))
                    {
                        TPVD = 0x45
                    }
                }
            }
        }

And the touchpad under it requires _REG to return a valid _STA:
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((TPVD == 0x53))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }

For some reason _REG doesn't get evaluated at initialization time, I guess it's due to 
lip 03 12:45:41 lenovo-mrozwod kernel: ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x0000000FF) is beyond end of object (length 0x10) (20200528/exoparg2-393)
Comment 2 Zhang Rui 2020-11-26 07:35:46 UTC
@Erik, can you please take a look at this?
Comment 3 Kai-Heng Feng 2020-11-26 07:43:00 UTC
Fixed by "21653a4181ff292480599dad996a2b759ccf050f i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()"

Note You need to log in before you can comment on or make changes to this bug.