Commit bcbfcf6a authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,ICE1712 driver
- added the support for Digigram VX442 board.
parent 7d584d28
...@@ -571,6 +571,7 @@ Module parameters ...@@ -571,6 +571,7 @@ Module parameters
* Hoontech SoundTrack DSP 24 * Hoontech SoundTrack DSP 24
* Hoontech SoundTrack DSP 24 Value * Hoontech SoundTrack DSP 24 Value
* Hoontech SoundTrack DSP 24 Media 7.1 * Hoontech SoundTrack DSP 24 Media 7.1
* Digigram VX442
omni - Omni I/O support for MidiMan M-Audio Delta44/66 omni - Omni I/O support for MidiMan M-Audio Delta44/66
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* ALSA driver for ICEnsemble ICE1712 (Envy24) * ALSA driver for ICEnsemble ICE1712 (Envy24)
* *
* Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile * Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile
* Digigram VX442
* *
* Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz> * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
* *
...@@ -83,12 +84,19 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice) ...@@ -83,12 +84,19 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice)
{ {
unsigned char tmp; unsigned char tmp;
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010LT) { switch (ice->eeprom.subvendor) {
case ICE1712_SUBDEVICE_DELTA1010LT:
tmp &= ~ICE1712_DELTA_1010LT_CS; tmp &= ~ICE1712_DELTA_1010LT_CS;
tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427; tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427;
} else { /* Audiophile */ break;
case ICE1712_SUBDEVICE_AUDIOPHILE:
tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
break;
case ICE1712_SUBDEVICE_VX442:
tmp |= ICE1712_VX442_CCLK | ICE1712_VX442_CODEC_CHIP_A | ICE1712_VX442_CODEC_CHIP_B;
tmp &= ~ICE1712_VX442_CS_DIGITAL;
break;
} }
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
udelay(5); udelay(5);
...@@ -98,11 +106,17 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice) ...@@ -98,11 +106,17 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice)
/* deassert chip select */ /* deassert chip select */
static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp) static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp)
{ {
if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010LT) { switch (ice->eeprom.subvendor) {
case ICE1712_SUBDEVICE_DELTA1010LT:
tmp &= ~ICE1712_DELTA_1010LT_CS; tmp &= ~ICE1712_DELTA_1010LT_CS;
tmp |= ICE1712_DELTA_1010LT_CS_NONE; tmp |= ICE1712_DELTA_1010LT_CS_NONE;
} else { /* Audiophile */ break;
case ICE1712_SUBDEVICE_AUDIOPHILE:
tmp |= ICE1712_DELTA_AP_CS_DIGITAL; tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
break;
case ICE1712_SUBDEVICE_VX442:
tmp |= ICE1712_VX442_CS_DIGITAL;
break;
} }
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
} }
...@@ -256,6 +270,20 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -256,6 +270,20 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip)
priv->cs_addr = chip << 4; priv->cs_addr = chip << 4;
} }
/*
* AK4528 on VX442 to choose the chip mask
*/
static void vx442_ak4524_lock(akm4xxx_t *ak, int chip)
{
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice);
priv->cs_mask =
priv->cs_addr = chip == 0 ? ICE1712_VX442_CODEC_CHIP_A :
ICE1712_VX442_CODEC_CHIP_B;
}
/* /*
* change the DFS bit according rate for Delta1010 * change the DFS bit according rate for Delta1010
*/ */
...@@ -308,6 +336,23 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) ...@@ -308,6 +336,23 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
snd_akm4xxx_reset(ak, 0); snd_akm4xxx_reset(ak, 0);
} }
/*
* change the rate of AK4524 on VX442
*/
static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
{
unsigned char val;
val = (rate > 48000) ? 0x65 : 0x60;
if (snd_akm4xxx_get(ak, 0, 0x02) != val ||
snd_akm4xxx_get(ak, 1, 0x02) != val) {
snd_akm4xxx_reset(ak, 1);
snd_akm4xxx_write(ak, 0, 0x02, val);
snd_akm4xxx_write(ak, 1, 0x02, val);
snd_akm4xxx_reset(ak, 0);
}
}
/* /*
* SPDIF ops for Delta 1010, Dio, 66 * SPDIF ops for Delta 1010, Dio, 66
...@@ -435,6 +480,28 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = { ...@@ -435,6 +480,28 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_vx442 __devinitdata = {
.type = SND_AK4524,
.num_adcs = 4,
.num_dacs = 4,
.ops = {
.lock = vx442_ak4524_lock,
.set_rate_val = vx442_ak4524_set_rate_val
}
};
static struct snd_ak4xxx_private akm_vx442_priv __devinitdata = {
.caddr = 2,
.cif = 0,
.data_mask = ICE1712_VX442_DOUT,
.clk_mask = ICE1712_VX442_CCLK,
.cs_mask = 0,
.cs_addr = 0, /* set later */
.cs_none = 0,
.add_flags = 0,
.mask_flags = 0,
};
static int __devinit snd_ice1712_delta_init(ice1712_t *ice) static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
{ {
int err; int err;
...@@ -456,6 +523,9 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice) ...@@ -456,6 +523,9 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA1010LT: case ICE1712_SUBDEVICE_DELTA1010LT:
ice->num_total_dacs = 8; ice->num_total_dacs = 8;
break; break;
case ICE1712_SUBDEVICE_VX442:
ice->num_total_dacs = 4;
break;
} }
/* initialize spdif */ /* initialize spdif */
...@@ -463,6 +533,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice) ...@@ -463,6 +533,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_AUDIOPHILE: case ICE1712_SUBDEVICE_AUDIOPHILE:
case ICE1712_SUBDEVICE_DELTA410: case ICE1712_SUBDEVICE_DELTA410:
case ICE1712_SUBDEVICE_DELTA1010LT: case ICE1712_SUBDEVICE_DELTA1010LT:
case ICE1712_SUBDEVICE_VX442:
if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) {
snd_printk("unable to create I2C bus\n"); snd_printk("unable to create I2C bus\n");
return err; return err;
...@@ -517,6 +588,9 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice) ...@@ -517,6 +588,9 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA44: case ICE1712_SUBDEVICE_DELTA44:
err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice); err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice);
break; break;
case ICE1712_SUBDEVICE_VX442:
err = snd_ice1712_akm4xxx_init(ak, &akm_vx442, &akm_vx442_priv, ice);
break;
default: default:
snd_BUG(); snd_BUG();
return -EINVAL; return -EINVAL;
...@@ -597,11 +671,13 @@ static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice) ...@@ -597,11 +671,13 @@ static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA410: case ICE1712_SUBDEVICE_DELTA410:
case ICE1712_SUBDEVICE_DELTA44: case ICE1712_SUBDEVICE_DELTA44:
case ICE1712_SUBDEVICE_DELTA66: case ICE1712_SUBDEVICE_DELTA66:
case ICE1712_SUBDEVICE_VX442:
err = snd_ice1712_akm4xxx_build_controls(ice); err = snd_ice1712_akm4xxx_build_controls(ice);
if (err < 0) if (err < 0)
return err; return err;
break; break;
} }
return 0; return 0;
} }
...@@ -653,5 +729,12 @@ struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = { ...@@ -653,5 +729,12 @@ struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = {
snd_ice1712_delta_init, snd_ice1712_delta_init,
snd_ice1712_delta_add_controls, snd_ice1712_delta_add_controls,
}, },
{
ICE1712_SUBDEVICE_VX442,
"Digigram VX442",
snd_ice1712_delta_init,
snd_ice1712_delta_add_controls,
1, /* NO MPU */
},
{ } /* terminator */ { } /* terminator */
}; };
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* ALSA driver for ICEnsemble ICE1712 (Envy24) * ALSA driver for ICEnsemble ICE1712 (Envy24)
* *
* Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile * Lowlevel functions for M-Audio Delta 1010, 44, 66, Dio2496, Audiophile
* Digigram VX442
* *
* Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz> * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
* *
...@@ -30,7 +31,8 @@ ...@@ -30,7 +31,8 @@
"{MidiMan M Audio,Delta DiO 2496},"\ "{MidiMan M Audio,Delta DiO 2496},"\
"{MidiMan M Audio,Delta 66},"\ "{MidiMan M Audio,Delta 66},"\
"{MidiMan M Audio,Delta 44},"\ "{MidiMan M Audio,Delta 44},"\
"{MidiMan M Audio,Audiophile 24/96}," "{MidiMan M Audio,Audiophile 24/96},"\
"{Digigram,VX442},"
#define ICE1712_SUBDEVICE_DELTA1010 0x121430d6 #define ICE1712_SUBDEVICE_DELTA1010 0x121430d6
#define ICE1712_SUBDEVICE_DELTADIO2496 0x121431d6 #define ICE1712_SUBDEVICE_DELTADIO2496 0x121431d6
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
#define ICE1712_SUBDEVICE_AUDIOPHILE 0x121434d6 #define ICE1712_SUBDEVICE_AUDIOPHILE 0x121434d6
#define ICE1712_SUBDEVICE_DELTA410 0x121438d6 #define ICE1712_SUBDEVICE_DELTA410 0x121438d6
#define ICE1712_SUBDEVICE_DELTA1010LT 0x12143bd6 #define ICE1712_SUBDEVICE_DELTA1010LT 0x12143bd6
#define ICE1712_SUBDEVICE_VX442 0x12143cd6
/* entry point */ /* entry point */
extern struct snd_ice1712_card_info snd_ice1712_delta_cards[]; extern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
...@@ -134,4 +137,12 @@ extern struct snd_ice1712_card_info snd_ice1712_delta_cards[]; ...@@ -134,4 +137,12 @@ extern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
#define ICE1712_DELTA_1010LT_CS_NONE 0x50 /* nothing */ #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 ??? */ #define ICE1712_DELTA_1010LT_WORDCLOCK 0x80 /* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */
/* Digigram VX442 definitions */
#define ICE1712_VX442_CCLK 0x02 /* SPI clock */
#define ICE1712_VX442_DIN 0x04 /* data input */
#define ICE1712_VX442_DOUT 0x08 /* data output */
#define ICE1712_VX442_CS_DIGITAL 0x10 /* chip select, low = CS8427 */
#define ICE1712_VX442_CODEC_CHIP_A 0x20 /* select chip A */
#define ICE1712_VX442_CODEC_CHIP_B 0x40 /* select chip B */
#endif /* __SOUND_DELTA_H */ #endif /* __SOUND_DELTA_H */
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