Skip to content

Commit ea58459

Browse files
committed
Merge tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO changes from Linus Walleij: "This is the bulk of GPIO changes for the v3.18 development cycle: - Increase the default ARCH_NR_GPIO from 256 to 512. This was done to avoid having a custom <asm/gpio.h> header for the x86 architecture - GPIO is custom and complicated enough as it is already! We want to move to a radix to store the descriptors going forward, and finally get rid of this fixed array size altogether. - Endgame patching of the gpio_remove() semantics initiated by Abdoulaye Berthe. It is not accepted by the system that the removal of a GPIO chip fails during eg reboot or shutdown, and therefore the return value has now painfully been refactored away. For special cases like GPIO expanders on a hot-pluggable bus like USB, we may later add some gpiochip_try_remove() call, but for the cases we have now, return values are moot. - Some incremental refactoring of the gpiolib core and ACPI GPIO library for more descriptor usage. - Refactor the chained IRQ handler set-up method to handle also threaded, nested interrupts and set up the parent IRQ correctly. Switch STMPE and TC3589x drivers to use this registration method. - Add a .irq_not_threaded flag to the struct gpio_chip, so that also GPIO expanders that block but are still not using threaded IRQ handlers. - New drivers for the ARM64 X-Gene SoC GPIO controller. - The syscon GPIO driver has been improved to handle the "DSP GPIO" found on the TI Keystone 2 SoC:s. - ADNP driver switched to use gpiolib irqchip helpers. - Refactor the DWAPB driver to support being instantiated from and MFD cell (platform device). - Incremental feature improvement in the Zynq, MCP23S08, DWAPB, OMAP, Xilinx and Crystalcove drivers. - Various minor fixes" * tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (52 commits) gpio: pch: Build context save/restore only for PM pinctrl: abx500: get rid of unused variable gpio: ks8695: fix 'else should follow close brace '}'' gpio: stmpe: add verbose debug code gpio: stmpe: fix up interrupt enable logic gpio: staticize xway_stp_init() gpio: handle also nested irqchips in the chained handler set-up gpio: set parent irq on chained handlers gpiolib: irqchip: use irq_find_mapping while removing irqchip gpio: crystalcove: support virtual GPIO pinctrl: bcm281xx: make Kconfig dependency more strict gpio: kona: enable only on BCM_MOBILE or for compile testing gpio, bcm-kona, LLVMLinux: Remove use of __initconst gpio: Fix ngpio in gpio-xilinx driver gpio: dwapb: fix pointer to integer cast gpio: xgene: Remove unneeded #ifdef CONFIG_OF guard gpio: xgene: Remove unneeded forward declation for struct xgene_gpio gpio: xgene: Fix missing spin_lock_init() gpio: ks8695: fix switch case indentation gpiolib: add irq_not_threaded flag to gpio_chip ...
2 parents 782d59c + a092e19 commit ea58459

65 files changed

Lines changed: 1297 additions & 659 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Keystone 2 DSP GPIO controller bindings
2+
3+
HOST OS userland running on ARM can send interrupts to DSP cores using
4+
the DSP GPIO controller IP. It provides 28 IRQ signals per each DSP core.
5+
This is one of the component used by the IPC mechanism used on Keystone SOCs.
6+
7+
For example TCI6638K2K SoC has 8 DSP GPIO controllers:
8+
- 8 for C66x CorePacx CPUs 0-7
9+
10+
Keystone 2 DSP GPIO controller has specific features:
11+
- each GPIO can be configured only as output pin;
12+
- setting GPIO value to 1 causes IRQ generation on target DSP core;
13+
- reading pin value returns 0 - if IRQ was handled or 1 - IRQ is still
14+
pending.
15+
16+
Required Properties:
17+
- compatible: should be "ti,keystone-dsp-gpio"
18+
- ti,syscon-dev: phandle/offset pair. The phandle to syscon used to
19+
access device state control registers and the offset of device's specific
20+
registers within device state control registers range.
21+
- gpio-controller: Marks the device node as a gpio controller.
22+
- #gpio-cells: Should be 2.
23+
24+
Please refer to gpio.txt in this directory for details of the common GPIO
25+
bindings used by client devices.
26+
27+
Example:
28+
dspgpio0: keystone_dsp_gpio@02620240 {
29+
compatible = "ti,keystone-dsp-gpio";
30+
ti,syscon-dev = <&devctrl 0x240>;
31+
gpio-controller;
32+
#gpio-cells = <2>;
33+
};
34+
35+
dsp0: dsp0 {
36+
compatible = "linux,rproc-user";
37+
...
38+
kick-gpio = <&dspgpio0 27>;
39+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
* NXP PCA953x I2C GPIO multiplexer
2+
3+
Required properties:
4+
- compatible: Has to contain one of the following:
5+
nxp,pca9505
6+
nxp,pca9534
7+
nxp,pca9535
8+
nxp,pca9536
9+
nxp,pca9537
10+
nxp,pca9538
11+
nxp,pca9539
12+
nxp,pca9554
13+
nxp,pca9555
14+
nxp,pca9556
15+
nxp,pca9557
16+
nxp,pca9574
17+
nxp,pca9575
18+
nxp,pca9698
19+
maxim,max7310
20+
maxim,max7312
21+
maxim,max7313
22+
maxim,max7315
23+
ti,pca6107
24+
ti,tca6408
25+
ti,tca6416
26+
ti,tca6424
27+
exar,xra1202
28+
29+
Example:
30+
31+
32+
gpio@20 {
33+
compatible = "nxp,pca9505";
34+
reg = <0x20>;
35+
pinctrl-names = "default";
36+
pinctrl-0 = <&pinctrl_pca9505>;
37+
interrupt-parent = <&gpio3>;
38+
interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
39+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
APM X-Gene SoC GPIO controller bindings
2+
3+
This is a gpio controller that is part of the flash controller.
4+
This gpio controller controls a total of 48 gpios.
5+
6+
Required properties:
7+
- compatible: "apm,xgene-gpio" for X-Gene GPIO controller
8+
- reg: Physical base address and size of the controller's registers
9+
- #gpio-cells: Should be two.
10+
- first cell is the pin number
11+
- second cell is used to specify the gpio polarity:
12+
0 = active high
13+
1 = active low
14+
- gpio-controller: Marks the device node as a GPIO controller.
15+
16+
Example:
17+
gpio0: gpio0@1701c000 {
18+
compatible = "apm,xgene-gpio";
19+
reg = <0x0 0x1701c000 0x0 0x40>;
20+
gpio-controller;
21+
#gpio-cells = <2>;
22+
};

‎Documentation/devicetree/bindings/gpio/mrvl-gpio.txt‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Required properties:
1919
- gpio-controller : Marks the device node as a gpio controller.
2020
- #gpio-cells : Should be one. It is the pin number.
2121

22-
Example:
22+
Example for a MMP platform:
2323

2424
gpio: gpio@d4019000 {
2525
compatible = "marvell,mmp-gpio";
@@ -32,6 +32,19 @@ Example:
3232
#interrupt-cells = <1>;
3333
};
3434

35+
Example for a PXA3xx platform:
36+
37+
gpio: gpio@40e00000 {
38+
compatible = "intel,pxa3xx-gpio";
39+
reg = <0x40e00000 0x10000>;
40+
interrupt-names = "gpio0", "gpio1", "gpio_mux";
41+
interrupts = <8 9 10>;
42+
gpio-controller;
43+
#gpio-cells = <0x2>;
44+
interrupt-controller;
45+
#interrupt-cells = <0x2>;
46+
};
47+
3548
* Marvell Orion GPIO Controller
3649

3750
Required properties:

‎Documentation/gpio/driver.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ symbol:
124124
* gpiochip_set_chained_irqchip(): sets up a chained irq handler for a
125125
gpio_chip from a parent IRQ and passes the struct gpio_chip* as handler
126126
data. (Notice handler data, since the irqchip data is likely used by the
127-
parent irqchip!) This is for the chained type of chip.
127+
parent irqchip!) This is for the chained type of chip. This is also used
128+
to set up a nested irqchip if NULL is passed as handler.
128129

129130
To use the helpers please keep the following in mind:
130131

@@ -178,7 +179,8 @@ does not help since it pins the module to the kernel forever (it calls
178179
try_module_get()). A GPIO driver can use the following functions instead
179180
to request and free descriptors without being pinned to the kernel forever.
180181

181-
int gpiochip_request_own_desc(struct gpio_desc *desc, const char *label)
182+
struct gpio_desc *gpiochip_request_own_desc(struct gpio_desc *desc,
183+
const char *label)
182184

183185
void gpiochip_free_own_desc(struct gpio_desc *desc)
184186

‎arch/arm/common/scoop.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,12 @@ static int scoop_probe(struct platform_device *pdev)
243243
static int scoop_remove(struct platform_device *pdev)
244244
{
245245
struct scoop_dev *sdev = platform_get_drvdata(pdev);
246-
int ret;
247246

248247
if (!sdev)
249248
return -EINVAL;
250249

251-
if (sdev->gpio.base != -1) {
252-
ret = gpiochip_remove(&sdev->gpio);
253-
if (ret) {
254-
dev_err(&pdev->dev, "Can't remove gpio chip: %d\n", ret);
255-
return ret;
256-
}
257-
}
250+
if (sdev->gpio.base != -1)
251+
gpiochip_remove(&sdev->gpio);
258252

259253
platform_set_drvdata(pdev, NULL);
260254
iounmap(sdev->base);

‎arch/mips/txx9/generic/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,11 @@ void __init txx9_iocled_init(unsigned long baseaddr,
789789
if (platform_device_add(pdev))
790790
goto out_pdev;
791791
return;
792+
792793
out_pdev:
793794
platform_device_put(pdev);
794795
out_gpio:
795-
if (gpiochip_remove(&iocled->chip))
796-
return;
796+
gpiochip_remove(&iocled->chip);
797797
out_unmap:
798798
iounmap(iocled->mmioaddr);
799799
out_free:

‎arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ static int mcu_gpiochip_add(struct mcu *mcu)
141141

142142
static int mcu_gpiochip_remove(struct mcu *mcu)
143143
{
144-
return gpiochip_remove(&mcu->gc);
144+
gpiochip_remove(&mcu->gc);
145+
return 0;
145146
}
146147

147148
static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)

‎arch/sh/boards/mach-x3proto/gpio.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,8 @@ int __init x3proto_gpio_setup(void)
128128
return 0;
129129

130130
err_irq:
131-
ret = gpiochip_remove(&x3proto_gpio_chip);
132-
if (unlikely(ret))
133-
pr_err("Failed deregistering GPIO\n");
134-
131+
gpiochip_remove(&x3proto_gpio_chip);
132+
ret = 0;
135133
err_gpio:
136134
synchronize_irq(ilsel);
137135

‎drivers/bcma/driver_gpio.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,6 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
255255
int bcma_gpio_unregister(struct bcma_drv_cc *cc)
256256
{
257257
bcma_gpio_irq_domain_exit(cc);
258-
return gpiochip_remove(&cc->gpio);
258+
gpiochip_remove(&cc->gpio);
259+
return 0;
259260
}

0 commit comments

Comments
 (0)