Skip to content

Commit b1bf7d4

Browse files
committed
Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6
Pull GPIO driver changes from Grant Likely: "Lots of gpio changes, both to core code and drivers. Changes do touch architecture code to remove the need for separate arm/gpio.h includes in most architectures. Some new drivers are added, and a number of gpio drivers are converted to use irq_domains for gpio inputs used as interrupts. Device tree support has been amended to allow multiple gpio_chips to use the same device tree node. Remaining changes are primarily bug fixes." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6: (33 commits) gpio/generic: initialize basic_mmio_gpio shadow variables properly gpiolib: Remove 'const' from data argument of gpiochip_find() gpio/rc5t583: add gpio driver for RICOH PMIC RC5T583 gpiolib: quiet gpiochip_add boot message noise gpio: mpc8xxx: Prevent NULL pointer deref in demux handler gpio/lpc32xx: Add device tree support gpio: Adjust of_xlate API to support multiple GPIO chips gpiolib: Implement devm_gpio_request_one() gpio-mcp23s08: dbg_show: fix pullup configuration display Add support for TCA6424A gpio/omap: (re)fix wakeups on level-triggered GPIOs gpio/omap: fix broken context restore for non-OFF mode transitions gpio/omap: fix missing check in *_runtime_suspend() gpio/omap: remove cpu_is_omapxxxx() checks from *_runtime_resume() gpio/omap: remove suspend/resume callbacks gpio/omap: remove retrigger variable in gpio_irq_handler gpio/omap: remove saved_wakeup field from struct gpio_bank gpio/omap: remove suspend_wakeup field from struct gpio_bank gpio/omap: remove saved_fallingdetect, saved_risingdetect gpio/omap: remove virtual_irq_start variable ... Conflicts: drivers/gpio/gpio-samsung.c
2 parents 0708500 + 3e11f7b commit b1bf7d4

53 files changed

Lines changed: 1210 additions & 878 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
NXP LPC32xx SoC GPIO controller
2+
3+
Required properties:
4+
- compatible: must be "nxp,lpc3220-gpio"
5+
- reg: Physical base address and length of the controller's registers.
6+
- gpio-controller: Marks the device node as a GPIO controller.
7+
- #gpio-cells: Should be 3:
8+
1) bank:
9+
0: GPIO P0
10+
1: GPIO P1
11+
2: GPIO P2
12+
3: GPIO P3
13+
4: GPI P3
14+
5: GPO P3
15+
2) pin number
16+
3) optional parameters:
17+
- bit 0 specifies polarity (0 for normal, 1 for inverted)
18+
- reg: Index of the GPIO group
19+
20+
Example:
21+
22+
gpio: gpio@40028000 {
23+
compatible = "nxp,lpc3220-gpio";
24+
reg = <0x40028000 0x1000>;
25+
gpio-controller;
26+
#gpio-cells = <3>; /* bank, pin, flags */
27+
};
28+
29+
leds {
30+
compatible = "gpio-leds";
31+
32+
led0 {
33+
gpios = <&gpio 5 1 1>; /* GPO_P3 1, active low */
34+
linux,default-trigger = "heartbeat";
35+
default-state = "off";
36+
};
37+
38+
led1 {
39+
gpios = <&gpio 5 14 1>; /* GPO_P3 14, active low */
40+
linux,default-trigger = "timer";
41+
default-state = "off";
42+
};
43+
};

‎Documentation/gpio.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ where 'flags' is currently defined to specify the following properties:
322322
* GPIOF_OPEN_DRAIN - gpio pin is open drain type.
323323
* GPIOF_OPEN_SOURCE - gpio pin is open source type.
324324

325+
* GPIOF_EXPORT_DIR_FIXED - export gpio to sysfs, keep direction
326+
* GPIOF_EXPORT_DIR_CHANGEABLE - also export, allow changing direction
327+
325328
since GPIOF_INIT_* are only valid when configured as output, so group valid
326329
combinations as:
327330

‎arch/alpha/include/asm/gpio.h‎

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,4 @@
1-
/*
2-
* Generic GPIO API implementation for Alpha.
3-
*
4-
* A stright copy of that for PowerPC which was:
5-
*
6-
* Copyright (c) 2007-2008 MontaVista Software, Inc.
7-
*
8-
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
9-
*
10-
* This program is free software; you can redistribute it and/or modify
11-
* it under the terms of the GNU General Public License as published by
12-
* the Free Software Foundation; either version 2 of the License, or
13-
* (at your option) any later version.
14-
*/
15-
16-
#ifndef _ASM_ALPHA_GPIO_H
17-
#define _ASM_ALPHA_GPIO_H
18-
19-
#include <linux/errno.h>
20-
#include <asm-generic/gpio.h>
21-
22-
#ifdef CONFIG_GPIOLIB
23-
24-
/*
25-
* We don't (yet) implement inlined/rapid versions for on-chip gpios.
26-
* Just call gpiolib.
27-
*/
28-
static inline int gpio_get_value(unsigned int gpio)
29-
{
30-
return __gpio_get_value(gpio);
31-
}
32-
33-
static inline void gpio_set_value(unsigned int gpio, int value)
34-
{
35-
__gpio_set_value(gpio, value);
36-
}
37-
38-
static inline int gpio_cansleep(unsigned int gpio)
39-
{
40-
return __gpio_cansleep(gpio);
41-
}
42-
43-
static inline int gpio_to_irq(unsigned int gpio)
44-
{
45-
return __gpio_to_irq(gpio);
46-
}
47-
48-
static inline int irq_to_gpio(unsigned int irq)
49-
{
50-
return -EINVAL;
51-
}
52-
53-
#endif /* CONFIG_GPIOLIB */
54-
55-
#endif /* _ASM_ALPHA_GPIO_H */
1+
#ifndef __LINUX_GPIO_H
2+
#warning Include linux/gpio.h instead of asm/gpio.h
3+
#include <linux/gpio.h>
4+
#endif

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config ARM
22
bool
33
default y
4+
select ARCH_HAVE_CUSTOM_GPIO_H
45
select HAVE_AOUT
56
select HAVE_DMA_API_DEBUG
67
select HAVE_IDE if PCI || ISA || PCMCIA

‎arch/arm/mach-imx/mach-mx35_3ds.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ static struct i2c_board_info __initdata i2c_devices_3ds[] = {
9898

9999
static int lcd_power_gpio = -ENXIO;
100100

101-
static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip,
102-
const void *data)
101+
static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, void *data)
103102
{
104103
return !strcmp(chip->label, data);
105104
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
/* empty */
1+
#ifndef __MACH_GPIO_H
2+
#define __MACH_GPIO_H
3+
4+
#include "gpio-lpc32xx.h"
5+
6+
#define ARCH_NR_GPIOS (LPC32XX_GPO_P3_GRP + LPC32XX_GPO_P3_MAX)
7+
8+
#endif /* __MACH_GPIO_H */

‎arch/arm/mach-omap1/gpio15xx.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {
4646
};
4747

4848
static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
49-
.virtual_irq_start = IH_MPUIO_BASE,
5049
.is_mpuio = true,
5150
.bank_width = 16,
5251
.bank_stride = 1,
@@ -89,7 +88,6 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
8988
};
9089

9190
static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
92-
.virtual_irq_start = IH_GPIO_BASE,
9391
.bank_width = 16,
9492
.regs = &omap15xx_gpio_regs,
9593
};

‎arch/arm/mach-omap1/gpio16xx.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
5252
};
5353

5454
static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
55-
.virtual_irq_start = IH_MPUIO_BASE,
5655
.is_mpuio = true,
5756
.bank_width = 16,
5857
.bank_stride = 1,
@@ -99,7 +98,6 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {
9998
};
10099

101100
static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
102-
.virtual_irq_start = IH_GPIO_BASE,
103101
.bank_width = 16,
104102
.regs = &omap16xx_gpio_regs,
105103
};
@@ -128,7 +126,6 @@ static struct __initdata resource omap16xx_gpio2_resources[] = {
128126
};
129127

130128
static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
131-
.virtual_irq_start = IH_GPIO_BASE + 16,
132129
.bank_width = 16,
133130
.regs = &omap16xx_gpio_regs,
134131
};
@@ -157,7 +154,6 @@ static struct __initdata resource omap16xx_gpio3_resources[] = {
157154
};
158155

159156
static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
160-
.virtual_irq_start = IH_GPIO_BASE + 32,
161157
.bank_width = 16,
162158
.regs = &omap16xx_gpio_regs,
163159
};
@@ -186,7 +182,6 @@ static struct __initdata resource omap16xx_gpio4_resources[] = {
186182
};
187183

188184
static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
189-
.virtual_irq_start = IH_GPIO_BASE + 48,
190185
.bank_width = 16,
191186
.regs = &omap16xx_gpio_regs,
192187
};

‎arch/arm/mach-omap1/gpio7xx.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {
5151
};
5252

5353
static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
54-
.virtual_irq_start = IH_MPUIO_BASE,
5554
.is_mpuio = true,
5655
.bank_width = 16,
5756
.bank_stride = 2,
@@ -93,7 +92,6 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {
9392
};
9493

9594
static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
96-
.virtual_irq_start = IH_GPIO_BASE,
9795
.bank_width = 32,
9896
.regs = &omap7xx_gpio_regs,
9997
};
@@ -122,7 +120,6 @@ static struct __initdata resource omap7xx_gpio2_resources[] = {
122120
};
123121

124122
static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
125-
.virtual_irq_start = IH_GPIO_BASE + 32,
126123
.bank_width = 32,
127124
.regs = &omap7xx_gpio_regs,
128125
};
@@ -151,7 +148,6 @@ static struct __initdata resource omap7xx_gpio3_resources[] = {
151148
};
152149

153150
static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
154-
.virtual_irq_start = IH_GPIO_BASE + 64,
155151
.bank_width = 32,
156152
.regs = &omap7xx_gpio_regs,
157153
};
@@ -180,7 +176,6 @@ static struct __initdata resource omap7xx_gpio4_resources[] = {
180176
};
181177

182178
static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
183-
.virtual_irq_start = IH_GPIO_BASE + 96,
184179
.bank_width = 32,
185180
.regs = &omap7xx_gpio_regs,
186181
};
@@ -209,7 +204,6 @@ static struct __initdata resource omap7xx_gpio5_resources[] = {
209204
};
210205

211206
static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
212-
.virtual_irq_start = IH_GPIO_BASE + 128,
213207
.bank_width = 32,
214208
.regs = &omap7xx_gpio_regs,
215209
};
@@ -238,7 +232,6 @@ static struct __initdata resource omap7xx_gpio6_resources[] = {
238232
};
239233

240234
static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
241-
.virtual_irq_start = IH_GPIO_BASE + 160,
242235
.bank_width = 32,
243236
.regs = &omap7xx_gpio_regs,
244237
};

‎arch/arm/mach-omap2/gpio.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
5656
dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr;
5757
pdata->bank_width = dev_attr->bank_width;
5858
pdata->dbck_flag = dev_attr->dbck_flag;
59-
pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
6059
pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
6160
pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
6261
if (!pdata->regs) {
@@ -103,6 +102,8 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
103102
pdata->regs->dataout = OMAP4_GPIO_DATAOUT;
104103
pdata->regs->set_dataout = OMAP4_GPIO_SETDATAOUT;
105104
pdata->regs->clr_dataout = OMAP4_GPIO_CLEARDATAOUT;
105+
pdata->regs->irqstatus_raw0 = OMAP4_GPIO_IRQSTATUSRAW0;
106+
pdata->regs->irqstatus_raw1 = OMAP4_GPIO_IRQSTATUSRAW1;
106107
pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0;
107108
pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1;
108109
pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0;

0 commit comments

Comments
 (0)