{
static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
{
static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
{
snd_opti93x_busy_wait(chip);
outb(chip->mce_bit | (reg & 0x1f), OPTi93X_PORT(chip, INDEX));
return inb(OPTi93X_PORT(chip, DATA));
}
{
snd_opti93x_busy_wait(chip);
outb(chip->mce_bit | (reg & 0x1f), OPTi93X_PORT(chip, INDEX));
return inb(OPTi93X_PORT(chip, DATA));
}
unsigned char mask, unsigned char value)
{
snd_opti93x_out_image(chip, reg,
unsigned char mask, unsigned char value)
{
snd_opti93x_out_image(chip, reg,
#define snd_opti93x_mute_reg(chip, reg, mute) \
snd_opti93x_out(chip, reg, mute ? 0x80 : chip->image[reg]);
#define snd_opti93x_mute_reg(chip, reg, mute) \
snd_opti93x_out(chip, reg, mute ? 0x80 : chip->image[reg]);
unsigned int format, int channels)
{
unsigned char retval = OPTi93X_LINEAR_8;
unsigned int format, int channels)
{
unsigned char retval = OPTi93X_LINEAR_8;
snd_pcm_group_for_each(pos, substream) {
s = snd_pcm_group_substream_entry(pos);
if (s == chip->playback_substream) {
snd_pcm_group_for_each(pos, substream) {
s = snd_pcm_group_substream_entry(pos);
if (s == chip->playback_substream) {
{
return snd_opti93x_trigger(substream,
OPTi93X_PLAYBACK_ENABLE, cmd);
}
{
return snd_opti93x_trigger(substream,
OPTi93X_PLAYBACK_ENABLE, cmd);
}
{
return snd_opti93x_trigger(substream,
OPTi93X_CAPTURE_ENABLE, cmd);
}
{
return snd_opti93x_trigger(substream,
OPTi93X_CAPTURE_ENABLE, cmd);
}
-static int snd_opti93x_hw_params(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_opti93x_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params)
- opti93x_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_opti93x *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
- opti93x_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_opti93x *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
- opti93x_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_opti93x *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
- opti93x_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_opti93x *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
chip->playback_substream = NULL;
snd_opti93x_close(chip, OPTi93X_MODE_PLAY);
return 0;
}
chip->playback_substream = NULL;
snd_opti93x_close(chip, OPTi93X_MODE_PLAY);
return 0;
}
chip->capture_substream = NULL;
snd_opti93x_close(chip, OPTi93X_MODE_CAPTURE);
chip->capture_substream = NULL;
snd_opti93x_close(chip, OPTi93X_MODE_CAPTURE);
.open = snd_opti93x_playback_open,
.close = snd_opti93x_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.open = snd_opti93x_playback_open,
.close = snd_opti93x_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.open = snd_opti93x_capture_open,
.close = snd_opti93x_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.open = snd_opti93x_capture_open,
.close = snd_opti93x_capture_close,
.ioctl = snd_pcm_lib_ioctl,
if ((error = snd_pcm_new(codec->card, "OPTi 82C93X", device, 1, 1, &pcm)))
return error;
if ((error = snd_pcm_new(codec->card, "OPTi 82C93X", device, 1, 1, &pcm)))
return error;
{
static char *texts[4] = {
"Line1", "Aux", "Mic", "Mix"
{
static char *texts[4] = {
"Line1", "Aux", "Mic", "Mix"
.get = snd_opti93x_get_single, .put = snd_opti93x_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
.get = snd_opti93x_get_single, .put = snd_opti93x_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
do { xctl.private_value &= ~0x0000ffff; \
xctl.private_value |= left_reg | (right_reg << 8); } while (0)
do { xctl.private_value &= ~0x0000ffff; \
xctl.private_value |= left_reg | (right_reg << 8); } while (0)
unsigned long flags;
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
unsigned long flags;
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
unsigned long flags;
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
unsigned long flags;
int left_reg = kcontrol->private_value & 0xff;
int right_reg = (kcontrol->private_value >> 8) & 0xff;
OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1),
OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1),
OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1),
static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}};
#endif /* CS4231 || OPTi93X */
int error;
static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}};
#endif /* CS4231 || OPTi93X */
int error;
if (pcard && !snd_opti9xx_first_hit)
return -EBUSY;
if (!(card = snd_card_new(index, id, THIS_MODULE,
if (pcard && !snd_opti9xx_first_hit)
return -EBUSY;
if (!(card = snd_card_new(index, id, THIS_MODULE,
snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port);
if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {
snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port);
if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {
#ifndef OPTi93X
if (chip->hardware == OPTi9XX_HW_82C928 ||
chip->hardware == OPTi9XX_HW_82C929 ||
chip->hardware == OPTi9XX_HW_82C924) {
#ifndef OPTi93X
if (chip->hardware == OPTi9XX_HW_82C928 ||
chip->hardware == OPTi9XX_HW_82C929 ||
chip->hardware == OPTi9XX_HW_82C924) {
/* assume we have an OPL4 */
snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2),
0x20, 0x20);
/* assume we have an OPL4 */
snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2),
0x20, 0x20);