Skip to content

Commit

Permalink
Merge tag 'gpio-fixes-for-v5.15-rc3' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - fix a regression in GPIO ACPI on HP ElitePad 1000 G2 where the
   gpio_set_debounce_timeout() now returns a fatal error if the specific
   debounce period is not supported by the driver instead of just
   emitting a warning

 - fix return values of irq_mask/unmask() callbacks in gpio-uniphier

 - fix hwirq calculation in gpio-aspeed-sgpio

 - fix two issues in gpio-rockchip: only make the extended debounce
   support available for v2 and remove a redundant BIT() usage

* tag 'gpio-fixes-for-v5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio/rockchip: fix get_direction value handling
  gpio/rockchip: extended debounce support is only available on v2
  gpio: gpio-aspeed-sgpio: Fix wrong hwirq in irq handler.
  gpio: uniphier: Fix void functions to remove return value
  gpiolib: acpi: Make set-debounce-timeout failures non fatal
  • Loading branch information
torvalds committed Sep 24, 2021
2 parents 47d7e65 + b22a470 commit 7d42e98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-aspeed-sgpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static void aspeed_sgpio_irq_handler(struct irq_desc *desc)
reg = ioread32(bank_reg(data, bank, reg_irq_status));

for_each_set_bit(p, &reg, 32)
generic_handle_domain_irq(gc->irq.domain, i * 32 + p);
generic_handle_domain_irq(gc->irq.domain, i * 32 + p * 2);
}

chained_irq_exit(ic, desc);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip,
u32 data;

data = rockchip_gpio_readl_bit(bank, offset, bank->gpio_regs->port_ddr);
if (data & BIT(offset))
if (data)
return GPIO_LINE_DIRECTION_OUT;

return GPIO_LINE_DIRECTION_IN;
Expand Down Expand Up @@ -195,7 +195,7 @@ static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
unsigned int cur_div_reg;
u64 div;

if (!IS_ERR(bank->db_clk)) {
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
div_debounce_support = true;
freq = clk_get_rate(bank->db_clk);
max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-uniphier.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)

uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);

return irq_chip_mask_parent(data);
irq_chip_mask_parent(data);
}

static void uniphier_gpio_irq_unmask(struct irq_data *data)
Expand All @@ -194,7 +194,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)

uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);

return irq_chip_unmask_parent(data);
irq_chip_unmask_parent(data);
}

static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
Expand Down
6 changes: 4 additions & 2 deletions drivers/gpio/gpiolib-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,

ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
if (ret)
gpiochip_free_own_desc(desc);
dev_warn(chip->parent,
"Failed to set debounce-timeout for pin 0x%04X, err %d\n",
pin, ret);

return ret ? ERR_PTR(ret) : desc;
return desc;
}

static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
Expand Down

0 comments on commit 7d42e98

Please sign in to comment.