提交 397eada9 编写于 作者: J Javier Martinez Canillas 提交者: Tony Lindgren

gpio/omap: don't use linear domain mapping for OMAP1

Commit ede4d7a5 ("gpio/omap: convert gpio irq domain to linear mapping")
converted the OMAP GPIO driver to use a linear mapping for the GPIO IRQ
domain instead of using a legacy mapping. Not using a legacy mapping has
a number of benefits but it requires the platform to support SPARSE_IRQ
which currently is not supported on OMAP1.

So this change caused a regression on OMAP1 platforms [1].

Since this issue is not present on all OMAP2+ platforms, there is no need to
revert the driver to use legacy domain mapping for all the platforms.

[1]: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg89005.htmlSigned-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 9e895ace
...@@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev) ...@@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev)
const struct omap_gpio_platform_data *pdata; const struct omap_gpio_platform_data *pdata;
struct resource *res; struct resource *res;
struct gpio_bank *bank; struct gpio_bank *bank;
#ifdef CONFIG_ARCH_OMAP1
int irq_base;
#endif
match = of_match_device(of_match_ptr(omap_gpio_match), dev); match = of_match_device(of_match_ptr(omap_gpio_match), dev);
...@@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev) ...@@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev)
pdata->get_context_loss_count; pdata->get_context_loss_count;
} }
#ifdef CONFIG_ARCH_OMAP1
/*
* REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
* irq_alloc_descs() and irq_domain_add_legacy() and just use a
* linear IRQ domain mapping for all OMAP platforms.
*/
irq_base = irq_alloc_descs(-1, 0, bank->width, 0);
if (irq_base < 0) {
dev_err(dev, "Couldn't allocate IRQ numbers\n");
return -ENODEV;
}
bank->domain = irq_domain_add_legacy(node, bank->width, irq_base,
0, &irq_domain_simple_ops, NULL);
#else
bank->domain = irq_domain_add_linear(node, bank->width, bank->domain = irq_domain_add_linear(node, bank->width,
&irq_domain_simple_ops, NULL); &irq_domain_simple_ops, NULL);
if (!bank->domain) #endif
if (!bank->domain) {
dev_err(dev, "Couldn't register an IRQ domain\n");
return -ENODEV; return -ENODEV;
}
if (bank->regs->set_dataout && bank->regs->clr_dataout) if (bank->regs->set_dataout && bank->regs->clr_dataout)
bank->set_dataout = _set_gpio_dataout_reg; bank->set_dataout = _set_gpio_dataout_reg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册