static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct sport_device *sport = runtime->private_data;
	int ret = 0;

	pr_debug("%s enter\n", __func__);
	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
			sport_tx_start(sport);
		else
			sport_rx_start(sport);
		break;
	case SNDRV_PCM_TRIGGER_STOP:
	case SNDRV_PCM_TRIGGER_SUSPEND:
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
			sport_tx_stop(sport);
		else
			sport_rx_stop(sport);
		break;
	default:
		ret = -EINVAL;
	}

	return ret;
}
static int bfin_i2s_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport = snd_soc_dai_get_drvdata(dai);

	if (dai->capture_active)
		sport_rx_stop(sport);
	if (dai->playback_active)
		sport_tx_stop(sport);
	return 0;
}
Esempio n. 3
0
static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);

	pr_debug("%s : sport %d\n", __func__, dai->id);

	if (dai->capture_active)
		sport_rx_stop(sport_handle);
	if (dai->playback_active)
		sport_tx_stop(sport_handle);
	return 0;
}
Esempio n. 4
0
static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport = snd_soc_dai_get_drvdata(dai);

	if (!dai->active)
		return 0;
	if (dai->capture.active)
		sport_rx_stop(sport);
	if (dai->playback.active)
		sport_tx_stop(sport);
	return 0;
}
Esempio n. 5
0
static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport = dai->private_data;

	if (!dai->active)
		return 0;
	if (dai->capture_active)
		sport_rx_stop(sport);
	if (dai->playback_active)
		sport_tx_stop(sport);
	return 0;
}
Esempio n. 6
0
static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
{
    struct sport_device *sport = dai->private_data;

    pr_debug("%s : sport %d\n", __func__, dai->id);
    if (!dai->active)
        return 0;
    if (dai->capture.active)
        sport_rx_stop(sport);
    if (dai->playback.active)
        sport_tx_stop(sport);
    return 0;
}
Esempio n. 7
0
static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport = snd_soc_dai_get_drvdata(dai);

	if (dai->playback_active)
		sport_tx_stop(sport);
	if (dai->capture_active)
		sport_rx_stop(sport);

	/* isolate sync/clock pins from codec while sports resume */
	peripheral_free_list(sport->pin_req);

	return 0;
}
Esempio n. 8
0
static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct sport_device *sport = runtime->private_data;
	int ret = 0;

	pr_debug("%s enter\n", __func__);
	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
			bf5xx_mmap_copy(substream, runtime->period_size);
			sport->tx_delay_pos = 0;
#endif
			sport_tx_start(sport);
		} else
			sport_rx_start(sport);
		break;
	case SNDRV_PCM_TRIGGER_STOP:
	case SNDRV_PCM_TRIGGER_SUSPEND:
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
			sport->tx_pos = 0;
#endif
			sport_tx_stop(sport);
		} else {
#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
			sport->rx_pos = 0;
#endif
			sport_rx_stop(sport);
		}
		break;
	default:
		ret = -EINVAL;
	}
	return ret;
}