int cmd, struct snd_soc_dai *dai)
{
struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
- int ret, stype = SUBSTREAM_TYPE(substream);
+ int ret;
unsigned long val, tmp;
ret = 0;
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
- if (PCM_TX == stype) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
tmp |= (SLOT3_VALID | SLOT4_VALID | VALID_FRAME);
AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
- if (PCM_TX == stype) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
tmp &= ~(SLOT3_VALID | SLOT4_VALID);
AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct nuc900_audio *nuc900_audio = runtime->private_data;
- unsigned long flags, stype = SUBSTREAM_TYPE(substream);
+ unsigned long flags;
int ret = 0;
spin_lock_irqsave(&nuc900_audio->lock, flags);
return ret;
nuc900_audio->substream = substream;
- nuc900_audio->dma_addr[stype] = runtime->dma_addr;
- nuc900_audio->buffersize[stype] = params_buffer_bytes(params);
+ nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr;
+ nuc900_audio->buffersize[substream->stream] =
+ params_buffer_bytes(params);
spin_unlock_irqrestore(&nuc900_audio->lock, flags);
struct nuc900_audio *nuc900_audio = runtime->private_data;
void __iomem *mmio_addr, *mmio_len;
- if (SUBSTREAM_TYPE(substream) == PCM_TX) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
mmio_addr = nuc900_audio->mmio + ACTL_PDSTB;
mmio_len = nuc900_audio->mmio + ACTL_PDST_LENGTH;
} else {
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct nuc900_audio *nuc900_audio = runtime->private_data;
- unsigned long flags, val, stype = SUBSTREAM_TYPE(substream);;
+ unsigned long flags, val;
spin_lock_irqsave(&nuc900_audio->lock, flags);
nuc900_update_dma_register(substream,
- nuc900_audio->dma_addr[stype], nuc900_audio->buffersize[stype]);
+ nuc900_audio->dma_addr[substream->stream],
+ nuc900_audio->buffersize[substream->stream]);
val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
switch (runtime->channels) {
case 1:
- if (PCM_TX == stype) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
val &= ~(PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
val |= PLAY_RIGHT_CHNNEL;
} else {
AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
break;
case 2:
- if (PCM_TX == stype)
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
val |= (PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
else
val |= (RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL);