Message ID | 20221010132007.924810-1-levente.revesz@eilabs.com |
---|---|
Headers | show |
Series | gpio: pca953x: Add interrupt mask support for pca953x chips | expand |
On Mon, Oct 10, 2022 at 3:23 PM Levente Révész <levente.revesz@eilabs.com> wrote: > Some chips in the pca953x family have an interrupt mask register in > addition to the standard 4 registers: > > 0: INPUT > 1: OUTPUT > 2: POLARITY > 3: CONFIGURATION > 4: INTERRUPT MASK > > Chips with this register: > > - pca9505 > - pca9506 > - pca9698 > > The interrupt mask register defaults to all interrupts disabled, so > interrupts are unusable unless the driver sets this register. > > Interrupt masking is already implemented for pcal chips. That > implementation could be extended to support this register as well. > > This patch series adds support for the interrupt mask register in > mentioned pca chips. Added some PCA953x users to the To-line, lots of people use this driver so please review! Yours, Linus Walleij
On Monday, October 17, 2022 7:31 PM, Andy Shevchenko wrote: > At first glance I think this needs two prerequisite patches: > > 1) convert _TYPE from bits to plain numbers, so we will have room > for up to 16 types; > > 2) Introducing PCAL953X_TYPE. > > After this is done, the current series will be neater. Thanks for the suggestions! I have started implementing this change: * Convert _TYPE from bits to 4 bit integer * Define 4 chip types: PCA953X_TYPE, PCAL953X_TYPE, PCAL653X_TYPE, PCA957X_TYPE The PCA_PCAL bit is redundant, we know which chip is PCAL from their chip type. Remove the PCA_PCAL bit and the PCA_LATCH_INT mask. The now modified bits were also used in the acpi_device_id initialization: static const struct acpi_device_id pca953x_acpi_ids[] = { { "INT3491", 16 | PCA953X_TYPE | PCA_LATCH_INT, }, { } }; MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids); I do not understand what is happening in this snippet. What should be the id? --- Best regards, Levente