Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284086
b: refs/heads/master
c: d6b2450
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jan 11, 2012
1 parent 2aa1a22 commit 7a26ba6
Show file tree
Hide file tree
Showing 57 changed files with 442 additions and 582 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: e48b46ba169181dc88ea48e31dcb4afcf8778397
refs/heads/master: d6b24507972341e5babdca8e25448325c9137232
9 changes: 9 additions & 0 deletions trunk/arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,14 @@ 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 @@ -641,6 +649,7 @@ 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: 6 additions & 0 deletions trunk/arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ 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 @@ -407,6 +412,7 @@ 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: 13 additions & 27 deletions trunk/sound/soc/au1x/ac97c.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,35 +229,34 @@ static int __devinit au1xac97c_drvprobe(struct platform_device *pdev)
struct resource *iores, *dmares;
struct au1xpsc_audio_data *ctx;

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

mutex_init(&ctx->lock);

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

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

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

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

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

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

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

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: 4 additions & 10 deletions trunk/sound/soc/au1x/dbdma2.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,27 +350,21 @@ 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 = kzalloc(2 * sizeof(struct au1xpsc_audio_dmadata), GFP_KERNEL);
dmadata = devm_kzalloc(&pdev->dev,
2 * sizeof(struct au1xpsc_audio_dmadata),
GFP_KERNEL);
if (!dmadata)
return -ENOMEM;

platform_set_drvdata(pdev, dmadata);

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

return ret;
return snd_soc_register_platform(&pdev->dev, &au1xpsc_soc_platform);
}

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: 2 additions & 10 deletions trunk/sound/soc/au1x/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,19 @@ 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 = kzalloc(sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

platform_set_drvdata(pdev, ctx);

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

return ret;
return snd_soc_register_platform(&pdev->dev, &alchemy_pcm_soc_platform);
}

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: 13 additions & 32 deletions trunk/sound/soc/au1x/i2sc.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,69 +227,50 @@ 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 = kzalloc(sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

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

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

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

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

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

platform_set_drvdata(pdev, ctx);

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;
return snd_soc_register_dai(&pdev->dev, &au1xi2s_dai_driver);
}

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: 14 additions & 27 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 = kzalloc(sizeof(struct au1xpsc_audio_data), GFP_KERNEL);
wd = devm_kzalloc(&pdev->dev, 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) {
ret = -ENODEV;
goto out0;
}
if (!iores)
return -ENODEV;

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

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

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

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

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

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

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 @@ -448,10 +439,6 @@ 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 7a26ba6

Please sign in to comment.