After informing kernel about I2C device using echo "pcf8575 0x20" > /sys/bus/i2c/devices/i2c-0/new_device I get new gpiochip instance under /sys/class/gpio, with that it is possible to export single GPIO pins and control them.
However I would like to assign predictable names to each element of this puzzle which lead to me ACPI SSDT table.
I'm trying to add I2C device using following ACPI SSDT exceprt:
Code: Select all
DefinitionBlock ("gpio-expander.aml", "SSDT", 1, "Vendor", "Accel", 0x00000004)
{
External (\_SB.PC00.I2C0, DeviceObj)
Scope (\_SB.PC00.I2C0)
{
Device (PCF0)
{
Name (_HID, "PRP0001")
Name (_DDN, "GPIO-Expander")
Name (_DSD, Package ()
{
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "compatible", Package() { "nxp,pcf8575" } },
}
})
Method (_STA, 0, NotSerialized)
{
Return (0x0F)
}
Name (_CRS, ResourceTemplate()
{
I2cSerialBus (
0x20,
ControllerInitiated,
100000,
AddressingMode7Bit,
"\\_SB.PC00.I2C0",
0x00
)
})
}
}
}
Code: Select all
root@odroid:~# ls -l /sys/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-PRP0001:00
total 0
lrwxrwxrwx 1 root root 0 Aug 8 06:51 firmware_node -> ../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:6b/PRP0001:00
-r--r--r-- 1 root root 4096 Aug 8 06:51 modalias
-r--r--r-- 1 root root 4096 Aug 8 06:42 name
drwxr-xr-x 2 root root 0 Aug 8 06:51 power
lrwxrwxrwx 1 root root 0 Aug 8 06:42 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Aug 8 06:42 uevent
-r--r--r-- 1 root root 4096 Aug 8 06:51 waiting_for_supplier
root@odroid:~# cat /sys/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-PRP0001:00/modalias
of:Npcf0TCnxp,pcf8575
Anyone had any luck with getting Odroid to work with SSDT tables?