]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/pci/oxygen/xonar_wm87x6.c
ALSA: oxygen: allow to dump codec registers
[mv-sheeva.git] / sound / pci / oxygen / xonar_wm87x6.c
index 200f7601276f8e5b5fa841a34ea5ad4a07c0fc44..2b5e69b6470859235c0061a941915c442ddaf623 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/delay.h>
 #include <sound/control.h>
 #include <sound/core.h>
+#include <sound/info.h>
 #include <sound/jack.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -1062,6 +1063,34 @@ static int xonar_ds_mixer_init(struct oxygen *chip)
        return 0;
 }
 
+static void dump_wm8776_registers(struct oxygen *chip,
+                                 struct snd_info_buffer *buffer)
+{
+       struct xonar_wm87x6 *data = chip->model_data;
+       unsigned int i;
+
+       snd_iprintf(buffer, "\nWM8776:\n00:");
+       for (i = 0; i < 0x10; ++i)
+               snd_iprintf(buffer, " %03x", data->wm8776_regs[i]);
+       snd_iprintf(buffer, "\n10:");
+       for (i = 0x10; i < 0x17; ++i)
+               snd_iprintf(buffer, " %03x", data->wm8776_regs[i]);
+       snd_iprintf(buffer, "\n");
+}
+
+static void dump_wm87x6_registers(struct oxygen *chip,
+                                 struct snd_info_buffer *buffer)
+{
+       struct xonar_wm87x6 *data = chip->model_data;
+       unsigned int i;
+
+       dump_wm8776_registers(chip, buffer);
+       snd_iprintf(buffer, "\nWM8766:\n00:");
+       for (i = 0; i < 0x10; ++i)
+               snd_iprintf(buffer, " %03x", data->wm8766_regs[i]);
+       snd_iprintf(buffer, "\n");
+}
+
 static const struct oxygen_model model_xonar_ds = {
        .shortname = "Xonar DS",
        .longname = "Asus Virtuoso 66",
@@ -1079,6 +1108,7 @@ static const struct oxygen_model model_xonar_ds = {
        .update_dac_mute = update_wm87x6_mute,
        .update_center_lfe_mix = update_wm8766_center_lfe_mix,
        .gpio_changed = xonar_ds_gpio_changed,
+       .dump_registers = dump_wm87x6_registers,
        .dac_tlv = wm87x6_dac_db_scale,
        .model_data_size = sizeof(struct xonar_wm87x6),
        .device_config = PLAYBACK_0_TO_I2S |