diff options
author | Vaibhav Bedia <vaibhav.bedia@ti.com> | 2011-02-09 08:09:54 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 17:33:32 -0500 |
commit | 4f82f0285297b89bb1d612b52dfd38fd572a8282 (patch) | |
tree | a45cdb22c28c0311dd287012ad9d7400b029cd46 /sound/soc/davinci/davinci-mcasp.c | |
parent | eef6d7b8c24e8dd5af6094ef453a05c80b68d36e (diff) |
ASoC: Davinci: Replace usage of IO_ADDRESS with ioremap()
This patch modifies the Davinci i2s and mcasp drivers to make use of
ioremap() instead of IO_ADDRESS()
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index e7ae621a3afa..a5af834c8ef5 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -885,7 +885,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
885 | clk_enable(dev->clk); | 885 | clk_enable(dev->clk); |
886 | dev->clk_active = 1; | 886 | dev->clk_active = 1; |
887 | 887 | ||
888 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); | 888 | dev->base = ioremap(mem->start, resource_size(mem)); |
889 | if (!dev->base) { | ||
890 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
891 | ret = -ENOMEM; | ||
892 | goto err_release_clk; | ||
893 | } | ||
894 | |||
889 | dev->op_mode = pdata->op_mode; | 895 | dev->op_mode = pdata->op_mode; |
890 | dev->tdm_slots = pdata->tdm_slots; | 896 | dev->tdm_slots = pdata->tdm_slots; |
891 | dev->num_serializer = pdata->num_serializer; | 897 | dev->num_serializer = pdata->num_serializer; |
@@ -899,14 +905,14 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
899 | dma_data->asp_chan_q = pdata->asp_chan_q; | 905 | dma_data->asp_chan_q = pdata->asp_chan_q; |
900 | dma_data->ram_chan_q = pdata->ram_chan_q; | 906 | dma_data->ram_chan_q = pdata->ram_chan_q; |
901 | dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset + | 907 | dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset + |
902 | io_v2p(dev->base)); | 908 | mem->start); |
903 | 909 | ||
904 | /* first TX, then RX */ | 910 | /* first TX, then RX */ |
905 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 911 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
906 | if (!res) { | 912 | if (!res) { |
907 | dev_err(&pdev->dev, "no DMA resource\n"); | 913 | dev_err(&pdev->dev, "no DMA resource\n"); |
908 | ret = -ENODEV; | 914 | ret = -ENODEV; |
909 | goto err_release_clk; | 915 | goto err_iounmap; |
910 | } | 916 | } |
911 | 917 | ||
912 | dma_data->channel = res->start; | 918 | dma_data->channel = res->start; |
@@ -915,13 +921,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
915 | dma_data->asp_chan_q = pdata->asp_chan_q; | 921 | dma_data->asp_chan_q = pdata->asp_chan_q; |
916 | dma_data->ram_chan_q = pdata->ram_chan_q; | 922 | dma_data->ram_chan_q = pdata->ram_chan_q; |
917 | dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset + | 923 | dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset + |
918 | io_v2p(dev->base)); | 924 | mem->start); |
919 | 925 | ||
920 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); | 926 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
921 | if (!res) { | 927 | if (!res) { |
922 | dev_err(&pdev->dev, "no DMA resource\n"); | 928 | dev_err(&pdev->dev, "no DMA resource\n"); |
923 | ret = -ENODEV; | 929 | ret = -ENODEV; |
924 | goto err_release_clk; | 930 | goto err_iounmap; |
925 | } | 931 | } |
926 | 932 | ||
927 | dma_data->channel = res->start; | 933 | dma_data->channel = res->start; |
@@ -929,9 +935,11 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
929 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); | 935 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); |
930 | 936 | ||
931 | if (ret != 0) | 937 | if (ret != 0) |
932 | goto err_release_clk; | 938 | goto err_iounmap; |
933 | return 0; | 939 | return 0; |
934 | 940 | ||
941 | err_iounmap: | ||
942 | iounmap(dev->base); | ||
935 | err_release_clk: | 943 | err_release_clk: |
936 | clk_disable(dev->clk); | 944 | clk_disable(dev->clk); |
937 | clk_put(dev->clk); | 945 | clk_put(dev->clk); |