diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-12-02 05:41:10 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-06 08:48:15 -0500 |
commit | 9719fcaa6a82be59a2d7767725e5cd8233c6a387 (patch) | |
tree | d9cbeec26ff94c135d15890cb7d9f5b6da5f40c7 | |
parent | e96f38f732d24515792296b3738842934c985539 (diff) |
ALSA: oxygen: allow to dump codec registers
To help with debugging, add the registers of the model-specific
codecs to the controller and AC97 register dump in the proc file.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 38 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.h | 3 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_lib.c | 10 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_cs43xx.c | 25 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_pcm179x.c | 56 | ||||
-rw-r--r-- | sound/pci/oxygen/xonar_wm87x6.c | 30 |
6 files changed, 151 insertions, 11 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index ea8fffefad9f..a58e448fc1bf 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <sound/ac97_codec.h> | 41 | #include <sound/ac97_codec.h> |
42 | #include <sound/control.h> | 42 | #include <sound/control.h> |
43 | #include <sound/core.h> | 43 | #include <sound/core.h> |
44 | #include <sound/info.h> | ||
44 | #include <sound/initval.h> | 45 | #include <sound/initval.h> |
45 | #include <sound/pcm.h> | 46 | #include <sound/pcm.h> |
46 | #include <sound/pcm_params.h> | 47 | #include <sound/pcm_params.h> |
@@ -518,6 +519,39 @@ static int generic_wm8785_mixer_init(struct oxygen *chip) | |||
518 | return 0; | 519 | return 0; |
519 | } | 520 | } |
520 | 521 | ||
522 | static void dump_ak4396_registers(struct oxygen *chip, | ||
523 | struct snd_info_buffer *buffer) | ||
524 | { | ||
525 | struct generic_data *data = chip->model_data; | ||
526 | unsigned int dac, i; | ||
527 | |||
528 | for (dac = 0; dac < data->dacs; ++dac) { | ||
529 | snd_iprintf(buffer, "\nAK4396 %u:", dac + 1); | ||
530 | for (i = 0; i < 5; ++i) | ||
531 | snd_iprintf(buffer, " %02x", data->ak4396_regs[dac][i]); | ||
532 | } | ||
533 | snd_iprintf(buffer, "\n"); | ||
534 | } | ||
535 | |||
536 | static void dump_wm8785_registers(struct oxygen *chip, | ||
537 | struct snd_info_buffer *buffer) | ||
538 | { | ||
539 | struct generic_data *data = chip->model_data; | ||
540 | unsigned int i; | ||
541 | |||
542 | snd_iprintf(buffer, "\nWM8785:"); | ||
543 | for (i = 0; i < 3; ++i) | ||
544 | snd_iprintf(buffer, " %03x", data->wm8785_regs[i]); | ||
545 | snd_iprintf(buffer, "\n"); | ||
546 | } | ||
547 | |||
548 | static void dump_oxygen_registers(struct oxygen *chip, | ||
549 | struct snd_info_buffer *buffer) | ||
550 | { | ||
551 | dump_ak4396_registers(chip, buffer); | ||
552 | dump_wm8785_registers(chip, buffer); | ||
553 | } | ||
554 | |||
521 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); | 555 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); |
522 | 556 | ||
523 | static const struct oxygen_model model_generic = { | 557 | static const struct oxygen_model model_generic = { |
@@ -533,6 +567,7 @@ static const struct oxygen_model model_generic = { | |||
533 | .set_adc_params = set_wm8785_params, | 567 | .set_adc_params = set_wm8785_params, |
534 | .update_dac_volume = update_ak4396_volume, | 568 | .update_dac_volume = update_ak4396_volume, |
535 | .update_dac_mute = update_ak4396_mute, | 569 | .update_dac_mute = update_ak4396_mute, |
570 | .dump_registers = dump_oxygen_registers, | ||
536 | .dac_tlv = ak4396_db_scale, | 571 | .dac_tlv = ak4396_db_scale, |
537 | .model_data_size = sizeof(struct generic_data), | 572 | .model_data_size = sizeof(struct generic_data), |
538 | .device_config = PLAYBACK_0_TO_I2S | | 573 | .device_config = PLAYBACK_0_TO_I2S | |
@@ -561,6 +596,7 @@ static int __devinit get_oxygen_model(struct oxygen *chip, | |||
561 | chip->model.mixer_init = generic_mixer_init; | 596 | chip->model.mixer_init = generic_mixer_init; |
562 | chip->model.resume = meridian_resume; | 597 | chip->model.resume = meridian_resume; |
563 | chip->model.set_adc_params = set_ak5385_params; | 598 | chip->model.set_adc_params = set_ak5385_params; |
599 | chip->model.dump_registers = dump_ak4396_registers; | ||
564 | chip->model.device_config = PLAYBACK_0_TO_I2S | | 600 | chip->model.device_config = PLAYBACK_0_TO_I2S | |
565 | PLAYBACK_1_TO_SPDIF | | 601 | PLAYBACK_1_TO_SPDIF | |
566 | CAPTURE_0_FROM_I2S_2 | | 602 | CAPTURE_0_FROM_I2S_2 | |
@@ -579,6 +615,7 @@ static int __devinit get_oxygen_model(struct oxygen *chip, | |||
579 | chip->model.suspend = claro_suspend; | 615 | chip->model.suspend = claro_suspend; |
580 | chip->model.resume = claro_resume; | 616 | chip->model.resume = claro_resume; |
581 | chip->model.set_adc_params = set_ak5385_params; | 617 | chip->model.set_adc_params = set_ak5385_params; |
618 | chip->model.dump_registers = dump_ak4396_registers; | ||
582 | chip->model.device_config = PLAYBACK_0_TO_I2S | | 619 | chip->model.device_config = PLAYBACK_0_TO_I2S | |
583 | PLAYBACK_1_TO_SPDIF | | 620 | PLAYBACK_1_TO_SPDIF | |
584 | CAPTURE_0_FROM_I2S_2 | | 621 | CAPTURE_0_FROM_I2S_2 | |
@@ -595,6 +632,7 @@ static int __devinit get_oxygen_model(struct oxygen *chip, | |||
595 | chip->model.resume = stereo_resume; | 632 | chip->model.resume = stereo_resume; |
596 | chip->model.mixer_init = generic_mixer_init; | 633 | chip->model.mixer_init = generic_mixer_init; |
597 | chip->model.set_adc_params = set_no_params; | 634 | chip->model.set_adc_params = set_no_params; |
635 | chip->model.dump_registers = dump_ak4396_registers; | ||
598 | chip->model.device_config = PLAYBACK_0_TO_I2S | | 636 | chip->model.device_config = PLAYBACK_0_TO_I2S | |
599 | PLAYBACK_1_TO_SPDIF; | 637 | PLAYBACK_1_TO_SPDIF; |
600 | if (id->driver_data == MODEL_FANTASIA) | 638 | if (id->driver_data == MODEL_FANTASIA) |
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h index cf9054ecb97b..b8fbc15b89a3 100644 --- a/sound/pci/oxygen/oxygen.h +++ b/sound/pci/oxygen/oxygen.h | |||
@@ -66,6 +66,7 @@ struct snd_pcm_hardware; | |||
66 | struct snd_pcm_hw_params; | 66 | struct snd_pcm_hw_params; |
67 | struct snd_kcontrol_new; | 67 | struct snd_kcontrol_new; |
68 | struct snd_rawmidi; | 68 | struct snd_rawmidi; |
69 | struct snd_info_buffer; | ||
69 | struct oxygen; | 70 | struct oxygen; |
70 | 71 | ||
71 | struct oxygen_model { | 72 | struct oxygen_model { |
@@ -93,6 +94,8 @@ struct oxygen_model { | |||
93 | void (*uart_input)(struct oxygen *chip); | 94 | void (*uart_input)(struct oxygen *chip); |
94 | void (*ac97_switch)(struct oxygen *chip, | 95 | void (*ac97_switch)(struct oxygen *chip, |
95 | unsigned int reg, unsigned int mute); | 96 | unsigned int reg, unsigned int mute); |
97 | void (*dump_registers)(struct oxygen *chip, | ||
98 | struct snd_info_buffer *buffer); | ||
96 | const unsigned int *dac_tlv; | 99 | const unsigned int *dac_tlv; |
97 | unsigned long private_data; | 100 | unsigned long private_data; |
98 | size_t model_data_size; | 101 | size_t model_data_size; |
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index 2e6579962217..e581e7ab216c 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -202,7 +202,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
202 | struct oxygen *chip = entry->private_data; | 202 | struct oxygen *chip = entry->private_data; |
203 | int i, j; | 203 | int i, j; |
204 | 204 | ||
205 | snd_iprintf(buffer, "CMI8788\n\n"); | 205 | snd_iprintf(buffer, "CMI8788:\n"); |
206 | for (i = 0; i < OXYGEN_IO_SIZE; i += 0x10) { | 206 | for (i = 0; i < OXYGEN_IO_SIZE; i += 0x10) { |
207 | snd_iprintf(buffer, "%02x:", i); | 207 | snd_iprintf(buffer, "%02x:", i); |
208 | for (j = 0; j < 0x10; ++j) | 208 | for (j = 0; j < 0x10; ++j) |
@@ -212,7 +212,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
212 | if (mutex_lock_interruptible(&chip->mutex) < 0) | 212 | if (mutex_lock_interruptible(&chip->mutex) < 0) |
213 | return; | 213 | return; |
214 | if (chip->has_ac97_0) { | 214 | if (chip->has_ac97_0) { |
215 | snd_iprintf(buffer, "\nAC97\n"); | 215 | snd_iprintf(buffer, "\nAC97:\n"); |
216 | for (i = 0; i < 0x80; i += 0x10) { | 216 | for (i = 0; i < 0x80; i += 0x10) { |
217 | snd_iprintf(buffer, "%02x:", i); | 217 | snd_iprintf(buffer, "%02x:", i); |
218 | for (j = 0; j < 0x10; j += 2) | 218 | for (j = 0; j < 0x10; j += 2) |
@@ -222,7 +222,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | if (chip->has_ac97_1) { | 224 | if (chip->has_ac97_1) { |
225 | snd_iprintf(buffer, "\nAC97 2\n"); | 225 | snd_iprintf(buffer, "\nAC97 2:\n"); |
226 | for (i = 0; i < 0x80; i += 0x10) { | 226 | for (i = 0; i < 0x80; i += 0x10) { |
227 | snd_iprintf(buffer, "%02x:", i); | 227 | snd_iprintf(buffer, "%02x:", i); |
228 | for (j = 0; j < 0x10; j += 2) | 228 | for (j = 0; j < 0x10; j += 2) |
@@ -232,13 +232,15 @@ static void oxygen_proc_read(struct snd_info_entry *entry, | |||
232 | } | 232 | } |
233 | } | 233 | } |
234 | mutex_unlock(&chip->mutex); | 234 | mutex_unlock(&chip->mutex); |
235 | if (chip->model.dump_registers) | ||
236 | chip->model.dump_registers(chip, buffer); | ||
235 | } | 237 | } |
236 | 238 | ||
237 | static void oxygen_proc_init(struct oxygen *chip) | 239 | static void oxygen_proc_init(struct oxygen *chip) |
238 | { | 240 | { |
239 | struct snd_info_entry *entry; | 241 | struct snd_info_entry *entry; |
240 | 242 | ||
241 | if (!snd_card_proc_new(chip->card, "cmi8788", &entry)) | 243 | if (!snd_card_proc_new(chip->card, "oxygen", &entry)) |
242 | snd_info_set_text_ops(entry, chip, oxygen_proc_read); | 244 | snd_info_set_text_ops(entry, chip, oxygen_proc_read); |
243 | } | 245 | } |
244 | #else | 246 | #else |
diff --git a/sound/pci/oxygen/xonar_cs43xx.c b/sound/pci/oxygen/xonar_cs43xx.c index 501fe45bbdce..092addb15e13 100644 --- a/sound/pci/oxygen/xonar_cs43xx.c +++ b/sound/pci/oxygen/xonar_cs43xx.c | |||
@@ -381,6 +381,30 @@ static int xonar_d1_mixer_init(struct oxygen *chip) | |||
381 | return 0; | 381 | return 0; |
382 | } | 382 | } |
383 | 383 | ||
384 | static void dump_cs4362a_registers(struct xonar_cs43xx *data, | ||
385 | struct snd_info_buffer *buffer) | ||
386 | { | ||
387 | unsigned int i; | ||
388 | |||
389 | snd_iprintf(buffer, "\nCS4362A:"); | ||
390 | for (i = 1; i <= 14; ++i) | ||
391 | snd_iprintf(buffer, " %02x", data->cs4362a_regs[i]); | ||
392 | snd_iprintf(buffer, "\n"); | ||
393 | } | ||
394 | |||
395 | static void dump_d1_registers(struct oxygen *chip, | ||
396 | struct snd_info_buffer *buffer) | ||
397 | { | ||
398 | struct xonar_cs43xx *data = chip->model_data; | ||
399 | unsigned int i; | ||
400 | |||
401 | snd_iprintf(buffer, "\nCS4398: 7?"); | ||
402 | for (i = 2; i <= 8; ++i) | ||
403 | snd_iprintf(buffer, " %02x", data->cs4398_regs[i]); | ||
404 | snd_iprintf(buffer, "\n"); | ||
405 | dump_cs4362a_registers(data, buffer); | ||
406 | } | ||
407 | |||
384 | static const struct oxygen_model model_xonar_d1 = { | 408 | static const struct oxygen_model model_xonar_d1 = { |
385 | .longname = "Asus Virtuoso 100", | 409 | .longname = "Asus Virtuoso 100", |
386 | .chip = "AV200", | 410 | .chip = "AV200", |
@@ -396,6 +420,7 @@ static const struct oxygen_model model_xonar_d1 = { | |||
396 | .update_dac_mute = update_cs43xx_mute, | 420 | .update_dac_mute = update_cs43xx_mute, |
397 | .update_center_lfe_mix = update_cs43xx_center_lfe_mix, | 421 | .update_center_lfe_mix = update_cs43xx_center_lfe_mix, |
398 | .ac97_switch = xonar_d1_line_mic_ac97_switch, | 422 | .ac97_switch = xonar_d1_line_mic_ac97_switch, |
423 | .dump_registers = dump_d1_registers, | ||
399 | .dac_tlv = cs4362a_db_scale, | 424 | .dac_tlv = cs4362a_db_scale, |
400 | .model_data_size = sizeof(struct xonar_cs43xx), | 425 | .model_data_size = sizeof(struct xonar_cs43xx), |
401 | .device_config = PLAYBACK_0_TO_I2S | | 426 | .device_config = PLAYBACK_0_TO_I2S | |
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c index 5193d73a916d..dc69fddf2e6e 100644 --- a/sound/pci/oxygen/xonar_pcm179x.c +++ b/sound/pci/oxygen/xonar_pcm179x.c | |||
@@ -150,6 +150,7 @@ | |||
150 | #include <sound/ac97_codec.h> | 150 | #include <sound/ac97_codec.h> |
151 | #include <sound/control.h> | 151 | #include <sound/control.h> |
152 | #include <sound/core.h> | 152 | #include <sound/core.h> |
153 | #include <sound/info.h> | ||
153 | #include <sound/pcm.h> | 154 | #include <sound/pcm.h> |
154 | #include <sound/pcm_params.h> | 155 | #include <sound/pcm_params.h> |
155 | #include <sound/tlv.h> | 156 | #include <sound/tlv.h> |
@@ -192,7 +193,7 @@ struct xonar_pcm179x { | |||
192 | bool hp_active; | 193 | bool hp_active; |
193 | s8 hp_gain_offset; | 194 | s8 hp_gain_offset; |
194 | bool has_cs2000; | 195 | bool has_cs2000; |
195 | u8 cs2000_fun_cfg_1; | 196 | u8 cs2000_regs[0x1f]; |
196 | }; | 197 | }; |
197 | 198 | ||
198 | struct xonar_hdav { | 199 | struct xonar_hdav { |
@@ -251,16 +252,14 @@ static void cs2000_write(struct oxygen *chip, u8 reg, u8 value) | |||
251 | struct xonar_pcm179x *data = chip->model_data; | 252 | struct xonar_pcm179x *data = chip->model_data; |
252 | 253 | ||
253 | oxygen_write_i2c(chip, I2C_DEVICE_CS2000, reg, value); | 254 | oxygen_write_i2c(chip, I2C_DEVICE_CS2000, reg, value); |
254 | if (reg == CS2000_FUN_CFG_1) | 255 | data->cs2000_regs[reg] = value; |
255 | data->cs2000_fun_cfg_1 = value; | ||
256 | } | 256 | } |
257 | 257 | ||
258 | static void cs2000_write_cached(struct oxygen *chip, u8 reg, u8 value) | 258 | static void cs2000_write_cached(struct oxygen *chip, u8 reg, u8 value) |
259 | { | 259 | { |
260 | struct xonar_pcm179x *data = chip->model_data; | 260 | struct xonar_pcm179x *data = chip->model_data; |
261 | 261 | ||
262 | if (reg != CS2000_FUN_CFG_1 || | 262 | if (value != data->cs2000_regs[reg]) |
263 | value != data->cs2000_fun_cfg_1) | ||
264 | cs2000_write(chip, reg, value); | 263 | cs2000_write(chip, reg, value); |
265 | } | 264 | } |
266 | 265 | ||
@@ -414,7 +413,8 @@ static void cs2000_registers_init(struct oxygen *chip) | |||
414 | cs2000_write(chip, CS2000_RATIO_0 + 1, 0x10); | 413 | cs2000_write(chip, CS2000_RATIO_0 + 1, 0x10); |
415 | cs2000_write(chip, CS2000_RATIO_0 + 2, 0x00); | 414 | cs2000_write(chip, CS2000_RATIO_0 + 2, 0x00); |
416 | cs2000_write(chip, CS2000_RATIO_0 + 3, 0x00); | 415 | cs2000_write(chip, CS2000_RATIO_0 + 3, 0x00); |
417 | cs2000_write(chip, CS2000_FUN_CFG_1, data->cs2000_fun_cfg_1); | 416 | cs2000_write(chip, CS2000_FUN_CFG_1, |
417 | data->cs2000_regs[CS2000_FUN_CFG_1]); | ||
418 | cs2000_write(chip, CS2000_FUN_CFG_2, 0); | 418 | cs2000_write(chip, CS2000_FUN_CFG_2, 0); |
419 | cs2000_write(chip, CS2000_GLOBAL_CFG, CS2000_EN_DEV_CFG_2); | 419 | cs2000_write(chip, CS2000_GLOBAL_CFG, CS2000_EN_DEV_CFG_2); |
420 | } | 420 | } |
@@ -425,7 +425,7 @@ static void xonar_st_init(struct oxygen *chip) | |||
425 | 425 | ||
426 | data->generic.anti_pop_delay = 100; | 426 | data->generic.anti_pop_delay = 100; |
427 | data->has_cs2000 = 1; | 427 | data->has_cs2000 = 1; |
428 | data->cs2000_fun_cfg_1 = CS2000_REF_CLK_DIV_1; | 428 | data->cs2000_regs[CS2000_FUN_CFG_1] = CS2000_REF_CLK_DIV_1; |
429 | 429 | ||
430 | oxygen_write16(chip, OXYGEN_I2S_A_FORMAT, | 430 | oxygen_write16(chip, OXYGEN_I2S_A_FORMAT, |
431 | OXYGEN_RATE_48000 | OXYGEN_I2S_FORMAT_I2S | | 431 | OXYGEN_RATE_48000 | OXYGEN_I2S_FORMAT_I2S | |
@@ -997,6 +997,45 @@ static int xonar_st_mixer_init(struct oxygen *chip) | |||
997 | return 0; | 997 | return 0; |
998 | } | 998 | } |
999 | 999 | ||
1000 | static void dump_pcm1796_registers(struct oxygen *chip, | ||
1001 | struct snd_info_buffer *buffer) | ||
1002 | { | ||
1003 | struct xonar_pcm179x *data = chip->model_data; | ||
1004 | unsigned int dac, i; | ||
1005 | |||
1006 | for (dac = 0; dac < data->dacs; ++dac) { | ||
1007 | snd_iprintf(buffer, "\nPCM1796 %u:", dac + 1); | ||
1008 | for (i = 0; i < 5; ++i) | ||
1009 | snd_iprintf(buffer, " %02x", | ||
1010 | data->pcm1796_regs[dac][i]); | ||
1011 | } | ||
1012 | snd_iprintf(buffer, "\n"); | ||
1013 | } | ||
1014 | |||
1015 | static void dump_cs2000_registers(struct oxygen *chip, | ||
1016 | struct snd_info_buffer *buffer) | ||
1017 | { | ||
1018 | struct xonar_pcm179x *data = chip->model_data; | ||
1019 | unsigned int i; | ||
1020 | |||
1021 | if (data->has_cs2000) { | ||
1022 | snd_iprintf(buffer, "\nCS2000:\n00: "); | ||
1023 | for (i = 1; i < 0x10; ++i) | ||
1024 | snd_iprintf(buffer, " %02x", data->cs2000_regs[i]); | ||
1025 | snd_iprintf(buffer, "\n10:"); | ||
1026 | for (i = 0x10; i < 0x1f; ++i) | ||
1027 | snd_iprintf(buffer, " %02x", data->cs2000_regs[i]); | ||
1028 | snd_iprintf(buffer, "\n"); | ||
1029 | } | ||
1030 | } | ||
1031 | |||
1032 | static void dump_st_registers(struct oxygen *chip, | ||
1033 | struct snd_info_buffer *buffer) | ||
1034 | { | ||
1035 | dump_pcm1796_registers(chip, buffer); | ||
1036 | dump_cs2000_registers(chip, buffer); | ||
1037 | } | ||
1038 | |||
1000 | static const struct oxygen_model model_xonar_d2 = { | 1039 | static const struct oxygen_model model_xonar_d2 = { |
1001 | .longname = "Asus Virtuoso 200", | 1040 | .longname = "Asus Virtuoso 200", |
1002 | .chip = "AV200", | 1041 | .chip = "AV200", |
@@ -1011,6 +1050,7 @@ static const struct oxygen_model model_xonar_d2 = { | |||
1011 | .set_adc_params = xonar_set_cs53x1_params, | 1050 | .set_adc_params = xonar_set_cs53x1_params, |
1012 | .update_dac_volume = update_pcm1796_volume, | 1051 | .update_dac_volume = update_pcm1796_volume, |
1013 | .update_dac_mute = update_pcm1796_mute, | 1052 | .update_dac_mute = update_pcm1796_mute, |
1053 | .dump_registers = dump_pcm1796_registers, | ||
1014 | .dac_tlv = pcm1796_db_scale, | 1054 | .dac_tlv = pcm1796_db_scale, |
1015 | .model_data_size = sizeof(struct xonar_pcm179x), | 1055 | .model_data_size = sizeof(struct xonar_pcm179x), |
1016 | .device_config = PLAYBACK_0_TO_I2S | | 1056 | .device_config = PLAYBACK_0_TO_I2S | |
@@ -1046,6 +1086,7 @@ static const struct oxygen_model model_xonar_hdav = { | |||
1046 | .update_dac_mute = update_pcm1796_mute, | 1086 | .update_dac_mute = update_pcm1796_mute, |
1047 | .uart_input = xonar_hdmi_uart_input, | 1087 | .uart_input = xonar_hdmi_uart_input, |
1048 | .ac97_switch = xonar_line_mic_ac97_switch, | 1088 | .ac97_switch = xonar_line_mic_ac97_switch, |
1089 | .dump_registers = dump_pcm1796_registers, | ||
1049 | .dac_tlv = pcm1796_db_scale, | 1090 | .dac_tlv = pcm1796_db_scale, |
1050 | .model_data_size = sizeof(struct xonar_hdav), | 1091 | .model_data_size = sizeof(struct xonar_hdav), |
1051 | .device_config = PLAYBACK_0_TO_I2S | | 1092 | .device_config = PLAYBACK_0_TO_I2S | |
@@ -1075,6 +1116,7 @@ static const struct oxygen_model model_xonar_st = { | |||
1075 | .update_dac_volume = update_pcm1796_volume, | 1116 | .update_dac_volume = update_pcm1796_volume, |
1076 | .update_dac_mute = update_pcm1796_mute, | 1117 | .update_dac_mute = update_pcm1796_mute, |
1077 | .ac97_switch = xonar_line_mic_ac97_switch, | 1118 | .ac97_switch = xonar_line_mic_ac97_switch, |
1119 | .dump_registers = dump_st_registers, | ||
1078 | .dac_tlv = pcm1796_db_scale, | 1120 | .dac_tlv = pcm1796_db_scale, |
1079 | .model_data_size = sizeof(struct xonar_pcm179x), | 1121 | .model_data_size = sizeof(struct xonar_pcm179x), |
1080 | .device_config = PLAYBACK_0_TO_I2S | | 1122 | .device_config = PLAYBACK_0_TO_I2S | |
diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c index 200f7601276f..2b5e69b64708 100644 --- a/sound/pci/oxygen/xonar_wm87x6.c +++ b/sound/pci/oxygen/xonar_wm87x6.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/delay.h> | 42 | #include <linux/delay.h> |
43 | #include <sound/control.h> | 43 | #include <sound/control.h> |
44 | #include <sound/core.h> | 44 | #include <sound/core.h> |
45 | #include <sound/info.h> | ||
45 | #include <sound/jack.h> | 46 | #include <sound/jack.h> |
46 | #include <sound/pcm.h> | 47 | #include <sound/pcm.h> |
47 | #include <sound/pcm_params.h> | 48 | #include <sound/pcm_params.h> |
@@ -1062,6 +1063,34 @@ static int xonar_ds_mixer_init(struct oxygen *chip) | |||
1062 | return 0; | 1063 | return 0; |
1063 | } | 1064 | } |
1064 | 1065 | ||
1066 | static void dump_wm8776_registers(struct oxygen *chip, | ||
1067 | struct snd_info_buffer *buffer) | ||
1068 | { | ||
1069 | struct xonar_wm87x6 *data = chip->model_data; | ||
1070 | unsigned int i; | ||
1071 | |||
1072 | snd_iprintf(buffer, "\nWM8776:\n00:"); | ||
1073 | for (i = 0; i < 0x10; ++i) | ||
1074 | snd_iprintf(buffer, " %03x", data->wm8776_regs[i]); | ||
1075 | snd_iprintf(buffer, "\n10:"); | ||
1076 | for (i = 0x10; i < 0x17; ++i) | ||
1077 | snd_iprintf(buffer, " %03x", data->wm8776_regs[i]); | ||
1078 | snd_iprintf(buffer, "\n"); | ||
1079 | } | ||
1080 | |||
1081 | static void dump_wm87x6_registers(struct oxygen *chip, | ||
1082 | struct snd_info_buffer *buffer) | ||
1083 | { | ||
1084 | struct xonar_wm87x6 *data = chip->model_data; | ||
1085 | unsigned int i; | ||
1086 | |||
1087 | dump_wm8776_registers(chip, buffer); | ||
1088 | snd_iprintf(buffer, "\nWM8766:\n00:"); | ||
1089 | for (i = 0; i < 0x10; ++i) | ||
1090 | snd_iprintf(buffer, " %03x", data->wm8766_regs[i]); | ||
1091 | snd_iprintf(buffer, "\n"); | ||
1092 | } | ||
1093 | |||
1065 | static const struct oxygen_model model_xonar_ds = { | 1094 | static const struct oxygen_model model_xonar_ds = { |
1066 | .shortname = "Xonar DS", | 1095 | .shortname = "Xonar DS", |
1067 | .longname = "Asus Virtuoso 66", | 1096 | .longname = "Asus Virtuoso 66", |
@@ -1079,6 +1108,7 @@ static const struct oxygen_model model_xonar_ds = { | |||
1079 | .update_dac_mute = update_wm87x6_mute, | 1108 | .update_dac_mute = update_wm87x6_mute, |
1080 | .update_center_lfe_mix = update_wm8766_center_lfe_mix, | 1109 | .update_center_lfe_mix = update_wm8766_center_lfe_mix, |
1081 | .gpio_changed = xonar_ds_gpio_changed, | 1110 | .gpio_changed = xonar_ds_gpio_changed, |
1111 | .dump_registers = dump_wm87x6_registers, | ||
1082 | .dac_tlv = wm87x6_dac_db_scale, | 1112 | .dac_tlv = wm87x6_dac_db_scale, |
1083 | .model_data_size = sizeof(struct xonar_wm87x6), | 1113 | .model_data_size = sizeof(struct xonar_wm87x6), |
1084 | .device_config = PLAYBACK_0_TO_I2S | | 1114 | .device_config = PLAYBACK_0_TO_I2S | |