Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 397eada

Browse files
Javier Martinez Canillastmlind
authored andcommitted
gpio/omap: don't use linear domain mapping for OMAP1
Commit ede4d7a ("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/[email protected]/msg89005.html Signed-off-by: Javier Martinez Canillas <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 9e895ac commit 397eada

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

drivers/gpio/gpio-omap.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev)
10941094
const struct omap_gpio_platform_data *pdata;
10951095
struct resource *res;
10961096
struct gpio_bank *bank;
1097+
#ifdef CONFIG_ARCH_OMAP1
1098+
int irq_base;
1099+
#endif
10971100

10981101
match = of_match_device(of_match_ptr(omap_gpio_match), dev);
10991102

@@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev)
11351138
pdata->get_context_loss_count;
11361139
}
11371140

1141+
#ifdef CONFIG_ARCH_OMAP1
1142+
/*
1143+
* REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
1144+
* irq_alloc_descs() and irq_domain_add_legacy() and just use a
1145+
* linear IRQ domain mapping for all OMAP platforms.
1146+
*/
1147+
irq_base = irq_alloc_descs(-1, 0, bank->width, 0);
1148+
if (irq_base < 0) {
1149+
dev_err(dev, "Couldn't allocate IRQ numbers\n");
1150+
return -ENODEV;
1151+
}
11381152

1153+
bank->domain = irq_domain_add_legacy(node, bank->width, irq_base,
1154+
0, &irq_domain_simple_ops, NULL);
1155+
#else
11391156
bank->domain = irq_domain_add_linear(node, bank->width,
11401157
&irq_domain_simple_ops, NULL);
1141-
if (!bank->domain)
1158+
#endif
1159+
if (!bank->domain) {
1160+
dev_err(dev, "Couldn't register an IRQ domain\n");
11421161
return -ENODEV;
1162+
}
11431163

11441164
if (bank->regs->set_dataout && bank->regs->clr_dataout)
11451165
bank->set_dataout = _set_gpio_dataout_reg;

0 commit comments

Comments
 (0)