diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 13:46:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 13:46:37 -0400 |
commit | d3e458d78167102cc961237cfceef6fffc80c0b3 (patch) | |
tree | e9195c1294daf053614e63ac52b0b44a28479017 /sound/soc/davinci/davinci-i2s.c | |
parent | f2e1fbb5f2177227f71c4fc0491e531dd7acd385 (diff) | |
parent | d351cf4603edb2a5bfa9a48d06c425511c63f2a3 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (308 commits)
ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl
ALSA: aloop - Fix possible IRQ lock inversion
ALSA: sound/core: merge list_del()/list_add_tail() to list_move_tail()
ALSA: ctxfi - use list_move() instead of list_del()/list_add() combination
ALSA: firewire - msleep needs delay.h
ALSA: firewire-lib, firewire-speakers: handle packet queueing errors
ALSA: firewire-lib: allocate DMA buffer separately
ALSA: firewire-lib: use no-info SYT for packets without SYT sample
ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver
ALSA: hda - Remove an unused variable in patch_realtek.c
ALSA: hda - pin-adc-mux-dmic auto-configuration of 92HD8X codecs
ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs
ALSA: hda - Move default input-src selection to init part
ALSA: hda - Initialize special cases for input src in init phase
ALSA: ctxfi - Clear input settings before initialization
ALSA: ctxfi - Fix SPDIF status retrieval
ALSA: ctxfi - Fix incorrect SPDIF status bit mask
ALSA: ctxfi - Fix microphone boost codes/comments
ALSA: atiixp - Fix wrong time-out checks during ac-link reset
ALSA: intel8x0m: append 'm' to "r_intel8x0"
...
Diffstat (limited to 'sound/soc/davinci/davinci-i2s.c')
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 9e0e565e6ed9..d0d60b8a54d4 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -658,7 +658,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
658 | return -ENODEV; | 658 | return -ENODEV; |
659 | } | 659 | } |
660 | 660 | ||
661 | ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, | 661 | ioarea = request_mem_region(mem->start, resource_size(mem), |
662 | pdev->name); | 662 | pdev->name); |
663 | if (!ioarea) { | 663 | if (!ioarea) { |
664 | dev_err(&pdev->dev, "McBSP region already claimed\n"); | 664 | dev_err(&pdev->dev, "McBSP region already claimed\n"); |
@@ -694,20 +694,25 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
694 | } | 694 | } |
695 | clk_enable(dev->clk); | 695 | clk_enable(dev->clk); |
696 | 696 | ||
697 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); | 697 | dev->base = ioremap(mem->start, resource_size(mem)); |
698 | if (!dev->base) { | ||
699 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
700 | ret = -ENOMEM; | ||
701 | goto err_release_clk; | ||
702 | } | ||
698 | 703 | ||
699 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].dma_addr = | 704 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].dma_addr = |
700 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG); | 705 | (dma_addr_t)(mem->start + DAVINCI_MCBSP_DXR_REG); |
701 | 706 | ||
702 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].dma_addr = | 707 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].dma_addr = |
703 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DRR_REG); | 708 | (dma_addr_t)(mem->start + DAVINCI_MCBSP_DRR_REG); |
704 | 709 | ||
705 | /* first TX, then RX */ | 710 | /* first TX, then RX */ |
706 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 711 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
707 | if (!res) { | 712 | if (!res) { |
708 | dev_err(&pdev->dev, "no DMA resource\n"); | 713 | dev_err(&pdev->dev, "no DMA resource\n"); |
709 | ret = -ENXIO; | 714 | ret = -ENXIO; |
710 | goto err_free_mem; | 715 | goto err_iounmap; |
711 | } | 716 | } |
712 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; | 717 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; |
713 | 718 | ||
@@ -715,7 +720,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
715 | if (!res) { | 720 | if (!res) { |
716 | dev_err(&pdev->dev, "no DMA resource\n"); | 721 | dev_err(&pdev->dev, "no DMA resource\n"); |
717 | ret = -ENXIO; | 722 | ret = -ENXIO; |
718 | goto err_free_mem; | 723 | goto err_iounmap; |
719 | } | 724 | } |
720 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; | 725 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; |
721 | dev->dev = &pdev->dev; | 726 | dev->dev = &pdev->dev; |
@@ -724,14 +729,19 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
724 | 729 | ||
725 | ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai); | 730 | ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai); |
726 | if (ret != 0) | 731 | if (ret != 0) |
727 | goto err_free_mem; | 732 | goto err_iounmap; |
728 | 733 | ||
729 | return 0; | 734 | return 0; |
730 | 735 | ||
736 | err_iounmap: | ||
737 | iounmap(dev->base); | ||
738 | err_release_clk: | ||
739 | clk_disable(dev->clk); | ||
740 | clk_put(dev->clk); | ||
731 | err_free_mem: | 741 | err_free_mem: |
732 | kfree(dev); | 742 | kfree(dev); |
733 | err_release_region: | 743 | err_release_region: |
734 | release_mem_region(mem->start, (mem->end - mem->start) + 1); | 744 | release_mem_region(mem->start, resource_size(mem)); |
735 | 745 | ||
736 | return ret; | 746 | return ret; |
737 | } | 747 | } |
@@ -747,7 +757,7 @@ static int davinci_i2s_remove(struct platform_device *pdev) | |||
747 | dev->clk = NULL; | 757 | dev->clk = NULL; |
748 | kfree(dev); | 758 | kfree(dev); |
749 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 759 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
750 | release_mem_region(mem->start, (mem->end - mem->start) + 1); | 760 | release_mem_region(mem->start, resource_size(mem)); |
751 | 761 | ||
752 | return 0; | 762 | return 0; |
753 | } | 763 | } |