Commit 99cdb0c8 authored by Philipp Zabel's avatar Philipp Zabel Committed by Samuel Ortiz

mfd: let asic3 use mem resource instead of bus_shift

The bus_shift parameter in platform_data is not needed
as we can tell the driver with the IOMEM_RESOURCE whether
the ASIC is located on a 16bit or 32bit memory bus.

The htc-egpio driver uses a more descriptive bus_width parameter,
but for drivers where the register map size fixed, we don't even
need this.
Signed-off-by: default avatarPhilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@openedhand.com>
parent 279cac48
...@@ -313,6 +313,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev) ...@@ -313,6 +313,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev)
struct asic3 *asic = platform_get_drvdata(pdev); struct asic3 *asic = platform_get_drvdata(pdev);
unsigned long clksel = 0; unsigned long clksel = 0;
unsigned int irq, irq_base; unsigned int irq, irq_base;
int map_size;
asic->irq_nr = platform_get_irq(pdev, 0); asic->irq_nr = platform_get_irq(pdev, 0);
if (asic->irq_nr < 0) if (asic->irq_nr < 0)
...@@ -551,8 +552,8 @@ static int __init asic3_probe(struct platform_device *pdev) ...@@ -551,8 +552,8 @@ static int __init asic3_probe(struct platform_device *pdev)
goto out_free; goto out_free;
} }
map_size = mem->end - mem->start + 1;
asic->mapping = ioremap(mem->start, PAGE_SIZE); asic->mapping = ioremap(mem->start, map_size);
if (!asic->mapping) { if (!asic->mapping) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(asic->dev, "Couldn't ioremap\n"); dev_err(asic->dev, "Couldn't ioremap\n");
...@@ -561,10 +562,8 @@ static int __init asic3_probe(struct platform_device *pdev) ...@@ -561,10 +562,8 @@ static int __init asic3_probe(struct platform_device *pdev)
asic->irq_base = pdata->irq_base; asic->irq_base = pdata->irq_base;
if (pdata && pdata->bus_shift) /* calculate bus shift from mem resource */
asic->bus_shift = 2 - pdata->bus_shift; asic->bus_shift = 2 - (map_size >> 12);
else
asic->bus_shift = 0;
clksel = 0; clksel = 0;
asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel); asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel);
......
...@@ -20,8 +20,6 @@ struct asic3_platform_data { ...@@ -20,8 +20,6 @@ struct asic3_platform_data {
u16 *gpio_config; u16 *gpio_config;
unsigned int gpio_config_num; unsigned int gpio_config_num;
unsigned int bus_shift;
unsigned int irq_base; unsigned int irq_base;
unsigned int gpio_base; unsigned int gpio_base;
...@@ -498,6 +496,7 @@ struct asic3_platform_data { ...@@ -498,6 +496,7 @@ struct asic3_platform_data {
#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C
#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0
#define ASIC3_MAP_SIZE 0x2000 #define ASIC3_MAP_SIZE_32BIT 0x2000
#define ASIC3_MAP_SIZE_16BIT 0x1000
#endif /* __ASIC3_H__ */ #endif /* __ASIC3_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment