예제 #1
0
int alsa_audio_disable(struct msm_audio *prtd)
{
	if (prtd->enabled) {
		MM_DBG("\n");
		mutex_lock(&the_locks.lock);
		prtd->enabled = 0;
		audio_dsp_out_enable(prtd, 0);
		wake_up(&the_locks.write_wait);
		audpp_disable(-1, prtd);
		prtd->out_needed = 0;
		mutex_unlock(&the_locks.lock);
	}
	return 0;
}
예제 #2
0
int audio_disable(struct msm_audio *prtd)
{
	if (prtd->enabled) {
		mutex_lock(&the_locks.lock);
		prtd->enabled = 0;
		audio_dsp_out_enable(prtd, 0);
		wake_up(&the_locks.write_wait);
		audpp_disable(AUDPP_ALSA_DECODER, prtd);
		audmgr_disable(&prtd->audmgr);
		prtd->out_needed = 0;
		mutex_unlock(&the_locks.lock);
	}
	return 0;
}
예제 #3
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	pr_info("audio_disable\n");
	if (audio->enabled) {
		audio->enabled = 0;
		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		wake_up(&audio->wait);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
	}
	return 0;
}
예제 #4
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	MM_DBG("\n"); /* Macro prints the file name and function */
	if (audio->enabled) {
		audio->enabled = 0;
		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		wake_up(&audio->wait);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
	}
	return 0;
}
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	MM_DBG("\n"); /* Macro prints the file name and function */
	if (audio->enabled) {
		MM_AUD_INFO("audio_disable()\n");
		audio->enabled = 0;
		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		audio->stopped = 1;
		wake_up(&audio->wait);
		audmgr_disable(&audio->audmgr);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
		htc_pwrsink_audio_set(PWRSINK_AUDIO_PCM, 0);
	}
	return 0;
}
예제 #6
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	MM_INFO("\n"); /* Macro prints the file name and function */
	if (audio->enabled) {
		audio->enabled = 0;
		
		isAudioEn = 0;			//JRD added.
		audio_opal_spkr_pa_enable();

		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		wake_up(&audio->wait);
		audmgr_disable(&audio->audmgr);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
	}
	return 0;
}
예제 #7
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	MM_INFO("\n"); /* Macro prints the file name and function */
	if (audio->enabled) {

#ifdef CONFIG_AMP_MAX97000
		audio_enabled = 0;
		//max97000_suspend();
#endif
		audio->enabled = 0;
		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		wake_up(&audio->wait);
		audmgr_disable(&audio->audmgr);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
	}
	return 0;
}
예제 #8
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
    MM_DBG("\n"); /* Macro prints the file name and function */
    if (audio->enabled) {
        audio->enabled = 0;
//added by john
        isAudioEn = audio->enabled;
        if(!isIncallMode) {
            audio_opal_spkr_pa_enable(false);
        }
//added by john
        audio_dsp_out_enable(audio, 0);

        audpp_disable(-1, audio);

        wake_up(&audio->wait);
        audmgr_disable(&audio->audmgr);
        audio->out_needed = 0;
        audio_allow_sleep(audio);
    }
    return 0;
}
예제 #9
0
/* must be called with audio->lock held */
static int audio_disable(struct audio *audio)
{
	MM_INFO("[CLK]\n"); /* Macro prints the file name and function */
	if (audio->enabled) {
		audio->enabled = 0;
#ifdef CONFIG_CCI_SPEAKER
	MM_INFO("[CLK] speaker_audmgr_enable(false)\n");
	/*cci.johnny_lee, for pop-noise issue */
	if (speaker_audmgr_enable(false) < 0)
	{
		MM_ERR("[CLK] speaker_audmgr_enable return failed, we will retry after 600ms\n");
	}
#endif
		audio_dsp_out_enable(audio, 0);

		audpp_disable(-1, audio);

		wake_up(&audio->wait);
		audmgr_disable(&audio->audmgr);
		audio->out_needed = 0;
		audio_allow_sleep(audio);
	}
	return 0;
}
예제 #10
0
void audio_dsp_event(void *data, unsigned id, uint16_t *msg)
{
	struct msm_audio *prtd = data;
	struct buffer *frame;
	unsigned long flag;

	switch (id) {
	case AUDPP_MSG_STATUS_MSG:
		break;
	case AUDPP_MSG_SPA_BANDS:
		break;
	case AUDPP_MSG_HOST_PCM_INTF_MSG:{
			unsigned id = msg[2];
			unsigned idx = msg[3] - 1;
			if (id != AUDPP_MSG_HOSTPCM_ID_ARM_RX) {
				printk(KERN_ERR "bogus id\n");
				break;
			}
			if (idx > 1) {
				printk(KERN_ERR "bogus buffer idx\n");
				break;
			}

			prtd->pcm_irq_pos += prtd->pcm_count;
			if (prtd->pcm_irq_pos > prtd->pcm_size)
				prtd->pcm_irq_pos = prtd->pcm_count;

			if (prtd->ops->playback)
				prtd->ops->playback(prtd);

			spin_lock_irqsave(&the_locks.write_dsp_lock, flag);
			if (prtd->running) {
				prtd->out[idx].used = 0;
				frame = prtd->out + prtd->out_tail;
				if (frame->used) {
					audio_dsp_send_buffer(prtd,
							      prtd->out_tail,
							      frame->used);
					prtd->out_tail ^= 1;
				} else {
					prtd->out_needed++;
				}
				wake_up(&the_locks.write_wait);
			}
			spin_unlock_irqrestore(&the_locks.write_dsp_lock, flag);
			break;
		}
	case AUDPP_MSG_PCMDMAMISSED:
		printk(KERN_ERR "audio_dsp_event: PCMDMAMISSED %d\n", msg[0]);
		break;
	case AUDPP_MSG_CFG_MSG:
		if (msg[0] == AUDPP_MSG_ENA_ENA) {
			prtd->out_needed = 0;
			prtd->running = 1;
			audio_dsp_out_enable(prtd, 1);
		} else if (msg[0] == AUDPP_MSG_ENA_DIS) {
			prtd->running = 0;
		} else {
			printk(KERN_ERR "audio_dsp_event:CFG_MSG=%d\n", msg[0]);
		}
		break;
	case EVENT_MSG_ID:
		pr_info("audio_dsp_event: arm9 event\n");
		break;
	default:
		printk(KERN_ERR "audio_dsp_event: UNKNOWN (%d)\n", id);
	}
}
예제 #11
0
void alsa_dsp_event(void *data, unsigned id, uint16_t *msg)
{
	struct msm_audio *prtd = data;
	struct buffer *frame;
	unsigned long flag = 0;

	MM_DBG("\n");
	switch (id) {
	case AUDPP_MSG_HOST_PCM_INTF_MSG: {
		unsigned id = msg[3];
		unsigned idx = msg[4] - 1;

		MM_DBG("HOST_PCM id %d idx %d\n", id, idx);
		if (id != AUDPP_MSG_HOSTPCM_ID_ARM_RX) {
			MM_ERR("bogus id\n");
			break;
		}
		if (idx > 1) {
			MM_ERR("bogus buffer idx\n");
			break;
		}

		/* Update with actual sent buffer size */
		if (prtd->out[idx].used != BUF_INVALID_LEN)
			prtd->pcm_irq_pos += prtd->out[idx].used;

		if (prtd->pcm_irq_pos > prtd->pcm_size)
			prtd->pcm_irq_pos = prtd->pcm_count;

		if (prtd->ops->playback)
			prtd->ops->playback(prtd);

		if (prtd->mmap_flag)
			break;

		spin_lock_irqsave(&the_locks.write_dsp_lock, flag);
		if (prtd->running) {
			prtd->out[idx].used = 0;
			frame = prtd->out + prtd->out_tail;
			if (frame->used) {
				alsa_dsp_send_buffer(
					prtd, prtd->out_tail, frame->used);
				/* Reset eos_ack flag to avoid stale
				 * PCMDMAMISS been considered
				 */
				prtd->eos_ack = 0;
				prtd->out_tail ^= 1;
			} else {
				prtd->out_needed++;
			}
			wake_up(&the_locks.write_wait);
		}
		spin_unlock_irqrestore(&the_locks.write_dsp_lock, flag);
		break;
	}
	case AUDPP_MSG_PCMDMAMISSED:
		MM_INFO("PCMDMAMISSED %d\n", msg[0]);
		prtd->eos_ack++;
		MM_DBG("PCMDMAMISSED Count per Buffer %d\n", prtd->eos_ack);
		wake_up(&the_locks.eos_wait);
		break;
	case AUDPP_MSG_CFG_MSG:
		if (msg[0] == AUDPP_MSG_ENA_ENA) {
			MM_DBG("CFG_MSG ENABLE\n");
			prtd->out_needed = 0;
			prtd->running = 1;
			audpp_dsp_set_vol_pan(prtd->session_id, &prtd->vol_pan,
					POPP);
			audpp_route_stream(prtd->session_id,
				msm_snddev_route_dec(prtd->session_id));
			audio_dsp_out_enable(prtd, 1);
		} else if (msg[0] == AUDPP_MSG_ENA_DIS) {
			MM_DBG("CFG_MSG DISABLE\n");
			prtd->running = 0;
		} else {
			MM_DBG("CFG_MSG %d?\n", msg[0]);
		}
		break;
	default:
		MM_DBG("UNKNOWN (%d)\n", id);
	}
}