audio-kernel: Fix compile with CONFIG_DEBUG_FS removed

Add fix for compilation failure after remove
CONFIG_DEBUG_FS.

Change-Id: I94f851916e1c397848aa5d107774f7480a74270f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>
This commit is contained in:
Laxminath Kasam
2020-04-10 17:40:37 +05:30
committed by Soumya Managoli
parent c24a60caf3
commit 80d432c96a
13 changed files with 155 additions and 118 deletions

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/types.h>
@@ -10,6 +10,7 @@
static struct miscdevice audio_alac_misc;
static struct ws_mgr audio_alac_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_alac_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -20,7 +21,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_alac_debug_fops);
}
#endif
static int alac_channel_map(u8 *channel_mapping, uint32_t channels);
static long audio_ioctl_shared(struct file *file, unsigned int cmd,
@@ -323,10 +324,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_alac_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
#endif
pr_debug("%s:alacdec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/types.h>
@@ -10,6 +10,7 @@
static struct miscdevice audio_ape_misc;
static struct ws_mgr audio_ape_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_ape_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -19,6 +20,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_ape_debug_fops);
}
#endif
static long audio_ioctl_shared(struct file *file, unsigned int cmd,
void *arg)
@@ -305,10 +307,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_ape_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
#endif
pr_debug("%s:apedec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2019-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/types.h>
@@ -10,6 +10,7 @@
static struct miscdevice audio_g711alaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -20,6 +21,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_g711_debug_fops);
}
#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -278,10 +280,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2019-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/types.h>
@@ -10,6 +10,7 @@
static struct miscdevice audio_g711mlaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -20,6 +21,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_g711_debug_fops);
}
#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -277,10 +279,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -144,56 +144,6 @@ struct generic_get_data_ {
};
static struct generic_get_data_ *generic_get_data;
#ifdef CONFIG_DEBUG_FS
#define OUT_BUFFER_SIZE 56
#define IN_BUFFER_SIZE 24
static struct timeval out_cold_tv;
static struct timeval out_warm_tv;
static struct timeval out_cont_tv;
static struct timeval in_cont_tv;
static long out_enable_flag;
static long in_enable_flag;
static struct dentry *out_dentry;
static struct dentry *in_dentry;
static int in_cont_index;
/*This var is used to keep track of first write done for cold output latency */
static int out_cold_index;
static char *out_buffer;
static char *in_buffer;
static uint32_t adsp_reg_event_opcode[] = {
ASM_STREAM_CMD_REGISTER_PP_EVENTS,
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS,
ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE };
static uint32_t adsp_raise_event_opcode[] = {
ASM_STREAM_PP_EVENT,
ASM_STREAM_CMD_ENCDEC_EVENTS,
ASM_IEC_61937_MEDIA_FMT_EVENT };
static int is_adsp_reg_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_reg_event_opcode); i++) {
if (cmd == adsp_reg_event_opcode[i])
return i;
}
return -EINVAL;
}
static int is_adsp_raise_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++) {
if (cmd == adsp_raise_event_opcode[i])
return i;
}
return -EINVAL;
}
static inline void q6asm_set_flag_in_token(union asm_token_struct *asm_token,
int flag, int flag_offset)
{
@@ -276,6 +226,56 @@ uint8_t q6asm_get_stream_id_from_token(uint32_t token)
}
EXPORT_SYMBOL(q6asm_get_stream_id_from_token);
static uint32_t adsp_reg_event_opcode[] = {
ASM_STREAM_CMD_REGISTER_PP_EVENTS,
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS,
ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE };
static int is_adsp_reg_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_reg_event_opcode); i++) {
if (cmd == adsp_reg_event_opcode[i])
return i;
}
return -EINVAL;
}
static uint32_t adsp_raise_event_opcode[] = {
ASM_STREAM_PP_EVENT,
ASM_STREAM_CMD_ENCDEC_EVENTS,
ASM_IEC_61937_MEDIA_FMT_EVENT };
static int is_adsp_raise_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++) {
if (cmd == adsp_raise_event_opcode[i])
return i;
}
return -EINVAL;
}
#ifdef CONFIG_DEBUG_FS
#define OUT_BUFFER_SIZE 56
#define IN_BUFFER_SIZE 24
static struct timeval out_cold_tv;
static struct timeval out_warm_tv;
static struct timeval out_cont_tv;
static struct timeval in_cont_tv;
static long out_enable_flag;
static long in_enable_flag;
static struct dentry *out_dentry;
static struct dentry *in_dentry;
static int in_cont_index;
/*This var is used to keep track of first write done for cold output latency */
static int out_cold_index;
static char *out_buffer;
static char *in_buffer;
static int audio_output_latency_dbgfs_open(struct inode *inode,
struct file *file)
{

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2010-2014, 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2010-2014, 2016-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/kernel.h>
@@ -1117,9 +1117,9 @@ static int __init apr_debug_init(void)
}
#else
static int __init apr_debug_init(void)
(
{
return 0;
)
}
#endif
static void apr_cleanup(void)
@@ -1140,7 +1140,9 @@ static void apr_cleanup(void)
mutex_destroy(&client[i][j].svc[k].m_lock);
}
}
#ifdef CONFIG_DEBUG_FS
debugfs_remove(debugfs_apr_debug);
#endif
}
static int apr_probe(struct platform_device *pdev)

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2010-2014, 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2010-2014, 2016-2020 The Linux Foundation. All rights reserved.
*/
#include <linux/kernel.h>
@@ -1308,9 +1308,9 @@ static int __init apr_debug_init(void)
}
#else
static int __init apr_debug_init(void)
(
{
return 0;
)
}
#endif
static void apr_cleanup(void)
@@ -1331,7 +1331,9 @@ static void apr_cleanup(void)
mutex_destroy(&client[i][j].svc[k].m_lock);
}
}
#ifdef CONFIG_DEBUG_FS
debugfs_remove(debugfs_apr_debug);
#endif
}
static int apr_probe(struct platform_device *pdev)

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -19,6 +19,7 @@
static struct miscdevice audio_alac_misc;
static struct ws_mgr audio_alac_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_alac_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_alac_debug_fops);
}
#endif
static int alac_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -332,10 +334,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_alac_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
#endif
pr_debug("%s:alacdec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -19,6 +19,7 @@
static struct miscdevice audio_ape_misc;
static struct ws_mgr audio_ape_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_ape_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -28,6 +29,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_ape_debug_fops);
}
#endif
static long audio_ioctl_shared(struct file *file, unsigned int cmd,
void *arg)
@@ -314,10 +316,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_ape_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("debugfs_create_file failed\n");
#endif
pr_debug("%s:apedec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -19,6 +19,7 @@
static struct miscdevice audio_g711alaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_g711_debug_fops);
}
#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -287,10 +289,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 2019-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -19,6 +19,7 @@
static struct miscdevice audio_g711mlaw_misc;
static struct ws_mgr audio_g711_ws_mgr;
#ifdef CONFIG_DEBUG_FS
static const struct file_operations audio_g711_debug_fops = {
.read = audio_aio_debug_read,
.open = audio_aio_debug_open,
@@ -29,6 +30,7 @@ static struct dentry *config_debugfs_create_file(const char *name, void *data)
return debugfs_create_file(name, S_IFREG | 0444,
NULL, (void *)data, &audio_g711_debug_fops);
}
#endif
static int g711_channel_map(u8 *channel_mapping, uint32_t channels);
@@ -286,10 +288,12 @@ static int audio_open(struct inode *inode, struct file *file)
}
snprintf(name, sizeof(name), "msm_g711_%04x", audio->ac->session);
#ifdef CONFIG_DEBUG_FS
audio->dentry = config_debugfs_create_file(name, (void *)audio);
if (IS_ERR_OR_NULL(audio->dentry))
pr_debug("%s: debugfs_create_file failed\n", __func__);
#endif
pr_debug("%s: g711dec success mode[%d]session[%d]\n", __func__,
audio->feedback,
audio->ac->session);

View File

@@ -146,56 +146,6 @@ struct generic_get_data_ {
};
static struct generic_get_data_ *generic_get_data;
#ifdef CONFIG_DEBUG_FS
#define OUT_BUFFER_SIZE 56
#define IN_BUFFER_SIZE 24
static struct timeval out_cold_tv;
static struct timeval out_warm_tv;
static struct timeval out_cont_tv;
static struct timeval in_cont_tv;
static long out_enable_flag;
static long in_enable_flag;
static struct dentry *out_dentry;
static struct dentry *in_dentry;
static int in_cont_index;
/*This var is used to keep track of first write done for cold output latency */
static int out_cold_index;
static char *out_buffer;
static char *in_buffer;
static uint32_t adsp_reg_event_opcode[] = {
ASM_STREAM_CMD_REGISTER_PP_EVENTS,
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS,
ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE };
static uint32_t adsp_raise_event_opcode[] = {
ASM_STREAM_PP_EVENT,
ASM_STREAM_CMD_ENCDEC_EVENTS,
ASM_IEC_61937_MEDIA_FMT_EVENT };
static int is_adsp_reg_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_reg_event_opcode); i++) {
if (cmd == adsp_reg_event_opcode[i])
return i;
}
return -EINVAL;
}
static int is_adsp_raise_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++) {
if (cmd == adsp_raise_event_opcode[i])
return i;
}
return -EINVAL;
}
static inline void q6asm_set_flag_in_token(union asm_token_struct *asm_token,
int flag, int flag_offset)
{
@@ -278,6 +228,56 @@ uint8_t q6asm_get_stream_id_from_token(uint32_t token)
}
EXPORT_SYMBOL(q6asm_get_stream_id_from_token);
static uint32_t adsp_reg_event_opcode[] = {
ASM_STREAM_CMD_REGISTER_PP_EVENTS,
ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS,
ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE };
static int is_adsp_reg_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_reg_event_opcode); i++) {
if (cmd == adsp_reg_event_opcode[i])
return i;
}
return -EINVAL;
}
static uint32_t adsp_raise_event_opcode[] = {
ASM_STREAM_PP_EVENT,
ASM_STREAM_CMD_ENCDEC_EVENTS,
ASM_IEC_61937_MEDIA_FMT_EVENT };
static int is_adsp_raise_event(uint32_t cmd)
{
int i;
for (i = 0; i < ARRAY_SIZE(adsp_raise_event_opcode); i++) {
if (cmd == adsp_raise_event_opcode[i])
return i;
}
return -EINVAL;
}
#ifdef CONFIG_DEBUG_FS
#define OUT_BUFFER_SIZE 56
#define IN_BUFFER_SIZE 24
static struct timeval out_cold_tv;
static struct timeval out_warm_tv;
static struct timeval out_cont_tv;
static struct timeval in_cont_tv;
static long out_enable_flag;
static long in_enable_flag;
static struct dentry *out_dentry;
static struct dentry *in_dentry;
static int in_cont_index;
/*This var is used to keep track of first write done for cold output latency */
static int out_cold_index;
static char *out_buffer;
static char *in_buffer;
static int audio_output_latency_dbgfs_open(struct inode *inode,
struct file *file)
{

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2010-2014, 2016-2019 The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2014, 2016-2020 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1124,9 +1124,9 @@ static int __init apr_debug_init(void)
}
#else
static int __init apr_debug_init(void)
(
{
return 0;
)
}
#endif
static void apr_cleanup(void)
@@ -1147,7 +1147,9 @@ static void apr_cleanup(void)
mutex_destroy(&client[i][j].svc[k].m_lock);
}
}
#ifdef CONFIG_DEBUG_FS
debugfs_remove(debugfs_apr_debug);
#endif
}
static int apr_probe(struct platform_device *pdev)