vserver 2.0 rc7
[linux-2.6.git] / sound / pci / ice1712 / revo.c
index 82db619..d48d425 100644 (file)
 #include "envy24ht.h"
 #include "revo.h"
 
+static void revo_i2s_mclk_changed(ice1712_t *ice)
+{
+       /* assert PRST# to converters; MT05 bit 7 */
+       outb(inb(ICEMT1724(ice, AC97_CMD)) | 0x80, ICEMT1724(ice, AC97_CMD));
+       mdelay(5);
+       /* deassert PRST# */
+       outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD));
+}
+
 /*
  * change the rate of envy24HT, AK4355 and AK4381
  */
@@ -119,6 +128,17 @@ static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = {
        .mask_flags = 0,
 };
 
+static unsigned int rates[] = {
+       32000, 44100, 48000, 64000, 88200, 96000,
+       176400, 192000,
+};
+
+static snd_pcm_hw_constraint_list_t revo_rates = {
+       .count = ARRAY_SIZE(rates),
+       .list = rates,
+       .mask = 0,
+};
+
 static int __devinit revo_init(ice1712_t *ice)
 {
        akm4xxx_t *ak;
@@ -135,6 +155,8 @@ static int __devinit revo_init(ice1712_t *ice)
                return -EINVAL;
        }
 
+       ice->gpio.i2s_mclk_changed = revo_i2s_mclk_changed;
+
        /* second stage of initialization, analog parts and others */
        ak = ice->akm = kcalloc(2, sizeof(akm4xxx_t), GFP_KERNEL);
        if (! ak)
@@ -151,6 +173,8 @@ static int __devinit revo_init(ice1712_t *ice)
                break;
        }
 
+       ice->hw_rates = &revo_rates; /* AK codecs don't support lower than 32k */
+
        return 0;
 }