Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: rockchip: create irq mapping in gpio_to_irq

Remove totally irq mappings create in probe, the gpio irq mapping will
be created when do
gpio_to_irq ->
rockchip_gpio_to_irq ->
irq_create_mapping

This patch can speed up system boot on, also abandon many unused irq
mappings' create.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
Link: https://lore.kernel.org/r/20201013063731.3618-4-jay.xu@rock-chips.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jianqun Xu and committed by
Linus Walleij
8045ec42 63fbf801

+12 -16
+12 -16
drivers/pinctrl/pinctrl-rockchip.c
··· 3196 3196 3197 3197 irq = __ffs(pend); 3198 3198 pend &= ~BIT(irq); 3199 - virq = irq_linear_revmap(bank->domain, irq); 3199 + virq = irq_find_mapping(bank->domain, irq); 3200 3200 3201 3201 if (!virq) { 3202 3202 dev_err(bank->drvdata->dev, "unmapped irq %d\n", irq); ··· 3375 3375 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 3376 3376 struct irq_chip_generic *gc; 3377 3377 int ret; 3378 - int i, j; 3378 + int i; 3379 3379 3380 3380 for (i = 0; i < ctrl->nr_banks; ++i, ++bank) { 3381 3381 if (!bank->valid) { ··· 3402 3402 3403 3403 ret = irq_alloc_domain_generic_chips(bank->domain, 32, 1, 3404 3404 "rockchip_gpio_irq", handle_level_irq, 3405 - clr, 0, IRQ_GC_INIT_MASK_CACHE); 3405 + clr, 0, 0); 3406 3406 if (ret) { 3407 3407 dev_err(&pdev->dev, "could not alloc generic chips for bank %s\n", 3408 3408 bank->name); ··· 3410 3410 clk_disable(bank->clk); 3411 3411 continue; 3412 3412 } 3413 - 3414 - /* 3415 - * Linux assumes that all interrupts start out disabled/masked. 3416 - * Our driver only uses the concept of masked and always keeps 3417 - * things enabled, so for us that's all masked and all enabled. 3418 - */ 3419 - writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK); 3420 - writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN); 3421 3413 3422 3414 gc = irq_get_domain_generic_chip(bank->domain, 0); 3423 3415 gc->reg_base = bank->reg_base; ··· 3427 3435 gc->chip_types[0].chip.irq_set_type = rockchip_irq_set_type; 3428 3436 gc->wake_enabled = IRQ_MSK(bank->nr_pins); 3429 3437 3438 + /* 3439 + * Linux assumes that all interrupts start out disabled/masked. 3440 + * Our driver only uses the concept of masked and always keeps 3441 + * things enabled, so for us that's all masked and all enabled. 3442 + */ 3443 + writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK); 3444 + writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN); 3445 + gc->mask_cache = 0xffffffff; 3446 + 3430 3447 irq_set_chained_handler_and_data(bank->irq, 3431 3448 rockchip_irq_demux, bank); 3432 - 3433 - /* map the gpio irqs here, when the clock is still running */ 3434 - for (j = 0 ; j < 32 ; j++) 3435 - irq_create_mapping(bank->domain, j); 3436 - 3437 3449 clk_disable(bank->clk); 3438 3450 } 3439 3451