Commit c86bde54 authored by Mark Brown's avatar Mark Brown

ASoC: Allow use of resource from the platform device for S3C IISv2

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 07736d48
...@@ -580,6 +580,24 @@ int s3c_i2sv2_probe(struct platform_device *pdev, ...@@ -580,6 +580,24 @@ int s3c_i2sv2_probe(struct platform_device *pdev,
/* record our i2s structure for later use in the callbacks */ /* record our i2s structure for later use in the callbacks */
dai->private_data = i2s; dai->private_data = i2s;
if (!base) {
struct resource *res = platform_get_resource(pdev,
IORESOURCE_MEM,
0);
if (!res) {
dev_err(dev, "Unable to get register resource\n");
return -ENXIO;
}
if (!request_mem_region(res->start, resource_size(res),
"s3c64xx-i2s-v4")) {
dev_err(dev, "Unable to request register region\n");
return -EBUSY;
}
base = res->start;
}
i2s->regs = ioremap(base, 0x100); i2s->regs = ioremap(base, 0x100);
if (i2s->regs == NULL) { if (i2s->regs == NULL) {
dev_err(dev, "cannot ioremap registers\n"); dev_err(dev, "cannot ioremap registers\n");
......
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