Skip to content

Commit

Permalink
Merge tag 'gpio-v3.13-4' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Dec 17, 2013
2 parents a5905a9 + 8808b64 commit 0eda402
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
6 changes: 4 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3761,9 +3761,11 @@ F: include/uapi/linux/gigaset_dev.h

GPIO SUBSYSTEM
M: Linus Walleij <linus.walleij@linaro.org>
S: Maintained
M: Alexandre Courbot <gnurou@gmail.com>
L: linux-gpio@vger.kernel.org
F: Documentation/gpio.txt
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
S: Maintained
F: Documentation/gpio/
F: drivers/gpio/
F: include/linux/gpio*
F: include/asm-generic/gpio.h
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-msm-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)

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

spin_lock_irqsave(&tlmm_lock, irq_flags);
__set_bit(gpio, msm_gpio.enabled_irqs);
set_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
set_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
writel(TARGET_PROC_SCORPION, GPIO_INTR_CFG_SU(gpio));
spin_unlock_irqrestore(&tlmm_lock, irq_flags);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpio/gpio-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
u32 pending;
unsigned int offset, irqs_handled = 0;

while ((pending = gpio_rcar_read(p, INTDT))) {
while ((pending = gpio_rcar_read(p, INTDT) &
gpio_rcar_read(p, INTMSK))) {
offset = __ffs(pending);
gpio_rcar_write(p, INTCLR, BIT(offset));
generic_handle_irq(irq_find_mapping(p->irq_domain, offset));
Expand Down
15 changes: 12 additions & 3 deletions drivers/gpio/gpio-twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int twl_direction_in(struct gpio_chip *chip, unsigned offset)
if (offset < TWL4030_GPIO_MAX)
ret = twl4030_set_gpio_direction(offset, 1);
else
ret = -EINVAL;
ret = -EINVAL; /* LED outputs can't be set as input */

if (!ret)
priv->direction &= ~BIT(offset);
Expand Down Expand Up @@ -354,11 +354,20 @@ static void twl_set(struct gpio_chip *chip, unsigned offset, int value)
static int twl_direction_out(struct gpio_chip *chip, unsigned offset, int value)
{
struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip);
int ret = -EINVAL;
int ret = 0;

mutex_lock(&priv->mutex);
if (offset < TWL4030_GPIO_MAX)
if (offset < TWL4030_GPIO_MAX) {
ret = twl4030_set_gpio_direction(offset, 0);
if (ret) {
mutex_unlock(&priv->mutex);
return ret;
}
}

/*
* LED gpios i.e. offset >= TWL4030_GPIO_MAX are always output
*/

priv->direction |= BIT(offset);
mutex_unlock(&priv->mutex);
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/sh-pfc/sh_pfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ struct sh_pfc_soc_info {
#define PINMUX_GPIO(_pin) \
[GPIO_##_pin] = { \
.pin = (u16)-1, \
.name = __stringify(name), \
.name = __stringify(GPIO_##_pin), \
.enum_id = _pin##_DATA, \
}

Expand Down

0 comments on commit 0eda402

Please sign in to comment.