Multiple ads7830 defined via ACPI all show up as ads7830-virtual-0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to add ACPI definitions for two i2c-based ads7830 sensors, but struggle to get them properly defined, so I can provide separate lm-sensors config for them. 
Currently, lm-sensor reports both devices as "ads7830-virtual-0".

I've followed the documentation for ACPI Based Device Enumeration, using PRP0001 as _HID to match the driver via the compatible property:

DefinitionBlock ("TelemetryADC.aml", "SSDT", 1, "MyOEM", "MyTable", 0x00000001)
{
        External (\_SB.PC00.I2C0, DeviceObj)
        Scope (\_SB.PC00.I2C0)
        {
                Device (ADS0)
                {
                        Name (_HID, "PRP0001")
                        Name (_DSD, Package ()
                        {
                                ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                                Package ()
                                {
                                        Package () { "compatible", Package() { "ti,ads7830" } },
                                }
                        })
                        Name (_CRS, ResourceTemplate()
                        {
                                I2cSerialBusV2 (
                                        0x4a, ControllerInitiated,
                                        100000, AddressingMode7Bit,
                                        "\\_SB.PC00.I2C0", 0x00,
                                        ResourceConsumer, , Exclusive,
                                )
                        })
                }

                Device (ADS1)
                {
                        Name (_HID, "PRP0001")
                        Name (_DSD, Package ()
                        {
                                ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                                Package ()
                                {
                                        Package () { "compatible", Package() { "ti,ads7830" } },
                                }
                        })
                        Name (_CRS, ResourceTemplate()
                        {
                                I2cSerialBusV2 (
                                        0x4b, ControllerInitiated,
                                        100000, AddressingMode7Bit,
                                        "\\_SB.PC00.I2C0", 0x00,
                                        ResourceConsumer, , Exclusive,
                                )
                        })
                }
        }
}

With this, lm-sensors finds the devices, but reports both devices as "ads7830-virtual-0", so I cannot match separate libsensors configs for each of them. 
If I register the sensors from userspace via sysfs, it works as expected, and hwmon shows two separate devices on the form ads7830-i2c-0-4a.
The adapter on an ACPI defined sensor is being reported by lm-sensors as "Virtual device", not "Synopsys DesignWare I2C adapter" as when registered via sysfs, so it seems that the i2c bus is not identified properly in the ACPI case. 

If I try to define one sensor (addr 0x4a) in ACPI and register the other (0x4b) via sysfs, I see this in /sys/bus/i2c/devices/
lrwxrwxrwx    1 root     root             0 Oct  8 12:17 0-004b -> ../../../devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/0-004b
lrwxrwxrwx    1 root     root             0 Oct  8 12:12 i2c-0 -> ../../../devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0
...
lrwxrwxrwx    1 root     root             0 Nov 11 12:12 i2c-PRP0001:00 -> ../../../devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-PRP0001:00

Any idea what I'm doing wrong in my ACPI definition?

Best regards
Mikael Lund Jepsen
Software Engineer
Danelec




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux