diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-10 16:24:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-10 16:24:48 -0400 |
commit | 055c9fa8874fa7261eec7a268366565db84af474 (patch) | |
tree | abad18539e25866d9fb9ca358400f230897a886b /drivers | |
parent | 310959e831783d220d1fcaaca90e17c923830ed6 (diff) | |
parent | 46bada60961396b65d01480e2cadf4af03bc1632 (diff) |
Merge tag 'fixes-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij:
"Yes, this is a *LATE* GPIO pull request with fixes for v3.5.
Grant moved across the planet and accidentally fell off the grid, so
he asked me to take over the GPIO merges for a while 10 days ago.
Since then I went over the archives and collected this pile of fixes,
and pulled two of them from the TI maintainer Kevin Hilman. Then
waited for them to at least hit linux-next once or twice."
GPIO fixes for v3.5:
- Invalid context restore on bank 0 for OMAP driver in runtime
suspend/resume cycle
- Check for NULL platform data in sta-2x11 driver
- Constrain selection of the V1 MSM GPIO driver to applicable platforms
(Kconfig issue)
- Make sure the correct output value is set in the wm8994 driver
- Export devm_gpio_request_one() so it can be used in modules.
Apparently some in-kernel modules can be configured to use this
leading to breakage.
- Check that the GPIO is valid in the lantiq driver
- Fix the flag bits introduced for v3.5, so they don't overlap
- Fix a device tree intialization bug for imx21-compatible devices
- Carry over the OF node to the TPS65910 GPIO chip struct
* tag 'fixes-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio: tps65910: initialize of_node of gpio_chip
gpio/mxc: make irqs work for fsl,imx21-gpio devices
gpio: fix bits conflict for gpio flags
mips: pci-lantiq: Fix check for valid gpio
gpio: export devm_gpio_request_one
gpiolib: wm8994: Pay attention to the value set when enabling as output
gpio/msm_v1: CONFIG_GPIO_MSM_V1 is only available on three SoCs
gpio-sta2x11: don't use pdata if null
gpio/omap: fix invalid context restore of gpio bank-0
gpio/omap: fix irq loss while in idle with debounce on
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/Kconfig | 2 | ||||
-rw-r--r-- | drivers/gpio/devres.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-mxc.c | 10 | ||||
-rw-r--r-- | drivers/gpio/gpio-omap.c | 14 | ||||
-rw-r--r-- | drivers/gpio/gpio-sta2x11.c | 5 | ||||
-rw-r--r-- | drivers/gpio/gpio-tps65910.c | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-wm8994.c | 5 |
7 files changed, 29 insertions, 9 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index c4067d0141f7..542f0c04b695 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -136,7 +136,7 @@ config GPIO_MPC8XXX | |||
136 | 136 | ||
137 | config GPIO_MSM_V1 | 137 | config GPIO_MSM_V1 |
138 | tristate "Qualcomm MSM GPIO v1" | 138 | tristate "Qualcomm MSM GPIO v1" |
139 | depends on GPIOLIB && ARCH_MSM | 139 | depends on GPIOLIB && ARCH_MSM && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50) |
140 | help | 140 | help |
141 | Say yes here to support the GPIO interface on ARM v6 based | 141 | Say yes here to support the GPIO interface on ARM v6 based |
142 | Qualcomm MSM chips. Most of the pins on the MSM can be | 142 | Qualcomm MSM chips. Most of the pins on the MSM can be |
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c index 9e9947cb86a3..1077754f8289 100644 --- a/drivers/gpio/devres.c +++ b/drivers/gpio/devres.c | |||
@@ -98,6 +98,7 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, | |||
98 | 98 | ||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | EXPORT_SYMBOL(devm_gpio_request_one); | ||
101 | 102 | ||
102 | /** | 103 | /** |
103 | * devm_gpio_free - free an interrupt | 104 | * devm_gpio_free - free an interrupt |
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index c337143b18f8..c89c4c1e668d 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c | |||
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev) | |||
398 | writel(~0, port->base + GPIO_ISR); | 398 | writel(~0, port->base + GPIO_ISR); |
399 | 399 | ||
400 | if (mxc_gpio_hwtype == IMX21_GPIO) { | 400 | if (mxc_gpio_hwtype == IMX21_GPIO) { |
401 | /* setup one handler for all GPIO interrupts */ | 401 | /* |
402 | if (pdev->id == 0) | 402 | * Setup one handler for all GPIO interrupts. Actually setting |
403 | irq_set_chained_handler(port->irq, | 403 | * the handler is needed only once, but doing it for every port |
404 | mx2_gpio_irq_handler); | 404 | * is more robust and easier. |
405 | */ | ||
406 | irq_set_chained_handler(port->irq, mx2_gpio_irq_handler); | ||
405 | } else { | 407 | } else { |
406 | /* setup one handler for each entry */ | 408 | /* setup one handler for each entry */ |
407 | irq_set_chained_handler(port->irq, mx3_gpio_irq_handler); | 409 | irq_set_chained_handler(port->irq, mx3_gpio_irq_handler); |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index c4ed1722734c..4fbc208c32cf 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -174,12 +174,22 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank) | |||
174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { | 174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { |
175 | clk_enable(bank->dbck); | 175 | clk_enable(bank->dbck); |
176 | bank->dbck_enabled = true; | 176 | bank->dbck_enabled = true; |
177 | |||
178 | __raw_writel(bank->dbck_enable_mask, | ||
179 | bank->base + bank->regs->debounce_en); | ||
177 | } | 180 | } |
178 | } | 181 | } |
179 | 182 | ||
180 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) | 183 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) |
181 | { | 184 | { |
182 | if (bank->dbck_enable_mask && bank->dbck_enabled) { | 185 | if (bank->dbck_enable_mask && bank->dbck_enabled) { |
186 | /* | ||
187 | * Disable debounce before cutting it's clock. If debounce is | ||
188 | * enabled but the clock is not, GPIO module seems to be unable | ||
189 | * to detect events and generate interrupts at least on OMAP3. | ||
190 | */ | ||
191 | __raw_writel(0, bank->base + bank->regs->debounce_en); | ||
192 | |||
183 | clk_disable(bank->dbck); | 193 | clk_disable(bank->dbck); |
184 | bank->dbck_enabled = false; | 194 | bank->dbck_enabled = false; |
185 | } | 195 | } |
@@ -1081,7 +1091,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) | |||
1081 | bank->is_mpuio = pdata->is_mpuio; | 1091 | bank->is_mpuio = pdata->is_mpuio; |
1082 | bank->non_wakeup_gpios = pdata->non_wakeup_gpios; | 1092 | bank->non_wakeup_gpios = pdata->non_wakeup_gpios; |
1083 | bank->loses_context = pdata->loses_context; | 1093 | bank->loses_context = pdata->loses_context; |
1084 | bank->get_context_loss_count = pdata->get_context_loss_count; | ||
1085 | bank->regs = pdata->regs; | 1094 | bank->regs = pdata->regs; |
1086 | #ifdef CONFIG_OF_GPIO | 1095 | #ifdef CONFIG_OF_GPIO |
1087 | bank->chip.of_node = of_node_get(node); | 1096 | bank->chip.of_node = of_node_get(node); |
@@ -1135,6 +1144,9 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) | |||
1135 | omap_gpio_chip_init(bank); | 1144 | omap_gpio_chip_init(bank); |
1136 | omap_gpio_show_rev(bank); | 1145 | omap_gpio_show_rev(bank); |
1137 | 1146 | ||
1147 | if (bank->loses_context) | ||
1148 | bank->get_context_loss_count = pdata->get_context_loss_count; | ||
1149 | |||
1138 | pm_runtime_put(bank->dev); | 1150 | pm_runtime_put(bank->dev); |
1139 | 1151 | ||
1140 | list_add_tail(&bank->node, &omap_gpio_list); | 1152 | list_add_tail(&bank->node, &omap_gpio_list); |
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index 38416be8ba11..6064fb376e11 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c | |||
@@ -383,8 +383,9 @@ static int __devinit gsta_probe(struct platform_device *dev) | |||
383 | } | 383 | } |
384 | spin_lock_init(&chip->lock); | 384 | spin_lock_init(&chip->lock); |
385 | gsta_gpio_setup(chip); | 385 | gsta_gpio_setup(chip); |
386 | for (i = 0; i < GSTA_NR_GPIO; i++) | 386 | if (gpio_pdata) |
387 | gsta_set_config(chip, i, gpio_pdata->pinconfig[i]); | 387 | for (i = 0; i < GSTA_NR_GPIO; i++) |
388 | gsta_set_config(chip, i, gpio_pdata->pinconfig[i]); | ||
388 | 389 | ||
389 | /* 384 was used in previous code: be compatible for other drivers */ | 390 | /* 384 was used in previous code: be compatible for other drivers */ |
390 | err = irq_alloc_descs(-1, 384, GSTA_NR_GPIO, NUMA_NO_NODE); | 391 | err = irq_alloc_descs(-1, 384, GSTA_NR_GPIO, NUMA_NO_NODE); |
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c index c1ad2884f2ed..0749f9630869 100644 --- a/drivers/gpio/gpio-tps65910.c +++ b/drivers/gpio/gpio-tps65910.c | |||
@@ -149,6 +149,7 @@ static int __devinit tps65910_gpio_probe(struct platform_device *pdev) | |||
149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; | 149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; |
150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; | 150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; |
151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; | 151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; |
152 | tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; | ||
152 | if (pdata && pdata->gpio_base) | 153 | if (pdata && pdata->gpio_base) |
153 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; | 154 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; |
154 | else | 155 | else |
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c index 92ea5350dfe9..aa61ad2fcaaa 100644 --- a/drivers/gpio/gpio-wm8994.c +++ b/drivers/gpio/gpio-wm8994.c | |||
@@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip, | |||
89 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | 89 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); |
90 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | 90 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; |
91 | 91 | ||
92 | if (value) | ||
93 | value = WM8994_GPN_LVL; | ||
94 | |||
92 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, | 95 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, |
93 | WM8994_GPN_DIR, 0); | 96 | WM8994_GPN_DIR | WM8994_GPN_LVL, value); |
94 | } | 97 | } |
95 | 98 | ||
96 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 99 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |