hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/davinci_voicecodec.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * DaVinci Voice Codec Core Interface for TI platforms
34 *
45 * Copyright (C) 2010 Texas Instruments, Inc
56 *
67 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
218 */
229
2310 #include <linux/init.h>
....@@ -32,7 +19,6 @@
3219 #include <sound/pcm.h>
3320
3421 #include <linux/mfd/davinci_voicecodec.h>
35
-#include <mach/hardware.h>
3622
3723 static const struct regmap_config davinci_vc_regmap = {
3824 .reg_bits = 32,
....@@ -44,6 +30,7 @@
4430 struct davinci_vc *davinci_vc;
4531 struct resource *res;
4632 struct mfd_cell *cell = NULL;
33
+ dma_addr_t fifo_base;
4734 int ret;
4835
4936 davinci_vc = devm_kzalloc(&pdev->dev,
....@@ -59,13 +46,12 @@
5946 }
6047 clk_enable(davinci_vc->clk);
6148
62
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
63
-
64
- davinci_vc->base = devm_ioremap_resource(&pdev->dev, res);
49
+ davinci_vc->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
6550 if (IS_ERR(davinci_vc->base)) {
6651 ret = PTR_ERR(davinci_vc->base);
6752 goto fail;
6853 }
54
+ fifo_base = (dma_addr_t)res->start;
6955
7056 davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev,
7157 davinci_vc->base,
....@@ -83,8 +69,7 @@
8369 }
8470
8571 davinci_vc->davinci_vcif.dma_tx_channel = res->start;
86
- davinci_vc->davinci_vcif.dma_tx_addr =
87
- (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_WFIFO);
72
+ davinci_vc->davinci_vcif.dma_tx_addr = fifo_base + DAVINCI_VC_WFIFO;
8873
8974 res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
9075 if (!res) {
....@@ -94,8 +79,7 @@
9479 }
9580
9681 davinci_vc->davinci_vcif.dma_rx_channel = res->start;
97
- davinci_vc->davinci_vcif.dma_rx_addr =
98
- (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_RFIFO);
82
+ davinci_vc->davinci_vcif.dma_rx_addr = fifo_base + DAVINCI_VC_RFIFO;
9983
10084 davinci_vc->dev = &pdev->dev;
10185 davinci_vc->pdev = pdev;