aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/asic3.c11
-rw-r--r--include/linux/mfd/asic3.h5
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index f2fb233b0ff3..3b870e7fb3e1 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -313,6 +313,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev)
313 struct asic3 *asic = platform_get_drvdata(pdev); 313 struct asic3 *asic = platform_get_drvdata(pdev);
314 unsigned long clksel = 0; 314 unsigned long clksel = 0;
315 unsigned int irq, irq_base; 315 unsigned int irq, irq_base;
316 int map_size;
316 317
317 asic->irq_nr = platform_get_irq(pdev, 0); 318 asic->irq_nr = platform_get_irq(pdev, 0);
318 if (asic->irq_nr < 0) 319 if (asic->irq_nr < 0)
@@ -551,8 +552,8 @@ static int __init asic3_probe(struct platform_device *pdev)
551 goto out_free; 552 goto out_free;
552 } 553 }
553 554
554 555 map_size = mem->end - mem->start + 1;
555 asic->mapping = ioremap(mem->start, PAGE_SIZE); 556 asic->mapping = ioremap(mem->start, map_size);
556 if (!asic->mapping) { 557 if (!asic->mapping) {
557 ret = -ENOMEM; 558 ret = -ENOMEM;
558 dev_err(asic->dev, "Couldn't ioremap\n"); 559 dev_err(asic->dev, "Couldn't ioremap\n");
@@ -561,10 +562,8 @@ static int __init asic3_probe(struct platform_device *pdev)
561 562
562 asic->irq_base = pdata->irq_base; 563 asic->irq_base = pdata->irq_base;
563 564
564 if (pdata && pdata->bus_shift) 565 /* calculate bus shift from mem resource */
565 asic->bus_shift = 2 - pdata->bus_shift; 566 asic->bus_shift = 2 - (map_size >> 12);
566 else
567 asic->bus_shift = 0;
568 567
569 clksel = 0; 568 clksel = 0;
570 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel); 569 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel);
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h
index 8f8c46c41f44..322cd6deb9f0 100644
--- a/include/linux/mfd/asic3.h
+++ b/include/linux/mfd/asic3.h
@@ -20,8 +20,6 @@ struct asic3_platform_data {
20 u16 *gpio_config; 20 u16 *gpio_config;
21 unsigned int gpio_config_num; 21 unsigned int gpio_config_num;
22 22
23 unsigned int bus_shift;
24
25 unsigned int irq_base; 23 unsigned int irq_base;
26 24
27 unsigned int gpio_base; 25 unsigned int gpio_base;
@@ -498,6 +496,7 @@ struct asic3_platform_data {
498#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C 496#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C
499#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 497#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0
500 498
501#define ASIC3_MAP_SIZE 0x2000 499#define ASIC3_MAP_SIZE_32BIT 0x2000
500#define ASIC3_MAP_SIZE_16BIT 0x1000
502 501
503#endif /* __ASIC3_H__ */ 502#endif /* __ASIC3_H__ */