| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * DaVinci Voice Codec Core Interface for TI platforms |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 Texas Instruments, Inc |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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 |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | |
|---|
| 23 | 10 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 32 | 19 | #include <sound/pcm.h> |
|---|
| 33 | 20 | |
|---|
| 34 | 21 | #include <linux/mfd/davinci_voicecodec.h> |
|---|
| 35 | | -#include <mach/hardware.h> |
|---|
| 36 | 22 | |
|---|
| 37 | 23 | static const struct regmap_config davinci_vc_regmap = { |
|---|
| 38 | 24 | .reg_bits = 32, |
|---|
| .. | .. |
|---|
| 44 | 30 | struct davinci_vc *davinci_vc; |
|---|
| 45 | 31 | struct resource *res; |
|---|
| 46 | 32 | struct mfd_cell *cell = NULL; |
|---|
| 33 | + dma_addr_t fifo_base; |
|---|
| 47 | 34 | int ret; |
|---|
| 48 | 35 | |
|---|
| 49 | 36 | davinci_vc = devm_kzalloc(&pdev->dev, |
|---|
| .. | .. |
|---|
| 59 | 46 | } |
|---|
| 60 | 47 | clk_enable(davinci_vc->clk); |
|---|
| 61 | 48 | |
|---|
| 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); |
|---|
| 65 | 50 | if (IS_ERR(davinci_vc->base)) { |
|---|
| 66 | 51 | ret = PTR_ERR(davinci_vc->base); |
|---|
| 67 | 52 | goto fail; |
|---|
| 68 | 53 | } |
|---|
| 54 | + fifo_base = (dma_addr_t)res->start; |
|---|
| 69 | 55 | |
|---|
| 70 | 56 | davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev, |
|---|
| 71 | 57 | davinci_vc->base, |
|---|
| .. | .. |
|---|
| 83 | 69 | } |
|---|
| 84 | 70 | |
|---|
| 85 | 71 | 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; |
|---|
| 88 | 73 | |
|---|
| 89 | 74 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
|---|
| 90 | 75 | if (!res) { |
|---|
| .. | .. |
|---|
| 94 | 79 | } |
|---|
| 95 | 80 | |
|---|
| 96 | 81 | 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; |
|---|
| 99 | 83 | |
|---|
| 100 | 84 | davinci_vc->dev = &pdev->dev; |
|---|
| 101 | 85 | davinci_vc->pdev = pdev; |
|---|