diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-10 16:52:55 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-02-10 17:14:49 +0100 |
commit | 9edd576d89a5b6d3e136d7dcab654d887c0d25b7 (patch) | |
tree | d19670de2256f8187321de3a41fa4a10d3c8e402 /sound/soc/au1x/psc-i2s.c | |
parent | e21af88d39796c907c38648c824be3d646ffbe35 (diff) | |
parent | 28a4d5675857f6386930a324317281cb8ed1e5d0 (diff) |
Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued
Back-merge from drm-fixes into drm-intel-next to sort out two things:
- interlaced support: -fixes contains a bugfix to correctly clear
interlaced configuration bits in case the bios sets up an interlaced
mode and we want to set up the progressive mode (current kernels
don't support interlaced). The actual feature work to support
interlaced depends upon (and conflicts with) this bugfix.
- forcewake voodoo to workaround missed IRQ issues: -fixes only enabled
this for ivybridge, but some recent bug reports indicate that we
need this on Sandybridge, too. But in a slightly different flavour
and with other fixes and reworks on top. Additionally there are some
forcewake cleanup patches heading to -next that would conflict with
currrent -fixes.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'sound/soc/au1x/psc-i2s.c')
-rw-r--r-- | sound/soc/au1x/psc-i2s.c | 57 |
1 files changed, 16 insertions, 41 deletions
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index e03c5ce01b3..0607ba3d925 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -265,7 +265,7 @@ static int au1xpsc_i2s_startup(struct snd_pcm_substream *substream, return 0; } -static struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = { +static const struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = { .startup = au1xpsc_i2s_startup, .trigger = au1xpsc_i2s_trigger, .hw_params = au1xpsc_i2s_hw_params, @@ -295,33 +295,34 @@ static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev) int ret; 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; 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; /* preserve PSC clock source set up by platform (dev.platform_data @@ -349,23 +350,12 @@ static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev) platform_set_drvdata(pdev, wd); - ret = snd_soc_register_dai(&pdev->dev, &wd->dai_drv); - if (!ret) - return 0; - -out2: - iounmap(wd->mmio); -out1: - release_mem_region(iores->start, resource_size(iores)); -out0: - kfree(wd); - return ret; + return snd_soc_register_dai(&pdev->dev, &wd->dai_drv); } static int __devexit au1xpsc_i2s_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); @@ -374,10 +364,6 @@ static int __devexit au1xpsc_i2s_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); - return 0; } @@ -435,18 +421,7 @@ static struct platform_driver au1xpsc_i2s_driver = { .remove = __devexit_p(au1xpsc_i2s_drvremove), }; -static int __init au1xpsc_i2s_load(void) -{ - return platform_driver_register(&au1xpsc_i2s_driver); -} - -static void __exit au1xpsc_i2s_unload(void) -{ - platform_driver_unregister(&au1xpsc_i2s_driver); -} - -module_init(au1xpsc_i2s_load); -module_exit(au1xpsc_i2s_unload); +module_platform_driver(au1xpsc_i2s_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Au12x0/Au1550 PSC I2S ALSA ASoC audio driver"); |