]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
arm: mach-tegra: Get rid of apbio.{c,h}
authorLaxman Dewangan <ldewangan@nvidia.com>
Thu, 8 Dec 2016 12:12:08 +0000 (17:42 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 9 Dec 2016 09:53:55 +0000 (01:53 -0800)
The apbio.c and apbio.h neither compiled nor used.
Remove these files from the tree as these were just
copied from older kernel version.

bug 200259459

Change-Id: Ie93c5efd690f2bec207e8a97ef60c166fa8627c1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1267575
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
arch/arm/mach-tegra/apbio.c [deleted file]
arch/arm/mach-tegra/apbio.h [deleted file]
drivers/platform/tegra/Makefile
drivers/platform/tegra/apbio.c [deleted file]

diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
deleted file mode 100644 (file)
index f248872..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2010 NVIDIA Corporation.
- * Copyright (C) 2010 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/completion.h>
-#include <linux/dmaengine.h>
-#include <linux/dma-mapping.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/mutex.h>
-#include <linux/of.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-
-#include "apbio.h"
-#include "iomap.h"
-
-#if defined(CONFIG_TEGRA20_APB_DMA)
-static DEFINE_MUTEX(tegra_apb_dma_lock);
-static u32 *tegra_apb_bb;
-static dma_addr_t tegra_apb_bb_phys;
-static DECLARE_COMPLETION(tegra_apb_wait);
-
-static int tegra_apb_readl_direct(unsigned long offset, u32 *value);
-static int tegra_apb_writel_direct(u32 value, unsigned long offset);
-
-static struct dma_chan *tegra_apb_dma_chan;
-static struct dma_slave_config dma_sconfig;
-
-static bool tegra_apb_dma_init(void)
-{
-       dma_cap_mask_t mask;
-
-       mutex_lock(&tegra_apb_dma_lock);
-
-       /* Check to see if we raced to setup */
-       if (tegra_apb_dma_chan)
-               goto skip_init;
-
-       dma_cap_zero(mask);
-       dma_cap_set(DMA_SLAVE, mask);
-       tegra_apb_dma_chan = dma_request_channel(mask, NULL, NULL);
-       if (!tegra_apb_dma_chan) {
-               /*
-                * This is common until the device is probed, so don't
-                * shout about it.
-                */
-               pr_debug("%s: can not allocate dma channel\n", __func__);
-               goto err_dma_alloc;
-       }
-
-       tegra_apb_bb = dma_alloc_coherent(NULL, sizeof(u32),
-               &tegra_apb_bb_phys, GFP_KERNEL);
-       if (!tegra_apb_bb) {
-               pr_err("%s: can not allocate bounce buffer\n", __func__);
-               goto err_buff_alloc;
-       }
-
-       dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-       dma_sconfig.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-       dma_sconfig.src_maxburst = 1;
-       dma_sconfig.dst_maxburst = 1;
-
-skip_init:
-       mutex_unlock(&tegra_apb_dma_lock);
-       return true;
-
-err_buff_alloc:
-       dma_release_channel(tegra_apb_dma_chan);
-       tegra_apb_dma_chan = NULL;
-
-err_dma_alloc:
-       mutex_unlock(&tegra_apb_dma_lock);
-       return false;
-}
-
-static void apb_dma_complete(void *args)
-{
-       complete(&tegra_apb_wait);
-}
-
-static int do_dma_transfer(unsigned long apb_add,
-               enum dma_transfer_direction dir)
-{
-       struct dma_async_tx_descriptor *dma_desc;
-       int ret;
-
-       if (dir == DMA_DEV_TO_MEM)
-               dma_sconfig.src_addr = apb_add;
-       else
-               dma_sconfig.dst_addr = apb_add;
-
-       ret = dmaengine_slave_config(tegra_apb_dma_chan, &dma_sconfig);
-       if (ret)
-               return ret;
-
-       dma_desc = dmaengine_prep_slave_single(tegra_apb_dma_chan,
-                       tegra_apb_bb_phys, sizeof(u32), dir,
-                       DMA_PREP_INTERRUPT |  DMA_CTRL_ACK);
-       if (!dma_desc)
-               return -EINVAL;
-
-       dma_desc->callback = apb_dma_complete;
-       dma_desc->callback_param = NULL;
-
-       reinit_completion(&tegra_apb_wait);
-
-       dmaengine_submit(dma_desc);
-       dma_async_issue_pending(tegra_apb_dma_chan);
-       ret = wait_for_completion_timeout(&tegra_apb_wait,
-               msecs_to_jiffies(50));
-
-       if (WARN(ret == 0, "apb read dma timed out")) {
-               dmaengine_terminate_all(tegra_apb_dma_chan);
-               return -EFAULT;
-       }
-       return 0;
-}
-
-int tegra_apb_readl_using_dma(unsigned long offset, u32 *value)
-{
-       int ret;
-
-       if (!tegra_apb_dma_chan && !tegra_apb_dma_init())
-               return tegra_apb_readl_direct(offset, value);
-
-       mutex_lock(&tegra_apb_dma_lock);
-       ret = do_dma_transfer(offset, DMA_DEV_TO_MEM);
-       if (ret < 0)
-               pr_err("error in reading offset 0x%08lx using dma\n", offset);
-       else
-               *value = *tegra_apb_bb;
-
-       mutex_unlock(&tegra_apb_dma_lock);
-
-       return ret;
-}
-
-int tegra_apb_writel_using_dma(u32 value, unsigned long offset)
-{
-       int ret;
-
-       if (!tegra_apb_dma_chan && !tegra_apb_dma_init())
-               return tegra_apb_writel_direct(value, offset);
-
-       mutex_lock(&tegra_apb_dma_lock);
-       *((u32 *)tegra_apb_bb) = value;
-       ret = do_dma_transfer(offset, DMA_MEM_TO_DEV);
-       mutex_unlock(&tegra_apb_dma_lock);
-       if (ret < 0)
-               pr_err("error in writing offset 0x%08lx using dma\n", offset);
-
-       return ret;
-}
-#else
-#define tegra_apb_readl_using_dma tegra_apb_readl_direct
-#define tegra_apb_writel_using_dma tegra_apb_writel_direct
-#endif
-
-typedef int (*apbio_read_fptr)(unsigned long offset, u32 *value);
-typedef int (*apbio_write_fptr)(u32 value, unsigned long offset);
-
-static apbio_read_fptr apbio_read;
-static apbio_write_fptr apbio_write;
-
-static int tegra_apb_readl_direct(unsigned long offset, u32 *value)
-{
-       *value = readl(IO_ADDRESS(offset));
-
-       return 0;
-}
-
-static int tegra_apb_writel_direct(u32 value, unsigned long offset)
-{
-       writel(value, IO_ADDRESS(offset));
-
-       return 0;
-}
-
-void tegra_apb_io_init(void)
-{
-       /* Need to use dma only when it is Tegra20 based platform */
-       if (of_machine_is_compatible("nvidia,tegra20") ||
-                       !of_have_populated_dt()) {
-               apbio_read = tegra_apb_readl_using_dma;
-               apbio_write = tegra_apb_writel_using_dma;
-       } else {
-               apbio_read = tegra_apb_readl_direct;
-               apbio_write = tegra_apb_writel_direct;
-       }
-}
-
-u32 tegra_apb_readl(unsigned long offset)
-{
-       u32 val;
-
-       if (apbio_read(offset, &val) < 0)
-               return 0;
-       else
-               return val;
-}
-
-void tegra_apb_writel(u32 value, unsigned long offset)
-{
-       apbio_write(value, offset);
-}
diff --git a/arch/arm/mach-tegra/apbio.h b/arch/arm/mach-tegra/apbio.h
deleted file mode 100644 (file)
index f05d71c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2010 NVIDIA Corporation.
- * Copyright (C) 2010 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef __MACH_TEGRA_APBIO_H
-#define __MACH_TEGRA_APBIO_H
-
-void tegra_apb_io_init(void);
-u32 tegra_apb_readl(unsigned long offset);
-void tegra_apb_writel(u32 value, unsigned long offset);
-#endif
index cc8e284a1764179887ee04b390031bef227efaf9..223f2b8f39285613235bef1c7680efb96a903116 100644 (file)
@@ -80,7 +80,6 @@ obj-$(CONFIG_COMMON_CLK) += common_clock.o
 
 
 obj-$(CONFIG_TEGRA_KFUSE) += tegra_kfuse.o
-obj-y += apbio.o
 
 obj-$(CONFIG_TEGRA_MC_DOMAINS) += pm_domains.o
 obj-y += bond_out.o
diff --git a/drivers/platform/tegra/apbio.c b/drivers/platform/tegra/apbio.c
deleted file mode 100644 (file)
index 357b821..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Automatically generated file; DO NOT EDIT. */
-#include "../../../arch/arm/mach-tegra/apbio.c"