Skip to content

Commit 0eda402

Browse files
committed
Merge tag 'gpio-v3.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "All but one are long-standing bug fixes that are also tagged for stable - Driver bug fixes for SH PFC, TWL4030, MSM and RCAR. - Update the MAINTAINERS" * tag 'gpio-v3.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: rcar: Fix level interrupt handling gpio: msm: Fix irq mask/unmask by writing bits instead of numbers gpio: twl4030: Fix regression for twl gpio LED output sh-pfc: Fix PINMUX_GPIO macro MAINTAINERS: update GPIO maintainers entry
2 parents a5905a9 + 8808b64 commit 0eda402

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎MAINTAINERS‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,9 +3761,11 @@ F: include/uapi/linux/gigaset_dev.h
37613761

37623762
GPIO SUBSYSTEM
37633763
M: Linus Walleij <linus.walleij@linaro.org>
3764-
S: Maintained
3764+
M: Alexandre Courbot <gnurou@gmail.com>
37653765
L: linux-gpio@vger.kernel.org
3766-
F: Documentation/gpio.txt
3766+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
3767+
S: Maintained
3768+
F: Documentation/gpio/
37673769
F: drivers/gpio/
37683770
F: include/linux/gpio*
37693771
F: include/asm-generic/gpio.h

‎drivers/gpio/gpio-msm-v2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)
252252

253253
spin_lock_irqsave(&tlmm_lock, irq_flags);
254254
writel(TARGET_PROC_NONE, GPIO_INTR_CFG_SU(gpio));
255-
clear_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
255+
clear_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
256256
__clear_bit(gpio, msm_gpio.enabled_irqs);
257257
spin_unlock_irqrestore(&tlmm_lock, irq_flags);
258258
}
@@ -264,7 +264,7 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
264264

265265
spin_lock_irqsave(&tlmm_lock, irq_flags);
266266
__set_bit(gpio, msm_gpio.enabled_irqs);
267-
set_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
267+
set_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
268268
writel(TARGET_PROC_SCORPION, GPIO_INTR_CFG_SU(gpio));
269269
spin_unlock_irqrestore(&tlmm_lock, irq_flags);
270270
}

‎drivers/gpio/gpio-rcar.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
169169
u32 pending;
170170
unsigned int offset, irqs_handled = 0;
171171

172-
while ((pending = gpio_rcar_read(p, INTDT))) {
172+
while ((pending = gpio_rcar_read(p, INTDT) &
173+
gpio_rcar_read(p, INTMSK))) {
173174
offset = __ffs(pending);
174175
gpio_rcar_write(p, INTCLR, BIT(offset));
175176
generic_handle_irq(irq_find_mapping(p->irq_domain, offset));

‎drivers/gpio/gpio-twl4030.c‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static int twl_direction_in(struct gpio_chip *chip, unsigned offset)
300300
if (offset < TWL4030_GPIO_MAX)
301301
ret = twl4030_set_gpio_direction(offset, 1);
302302
else
303-
ret = -EINVAL;
303+
ret = -EINVAL; /* LED outputs can't be set as input */
304304

305305
if (!ret)
306306
priv->direction &= ~BIT(offset);
@@ -354,11 +354,20 @@ static void twl_set(struct gpio_chip *chip, unsigned offset, int value)
354354
static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value)
355355
{
356356
struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip);
357-
int ret = -EINVAL;
357+
int ret = 0;
358358

359359
mutex_lock(&priv->mutex);
360-
if (offset < TWL4030_GPIO_MAX)
360+
if (offset < TWL4030_GPIO_MAX) {
361361
ret = twl4030_set_gpio_direction(offset, 0);
362+
if (ret) {
363+
mutex_unlock(&priv->mutex);
364+
return ret;
365+
}
366+
}
367+
368+
/*
369+
* LED gpios i.e. offset >= TWL4030_GPIO_MAX are always output
370+
*/
362371

363372
priv->direction |= BIT(offset);
364373
mutex_unlock(&priv->mutex);

‎drivers/pinctrl/sh-pfc/sh_pfc.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ struct sh_pfc_soc_info {
254254
#define PINMUX_GPIO(_pin) \
255255
[GPIO_##_pin] = { \
256256
.pin = (u16)-1, \
257-
.name = __stringify(name), \
257+
.name = __stringify(GPIO_##_pin), \
258258
.enum_id = _pin##_DATA, \
259259
}
260260

0 commit comments

Comments
 (0)