mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
i2c: tegra: Use threaded interrupt
Switch to use threaded interrupt context in order to avoid checking of "are we in interrupt?" for the code that may sleep in the IRQ handler. I2C doesn't require a very low interrupt-handling latency, hence this change doesn't introduce any noticeable effects. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
2e7f3db5d8
commit
3928bbb020
1 changed files with 5 additions and 4 deletions
|
@ -550,7 +550,7 @@ static int tegra_i2c_poll_register(struct tegra_i2c_dev *i2c_dev,
|
||||||
void __iomem *addr = i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg);
|
void __iomem *addr = i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg);
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
if (!i2c_dev->atomic_mode && !in_irq())
|
if (!i2c_dev->atomic_mode)
|
||||||
return readl_relaxed_poll_timeout(addr, val, !(val & mask),
|
return readl_relaxed_poll_timeout(addr, val, !(val & mask),
|
||||||
delay_us, timeout_us);
|
delay_us, timeout_us);
|
||||||
|
|
||||||
|
@ -1739,9 +1739,10 @@ static int tegra_i2c_probe(struct platform_device *pdev)
|
||||||
/* interrupt will be enabled during of transfer time */
|
/* interrupt will be enabled during of transfer time */
|
||||||
irq_set_status_flags(i2c_dev->irq, IRQ_NOAUTOEN);
|
irq_set_status_flags(i2c_dev->irq, IRQ_NOAUTOEN);
|
||||||
|
|
||||||
err = devm_request_irq(i2c_dev->dev, i2c_dev->irq, tegra_i2c_isr,
|
err = devm_request_threaded_irq(i2c_dev->dev, i2c_dev->irq,
|
||||||
IRQF_NO_SUSPEND, dev_name(i2c_dev->dev),
|
NULL, tegra_i2c_isr,
|
||||||
i2c_dev);
|
IRQF_NO_SUSPEND | IRQF_ONESHOT,
|
||||||
|
dev_name(i2c_dev->dev), i2c_dev);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue