A previous change allowed I2C client devices to discover new IRQs upon reprobe by clearing the IRQ in i2c_device_remove. However, if an IRQ was assigned in i2c_new_device, that information is lost. For example, the touchscreen and trackpad devices on a Dell Inspiron laptop are I2C devices whose IRQs are defined by ACPI extended IRQ types. The client device structures are initialized during an ACPI walk. After removing the i2c_hid device, modprobe fails. This change caches the initial IRQ value in i2c_new_device and then resets the client device IRQ to the initial value in i2c_device_remove.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -333,6 +333,7 @@ struct i2c_client { · 332 unmodified lines | ||
| 333 | 333 | char name[I2C_NAME_SIZE]; |
| 334 | 334 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
| 335 | 335 | struct device dev; /* the device structure */ |
| 336 | + int init_irq; /* irq set at initialization */ | |
| 336 | 337 | int irq; /* irq issued by device */ |
| 337 | 338 | struct list_head detected; |
| 338 | 339 | #if IS_ENABLED(CONFIG_I2C_SLAVE) |