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

Commit 2283a81e authored by Kogara Naveen Kumar's avatar Kogara Naveen Kumar Committed by Gerrit - the friendly Code Review server
Browse files

audio-kernel: Reset client info on deregister.



For elite and audioreach co-exit, we need keep source file same.
This patch exit in audioreach but not included in elite, cp it to keep file same.
Leveraged from audio-ar commit id ac15eb7016aff23a2be2a57289635d741cb95340

Change-Id: I187909403e9b54c8f6836477208de5e8311bf4ff
Signed-off-by: default avatarKogara Naveen Kumar <quic_nkogara@quicinc.com>
parent 282aeeb3
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018, 2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/platform_device.h>
@@ -233,6 +234,9 @@ int snd_event_client_deregister(struct device *dev)
		return -EINVAL;
	}

	dev_dbg(dev, "%s: removing client to SND event FW \n",
		__func__);

	mutex_lock(&snd_event_mutex);
	if (list_empty(&snd_event_client_list)) {
		dev_dbg(dev, "%s: No SND client registered\n", __func__);
@@ -249,7 +253,7 @@ int snd_event_client_deregister(struct device *dev)

	c->state = false;

	if (master && master->clients_found) {
	if (master) {
		struct snd_event_client *d;
		bool dev_found = false;

@@ -261,9 +265,12 @@ int snd_event_client_deregister(struct device *dev)
			}
		}
		if (dev_found ) {
			if(master->clients_found) {
				ret = check_and_update_fwk_state();
				master->clients_found = false;
			}
			master->clients->cl_arr[i].dev = NULL;
		}
	}

	list_del(&c->node);
@@ -465,6 +472,9 @@ int snd_event_notify(struct device *dev, unsigned int state)
		return -EINVAL;
	}

	dev_dbg(dev, "%s: snd_event_notify (state %u)\n",
		__func__, state);

	mutex_lock(&snd_event_mutex);
	if (list_empty(&snd_event_client_list) && !master) {
		dev_err(dev, "%s: No device registered\n", __func__);