Skip to content

Commit 7d42e98

Browse files
committed
Merge tag 'gpio-fixes-for-v5.15-rc3' of git://git.kernel.org/pub/scm/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
2 parents 47d7e65 + b22a470 commit 7d42e98

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

drivers/gpio/gpio-aspeed-sgpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static void aspeed_sgpio_irq_handler(struct irq_desc *desc)
395395
reg = ioread32(bank_reg(data, bank, reg_irq_status));
396396

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

401401
chained_irq_exit(ic, desc);

drivers/gpio/gpio-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip,
141141
u32 data;
142142

143143
data = rockchip_gpio_readl_bit(bank, offset, bank->gpio_regs->port_ddr);
144-
if (data & BIT(offset))
144+
if (data)
145145
return GPIO_LINE_DIRECTION_OUT;
146146

147147
return GPIO_LINE_DIRECTION_IN;
@@ -195,7 +195,7 @@ static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
195195
unsigned int cur_div_reg;
196196
u64 div;
197197

198-
if (!IS_ERR(bank->db_clk)) {
198+
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
199199
div_debounce_support = true;
200200
freq = clk_get_rate(bank->db_clk);
201201
max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;

drivers/gpio/gpio-uniphier.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
184184

185185
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
186186

187-
return irq_chip_mask_parent(data);
187+
irq_chip_mask_parent(data);
188188
}
189189

190190
static void uniphier_gpio_irq_unmask(struct irq_data *data)
@@ -194,7 +194,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
194194

195195
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
196196

197-
return irq_chip_unmask_parent(data);
197+
irq_chip_unmask_parent(data);
198198
}
199199

200200
static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)

drivers/gpio/gpiolib-acpi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
313313

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

318-
return ret ? ERR_PTR(ret) : desc;
320+
return desc;
319321
}
320322

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

0 commit comments

Comments
 (0)