1

I'm trying to register I2C gpio expander (PCF8575) on Odroid H3+/Ubuntu 22.04 using ACPI SSDT so later I can easly assign each GPIO as led and use nice names for toggling pins. I have following SSDT table:

DefinitionBlock ("gpio-expander.aml", "SSDT", 1, "Vendor", "Accel", 0x00000004)
{
        External (\_SB.PC00.I2C0, DeviceObj)
        Scope (\_SB.PC00.I2C0)
        {
                Device (PCF0)
                {
                        Name (_CID, "PRP0001")
                        Name (_DDN, "GPIO-Expander")
                        Name (_ADR, 0x0020)
                        Name (_DSD, Package ()
                        {
                                ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                                Package ()
                                {
                                        Package () { "compatible", Package() { "nxp,pcf8575" } },
                                }
                        })
                        Method (_STA, 0, NotSerialized)  // _STA: Status
                        {
                                Return (0x0F)
                        }
                        Name (_CRS, ResourceTemplate()
                        {
                                I2cSerialBusV2 (
                                        0x20,
                                        ControllerInitiated,
                                        100000,
                                        AddressingMode7Bit,
                                        "\\_SB.PC00.I2C0",
                                        0x00
                                )
                        })
                }
        }
}

(loaded using GRUB or acpi_configfs - effect is the same), there is node appearing in /sys in correct place but for same, unknown to me, reason kernel is not assigning any driver. if I add device using echo "pcf8575 0x20" > ../new_device driver is assigned correctly, so it should also assign it using ACPI

I tried different variations: with or without _ADR, _CRS being method or not.

Novakov
  • 111
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 16 '23 at 21:47

1 Answers1

0

Well, the answer is simple enough. Snippet from Linux kernel 5.15 (which is used in this question):

#ifdef CONFIG_OF
static const struct of_device_id pcf857x_of_table[] = {
    { .compatible = "nxp,pcf8574" },
    { .compatible = "nxp,pcf8574a" },
    { .compatible = "nxp,pca8574" },
    { .compatible = "nxp,pca9670" },
    { .compatible = "nxp,pca9672" },
    { .compatible = "nxp,pca9674" },
    { .compatible = "nxp,pcf8575" },
    { .compatible = "nxp,pca8575" },
    { .compatible = "nxp,pca9671" },
    { .compatible = "nxp,pca9673" },
    { .compatible = "nxp,pca9675" },
    { .compatible = "maxim,max7328" },
    { .compatible = "maxim,max7329" },
    { }
};
MODULE_DEVICE_TABLE(of, pcf857x_of_table);
#endif

ID table is guarded by CONFIG_OF which means that this driver is not yet capable of being enumerated by using ACPI tables. That guard was removed in kernel 6.3 along with few more changes required to provide such capability.

I recommend author of this question (me) to use newer kernel or different GPIO expander.

Novakov
  • 111
  • 3