Update of /cvsroot/alsa/alsa-kernel/pci/ice1712
In directory usw-pr-cvs1:/tmp/cvs-serv21235

Modified Files:
        ak4524.c delta.c delta.h ews.c ice1712.h 
Log Message:
Added full (but alpha) support for Delta1010LT

Index: ak4524.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/ak4524.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ak4524.c    17 Sep 2002 10:42:07 -0000      1.1
+++ ak4524.c    18 Oct 2002 12:58:50 -0000      1.2
@@ -51,12 +51,18 @@
 
        tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
        tmp |= ak->add_flags;
-       if (ak->cif) {
-               tmp |= ak->codecs_mask; /* start without chip select */
-       }  else {
-               tmp &= ~ak->codecs_mask; /* chip select low */
-               snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
-               udelay(1);
+       tmp &= ~ak->mask_flags;
+       if (ak->cs_mask == ak->cs_addr) {
+               if (ak->cif) {
+                       tmp |= ak->cs_mask; /* start without chip select */
+               }  else {
+                       tmp &= ~ak->cs_mask; /* chip select low */
+                       snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
+                       udelay(1);
+               }
+       } else {
+               tmp &= ~ak->cs_mask;
+               tmp |= ak->cs_addr;
        }
 
        addr &= 0x07;
@@ -79,13 +85,18 @@
        else
                ak->ipga_gain[chip][addr-4] = data;
 
-       if (ak->cif) {
-               /* assert a cs pulse to trigger */
-               tmp &= ~ak->codecs_mask;
-               snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
-               udelay(1);
+       if (ak->cs_mask == ak->cs_addr) {
+               if (ak->cif) {
+                       /* assert a cs pulse to trigger */
+                       tmp &= ~ak->cs_mask;
+                       snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
+                       udelay(1);
+               }
+               tmp |= ak->cs_mask; /* chip select high to trigger */
+       } else {
+               tmp &= ~ak->cs_mask;
+               tmp |= ak->cs_none; /* deselect address */
        }
-       tmp |= ak->codecs_mask; /* chip select high to trigger */
        snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
        udelay(1);
 

Index: delta.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/delta.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- delta.c     17 Sep 2002 10:42:07 -0000      1.1
+++ delta.c     18 Oct 2002 12:58:50 -0000      1.2
@@ -83,8 +83,13 @@
 {
        unsigned char tmp;
        tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
-       tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
-       tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
+       if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010LT) {
+               tmp &= ~ICE1712_DELTA_1010LT_CS;
+               tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427;
+       } else { /* Audiophile */
+               tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
+               tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
+       }
        snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
        udelay(5);
        return tmp;
@@ -93,7 +98,12 @@
 /* deassert chip select */
 static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp)
 {
-       tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
+       if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010LT) {
+               tmp &= ~ICE1712_DELTA_1010LT_CS;
+               tmp |= ICE1712_DELTA_1010LT_CS_NONE;
+       } else { /* Audiophile */
+               tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
+       }
        snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
 }
 
@@ -227,12 +237,25 @@
 static int delta_ak4524_start(ice1712_t *ice, unsigned char *saved, int chip)
 {
        snd_ice1712_save_gpio_status(ice, saved);
-       ice->ak4524.codecs_mask = chip == 0 ? ICE1712_DELTA_CODEC_CHIP_A : 
ICE1712_DELTA_CODEC_CHIP_B;
+       ice->ak4524.cs_mask =
+       ice->ak4524.cs_addr = chip == 0 ? ICE1712_DELTA_CODEC_CHIP_A :
+                                         ICE1712_DELTA_CODEC_CHIP_B;
+       return 0;
+}
+
+/*
+ * AK4524 on Delta1010LT to choose the chip address
+ */
+static int delta1010lt_ak4524_start(ice1712_t *ice, unsigned char *saved, int chip)
+{
+       snd_ice1712_save_gpio_status(ice, saved);
+       ice->ak4524.cs_mask = ICE1712_DELTA_1010LT_CS;
+       ice->ak4524.cs_addr = chip << 4;
        return 0;
 }
 
 /*
- * change the rate of AK4524 on Delta 44/66 and AP
+ * change the rate of AK4524 on Delta 44/66, AP, 1010LT
  */
 static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned char val)
 {
@@ -319,6 +342,7 @@
                ice->num_total_dacs = ice->omni ? 8 : 4;
                break;
        case ICE1712_SUBDEVICE_DELTA1010:
+       case ICE1712_SUBDEVICE_DELTA1010LT:
                ice->num_total_dacs = 8;
                break;
        }
@@ -326,6 +350,7 @@
        /* initialize spdif */
        switch (ice->eeprom.subvendor) {
        case ICE1712_SUBDEVICE_AUDIOPHILE:
+       case ICE1712_SUBDEVICE_DELTA1010LT:
                if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, 
&ice->i2c)) < 0) {
                        snd_printk("unable to create I2C bus\n");
                        return err;
@@ -358,8 +383,23 @@
                ak->cif = 0; /* the default level of the CIF pin from AK4524 */
                ak->data_mask = ICE1712_DELTA_AP_DOUT;
                ak->clk_mask = ICE1712_DELTA_AP_CCLK;
-               ak->codecs_mask = ICE1712_DELTA_AP_CS_CODEC; /* select AK4528 codec */
+               ak->cs_mask = ak->cs_addr = ICE1712_DELTA_AP_CS_CODEC; /* select 
+AK4528 codec */
+               ak->cs_none = 0;
                ak->add_flags = ICE1712_DELTA_AP_CS_DIGITAL; /* assert digital high */
+               ak->mask_flags = 0;
+               ak->ops.set_rate_val = delta_ak4524_set_rate_val;
+               snd_ice1712_ak4524_init(ice);
+               break;
+       case ICE1712_SUBDEVICE_DELTA1010LT:
+               ak->num_adcs = ak->num_dacs = 8;
+               ak->cif = 0; /* the default level of the CIF pin from AK4524 */
+               ak->data_mask = ICE1712_DELTA_1010LT_DOUT;
+               ak->clk_mask = ICE1712_DELTA_1010LT_CCLK;
+               ak->cs_mask = ak->cs_addr = 0; /* set later */
+               ak->cs_none = ICE1712_DELTA_1010LT_CS_NONE;
+               ak->add_flags = 0;
+               ak->mask_flags = 0;
+               ak->ops.start = delta1010lt_ak4524_start;
                ak->ops.set_rate_val = delta_ak4524_set_rate_val;
                snd_ice1712_ak4524_init(ice);
                break;
@@ -369,8 +409,10 @@
                ak->cif = 0; /* the default level of the CIF pin from AK4524 */
                ak->data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA;
                ak->clk_mask = ICE1712_DELTA_CODEC_SERIAL_CLOCK;
-               ak->codecs_mask = 0; /* set later */
+               ak->cs_mask = ak->cs_addr = 0; /* set later */
+               ak->cs_none = 0;
                ak->add_flags = 0;
+               ak->mask_flags = 0;
                ak->ops.start = delta_ak4524_start;
                ak->ops.set_rate_val = delta_ak4524_set_rate_val;
                snd_ice1712_ak4524_init(ice);
@@ -387,6 +429,8 @@
 
 static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_select __devinitdata =
 ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_PCM, "Word Clock Sync", 0, 
ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0);
+static snd_kcontrol_new_t snd_ice1712_delta1010lt_wordclock_select __devinitdata =
+ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_PCM, "Word Clock Sync", 0, 
+ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0);
 static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_status __devinitdata =
 ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_PCM, "Word Clock Status", 0, 
ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | 
SNDRV_CTL_ELEM_ACCESS_VOLATILE);
 static snd_kcontrol_new_t snd_ice1712_deltadio2496_spdif_in_select __devinitdata =
@@ -411,6 +455,11 @@
                break;
        case ICE1712_SUBDEVICE_DELTADIO2496:
                err = snd_ctl_add(ice->card, 
snd_ctl_new1(&snd_ice1712_deltadio2496_spdif_in_select, ice));
+               if (err < 0)
+                       return err;
+               break;
+       case ICE1712_SUBDEVICE_DELTA1010LT:
+               err = snd_ctl_add(ice->card, 
+snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_select, ice));
                if (err < 0)
                        return err;
                break;

Index: delta.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/delta.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- delta.h     17 Sep 2002 10:42:07 -0000      1.1
+++ delta.h     18 Oct 2002 12:58:50 -0000      1.2
@@ -46,7 +46,7 @@
  *  MidiMan M-Audio Delta GPIO definitions
  */
 
-/* MidiMan M-Audio Delta1010 */
+/* MidiMan M-Audio Delta shared pins */
 #define ICE1712_DELTA_DFS 0x01         /* fast/slow sample rate mode */
                                        /* (>48kHz must be 1) */
 #define ICE1712_DELTA_SPDIF_IN_STAT 0x02
@@ -116,5 +116,19 @@
 #define ICE1712_DELTA_AP_CS_CODEC 0x20 /* AK4528 chip select */
                                        /* low signal = select */
 
+/* MidiMan M-Audio Delta1010LT definitions */
+/* thanks to Anders Johansson <[EMAIL PROTECTED]> */
+/* 0x01 = DFS */
+#define ICE1712_DELTA_1010LT_CCLK      0x02    /* SPI clock (AK4524 + CS8427) */
+#define ICE1712_DELTA_1010LT_DIN       0x04    /* data input (CS8427) */
+#define ICE1712_DELTA_1010LT_DOUT      0x08    /* data output (AK4524 + CS8427) */
+#define ICE1712_DELTA_1010LT_CS                0x70    /* mask for CS address */
+#define ICE1712_DELTA_1010LT_CS_CHIP_A 0x00    /* AK4524 #0 */
+#define ICE1712_DELTA_1010LT_CS_CHIP_B 0x10    /* AK4524 #1 */
+#define ICE1712_DELTA_1010LT_CS_CHIP_C 0x20    /* AK4524 #2 */
+#define ICE1712_DELTA_1010LT_CS_CHIP_D 0x30    /* AK4524 #3 */
+#define ICE1712_DELTA_1010LT_CS_CS8427 0x40    /* CS8427 */
+#define ICE1712_DELTA_1010LT_CS_NONE   0x50    /* nothing */
+#define ICE1712_DELTA_1010LT_WORDCLOCK 0x80    /* sample clock source: 0 = Word Clock 
+Input, 1 = S/PDIF Input ??? */
 
 #endif /* __SOUND_DELTA_H */

Index: ews.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/ews.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ews.c       19 Sep 2002 15:23:43 -0000      1.2
+++ ews.c       18 Oct 2002 12:58:50 -0000      1.3
@@ -199,7 +199,7 @@
 {
        unsigned char tmp;
        snd_ice1712_save_gpio_status(ice, saved);
-       tmp = ice->ak4524.codecs_mask = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK;
+       tmp = ice->ak4524.cs_mask = ice->ak4524.cs_addr = (1 << chip) & 
+ICE1712_6FIRE_AK4524_CS_MASK;
        tmp |= ICE1712_6FIRE_SERIAL_DATA |
                ICE1712_6FIRE_SERIAL_CLOCK |
                ICE1712_6FIRE_RW;
@@ -408,8 +408,9 @@
                ak->cif = 1; /* CIF high */
                ak->data_mask = ICE1712_EWS88_SERIAL_DATA;
                ak->clk_mask = ICE1712_EWS88_SERIAL_CLOCK;
-               ak->codecs_mask = 0; /* no chip select on gpio */
+               ak->cs_mask = ak->cs_addr = ak->cs_none = 0; /* no chip select on gpio 
+*/
                ak->add_flags = ICE1712_EWS88_RW; /* set rw bit high */
+               ak->mask_flags = 0;
                ak->ops.start = ews88mt_ak4524_start;
                ak->ops.stop = ews88mt_ak4524_stop;
                snd_ice1712_ak4524_init(ice);
@@ -419,8 +420,10 @@
                ak->cif = 1; /* CIF high */
                ak->data_mask = ICE1712_EWS88_SERIAL_DATA;
                ak->clk_mask = ICE1712_EWS88_SERIAL_CLOCK;
-               ak->codecs_mask = ICE1712_EWX2496_AK4524_CS;
+               ak->cs_mask = ak->cs_addr = ICE1712_EWX2496_AK4524_CS;
+               ak->cs_none = 0;
                ak->add_flags = ICE1712_EWS88_RW; /* set rw bit high */
+               ak->mask_flags = 0;
                ak->ops.start = ewx2496_ak4524_start;
                snd_ice1712_ak4524_init(ice);
                break;
@@ -429,8 +432,10 @@
                ak->cif = 1; /* CIF high */
                ak->data_mask = ICE1712_6FIRE_SERIAL_DATA;
                ak->clk_mask = ICE1712_6FIRE_SERIAL_CLOCK;
-               ak->codecs_mask = 0; /* set later */
+               ak->cs_mask = ak->cs_addr = 0; /* set later */
+               ak->cs_none = 0;
                ak->add_flags = ICE1712_6FIRE_RW; /* set rw bit high */
+               ak->mask_flags = 0;
                ak->ops.start = dmx6fire_ak4524_start;
                snd_ice1712_ak4524_init(ice);
                break;

Index: ice1712.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/ice1712.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ice1712.h   17 Sep 2002 10:42:07 -0000      1.1
+++ ice1712.h   18 Oct 2002 12:58:50 -0000      1.2
@@ -246,8 +246,11 @@
        unsigned int cif: 1;
        unsigned char data_mask;
        unsigned char clk_mask;
-       unsigned char codecs_mask;
+       unsigned char cs_mask;
+       unsigned char cs_addr;
+       unsigned char cs_none;
        unsigned char add_flags;
+       unsigned char mask_flags;
        struct snd_ak4524_ops {
                int (*start)(ice1712_t *, unsigned char *, int);
                void (*stop)(ice1712_t *, unsigned char *);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to