Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284083
b: refs/heads/master
c: b425b88
h: refs/heads/master
i:
  284081: 27be3f0
  284079: 64d6e24
v: v3
  • Loading branch information
Axel Lin authored and Liam Girdwood committed Dec 23, 2011
1 parent ea4e73e commit adabc89
Show file tree
Hide file tree
Showing 70 changed files with 595 additions and 442 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a748e4318909e680b3900e3b97ea42a92724c68
refs/heads/master: b425b88418e302caf27e9cf44aa987b83c04cb2d
9 changes: 0 additions & 9 deletions trunk/arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,6 @@ static struct platform_device corgiled_device = {
},
};

/*
* Corgi Audio
*/
static struct platform_device corgi_audio_device = {
.name = "corgi-audio",
.id = -1,
};

/*
* MMC/SD Device
*
Expand Down Expand Up @@ -649,7 +641,6 @@ static struct platform_device *devices[] __initdata = {
&corgifb_device,
&corgikbd_device,
&corgiled_device,
&corgi_audio_device,
&sharpsl_nand_device,
&sharpsl_rom_device,
};
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ static struct scoop_pcmcia_config poodle_pcmcia_config = {
EXPORT_SYMBOL(poodle_scoop_device);


static struct platform_device poodle_audio_device = {
.name = "poodle-audio",
.id = -1,
};

/* LoCoMo device */
static struct resource locomo_resources[] = {
[0] = {
Expand Down Expand Up @@ -412,7 +407,6 @@ static struct platform_device sharpsl_rom_device = {
static struct platform_device *devices[] __initdata = {
&poodle_locomo_device,
&poodle_scoop_device,
&poodle_audio_device,
&sharpsl_nand_device,
&sharpsl_rom_device,
};
Expand Down
40 changes: 27 additions & 13 deletions trunk/sound/soc/au1x/ac97c.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,34 +229,35 @@ static int __devinit au1xac97c_drvprobe(struct platform_device *pdev)
struct resource *iores, *dmares;
struct au1xpsc_audio_data *ctx;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

mutex_init(&ctx->lock);

iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!iores)
return -ENODEV;
if (!iores) {
ret = -ENODEV;
goto out0;
}

if (!devm_request_mem_region(&pdev->dev, iores->start,
resource_size(iores),
pdev->name))
return -EBUSY;
ret = -EBUSY;
if (!request_mem_region(iores->start, resource_size(iores),
pdev->name))
goto out0;

ctx->mmio = devm_ioremap_nocache(&pdev->dev, iores->start,
resource_size(iores));
ctx->mmio = ioremap_nocache(iores->start, resource_size(iores));
if (!ctx->mmio)
return -EBUSY;
goto out1;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!dmares)
return -EBUSY;
goto out2;
ctx->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = dmares->start;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!dmares)
return -EBUSY;
goto out2;
ctx->dmaids[SNDRV_PCM_STREAM_CAPTURE] = dmares->start;

/* switch it on */
Expand All @@ -270,20 +271,33 @@ static int __devinit au1xac97c_drvprobe(struct platform_device *pdev)

ret = snd_soc_register_dai(&pdev->dev, &au1xac97c_dai_driver);
if (ret)
return ret;
goto out2;

ac97c_workdata = ctx;
return 0;

out2:
iounmap(ctx->mmio);
out1:
release_mem_region(iores->start, resource_size(iores));
out0:
kfree(ctx);
return ret;
}

static int __devexit au1xac97c_drvremove(struct platform_device *pdev)
{
struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);

snd_soc_unregister_dai(&pdev->dev);

WR(ctx, AC97_ENABLE, EN_D); /* clock off, disable */

iounmap(ctx->mmio);
release_mem_region(r->start, resource_size(r));
kfree(ctx);

ac97c_workdata = NULL; /* MDEV */

return 0;
Expand Down
14 changes: 10 additions & 4 deletions trunk/sound/soc/au1x/dbdma2.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,21 +350,27 @@ static struct snd_soc_platform_driver au1xpsc_soc_platform = {
static int __devinit au1xpsc_pcm_drvprobe(struct platform_device *pdev)
{
struct au1xpsc_audio_dmadata *dmadata;
int ret;

dmadata = devm_kzalloc(&pdev->dev,
2 * sizeof(struct au1xpsc_audio_dmadata),
GFP_KERNEL);
dmadata = kzalloc(2 * sizeof(struct au1xpsc_audio_dmadata), GFP_KERNEL);
if (!dmadata)
return -ENOMEM;

platform_set_drvdata(pdev, dmadata);

return snd_soc_register_platform(&pdev->dev, &au1xpsc_soc_platform);
ret = snd_soc_register_platform(&pdev->dev, &au1xpsc_soc_platform);
if (ret)
kfree(dmadata);

return ret;
}

static int __devexit au1xpsc_pcm_drvremove(struct platform_device *pdev)
{
struct au1xpsc_audio_dmadata *dmadata = platform_get_drvdata(pdev);

snd_soc_unregister_platform(&pdev->dev);
kfree(dmadata);

return 0;
}
Expand Down
12 changes: 10 additions & 2 deletions trunk/sound/soc/au1x/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,27 @@ static struct snd_soc_platform_driver alchemy_pcm_soc_platform = {
static int __devinit alchemy_pcm_drvprobe(struct platform_device *pdev)
{
struct alchemy_pcm_ctx *ctx;
int ret;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

platform_set_drvdata(pdev, ctx);

return snd_soc_register_platform(&pdev->dev, &alchemy_pcm_soc_platform);
ret = snd_soc_register_platform(&pdev->dev, &alchemy_pcm_soc_platform);
if (ret)
kfree(ctx);

return ret;
}

static int __devexit alchemy_pcm_drvremove(struct platform_device *pdev)
{
struct alchemy_pcm_ctx *ctx = platform_get_drvdata(pdev);

snd_soc_unregister_platform(&pdev->dev);
kfree(ctx);

return 0;
}
Expand Down
45 changes: 32 additions & 13 deletions trunk/sound/soc/au1x/i2sc.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,50 +227,69 @@ static struct snd_soc_dai_driver au1xi2s_dai_driver = {

static int __devinit au1xi2s_drvprobe(struct platform_device *pdev)
{
int ret;
struct resource *iores, *dmares;
struct au1xpsc_audio_data *ctx;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!iores)
return -ENODEV;
if (!iores) {
ret = -ENODEV;
goto out0;
}

if (!devm_request_mem_region(&pdev->dev, iores->start,
resource_size(iores),
pdev->name))
return -EBUSY;
ret = -EBUSY;
if (!request_mem_region(iores->start, resource_size(iores),
pdev->name))
goto out0;

ctx->mmio = devm_ioremap_nocache(&pdev->dev, iores->start,
resource_size(iores));
ctx->mmio = ioremap_nocache(iores->start, resource_size(iores));
if (!ctx->mmio)
return -EBUSY;
goto out1;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!dmares)
return -EBUSY;
goto out2;
ctx->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = dmares->start;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!dmares)
return -EBUSY;
goto out2;
ctx->dmaids[SNDRV_PCM_STREAM_CAPTURE] = dmares->start;

platform_set_drvdata(pdev, ctx);

return snd_soc_register_dai(&pdev->dev, &au1xi2s_dai_driver);
ret = snd_soc_register_dai(&pdev->dev, &au1xi2s_dai_driver);
if (ret)
goto out2;

return 0;

out2:
iounmap(ctx->mmio);
out1:
release_mem_region(iores->start, resource_size(iores));
out0:
kfree(ctx);
return ret;
}

static int __devexit au1xi2s_drvremove(struct platform_device *pdev)
{
struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);
struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);

snd_soc_unregister_dai(&pdev->dev);

WR(ctx, I2S_ENABLE, EN_D); /* clock off, disable */

iounmap(ctx->mmio);
release_mem_region(r->start, resource_size(r));
kfree(ctx);

return 0;
}

Expand Down
41 changes: 27 additions & 14 deletions trunk/sound/soc/au1x/psc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,35 +368,35 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev)
unsigned long sel;
struct au1xpsc_audio_data *wd;

wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data),
GFP_KERNEL);
wd = kzalloc(sizeof(struct au1xpsc_audio_data), GFP_KERNEL);
if (!wd)
return -ENOMEM;

mutex_init(&wd->lock);

iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!iores)
return -ENODEV;
if (!iores) {
ret = -ENODEV;
goto out0;
}

if (!devm_request_mem_region(&pdev->dev, iores->start,
resource_size(iores),
pdev->name))
return -EBUSY;
ret = -EBUSY;
if (!request_mem_region(iores->start, resource_size(iores),
pdev->name))
goto out0;

wd->mmio = devm_ioremap(&pdev->dev, iores->start,
resource_size(iores));
wd->mmio = ioremap(iores->start, resource_size(iores));
if (!wd->mmio)
return -EBUSY;
goto out1;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!dmares)
return -EBUSY;
goto out2;
wd->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = dmares->start;

dmares = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!dmares)
return -EBUSY;
goto out2;
wd->dmaids[SNDRV_PCM_STREAM_CAPTURE] = dmares->start;

/* configuration: max dma trigger threshold, enable ac97 */
Expand All @@ -421,15 +421,24 @@ static int __devinit au1xpsc_ac97_drvprobe(struct platform_device *pdev)

ret = snd_soc_register_dai(&pdev->dev, &wd->dai_drv);
if (ret)
return ret;
goto out2;

au1xpsc_ac97_workdata = wd;
return 0;

out2:
iounmap(wd->mmio);
out1:
release_mem_region(iores->start, resource_size(iores));
out0:
kfree(wd);
return ret;
}

static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev)
{
struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);

snd_soc_unregister_dai(&pdev->dev);

Expand All @@ -439,6 +448,10 @@ static int __devexit au1xpsc_ac97_drvremove(struct platform_device *pdev)
au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd));
au_sync();

iounmap(wd->mmio);
release_mem_region(r->start, resource_size(r));
kfree(wd);

au1xpsc_ac97_workdata = NULL; /* MDEV */

return 0;
Expand Down
Loading

0 comments on commit adabc89

Please sign in to comment.