diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 586dba7e5f23..8833c349f23c 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -108,6 +108,8 @@ | |||
108 | #define GPMC_HAS_WR_ACCESS 0x1 | 108 | #define GPMC_HAS_WR_ACCESS 0x1 |
109 | #define GPMC_HAS_WR_DATA_MUX_BUS 0x2 | 109 | #define GPMC_HAS_WR_DATA_MUX_BUS 0x2 |
110 | 110 | ||
111 | #define GPMC_NR_WAITPINS 4 | ||
112 | |||
111 | /* XXX: Only NAND irq has been considered,currently these are the only ones used | 113 | /* XXX: Only NAND irq has been considered,currently these are the only ones used |
112 | */ | 114 | */ |
113 | #define GPMC_NR_IRQ 2 | 115 | #define GPMC_NR_IRQ 2 |
@@ -153,6 +155,7 @@ static struct resource gpmc_cs_mem[GPMC_CS_NUM]; | |||
153 | static DEFINE_SPINLOCK(gpmc_mem_lock); | 155 | static DEFINE_SPINLOCK(gpmc_mem_lock); |
154 | /* Define chip-selects as reserved by default until probe completes */ | 156 | /* Define chip-selects as reserved by default until probe completes */ |
155 | static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1); | 157 | static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1); |
158 | static unsigned int gpmc_nr_waitpins; | ||
156 | static struct device *gpmc_dev; | 159 | static struct device *gpmc_dev; |
157 | static int gpmc_irq; | 160 | static int gpmc_irq; |
158 | static resource_size_t phys_base, mem_size; | 161 | static resource_size_t phys_base, mem_size; |
@@ -1294,6 +1297,13 @@ static int gpmc_probe_dt(struct platform_device *pdev) | |||
1294 | if (!of_id) | 1297 | if (!of_id) |
1295 | return 0; | 1298 | return 0; |
1296 | 1299 | ||
1300 | ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins", | ||
1301 | &gpmc_nr_waitpins); | ||
1302 | if (ret < 0) { | ||
1303 | pr_err("%s: number of wait pins not found!\n", __func__); | ||
1304 | return ret; | ||
1305 | } | ||
1306 | |||
1297 | for_each_node_by_name(child, "nand") { | 1307 | for_each_node_by_name(child, "nand") { |
1298 | ret = gpmc_probe_nand_child(pdev, child); | 1308 | ret = gpmc_probe_nand_child(pdev, child); |
1299 | if (ret < 0) { | 1309 | if (ret < 0) { |
@@ -1372,6 +1382,9 @@ static int gpmc_probe(struct platform_device *pdev) | |||
1372 | /* Now the GPMC is initialised, unreserve the chip-selects */ | 1382 | /* Now the GPMC is initialised, unreserve the chip-selects */ |
1373 | gpmc_cs_map = 0; | 1383 | gpmc_cs_map = 0; |
1374 | 1384 | ||
1385 | if (!pdev->dev.of_node) | ||
1386 | gpmc_nr_waitpins = GPMC_NR_WAITPINS; | ||
1387 | |||
1375 | rc = gpmc_probe_dt(pdev); | 1388 | rc = gpmc_probe_dt(pdev); |
1376 | if (rc < 0) { | 1389 | if (rc < 0) { |
1377 | clk_disable_unprepare(gpmc_l3_clk); | 1390 | clk_disable_unprepare(gpmc_l3_clk); |