Commit d76596b1 authored by Clemens Ladisch's avatar Clemens Ladisch

ALSA: oxygen: rename pcm_dev_cfg

Rename the pcm_dev_cfg field to device_config because there will be
additional flags that do not describe PCM devices.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent c3f00739
......@@ -157,9 +157,9 @@ static const struct oxygen_model model_hifier = {
.update_dac_mute = update_ak4396_mute,
.dac_tlv = ak4396_db_scale,
.model_data_size = sizeof(struct hifier_data),
.pcm_dev_cfg = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_1,
.device_config = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_1,
.dac_channels = 2,
.dac_volume_min = 0,
.dac_volume_max = 255,
......
......@@ -292,10 +292,10 @@ static int generic_probe(struct oxygen *chip, unsigned long driver_data)
chip->model.init = meridian_init;
chip->model.resume = ak4396_registers_init;
chip->model.set_adc_params = set_ak5385_params;
chip->model.pcm_dev_cfg = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2 |
CAPTURE_1_FROM_SPDIF;
chip->model.device_config = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2 |
CAPTURE_1_FROM_SPDIF;
chip->model.misc_flags = OXYGEN_MISC_MIDI;
}
return 0;
......@@ -316,12 +316,12 @@ static const struct oxygen_model model_generic = {
.update_dac_mute = update_ak4396_mute,
.dac_tlv = ak4396_db_scale,
.model_data_size = sizeof(struct generic_data),
.pcm_dev_cfg = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
PLAYBACK_2_TO_AC97_1 |
CAPTURE_0_FROM_I2S_1 |
CAPTURE_1_FROM_SPDIF |
CAPTURE_2_FROM_AC97_1,
.device_config = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
PLAYBACK_2_TO_AC97_1 |
CAPTURE_0_FROM_I2S_1 |
CAPTURE_1_FROM_SPDIF |
CAPTURE_2_FROM_AC97_1,
.dac_channels = 8,
.dac_volume_min = 0,
.dac_volume_max = 255,
......
......@@ -78,7 +78,7 @@ struct oxygen_model {
unsigned int reg, unsigned int mute);
const unsigned int *dac_tlv;
size_t model_data_size;
unsigned int pcm_dev_cfg;
unsigned int device_config;
u8 dac_channels;
u8 dac_volume_min;
u8 dac_volume_max;
......
......@@ -273,7 +273,7 @@ static void oxygen_init(struct oxygen *chip)
OXYGEN_RATE_48000 | chip->model.dac_i2s_format |
OXYGEN_I2S_MCLK_256 | OXYGEN_I2S_BITS_16 |
OXYGEN_I2S_MASTER | OXYGEN_I2S_BCLK_64);
if (chip->model.pcm_dev_cfg & CAPTURE_0_FROM_I2S_1)
if (chip->model.device_config & CAPTURE_0_FROM_I2S_1)
oxygen_write16(chip, OXYGEN_I2S_A_FORMAT,
OXYGEN_RATE_48000 | chip->model.adc_i2s_format |
OXYGEN_I2S_MCLK_256 | OXYGEN_I2S_BITS_16 |
......@@ -281,8 +281,8 @@ static void oxygen_init(struct oxygen *chip)
else
oxygen_write16(chip, OXYGEN_I2S_A_FORMAT,
OXYGEN_I2S_MASTER | OXYGEN_I2S_MUTE_MCLK);
if (chip->model.pcm_dev_cfg & (CAPTURE_0_FROM_I2S_2 |
CAPTURE_2_FROM_I2S_2))
if (chip->model.device_config & (CAPTURE_0_FROM_I2S_2 |
CAPTURE_2_FROM_I2S_2))
oxygen_write16(chip, OXYGEN_I2S_B_FORMAT,
OXYGEN_RATE_48000 | chip->model.adc_i2s_format |
OXYGEN_I2S_MCLK_256 | OXYGEN_I2S_BITS_16 |
......@@ -295,7 +295,7 @@ static void oxygen_init(struct oxygen *chip)
oxygen_clear_bits32(chip, OXYGEN_SPDIF_CONTROL,
OXYGEN_SPDIF_OUT_ENABLE |
OXYGEN_SPDIF_LOOPBACK);
if (chip->model.pcm_dev_cfg & CAPTURE_1_FROM_SPDIF)
if (chip->model.device_config & CAPTURE_1_FROM_SPDIF)
oxygen_write32_masked(chip, OXYGEN_SPDIF_CONTROL,
OXYGEN_SPDIF_SENSE_MASK |
OXYGEN_SPDIF_LOCK_MASK |
......@@ -514,7 +514,7 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
oxygen_proc_init(chip);
spin_lock_irq(&chip->reg_lock);
if (chip->model.pcm_dev_cfg & CAPTURE_1_FROM_SPDIF)
if (chip->model.device_config & CAPTURE_1_FROM_SPDIF)
chip->interrupt_mask |= OXYGEN_INT_SPDIF_IN_DETECT;
if (chip->has_ac97_0 | chip->has_ac97_1)
chip->interrupt_mask |= OXYGEN_INT_AC97;
......
......@@ -974,14 +974,14 @@ int oxygen_mixer_init(struct oxygen *chip)
err = add_controls(chip, controls, ARRAY_SIZE(controls));
if (err < 0)
return err;
if (chip->model.pcm_dev_cfg & CAPTURE_1_FROM_SPDIF) {
if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) {
err = add_controls(chip, spdif_input_controls,
ARRAY_SIZE(spdif_input_controls));
if (err < 0)
return err;
}
for (i = 0; i < ARRAY_SIZE(monitor_controls); ++i) {
if (!(chip->model.pcm_dev_cfg & monitor_controls[i].pcm_dev))
if (!(chip->model.device_config & monitor_controls[i].pcm_dev))
continue;
err = add_controls(chip, monitor_controls[i].controls,
ARRAY_SIZE(monitor_controls[i].controls));
......
......@@ -129,7 +129,7 @@ static int oxygen_open(struct snd_pcm_substream *substream,
runtime->private_data = (void *)(uintptr_t)channel;
if (channel == PCM_B && chip->has_ac97_1 &&
(chip->model.pcm_dev_cfg & CAPTURE_2_FROM_AC97_1))
(chip->model.device_config & CAPTURE_2_FROM_AC97_1))
runtime->hw = oxygen_ac97_hardware;
else
runtime->hw = *oxygen_hardware[channel];
......@@ -381,7 +381,7 @@ static int oxygen_rec_b_hw_params(struct snd_pcm_substream *substream,
return err;
is_ac97 = chip->has_ac97_1 &&
(chip->model.pcm_dev_cfg & CAPTURE_2_FROM_AC97_1);
(chip->model.device_config & CAPTURE_2_FROM_AC97_1);
spin_lock_irq(&chip->reg_lock);
oxygen_write8_masked(chip, OXYGEN_REC_FORMAT,
......@@ -657,9 +657,9 @@ int oxygen_pcm_init(struct oxygen *chip)
int outs, ins;
int err;
outs = !!(chip->model.pcm_dev_cfg & PLAYBACK_0_TO_I2S);
ins = !!(chip->model.pcm_dev_cfg & (CAPTURE_0_FROM_I2S_1 |
CAPTURE_0_FROM_I2S_2));
outs = !!(chip->model.device_config & PLAYBACK_0_TO_I2S);
ins = !!(chip->model.device_config & (CAPTURE_0_FROM_I2S_1 |
CAPTURE_0_FROM_I2S_2));
if (outs | ins) {
err = snd_pcm_new(chip->card, "Analog", 0, outs, ins, &pcm);
if (err < 0)
......@@ -667,10 +667,10 @@ int oxygen_pcm_init(struct oxygen *chip)
if (outs)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
&oxygen_multich_ops);
if (chip->model.pcm_dev_cfg & CAPTURE_0_FROM_I2S_1)
if (chip->model.device_config & CAPTURE_0_FROM_I2S_1)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&oxygen_rec_a_ops);
else if (chip->model.pcm_dev_cfg & CAPTURE_0_FROM_I2S_2)
else if (chip->model.device_config & CAPTURE_0_FROM_I2S_2)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&oxygen_rec_b_ops);
pcm->private_data = chip;
......@@ -690,8 +690,8 @@ int oxygen_pcm_init(struct oxygen *chip)
BUFFER_BYTES_MAX);
}
outs = !!(chip->model.pcm_dev_cfg & PLAYBACK_1_TO_SPDIF);
ins = !!(chip->model.pcm_dev_cfg & CAPTURE_1_FROM_SPDIF);
outs = !!(chip->model.device_config & PLAYBACK_1_TO_SPDIF);
ins = !!(chip->model.device_config & CAPTURE_1_FROM_SPDIF);
if (outs | ins) {
err = snd_pcm_new(chip->card, "Digital", 1, outs, ins, &pcm);
if (err < 0)
......@@ -712,11 +712,11 @@ int oxygen_pcm_init(struct oxygen *chip)
}
if (chip->has_ac97_1) {
outs = !!(chip->model.pcm_dev_cfg & PLAYBACK_2_TO_AC97_1);
ins = !!(chip->model.pcm_dev_cfg & CAPTURE_2_FROM_AC97_1);
outs = !!(chip->model.device_config & PLAYBACK_2_TO_AC97_1);
ins = !!(chip->model.device_config & CAPTURE_2_FROM_AC97_1);
} else {
outs = 0;
ins = !!(chip->model.pcm_dev_cfg & CAPTURE_2_FROM_I2S_2);
ins = !!(chip->model.device_config & CAPTURE_2_FROM_I2S_2);
}
if (outs | ins) {
err = snd_pcm_new(chip->card, outs ? "AC97" : "Analog2",
......
......@@ -566,10 +566,10 @@ static const struct oxygen_model model_xonar_d2 = {
.update_dac_mute = update_pcm1796_mute,
.dac_tlv = pcm1796_db_scale,
.model_data_size = sizeof(struct xonar_data),
.pcm_dev_cfg = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2 |
CAPTURE_1_FROM_SPDIF,
.device_config = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2 |
CAPTURE_1_FROM_SPDIF,
.dac_channels = 8,
.dac_volume_min = 0x0f,
.dac_volume_max = 0xff,
......@@ -598,9 +598,9 @@ static const struct oxygen_model model_xonar_d1 = {
.ac97_switch = xonar_d1_ac97_switch,
.dac_tlv = cs4362a_db_scale,
.model_data_size = sizeof(struct xonar_data),
.pcm_dev_cfg = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2,
.device_config = PLAYBACK_0_TO_I2S |
PLAYBACK_1_TO_SPDIF |
CAPTURE_0_FROM_I2S_2,
.dac_channels = 8,
.dac_volume_min = 0,
.dac_volume_max = 127,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment