gpio: pca953x: use a per instance irq_chip structure
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 16 Jan 2019 09:31:58 +0000 (10:31 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 21 Jan 2019 13:05:42 +0000 (14:05 +0100)
commit5c4fee63c5ed8133e5a6011787a614c7dbc80c82
tree824c10d6112cfb2994b91a48e13140713139c08f
parent7341fa7a6bf3f8dc7466bdd340dc5a61efab8902
gpio: pca953x: use a per instance irq_chip structure

When a system has two PCA953x GPIO expanders, the kernel complains with:

gpio gpiochip2: (0-0021): detected irqchip that is shared with multiple gpiochips: please fix the driver.

Indeed, there is a single instance of "struct irq_chip" that gets
re-used for both PCA953x instance. This commit moves the "struct
irq_chip" to be part of the "struct pca953x_chip", so that we have one
"struct irq_chip" per PCA953X instance.

As part of this, the name of the irq_chip is also made different on a
per-instance basis, now using the dev_name() of the I2C device. This
changes what is visible in /proc/interrupts.

Before:

 47:          0          0   pca953x  10 Edge      e0100000.sdhci cd
 48:          0          0   pca953x   6 Edge      e0101000.sdhci cd

After:

 47:          0          0    0-0020  10 Edge      e0100000.sdhci cd
 48:          2          0    0-0020   6 Edge      e0101000.sdhci cd

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pca953x.c