Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 965a68a2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: codecs: Add flag to check if wait event initialized before access"

parents 40bfaf0e 0d30652d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2009-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2009-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
@@ -1340,6 +1340,7 @@ int audio_aio_open(struct q6audio_aio *audio, struct file *file)
	audio->pcm_cfg.sample_rate = 48000;
	audio->pcm_cfg.channel_count = 2;

	audio->wake_event_initialized = false;
	/* Only AIO interface */
	if (file->f_flags & O_NONBLOCK) {
		pr_debug("%s[%pK]:set to aio interface\n", __func__, audio);
@@ -1373,6 +1374,7 @@ int audio_aio_open(struct q6audio_aio *audio, struct file *file)
	audio->drv_ops.out_flush(audio);
	audio->opened = 1;
	audio->reset_event = false;
	audio->wake_event_initialized = true;
	file->private_data = audio;
	audio->codec_ioctl = audio_aio_ioctl;
	audio->codec_compat_ioctl = audio_aio_compat_ioctl;
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2009-2018, 2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2009-2018, 2020-2021 The Linux Foundation. All rights reserved.
 */

#include <linux/fs.h>
@@ -188,6 +188,7 @@ struct q6audio_aio {
	int rflush;             /* Read  flush */
	int wflush;             /* Write flush */
	bool reset_event;
	bool wake_event_initialized;
	long (*codec_ioctl)(struct file *, unsigned int, unsigned long);
	long (*codec_compat_ioctl)(struct file *, unsigned int, unsigned long);
};
+3 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -110,6 +110,7 @@ void audio_aio_cb(uint32_t opcode, uint32_t token,
		pr_err("%s: Received opcode:0x%x\n", __func__, opcode);
		audio->stopped = 1;
		audio->reset_event = true;
		if (audio->wake_event_initialized)
			wake_up(&audio->event_wait);
		break;
	default: