platform: nvadsp: rename aram manager apis

As aram manager functions are made available through
tegra_nvadsp.h header, rename those to make those specific
to nvadsp.

Bug 200326188

Change-Id: Ib10d78f6f74600bb2771151ca38792f6f81858f1
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1545002
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This commit is contained in:
Nitin Kumbhar
2017-08-24 04:25:43 -07:00
committed by Laxman Dewangan
parent 12be717e8c
commit 3fb218dbaa
4 changed files with 28 additions and 36 deletions

View File

@@ -3,7 +3,7 @@
*
* ADSP OS App management
*
* Copyright (C) 2014-2016, NVIDIA Corporation. All rights reserved.
* Copyright (C) 2014-2017, NVIDIA Corporation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -387,7 +387,7 @@ static void free_instance_memory(nvadsp_app_info_t *app,
}
if (mem->aram_flag)
aram_release(mem->aram);
nvadsp_aram_release(mem->aram);
else if (mem->aram)
nvadsp_free_coherent(sz->aram, mem->aram, iova_mem->aram);
mem->aram = NULL;
@@ -395,7 +395,7 @@ static void free_instance_memory(nvadsp_app_info_t *app,
mem->aram_flag = 0;
if (mem->aram_x_flag) {
aram_release(mem->aram_x);
nvadsp_aram_release(mem->aram_x);
mem->aram_x = NULL;
iova_mem->aram_x = 0;
mem->aram_flag = 0;
@@ -454,9 +454,9 @@ static int create_instance_memory(nvadsp_app_info_t *app,
}
if (sz->aram) {
aram_handle = aram_request(name, sz->aram);
aram_handle = nvadsp_aram_request(name, sz->aram);
if (!IS_ERR_OR_NULL(aram_handle)) {
iova_mem->aram = aram_get_address(aram_handle);
iova_mem->aram = nvadsp_aram_get_address(aram_handle);
mem->aram = aram_handle;
iova_mem->aram_flag = mem->aram_flag = 1;
dev_dbg(dev, "%s aram %x\n", name, iova_mem->aram);
@@ -479,9 +479,9 @@ static int create_instance_memory(nvadsp_app_info_t *app,
}
if (sz->aram_x) {
aram_handle = aram_request(name, sz->aram);
aram_handle = nvadsp_aram_request(name, sz->aram);
if (!IS_ERR_OR_NULL(aram_handle)) {
iova_mem->aram_x = aram_get_address(aram_handle);
iova_mem->aram_x = nvadsp_aram_get_address(aram_handle);
mem->aram_x = aram_handle;
iova_mem->aram_x_flag = mem->aram_x_flag = 1;
dev_dbg(dev, "aram_x %x\n", iova_mem->aram_x);

View File

@@ -3,7 +3,7 @@
*
* ARAM manager
*
* Copyright (C) 2014-2016, NVIDIA Corporation. All rights reserved.
* Copyright (C) 2014-2017, NVIDIA Corporation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -19,6 +19,7 @@
#define pr_fmt(fmt) "%s : %d, " fmt, __func__, __LINE__
#include <linux/debugfs.h>
#include <linux/tegra_nvadsp.h>
#include "aram_manager.h"
@@ -27,53 +28,53 @@ static void *aram_handle;
static LIST_HEAD(aram_alloc_list);
static LIST_HEAD(aram_free_list);
void aram_print(void)
void nvadsp_aram_print(void)
{
mem_print(aram_handle);
}
EXPORT_SYMBOL(aram_print);
EXPORT_SYMBOL(nvadsp_aram_print);
void *aram_request(const char *name, size_t size)
void *nvadsp_aram_request(const char *name, size_t size)
{
return mem_request(aram_handle, name, size);
}
EXPORT_SYMBOL(aram_request);
EXPORT_SYMBOL(nvadsp_aram_request);
bool aram_release(void *handle)
bool nvadsp_aram_release(void *handle)
{
return mem_release(aram_handle, handle);
}
EXPORT_SYMBOL(aram_release);
EXPORT_SYMBOL(nvadsp_aram_release);
unsigned long aram_get_address(void *handle)
unsigned long nvadsp_aram_get_address(void *handle)
{
return mem_get_address(handle);
}
EXPORT_SYMBOL(aram_get_address);
EXPORT_SYMBOL(nvadsp_aram_get_address);
#ifdef CONFIG_DEBUG_FS
static struct dentry *aram_dump_debugfs_file;
static int aram_dump(struct seq_file *s, void *data)
static int nvadsp_aram_dump(struct seq_file *s, void *data)
{
mem_dump(aram_handle, s);
return 0;
}
static int aram_dump_open(struct inode *inode, struct file *file)
static int nvadsp_aram_dump_open(struct inode *inode, struct file *file)
{
return single_open(file, aram_dump, inode->i_private);
return single_open(file, nvadsp_aram_dump, inode->i_private);
}
static const struct file_operations aram_dump_fops = {
.open = aram_dump_open,
.open = nvadsp_aram_dump_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif
int aram_init(unsigned long addr, unsigned long size)
int nvadsp_aram_init(unsigned long addr, unsigned long size)
{
aram_handle = create_mem_manager("ARAM", addr, size);
if (IS_ERR(aram_handle)) {
@@ -92,14 +93,12 @@ int aram_init(unsigned long addr, unsigned long size)
#endif
return 0;
}
EXPORT_SYMBOL(aram_init);
void aram_exit(void)
void nvadsp_aram_exit(void)
{
#ifdef CONFIG_DEBUG_FS
debugfs_remove(aram_dump_debugfs_file);
#endif
destroy_mem_manager(aram_handle);
}
EXPORT_SYMBOL(aram_exit);

View File

@@ -1,7 +1,7 @@
/*
* Header file for aram manager
*
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -18,13 +18,6 @@
#include "mem_manager.h"
int aram_init(unsigned long addr, unsigned long size);
void aram_exit(void);
void *aram_request(const char *name, size_t size);
bool aram_release(void *handle);
unsigned long aram_get_address(void *handle);
void aram_print(void);
int nvadsp_aram_init(unsigned long addr, unsigned long size);
void nvadsp_aram_exit(void);
#endif /* __TEGRA_NVADSP_ARAM_MANAGER_H */

View File

@@ -357,7 +357,7 @@ static int __init nvadsp_probe(struct platform_device *pdev)
aram_addr = drv_data->adsp_mem[ARAM_ALIAS_0_ADDR];
aram_size = drv_data->adsp_mem[ARAM_ALIAS_0_SIZE];
ret = aram_init(aram_addr, aram_size);
ret = nvadsp_aram_init(aram_addr, aram_size);
if (ret)
dev_err(dev, "Failed to init aram\n");
err:
@@ -375,7 +375,7 @@ static int nvadsp_remove(struct platform_device *pdev)
#ifdef CONFIG_TEGRA_EMC_APE_DFS
emc_dfs_exit();
#endif
aram_exit();
nvadsp_aram_exit();
pm_runtime_disable(&pdev->dev);