Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1374109
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 6/9] pinctrl: Add IRQ support to STM32 gpios |
| Date | 2016-04-08 11:50 +0200 |
| Message-ID | <rlBd8-1LF-9@gated-at.bofh.it> (permalink) |
| References | <riMoq-6WJ-11@gated-at.bofh.it> <riMy7-71p-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Mar 31, 2016 at 5:09 PM, Maxime Coquelin
<mcoquelin.stm32@gmail.com> wrote:
> +static int stm32_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
> +{
> + struct stm32_pinctrl *pctl = dev_get_drvdata(chip->parent);
> + struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
> + unsigned int irq;
> +
> + regmap_field_write(pctl->irqmux[offset], bank->range.id);
No. You must implement the irqchip and GPIO controllers to
be orthogonal, doing things like this creates a semantic that
assumes .to_irq() is always called before using the IRQ and
that is not guaranteed at all. A consumer may very well
use an interrupt right off the irqchip without this being called
first. All this function should do is translate a number. No
other semantics.
This needs to be done from the irqchip (sorry).
Yours,
Linus Walleij
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH v2 6/9] pinctrl: Add IRQ support to STM32 gpios Linus Walleij <linus.walleij@linaro.org> - 2016-04-08 11:50 +0200
csiph-web