Loading dsp/codecs/audio_aac.c +10 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. 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 Loading Loading @@ -355,20 +355,24 @@ static int audio_open(struct inode *inode, struct file *file) struct q6audio_aio *audio = NULL; int rc = 0; struct msm_audio_aac_config *aac_config = NULL; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_aac_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_aac_config), GFP_KERNEL); if (audio->codec_cfg == NULL) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } aac_config = audio->codec_cfg; Loading @@ -389,14 +393,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading dsp/codecs/audio_alac.c +10 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #include <linux/types.h> Loading Loading @@ -259,18 +259,22 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_alac_" + 5]; spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (!audio) if (!audio) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_alac_config), GFP_KERNEL); if (!audio->codec_cfg) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } Loading @@ -286,14 +290,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading dsp/codecs/audio_amrnb.c +9 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2011-2017, 2019-2021 The Linux Foundation. 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 Loading Loading @@ -122,15 +122,18 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_amrnb_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; audio->miscdevice = &audio_amrnb_misc; Loading @@ -143,14 +146,17 @@ static int audio_open(struct inode *inode, struct file *file) if (!audio->ac) { pr_err("Could not allocate memory for audio client\n"); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading dsp/codecs/audio_amrwb.c +9 −5 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2011-2017, 2021 The Linux Foundation. All rights reserved. */ #include <linux/compat.h> Loading Loading @@ -115,16 +115,18 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_amrwb_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; audio->miscdevice = &audio_amrwb_misc; audio->wakelock_voted = false; Loading @@ -136,15 +138,17 @@ static int audio_open(struct inode *inode, struct file *file) if (!audio->ac) { pr_err("Could not allocate memory for audio client\n"); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading dsp/codecs/audio_amrwbplus.c +10 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2010-2017, 2019-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2010-2017, 2019-2021 The Linux Foundation. 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 Loading Loading @@ -295,16 +295,21 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_amrwbplus_config_v2), GFP_KERNEL); if (audio->codec_cfg == NULL) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; Loading @@ -319,15 +324,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading Loading
dsp/codecs/audio_aac.c +10 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. 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 Loading Loading @@ -355,20 +355,24 @@ static int audio_open(struct inode *inode, struct file *file) struct q6audio_aio *audio = NULL; int rc = 0; struct msm_audio_aac_config *aac_config = NULL; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_aac_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_aac_config), GFP_KERNEL); if (audio->codec_cfg == NULL) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } aac_config = audio->codec_cfg; Loading @@ -389,14 +393,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading
dsp/codecs/audio_alac.c +10 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #include <linux/types.h> Loading Loading @@ -259,18 +259,22 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_alac_" + 5]; spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (!audio) if (!audio) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_alac_config), GFP_KERNEL); if (!audio->codec_cfg) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } Loading @@ -286,14 +290,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading
dsp/codecs/audio_amrnb.c +9 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2011-2017, 2019-2021 The Linux Foundation. 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 Loading Loading @@ -122,15 +122,18 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_amrnb_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; audio->miscdevice = &audio_amrnb_misc; Loading @@ -143,14 +146,17 @@ static int audio_open(struct inode *inode, struct file *file) if (!audio->ac) { pr_err("Could not allocate memory for audio client\n"); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading
dsp/codecs/audio_amrwb.c +9 −5 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2011-2017, 2021 The Linux Foundation. All rights reserved. */ #include <linux/compat.h> Loading Loading @@ -115,16 +115,18 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; #ifdef CONFIG_DEBUG_FS /* 4 bytes represents decoder number, 1 byte for terminate string */ char name[sizeof "msm_amrwb_" + 5]; #endif spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; audio->miscdevice = &audio_amrwb_misc; audio->wakelock_voted = false; Loading @@ -136,15 +138,17 @@ static int audio_open(struct inode *inode, struct file *file) if (!audio->ac) { pr_err("Could not allocate memory for audio client\n"); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading
dsp/codecs/audio_amrwbplus.c +10 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2010-2017, 2019-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2010-2017, 2019-2021 The Linux Foundation. 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 Loading Loading @@ -295,16 +295,21 @@ static int audio_open(struct inode *inode, struct file *file) { struct q6audio_aio *audio = NULL; int rc = 0; unsigned long flags = 0; spin_lock_irqsave(&enc_dec_lock, flags); audio = kzalloc(sizeof(struct q6audio_aio), GFP_KERNEL); if (audio == NULL) if (audio == NULL) { spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->codec_cfg = kzalloc(sizeof(struct msm_audio_amrwbplus_config_v2), GFP_KERNEL); if (audio->codec_cfg == NULL) { kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } audio->pcm_cfg.buffer_size = PCM_BUFSZ_MIN; Loading @@ -319,15 +324,17 @@ static int audio_open(struct inode *inode, struct file *file) pr_err("Could not allocate memory for audio client\n"); kfree(audio->codec_cfg); kfree(audio); spin_unlock_irqrestore(&enc_dec_lock, flags); return -ENOMEM; } rc = audio_aio_open(audio, file); if (rc < 0) { pr_err_ratelimited("%s: audio_aio_open rc=%d\n", __func__, rc); spin_unlock_irqrestore(&enc_dec_lock, flags); goto fail; } spin_unlock_irqrestore(&enc_dec_lock, flags); /* open in T/NT mode */ if ((file->f_mode & FMODE_WRITE) && (file->f_mode & FMODE_READ)) { rc = q6asm_open_read_write(audio->ac, FORMAT_LINEAR_PCM, Loading