Comment 384 for bug 1958019

Revision history for this message
In , kernel (kernel-linux-kernel-bugs) wrote :

Some update on de Legion 7 16ACHg6 (AMD Ryzen 5000), I finally got the QEMU VM working, the IOMMU groups were really bad grouped for the sound card. But started and got the HDA verbs. But still no sound, in the VM is also no sound. The Cirrus Logic amplifier needs to be initialized on this board. Got the driver but the VM doesn't pick it up. After some searching in the drivers it seems that this chip is controlled by I2C/GPIO through ACPI.

Decoded the DSDT table in ACPI and found the following:
   Scope (_SB.I2CD)
    {
        Device (SPKR)
        {
            Name (_HID, "CLSA0100") // _HID: Hardware ID
            Name (_UID, One) // _UID: Unique ID
            Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    I2cSerialBusV2 (0x0040, ControllerInitiated, 0x000F4240,
                        AddressingMode7Bit, "\\_SB.I2CD",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    I2cSerialBusV2 (0x0041, ControllerInitiated, 0x000F4240,
                        AddressingMode7Bit, "\\_SB.I2CD",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        { // Pin list
                            0x0006
                        }
                    GpioIo (Shared, PullUp, 0x0064, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        { // Pin list
                            0x0054
                        }
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        { // Pin list
                            0x0091
                        }
                    GpioInt (Edge, ActiveBoth, Shared, PullUp, 0x0064,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        { // Pin list
                            0x0054
                        }
                })
                Return (RBUF) /* \_SB_.I2CD.SPKR._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized) // _STA: Status
            {
                If ((MCSK == 0x04))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
            {
            }
        }
    }

Is there anyone that can help me from here on? Now I've no idea what to do, how to set the GPIO pins of this device from linux, maybe that works. There are also some init sequences and blobs from the Cirrus Logic drivers. Or can this be debugged from Windows in any way?