1777 |
if ((nr_ch == 3) || ((dir == SNDRV_PCM_STREAM_CAPTURE)&&(nr_ch > 2))) |
if ((nr_ch == 3) || ((dir == SNDRV_PCM_STREAM_CAPTURE)&&(nr_ch > 2))) |
1778 |
return -EBUSY; |
return -EBUSY; |
1779 |
|
|
1780 |
spin_lock(vortex->lock); |
spin_lock(&vortex->lock); |
1781 |
if (dma >= 0) { |
if (dma >= 0) { |
1782 |
en = 0; |
en = 0; |
1783 |
vortex_adb_checkinout(vortex, vortex->dma_adb[dma].resources, en, VORTEX_RESOURCE_DMA); |
vortex_adb_checkinout(vortex, vortex->dma_adb[dma].resources, en, VORTEX_RESOURCE_DMA); |
1793 |
stream->type = type; |
stream->type = type; |
1794 |
|
|
1795 |
// FIXME: check for success of checkout or checkin. |
// FIXME: check for success of checkout or checkin. |
1796 |
|
/* PLAYBACK ROUTES. */ |
1797 |
if (dir == SNDRV_PCM_STREAM_PLAYBACK) { |
if (dir == SNDRV_PCM_STREAM_PLAYBACK) { |
1798 |
int src[4], mix[4], a3d=0, ch_top; |
int src[4], mix[4], a3d=0, ch_top; |
1799 |
|
|
1856 |
if ((stream->type == VORTEX_PCM_SPDIF)&&(!en)) { |
if ((stream->type == VORTEX_PCM_SPDIF)&&(!en)) { |
1857 |
vortex_route(vortex, 1, 0x14, ADB_MIXOUT(vortex->mixspdif[0]), ADB_SPDIFOUT(0)); |
vortex_route(vortex, 1, 0x14, ADB_MIXOUT(vortex->mixspdif[0]), ADB_SPDIFOUT(0)); |
1858 |
vortex_route(vortex, 1, 0x14, ADB_MIXOUT(vortex->mixspdif[1]), ADB_SPDIFOUT(1)); |
vortex_route(vortex, 1, 0x14, ADB_MIXOUT(vortex->mixspdif[1]), ADB_SPDIFOUT(1)); |
1859 |
} |
} |
1860 |
|
/* CAPTURE ROUTES. */ |
1861 |
} else { |
} else { |
1862 |
int src[2], mix[2]; |
int src[2], mix[2]; |
1863 |
|
|
1886 |
} |
} |
1887 |
} |
} |
1888 |
vortex->dma_adb[dma].nr_ch = nr_ch; |
vortex->dma_adb[dma].nr_ch = nr_ch; |
1889 |
spin_unlock(vortex->lock); |
spin_unlock(&vortex->lock); |
1890 |
|
|
1891 |
#if 0 |
#if 0 |
1892 |
/* AC97 Codec channel setup. FIXME: this has no effect !! */ |
/* AC97 Codec channel setup. FIXME: this has no effect on some cards !! */ |
1893 |
if (nr_ch < 4) { |
if (nr_ch < 4) { |
1894 |
/* Copy stereo to rear channel (surround) */ |
/* Copy stereo to rear channel (surround) */ |
1895 |
snd_ac97_write_cache(vortex->codec, AC97_SIGMATEL_DAC2INVERT, snd_ac97_read(vortex->codec, AC97_SIGMATEL_DAC2INVERT) | 4); |
snd_ac97_write_cache(vortex->codec, AC97_SIGMATEL_DAC2INVERT, snd_ac97_read(vortex->codec, AC97_SIGMATEL_DAC2INVERT) | 4); |
1896 |
} else { |
} else { |
1897 |
/* Allow separate front a rear channels. */ |
/* Allow separate front and rear channels. */ |
1898 |
snd_ac97_write_cache(vortex->codec, AC97_SIGMATEL_DAC2INVERT, snd_ac97_read(vortex->codec, AC97_SIGMATEL_DAC2INVERT) & ~((u32)4)); |
snd_ac97_write_cache(vortex->codec, AC97_SIGMATEL_DAC2INVERT, snd_ac97_read(vortex->codec, AC97_SIGMATEL_DAC2INVERT) & ~((u32)4)); |
1899 |
} |
} |
1900 |
#endif |
#endif |