Issue with TPS6598x driver on ThinkPad T14 Gen1

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

 



Greetings,

I've been looking into fixing this error in dmesg relating to the tps6598x driver on my Lenovo ThinkPad T14 Gen1 AMD:

[ 12.808694] Serial bus multi instantiate pseudo device driver INT3515:00: error -ENXIO: IRQ index 1 not found [ 12.808706] Serial bus multi instantiate pseudo device driver INT3515:00: error -ENXIO: Error requesting irq at index 1

Here's what the device resources look like in the ACPI tables:

Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
   Name (SBFX, ResourceTemplate ()
   {
       I2cSerialBusV2 (0x0023, ControllerInitiated, 0x00061A80,
           AddressingMode7Bit, "\\_SB.I2CA",
           0x00, ResourceConsumer, , Exclusive,
           )
       I2cSerialBusV2 (0x0027, ControllerInitiated, 0x00061A80,
           AddressingMode7Bit, "\\_SB.I2CA",
           0x00, ResourceConsumer, , Exclusive,
           )
       GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullUp, 0x0000,
           "\\_SB.GPIO", 0x00, ResourceConsumer, ,
           )
           { // Pin list
               0x0045
           }
   })
   Return (SBFX) /* \_SB_.I2CA.UCMX._CRS.SBFX */
}

I believe the problem is that the serial-multi-instantiate driver is assuming there are separate irqs defined for each of the i2c device instances:

static const struct smi_node int3515_data = {
   .instances = {
       { "tps6598x", IRQ_RESOURCE_APIC, 0 },
       { "tps6598x", IRQ_RESOURCE_APIC, 1 },
       { "tps6598x", IRQ_RESOURCE_APIC, 2 },
       { "tps6598x", IRQ_RESOURCE_APIC, 3 },
       {}
   },
   .bus_type = SMI_I2C,
};

However as far as I know the tps6598x family of PD controllers expose multiple i2c slaves (per USB-C port) with one shared irq. I modified the smi driver as follows:

static const struct smi_node int3515_data = {
    .instances = {
        { "tps6598x", IRQ_RESOURCE_AUTO, 0 },
        { "tps6598x", IRQ_RESOURCE_AUTO, 0 },
        { "tps6598x", IRQ_RESOURCE_AUTO, 0 },
        { "tps6598x", IRQ_RESOURCE_AUTO, 0 },
        {}
    },
    .bus_type = SMI_I2C,
};

which resulted in a successful probe of the driver and creation of port{0,1} entries in /sys/class/typec:

[ 49.742618] Serial bus multi instantiate pseudo device driver INT3515:00: Using gpio irq [ 49.747584] Serial bus multi instantiate pseudo device driver INT3515:00: Using gpio irq [ 49.752350] Serial bus multi instantiate pseudo device driver INT3515:00: Instantiated 2 I2C devices.

So I guess my question for y'all is this: would this be an acceptable change to make in the driver? If so, I'd be happy to push out the patch. Or is it a case of the ACPI tables being bugged and I need to pester Lenovo to fix them? Or, do we need to add logic to the driver to handle both cases?

It would be nice if the authors of the driver could chime in.
Kind regards / Pozdrawiam,
Michał Kopeć







[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux