Esempio n. 1
0
static int q6_voice_stop(void)
{
	mutex_lock(&voice_lock);
	if (voice_started) {
		q6voice_close(voc_tx_clnt);
		q6voice_close(voc_rx_clnt);
		voice_started = 0;
	}
	mutex_unlock(&voice_lock);
	return 0;
}
Esempio n. 2
0
static int q6_voice_stop(void)
{
	mutex_lock(&voice_lock);
	if (atomic_read(&voice_started)) {
		q6voice_close(voc_tx_clnt);
		q6voice_close(voc_rx_clnt);
		atomic_set(&voice_started,0);
	}
	mutex_unlock(&voice_lock);
	return 0;
}
Esempio n. 3
0
static int q6_voice_start(uint32_t rx_acdb_id, uint32_t tx_acdb_id)
{
	int rc = 0;

	mutex_lock(&voice_lock);

	if (voice_started) {
		pr_err("voice: busy\n");
		rc = -EBUSY;
		goto done;
	}

	voc_rx_clnt = q6voice_open(AUDIO_FLAG_WRITE, rx_acdb_id);
	if (!voc_rx_clnt) {
		pr_err("voice: open voice rx failed.\n");
		rc = -ENOMEM;
		goto done;
	}

	voc_tx_clnt = q6voice_open(AUDIO_FLAG_READ, tx_acdb_id);
	if (!voc_tx_clnt) {
		pr_err("voice: open voice tx failed.\n");
		q6voice_close(voc_rx_clnt);
		rc = -ENOMEM;
	}

	voice_started = 1;
done:
	mutex_unlock(&voice_lock);
	return rc;
}
Esempio n. 4
0
static int q6_voice_start(void)
{
	int rc = 0;

	mutex_lock(&voice_lock);

	if (voice_started) {
		pr_err("[%s:%s] busy\n", __MM_FILE__, __func__);
		rc = -EBUSY;
		goto done;
	}

	voc_tx_clnt = q6voice_open(AUDIO_FLAG_WRITE);
	if (!voc_tx_clnt) {
		pr_err("[%s:%s] open voice tx failed.\n", __MM_FILE__,
				__func__);
		rc = -ENOMEM;
		goto done;
	}

	voc_rx_clnt = q6voice_open(AUDIO_FLAG_READ);
	if (!voc_rx_clnt) {
		pr_err("[%s:%s] open voice rx failed.\n", __MM_FILE__,
				__func__);
		q6voice_close(voc_tx_clnt);
		rc = -ENOMEM;
	}

	voice_started = 1;
done:
	mutex_unlock(&voice_lock);
	return rc;
}