summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-04-07 08:39:45 +0100
committerAndy Green <andy.green@linaro.org>2011-04-07 08:39:45 +0100
commit87200802e5e5611ce71dff0cb74bb891fb3dae65 (patch)
tree20bd2cf940b2e38cdf2643d41d6131ccff945ade /sound/soc
parent577ba65da0ed7d107e43edf94d2eed1d9c805857 (diff)
ASoC: ABE DSP: ioremap ABE memory to allow module compilation
omap_hwmod_get_mpu_rt_va cannot be used if the driver is compiled as a module, ABE memory is ioremap'ed explicitly instead. Change-Id: Idd05c536a80eae7223d27cccc2b925fda4a22dc1 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/omap-abe-dsp.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c
index 0b9826f618b..ceb41964c55 100644
--- a/sound/soc/omap/omap-abe-dsp.c
+++ b/sound/soc/omap/omap-abe-dsp.c
@@ -2069,16 +2069,10 @@ static int omap_pm_abe_get_dev_context_loss_count(struct device *dev)
static int __devinit abe_engine_probe(struct platform_device *pdev)
{
- struct omap_hwmod *oh;
struct omap4_abe_dsp_pdata *pdata = pdev->dev.platform_data;
+ struct resource *res;
int ret = -EINVAL, i;
- oh = omap_hwmod_lookup("omap-aess-audio");
- if (oh == NULL) {
- dev_err(&pdev->dev, "no hwmod device found\n");
- return -ENODEV;
- }
-
abe = kzalloc(sizeof(struct abe_data), GFP_KERNEL);
if (abe == NULL)
return -ENOMEM;
@@ -2088,7 +2082,13 @@ static int __devinit abe_engine_probe(struct platform_device *pdev)
for (i = 0; i < ABE_ROUTES_UL + 2; i++)
abe->router[i] = ZERO_labelID;
- abe->io_base = omap_hwmod_get_mpu_rt_va(oh);
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (res == NULL) {
+ dev_err(&pdev->dev, "no resource\n");
+ goto err;
+ }
+
+ abe->io_base = ioremap(res->start, resource_size(res));
if (!abe->io_base) {
ret = -ENOMEM;
goto err;
@@ -2097,7 +2097,7 @@ static int __devinit abe_engine_probe(struct platform_device *pdev)
abe->irq = platform_get_irq(pdev, 0);
if (abe->irq < 0) {
ret = abe->irq;
- goto err;
+ goto err_irq;
}
#if defined(CONFIG_PM)
@@ -2121,6 +2121,8 @@ static int __devinit abe_engine_probe(struct platform_device *pdev)
if (ret == 0)
return 0;
+err_irq:
+ iounmap(abe->io_base);
err:
kfree(abe);
return ret;
@@ -2131,6 +2133,7 @@ static int __devexit abe_engine_remove(struct platform_device *pdev)
struct abe_data *priv = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_platform(&pdev->dev);
+ iounmap(priv->io_base);
kfree(priv);
return 0;
}