Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
techpack: audio: Merge tag 'LA.UM.8.1.r1-15400-sm8150.0' into neutrin…
Browse files Browse the repository at this point in the history
…o-msm-hotdogb-4.14

"LA.UM.8.1.r1-15400-sm8150.0"

* tag 'LA.UM.8.1.r1-15400-sm8150.0':
  audio-kernel: Fix compile with CONFIG_DEBUG_FS removed

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Jul 8, 2020
2 parents 100d51d + ffeb349 commit 509449f
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 118 deletions.
7 changes: 5 additions & 2 deletions techpack/audio/4.0/dsp/codecs/audio_alac.c
@@ -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>
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion techpack/audio/4.0/dsp/codecs/audio_ape.c
@@ -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>
Expand All @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion techpack/audio/4.0/dsp/codecs/audio_g711alaw.c
@@ -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>
Expand All @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion techpack/audio/4.0/dsp/codecs/audio_g711mlaw.c
@@ -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>
Expand All @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
100 changes: 50 additions & 50 deletions techpack/audio/4.0/dsp/q6asm.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
8 changes: 5 additions & 3 deletions techpack/audio/4.0/ipc/apr.c
@@ -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>
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions techpack/audio/4.0/ipc/apr_vm.c
@@ -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>
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion techpack/audio/dsp/codecs/audio_alac.c
@@ -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
Expand All @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion techpack/audio/dsp/codecs/audio_ape.c
@@ -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
Expand All @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 509449f

Please sign in to comment.