Commit 6ca308d4 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PCI ICE1712

Modules: ICE1712 driver

Remove xxx_t typedefs from the PCI ICE1712 driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a98f90fd
...@@ -34,16 +34,16 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); ...@@ -34,16 +34,16 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("ICEnsemble ICE17xx <-> AK4xxx AD/DA chip interface"); MODULE_DESCRIPTION("ICEnsemble ICE17xx <-> AK4xxx AD/DA chip interface");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static void snd_ice1712_akm4xxx_lock(akm4xxx_t *ak, int chip) static void snd_ice1712_akm4xxx_lock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
} }
static void snd_ice1712_akm4xxx_unlock(akm4xxx_t *ak, int chip) static void snd_ice1712_akm4xxx_unlock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_restore_gpio_status(ice); snd_ice1712_restore_gpio_status(ice);
} }
...@@ -51,14 +51,14 @@ static void snd_ice1712_akm4xxx_unlock(akm4xxx_t *ak, int chip) ...@@ -51,14 +51,14 @@ static void snd_ice1712_akm4xxx_unlock(akm4xxx_t *ak, int chip)
/* /*
* write AK4xxx register * write AK4xxx register
*/ */
static void snd_ice1712_akm4xxx_write(akm4xxx_t *ak, int chip, static void snd_ice1712_akm4xxx_write(struct snd_akm4xxx *ak, int chip,
unsigned char addr, unsigned char data) unsigned char addr, unsigned char data)
{ {
unsigned int tmp; unsigned int tmp;
int idx; int idx;
unsigned int addrdata; unsigned int addrdata;
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_assert(chip >= 0 && chip < 4, return); snd_assert(chip >= 0 && chip < 4, return);
...@@ -119,10 +119,10 @@ static void snd_ice1712_akm4xxx_write(akm4xxx_t *ak, int chip, ...@@ -119,10 +119,10 @@ static void snd_ice1712_akm4xxx_write(akm4xxx_t *ak, int chip,
} }
/* /*
* initialize the akm4xxx_t record with the template * initialize the struct snd_akm4xxx record with the template
*/ */
int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *temp, int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *temp,
const struct snd_ak4xxx_private *_priv, ice1712_t *ice) const struct snd_ak4xxx_private *_priv, struct snd_ice1712 *ice)
{ {
struct snd_ak4xxx_private *priv; struct snd_ak4xxx_private *priv;
...@@ -148,13 +148,13 @@ int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *temp, ...@@ -148,13 +148,13 @@ int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *temp,
return 0; return 0;
} }
void snd_ice1712_akm4xxx_free(ice1712_t *ice) void snd_ice1712_akm4xxx_free(struct snd_ice1712 *ice)
{ {
unsigned int akidx; unsigned int akidx;
if (ice->akm == NULL) if (ice->akm == NULL)
return; return;
for (akidx = 0; akidx < ice->akm_codecs; akidx++) { for (akidx = 0; akidx < ice->akm_codecs; akidx++) {
akm4xxx_t *ak = &ice->akm[akidx]; struct snd_akm4xxx *ak = &ice->akm[akidx];
kfree((void*)ak->private_value[0]); kfree((void*)ak->private_value[0]);
} }
kfree(ice->akm); kfree(ice->akm);
...@@ -163,13 +163,13 @@ void snd_ice1712_akm4xxx_free(ice1712_t *ice) ...@@ -163,13 +163,13 @@ void snd_ice1712_akm4xxx_free(ice1712_t *ice)
/* /*
* build AK4xxx controls * build AK4xxx controls
*/ */
int snd_ice1712_akm4xxx_build_controls(ice1712_t *ice) int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice)
{ {
unsigned int akidx; unsigned int akidx;
int err; int err;
for (akidx = 0; akidx < ice->akm_codecs; akidx++) { for (akidx = 0; akidx < ice->akm_codecs; akidx++) {
akm4xxx_t *ak = &ice->akm[akidx]; struct snd_akm4xxx *ak = &ice->akm[akidx];
err = snd_akm4xxx_build_controls(ak); err = snd_akm4xxx_build_controls(ak);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
*/ */
/* send 8 bits */ /* send 8 bits */
static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned char tmp) static void ap_cs8427_write_byte(struct snd_ice1712 *ice, unsigned char data, unsigned char tmp)
{ {
int idx; int idx;
...@@ -61,7 +61,7 @@ static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned ch ...@@ -61,7 +61,7 @@ static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned ch
} }
/* read 8 bits */ /* read 8 bits */
static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp) static unsigned char ap_cs8427_read_byte(struct snd_ice1712 *ice, unsigned char tmp)
{ {
unsigned char data = 0; unsigned char data = 0;
int idx; int idx;
...@@ -80,7 +80,7 @@ static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp) ...@@ -80,7 +80,7 @@ static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp)
} }
/* assert chip select */ /* assert chip select */
static unsigned char ap_cs8427_codec_select(ice1712_t *ice) static unsigned char ap_cs8427_codec_select(struct snd_ice1712 *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);
...@@ -105,7 +105,7 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice) ...@@ -105,7 +105,7 @@ 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(struct snd_ice1712 *ice, unsigned char tmp)
{ {
switch (ice->eeprom.subvendor) { switch (ice->eeprom.subvendor) {
case ICE1712_SUBDEVICE_DELTA1010LT: case ICE1712_SUBDEVICE_DELTA1010LT:
...@@ -124,9 +124,9 @@ static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp) ...@@ -124,9 +124,9 @@ static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp)
} }
/* sequential write */ /* sequential write */
static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) static int ap_cs8427_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count)
{ {
ice1712_t *ice = device->bus->private_data; struct snd_ice1712 *ice = device->bus->private_data;
int res = count; int res = count;
unsigned char tmp; unsigned char tmp;
...@@ -141,9 +141,9 @@ static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, i ...@@ -141,9 +141,9 @@ static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, i
} }
/* sequential read */ /* sequential read */
static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) static int ap_cs8427_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count)
{ {
ice1712_t *ice = device->bus->private_data; struct snd_ice1712 *ice = device->bus->private_data;
int res = count; int res = count;
unsigned char tmp; unsigned char tmp;
...@@ -157,14 +157,14 @@ static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, i ...@@ -157,14 +157,14 @@ static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, i
return res; return res;
} }
static int ap_cs8427_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) static int ap_cs8427_probeaddr(struct snd_i2c_bus *bus, unsigned short addr)
{ {
if (addr == 0x10) if (addr == 0x10)
return 1; return 1;
return -ENOENT; return -ENOENT;
} }
static snd_i2c_ops_t ap_cs8427_i2c_ops = { static struct snd_i2c_ops ap_cs8427_i2c_ops = {
.sendbytes = ap_cs8427_sendbytes, .sendbytes = ap_cs8427_sendbytes,
.readbytes = ap_cs8427_readbytes, .readbytes = ap_cs8427_readbytes,
.probeaddr = ap_cs8427_probeaddr, .probeaddr = ap_cs8427_probeaddr,
...@@ -173,7 +173,7 @@ static snd_i2c_ops_t ap_cs8427_i2c_ops = { ...@@ -173,7 +173,7 @@ static snd_i2c_ops_t ap_cs8427_i2c_ops = {
/* /*
*/ */
static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char bits) static void snd_ice1712_delta_cs8403_spdif_write(struct snd_ice1712 *ice, unsigned char bits)
{ {
unsigned char tmp, mask1, mask2; unsigned char tmp, mask1, mask2;
int idx; int idx;
...@@ -198,12 +198,12 @@ static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char b ...@@ -198,12 +198,12 @@ static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char b
} }
static void delta_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static void delta_spdif_default_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits); snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits);
} }
static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static int delta_spdif_default_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
unsigned int val; unsigned int val;
int change; int change;
...@@ -221,12 +221,12 @@ static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr ...@@ -221,12 +221,12 @@ static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
return change; return change;
} }
static void delta_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static void delta_spdif_stream_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits); snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits);
} }
static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static int delta_spdif_stream_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
unsigned int val; unsigned int val;
int change; int change;
...@@ -248,10 +248,10 @@ static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro ...@@ -248,10 +248,10 @@ static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro
/* /*
* AK4524 on Delta 44 and 66 to choose the chip mask * AK4524 on Delta 44 and 66 to choose the chip mask
*/ */
static void delta_ak4524_lock(akm4xxx_t *ak, int chip) static void delta_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
priv->cs_mask = priv->cs_mask =
...@@ -262,10 +262,10 @@ static void delta_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -262,10 +262,10 @@ static void delta_ak4524_lock(akm4xxx_t *ak, int chip)
/* /*
* AK4524 on Delta1010LT to choose the chip address * AK4524 on Delta1010LT to choose the chip address
*/ */
static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip) static void delta1010lt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
priv->cs_mask = ICE1712_DELTA_1010LT_CS; priv->cs_mask = ICE1712_DELTA_1010LT_CS;
...@@ -275,10 +275,10 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -275,10 +275,10 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip)
/* /*
* AK4528 on VX442 to choose the chip mask * AK4528 on VX442 to choose the chip mask
*/ */
static void vx442_ak4524_lock(akm4xxx_t *ak, int chip) static void vx442_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
priv->cs_mask = priv->cs_mask =
...@@ -289,7 +289,7 @@ static void vx442_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -289,7 +289,7 @@ static void vx442_ak4524_lock(akm4xxx_t *ak, int chip)
/* /*
* change the DFS bit according rate for Delta1010 * change the DFS bit according rate for Delta1010
*/ */
static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate) static void delta_1010_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
{ {
unsigned char tmp, tmp2; unsigned char tmp, tmp2;
...@@ -309,10 +309,10 @@ static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate) ...@@ -309,10 +309,10 @@ static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate)
/* /*
* change the rate of AK4524 on Delta 44/66, AP, 1010LT * change the rate of AK4524 on Delta 44/66, AP, 1010LT
*/ */
static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
{ {
unsigned char tmp, tmp2; unsigned char tmp, tmp2;
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
if (rate == 0) /* no hint - S/PDIF input is master, simply return */ if (rate == 0) /* no hint - S/PDIF input is master, simply return */
return; return;
...@@ -341,7 +341,7 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) ...@@ -341,7 +341,7 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
/* /*
* change the rate of AK4524 on VX442 * change the rate of AK4524 on VX442
*/ */
static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) static void vx442_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
{ {
unsigned char val; unsigned char val;
...@@ -361,13 +361,13 @@ static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) ...@@ -361,13 +361,13 @@ static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
*/ */
/* open callback */ /* open callback */
static void delta_open_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) static void delta_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ {
ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits; ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
} }
/* set up */ /* set up */
static void delta_setup_spdif(ice1712_t *ice, int rate) static void delta_setup_spdif(struct snd_ice1712 *ice, int rate)
{ {
unsigned long flags; unsigned long flags;
unsigned int tmp; unsigned int tmp;
...@@ -396,7 +396,7 @@ static void delta_setup_spdif(ice1712_t *ice, int rate) ...@@ -396,7 +396,7 @@ static void delta_setup_spdif(ice1712_t *ice, int rate)
* initialize the chips on M-Audio cards * initialize the chips on M-Audio cards
*/ */
static akm4xxx_t akm_audiophile __devinitdata = { static struct snd_akm4xxx akm_audiophile __devinitdata = {
.type = SND_AK4528, .type = SND_AK4528,
.num_adcs = 2, .num_adcs = 2,
.num_dacs = 2, .num_dacs = 2,
...@@ -417,7 +417,7 @@ static struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = { ...@@ -417,7 +417,7 @@ static struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_delta410 __devinitdata = { static struct snd_akm4xxx akm_delta410 __devinitdata = {
.type = SND_AK4529, .type = SND_AK4529,
.num_adcs = 2, .num_adcs = 2,
.num_dacs = 8, .num_dacs = 8,
...@@ -438,7 +438,7 @@ static struct snd_ak4xxx_private akm_delta410_priv __devinitdata = { ...@@ -438,7 +438,7 @@ static struct snd_ak4xxx_private akm_delta410_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_delta1010lt __devinitdata = { static struct snd_akm4xxx akm_delta1010lt __devinitdata = {
.type = SND_AK4524, .type = SND_AK4524,
.num_adcs = 8, .num_adcs = 8,
.num_dacs = 8, .num_dacs = 8,
...@@ -460,7 +460,7 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = { ...@@ -460,7 +460,7 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_delta44 __devinitdata = { static struct snd_akm4xxx akm_delta44 __devinitdata = {
.type = SND_AK4524, .type = SND_AK4524,
.num_adcs = 4, .num_adcs = 4,
.num_dacs = 4, .num_dacs = 4,
...@@ -482,7 +482,7 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = { ...@@ -482,7 +482,7 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_vx442 __devinitdata = { static struct snd_akm4xxx akm_vx442 __devinitdata = {
.type = SND_AK4524, .type = SND_AK4524,
.num_adcs = 4, .num_adcs = 4,
.num_dacs = 4, .num_dacs = 4,
...@@ -504,10 +504,10 @@ static struct snd_ak4xxx_private akm_vx442_priv __devinitdata = { ...@@ -504,10 +504,10 @@ static struct snd_ak4xxx_private akm_vx442_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static int __devinit snd_ice1712_delta_init(ice1712_t *ice) static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
{ {
int err; int err;
akm4xxx_t *ak; struct snd_akm4xxx *ak;
/* determine I2C, DACs and ADCs */ /* determine I2C, DACs and ADCs */
switch (ice->eeprom.subvendor) { switch (ice->eeprom.subvendor) {
...@@ -582,7 +582,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice) ...@@ -582,7 +582,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
} }
/* second stage of initialization, analog parts and others */ /* second stage of initialization, analog parts and others */
ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
if (! ak) if (! ak)
return -ENOMEM; return -ENOMEM;
ice->akm_codecs = 1; ice->akm_codecs = 1;
...@@ -617,19 +617,19 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice) ...@@ -617,19 +617,19 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
* additional controls for M-Audio cards * additional controls for M-Audio cards
*/ */
static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_select __devinitdata = static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata =
ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0);
static snd_kcontrol_new_t snd_ice1712_delta1010lt_wordclock_select __devinitdata = static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata =
ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0);
static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_status __devinitdata = static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata =
ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "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 = static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata =
ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0);
static snd_kcontrol_new_t snd_ice1712_delta_spdif_in_status __devinitdata = static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status __devinitdata =
ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Delta IEC958 Input Status", 0, ICE1712_DELTA_SPDIF_IN_STAT, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Delta IEC958 Input Status", 0, ICE1712_DELTA_SPDIF_IN_STAT, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE);
static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice) static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice)
{ {
int err; int err;
......
...@@ -50,9 +50,9 @@ enum { ...@@ -50,9 +50,9 @@ enum {
*/ */
/* send SDA and SCL */ /* send SDA and SCL */
static void ewx_i2c_setlines(snd_i2c_bus_t *bus, int clk, int data) static void ewx_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
unsigned char tmp = 0; unsigned char tmp = 0;
if (clk) if (clk)
tmp |= ICE1712_EWX2496_SERIAL_CLOCK; tmp |= ICE1712_EWX2496_SERIAL_CLOCK;
...@@ -62,15 +62,15 @@ static void ewx_i2c_setlines(snd_i2c_bus_t *bus, int clk, int data) ...@@ -62,15 +62,15 @@ static void ewx_i2c_setlines(snd_i2c_bus_t *bus, int clk, int data)
udelay(5); udelay(5);
} }
static int ewx_i2c_getclock(snd_i2c_bus_t *bus) static int ewx_i2c_getclock(struct snd_i2c_bus *bus)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_CLOCK ? 1 : 0; return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_CLOCK ? 1 : 0;
} }
static int ewx_i2c_getdata(snd_i2c_bus_t *bus, int ack) static int ewx_i2c_getdata(struct snd_i2c_bus *bus, int ack)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
int bit; int bit;
/* set RW pin to low */ /* set RW pin to low */
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW);
...@@ -85,9 +85,9 @@ static int ewx_i2c_getdata(snd_i2c_bus_t *bus, int ack) ...@@ -85,9 +85,9 @@ static int ewx_i2c_getdata(snd_i2c_bus_t *bus, int ack)
return bit; return bit;
} }
static void ewx_i2c_start(snd_i2c_bus_t *bus) static void ewx_i2c_start(struct snd_i2c_bus *bus)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
unsigned char mask; unsigned char mask;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
...@@ -104,15 +104,15 @@ static void ewx_i2c_start(snd_i2c_bus_t *bus) ...@@ -104,15 +104,15 @@ static void ewx_i2c_start(snd_i2c_bus_t *bus)
snd_ice1712_gpio_write_bits(ice, mask, mask); snd_ice1712_gpio_write_bits(ice, mask, mask);
} }
static void ewx_i2c_stop(snd_i2c_bus_t *bus) static void ewx_i2c_stop(struct snd_i2c_bus *bus)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
snd_ice1712_restore_gpio_status(ice); snd_ice1712_restore_gpio_status(ice);
} }
static void ewx_i2c_direction(snd_i2c_bus_t *bus, int clock, int data) static void ewx_i2c_direction(struct snd_i2c_bus *bus, int clock, int data)
{ {
ice1712_t *ice = bus->private_data; struct snd_ice1712 *ice = bus->private_data;
unsigned char mask = 0; unsigned char mask = 0;
if (clock) if (clock)
...@@ -125,7 +125,7 @@ static void ewx_i2c_direction(snd_i2c_bus_t *bus, int clock, int data) ...@@ -125,7 +125,7 @@ static void ewx_i2c_direction(snd_i2c_bus_t *bus, int clock, int data)
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask);
} }
static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = { static struct snd_i2c_bit_ops snd_ice1712_ewx_cs8427_bit_ops = {
.start = ewx_i2c_start, .start = ewx_i2c_start,
.stop = ewx_i2c_stop, .stop = ewx_i2c_stop,
.direction = ewx_i2c_direction, .direction = ewx_i2c_direction,
...@@ -140,7 +140,7 @@ static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = { ...@@ -140,7 +140,7 @@ static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = {
*/ */
/* AK4524 chip select; address 0x48 bit 0-3 */ /* AK4524 chip select; address 0x48 bit 0-3 */
static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask) static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mask)
{ {
unsigned char data, ndata; unsigned char data, ndata;
...@@ -162,9 +162,9 @@ static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask) ...@@ -162,9 +162,9 @@ static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
} }
/* start callback for EWS88MT, needs to select a certain chip mask */ /* start callback for EWS88MT, needs to select a certain chip mask */
static void ews88mt_ak4524_lock(akm4xxx_t *ak, int chip) static void ews88mt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
unsigned char tmp; unsigned char tmp;
/* assert AK4524 CS */ /* assert AK4524 CS */
if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0)
...@@ -179,18 +179,18 @@ static void ews88mt_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -179,18 +179,18 @@ static void ews88mt_ak4524_lock(akm4xxx_t *ak, int chip)
} }
/* stop callback for EWS88MT, needs to deselect chip mask */ /* stop callback for EWS88MT, needs to deselect chip mask */
static void ews88mt_ak4524_unlock(akm4xxx_t *ak, int chip) static void ews88mt_ak4524_unlock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_restore_gpio_status(ice); snd_ice1712_restore_gpio_status(ice);
udelay(1); udelay(1);
snd_ice1712_ews88mt_chip_select(ice, 0x0f); snd_ice1712_ews88mt_chip_select(ice, 0x0f);
} }
/* start callback for EWX24/96 */ /* start callback for EWX24/96 */
static void ewx2496_ak4524_lock(akm4xxx_t *ak, int chip) static void ewx2496_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
unsigned char tmp; unsigned char tmp;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
tmp = ICE1712_EWX2496_SERIAL_DATA | tmp = ICE1712_EWX2496_SERIAL_DATA |
...@@ -203,10 +203,10 @@ static void ewx2496_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -203,10 +203,10 @@ static void ewx2496_ak4524_lock(akm4xxx_t *ak, int chip)
} }
/* start callback for DMX 6fire */ /* start callback for DMX 6fire */
static void dmx6fire_ak4524_lock(akm4xxx_t *ak, int chip) static void dmx6fire_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
unsigned char tmp; unsigned char tmp;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
tmp = priv->cs_mask = priv->cs_addr = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK; tmp = priv->cs_mask = priv->cs_addr = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK;
...@@ -222,7 +222,7 @@ static void dmx6fire_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -222,7 +222,7 @@ static void dmx6fire_ak4524_lock(akm4xxx_t *ak, int chip)
* CS8404 interface on EWS88MT/D * CS8404 interface on EWS88MT/D
*/ */
static void snd_ice1712_ews_cs8404_spdif_write(ice1712_t *ice, unsigned char bits) static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned char bits)
{ {
unsigned char bytes[2]; unsigned char bytes[2];
...@@ -251,12 +251,12 @@ static void snd_ice1712_ews_cs8404_spdif_write(ice1712_t *ice, unsigned char bit ...@@ -251,12 +251,12 @@ static void snd_ice1712_ews_cs8404_spdif_write(ice1712_t *ice, unsigned char bit
/* /*
*/ */
static void ews88_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static void ews88_spdif_default_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits); snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits);
} }
static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static int ews88_spdif_default_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
unsigned int val; unsigned int val;
int change; int change;
...@@ -274,12 +274,12 @@ static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr ...@@ -274,12 +274,12 @@ static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
return change; return change;
} }
static void ews88_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static void ews88_spdif_stream_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits); snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits);
} }
static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) static int ews88_spdif_stream_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
{ {
unsigned int val; unsigned int val;
int change; int change;
...@@ -299,13 +299,13 @@ static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro ...@@ -299,13 +299,13 @@ static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro
/* open callback */ /* open callback */
static void ews88_open_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) static void ews88_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ {
ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits; ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
} }
/* set up SPDIF for EWS88MT / EWS88D */ /* set up SPDIF for EWS88MT / EWS88D */
static void ews88_setup_spdif(ice1712_t *ice, int rate) static void ews88_setup_spdif(struct snd_ice1712 *ice, int rate)
{ {
unsigned long flags; unsigned long flags;
unsigned char tmp; unsigned char tmp;
...@@ -332,7 +332,7 @@ static void ews88_setup_spdif(ice1712_t *ice, int rate) ...@@ -332,7 +332,7 @@ static void ews88_setup_spdif(ice1712_t *ice, int rate)
/* /*
*/ */
static akm4xxx_t akm_ews88mt __devinitdata = { static struct snd_akm4xxx akm_ews88mt __devinitdata = {
.num_adcs = 8, .num_adcs = 8,
.num_dacs = 8, .num_dacs = 8,
.type = SND_AK4524, .type = SND_AK4524,
...@@ -354,7 +354,7 @@ static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = { ...@@ -354,7 +354,7 @@ static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_ewx2496 __devinitdata = { static struct snd_akm4xxx akm_ewx2496 __devinitdata = {
.num_adcs = 2, .num_adcs = 2,
.num_dacs = 2, .num_dacs = 2,
.type = SND_AK4524, .type = SND_AK4524,
...@@ -375,7 +375,7 @@ static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = { ...@@ -375,7 +375,7 @@ static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static akm4xxx_t akm_6fire __devinitdata = { static struct snd_akm4xxx akm_6fire __devinitdata = {
.num_adcs = 6, .num_adcs = 6,
.num_dacs = 6, .num_dacs = 6,
.type = SND_AK4524, .type = SND_AK4524,
...@@ -406,12 +406,12 @@ static struct snd_ak4xxx_private akm_6fire_priv __devinitdata = { ...@@ -406,12 +406,12 @@ static struct snd_ak4xxx_private akm_6fire_priv __devinitdata = {
#define PCF9554_REG_POLARITY 2 #define PCF9554_REG_POLARITY 2
#define PCF9554_REG_CONFIG 3 #define PCF9554_REG_CONFIG 3
static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsigned char data); static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data);
static int __devinit snd_ice1712_ews_init(ice1712_t *ice) static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
{ {
int err; int err;
akm4xxx_t *ak; struct snd_akm4xxx *ak;
/* set the analog DACs */ /* set the analog DACs */
switch (ice->eeprom.subvendor) { switch (ice->eeprom.subvendor) {
...@@ -507,7 +507,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice) ...@@ -507,7 +507,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
} }
/* analog section */ /* analog section */
ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
if (! ak) if (! ak)
return -ENOMEM; return -ENOMEM;
ice->akm_codecs = 1; ice->akm_codecs = 1;
...@@ -536,7 +536,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice) ...@@ -536,7 +536,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
*/ */
/* i/o sensitivity - this callback is shared among other devices, too */ /* i/o sensitivity - this callback is shared among other devices, too */
static int snd_ice1712_ewx_io_sense_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo){ static int snd_ice1712_ewx_io_sense_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo){
static char *texts[2] = { static char *texts[2] = {
"+4dBu", "-10dBV", "+4dBu", "-10dBV",
...@@ -550,9 +550,9 @@ static int snd_ice1712_ewx_io_sense_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -550,9 +550,9 @@ static int snd_ice1712_ewx_io_sense_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int snd_ice1712_ewx_io_sense_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff; unsigned char mask = kcontrol->private_value & 0xff;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
...@@ -561,9 +561,9 @@ static int snd_ice1712_ewx_io_sense_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_ ...@@ -561,9 +561,9 @@ static int snd_ice1712_ewx_io_sense_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int snd_ice1712_ewx_io_sense_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff; unsigned char mask = kcontrol->private_value & 0xff;
int val, nval; int val, nval;
...@@ -578,7 +578,7 @@ static int snd_ice1712_ewx_io_sense_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_ ...@@ -578,7 +578,7 @@ static int snd_ice1712_ewx_io_sense_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_
return val != nval; return val != nval;
} }
static snd_kcontrol_new_t snd_ice1712_ewx2496_controls[] __devinitdata = { static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] __devinitdata = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Input Sensitivity Switch", .name = "Input Sensitivity Switch",
...@@ -602,9 +602,9 @@ static snd_kcontrol_new_t snd_ice1712_ewx2496_controls[] __devinitdata = { ...@@ -602,9 +602,9 @@ static snd_kcontrol_new_t snd_ice1712_ewx2496_controls[] __devinitdata = {
* EWS88MT specific controls * EWS88MT specific controls
*/ */
/* analog output sensitivity;; address 0x48 bit 6 */ /* analog output sensitivity;; address 0x48 bit 6 */
static int snd_ice1712_ews88mt_output_sense_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_ews88mt_output_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char data; unsigned char data;
snd_i2c_lock(ice->i2c); snd_i2c_lock(ice->i2c);
...@@ -618,9 +618,9 @@ static int snd_ice1712_ews88mt_output_sense_get(snd_kcontrol_t *kcontrol, snd_ct ...@@ -618,9 +618,9 @@ static int snd_ice1712_ews88mt_output_sense_get(snd_kcontrol_t *kcontrol, snd_ct
} }
/* analog output sensitivity;; address 0x48 bit 6 */ /* analog output sensitivity;; address 0x48 bit 6 */
static int snd_ice1712_ews88mt_output_sense_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_ews88mt_output_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char data, ndata; unsigned char data, ndata;
snd_i2c_lock(ice->i2c); snd_i2c_lock(ice->i2c);
...@@ -638,9 +638,9 @@ static int snd_ice1712_ews88mt_output_sense_put(snd_kcontrol_t *kcontrol, snd_ct ...@@ -638,9 +638,9 @@ static int snd_ice1712_ews88mt_output_sense_put(snd_kcontrol_t *kcontrol, snd_ct
} }
/* analog input sensitivity; address 0x46 */ /* analog input sensitivity; address 0x46 */
static int snd_ice1712_ews88mt_input_sense_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_ews88mt_input_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned char data; unsigned char data;
...@@ -657,9 +657,9 @@ static int snd_ice1712_ews88mt_input_sense_get(snd_kcontrol_t *kcontrol, snd_ctl ...@@ -657,9 +657,9 @@ static int snd_ice1712_ews88mt_input_sense_get(snd_kcontrol_t *kcontrol, snd_ctl
} }
/* analog output sensitivity; address 0x46 */ /* analog output sensitivity; address 0x46 */
static int snd_ice1712_ews88mt_input_sense_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned char data, ndata; unsigned char data, ndata;
...@@ -678,7 +678,7 @@ static int snd_ice1712_ews88mt_input_sense_put(snd_kcontrol_t *kcontrol, snd_ctl ...@@ -678,7 +678,7 @@ static int snd_ice1712_ews88mt_input_sense_put(snd_kcontrol_t *kcontrol, snd_ctl
return ndata != data; return ndata != data;
} }
static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = { static struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Input Sensitivity Switch", .name = "Input Sensitivity Switch",
.info = snd_ice1712_ewx_io_sense_info, .info = snd_ice1712_ewx_io_sense_info,
...@@ -687,7 +687,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = { ...@@ -687,7 +687,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = {
.count = 8, .count = 8,
}; };
static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = { static struct snd_kcontrol_new snd_ice1712_ews88mt_output_sense __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Output Sensitivity Switch", .name = "Output Sensitivity Switch",
.info = snd_ice1712_ewx_io_sense_info, .info = snd_ice1712_ewx_io_sense_info,
...@@ -700,7 +700,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = { ...@@ -700,7 +700,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = {
* EWS88D specific controls * EWS88D specific controls
*/ */
static int snd_ice1712_ews88d_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int snd_ice1712_ews88d_control_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -709,9 +709,9 @@ static int snd_ice1712_ews88d_control_info(snd_kcontrol_t *kcontrol, snd_ctl_ele ...@@ -709,9 +709,9 @@ static int snd_ice1712_ews88d_control_info(snd_kcontrol_t *kcontrol, snd_ctl_ele
return 0; return 0;
} }
static int snd_ice1712_ews88d_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_ews88d_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int shift = kcontrol->private_value & 0xff; int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1; int invert = (kcontrol->private_value >> 8) & 1;
unsigned char data[2]; unsigned char data[2];
...@@ -729,9 +729,9 @@ static int snd_ice1712_ews88d_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -729,9 +729,9 @@ static int snd_ice1712_ews88d_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem
return 0; return 0;
} }
static int snd_ice1712_ews88d_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int shift = kcontrol->private_value & 0xff; int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1; int invert = (kcontrol->private_value >> 8) & 1;
unsigned char data[2], ndata[2]; unsigned char data[2], ndata[2];
...@@ -769,7 +769,7 @@ static int snd_ice1712_ews88d_control_put(snd_kcontrol_t * kcontrol, snd_ctl_ele ...@@ -769,7 +769,7 @@ static int snd_ice1712_ews88d_control_put(snd_kcontrol_t * kcontrol, snd_ctl_ele
.private_value = xshift | (xinvert << 8),\ .private_value = xshift | (xinvert << 8),\
} }
static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = { static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] __devinitdata = {
EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */
EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0),
EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0),
...@@ -782,7 +782,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = { ...@@ -782,7 +782,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = {
* DMX 6Fire specific controls * DMX 6Fire specific controls
*/ */
static int snd_ice1712_6fire_read_pca(ice1712_t *ice, unsigned char reg) static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg)
{ {
unsigned char byte; unsigned char byte;
snd_i2c_lock(ice->i2c); snd_i2c_lock(ice->i2c);
...@@ -798,7 +798,7 @@ static int snd_ice1712_6fire_read_pca(ice1712_t *ice, unsigned char reg) ...@@ -798,7 +798,7 @@ static int snd_ice1712_6fire_read_pca(ice1712_t *ice, unsigned char reg)
return byte; return byte;
} }
static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsigned char data) static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data)
{ {
unsigned char bytes[2]; unsigned char bytes[2];
snd_i2c_lock(ice->i2c); snd_i2c_lock(ice->i2c);
...@@ -812,7 +812,7 @@ static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsign ...@@ -812,7 +812,7 @@ static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsign
return 0; return 0;
} }
static int snd_ice1712_6fire_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int snd_ice1712_6fire_control_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -821,9 +821,9 @@ static int snd_ice1712_6fire_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -821,9 +821,9 @@ static int snd_ice1712_6fire_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
return 0; return 0;
} }
static int snd_ice1712_6fire_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_6fire_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int shift = kcontrol->private_value & 0xff; int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1; int invert = (kcontrol->private_value >> 8) & 1;
int data; int data;
...@@ -837,9 +837,9 @@ static int snd_ice1712_6fire_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -837,9 +837,9 @@ static int snd_ice1712_6fire_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int snd_ice1712_6fire_control_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_6fire_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int shift = kcontrol->private_value & 0xff; int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1; int invert = (kcontrol->private_value >> 8) & 1;
int data, ndata; int data, ndata;
...@@ -858,7 +858,7 @@ static int snd_ice1712_6fire_control_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -858,7 +858,7 @@ static int snd_ice1712_6fire_control_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int snd_ice1712_6fire_select_input_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[4] = { static char *texts[4] = {
"Internal", "Front Input", "Rear Input", "Wave Table" "Internal", "Front Input", "Rear Input", "Wave Table"
...@@ -872,9 +872,9 @@ static int snd_ice1712_6fire_select_input_info(snd_kcontrol_t *kcontrol, snd_ctl ...@@ -872,9 +872,9 @@ static int snd_ice1712_6fire_select_input_info(snd_kcontrol_t *kcontrol, snd_ctl
return 0; return 0;
} }
static int snd_ice1712_6fire_select_input_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data; int data;
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0) if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
...@@ -883,9 +883,9 @@ static int snd_ice1712_6fire_select_input_get(snd_kcontrol_t *kcontrol, snd_ctl_ ...@@ -883,9 +883,9 @@ static int snd_ice1712_6fire_select_input_get(snd_kcontrol_t *kcontrol, snd_ctl_
return 0; return 0;
} }
static int snd_ice1712_6fire_select_input_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data, ndata; int data, ndata;
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0) if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
...@@ -909,7 +909,7 @@ static int snd_ice1712_6fire_select_input_put(snd_kcontrol_t *kcontrol, snd_ctl_ ...@@ -909,7 +909,7 @@ static int snd_ice1712_6fire_select_input_put(snd_kcontrol_t *kcontrol, snd_ctl_
.private_value = xshift | (xinvert << 8),\ .private_value = xshift | (xinvert << 8),\
} }
static snd_kcontrol_new_t snd_ice1712_6fire_controls[] __devinitdata = { static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog Input Select", .name = "Analog Input Select",
...@@ -925,7 +925,7 @@ static snd_kcontrol_new_t snd_ice1712_6fire_controls[] __devinitdata = { ...@@ -925,7 +925,7 @@ static snd_kcontrol_new_t snd_ice1712_6fire_controls[] __devinitdata = {
}; };
static int __devinit snd_ice1712_ews_add_controls(ice1712_t *ice) static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
{ {
unsigned int idx; unsigned int idx;
int err; int err;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "hoontech.h" #include "hoontech.h"
static void __devinit snd_ice1712_stdsp24_gpio_write(ice1712_t *ice, unsigned char byte) static void __devinit snd_ice1712_stdsp24_gpio_write(struct snd_ice1712 *ice, unsigned char byte)
{ {
byte |= ICE1712_STDSP24_CLOCK_BIT; byte |= ICE1712_STDSP24_CLOCK_BIT;
udelay(100); udelay(100);
...@@ -46,7 +46,7 @@ static void __devinit snd_ice1712_stdsp24_gpio_write(ice1712_t *ice, unsigned ch ...@@ -46,7 +46,7 @@ static void __devinit snd_ice1712_stdsp24_gpio_write(ice1712_t *ice, unsigned ch
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte);
} }
static void __devinit snd_ice1712_stdsp24_darear(ice1712_t *ice, int activate) static void __devinit snd_ice1712_stdsp24_darear(struct snd_ice1712 *ice, int activate)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate); ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate);
...@@ -54,7 +54,7 @@ static void __devinit snd_ice1712_stdsp24_darear(ice1712_t *ice, int activate) ...@@ -54,7 +54,7 @@ static void __devinit snd_ice1712_stdsp24_darear(ice1712_t *ice, int activate)
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static void __devinit snd_ice1712_stdsp24_mute(ice1712_t *ice, int activate) static void __devinit snd_ice1712_stdsp24_mute(struct snd_ice1712 *ice, int activate)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate); ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate);
...@@ -62,7 +62,7 @@ static void __devinit snd_ice1712_stdsp24_mute(ice1712_t *ice, int activate) ...@@ -62,7 +62,7 @@ static void __devinit snd_ice1712_stdsp24_mute(ice1712_t *ice, int activate)
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static void __devinit snd_ice1712_stdsp24_insel(ice1712_t *ice, int activate) static void __devinit snd_ice1712_stdsp24_insel(struct snd_ice1712 *ice, int activate)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate); ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate);
...@@ -70,7 +70,7 @@ static void __devinit snd_ice1712_stdsp24_insel(ice1712_t *ice, int activate) ...@@ -70,7 +70,7 @@ static void __devinit snd_ice1712_stdsp24_insel(ice1712_t *ice, int activate)
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, int chn, int activate) static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, int box, int chn, int activate)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
...@@ -118,7 +118,7 @@ static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, i ...@@ -118,7 +118,7 @@ static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, i
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int master) static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int box, int master)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
...@@ -144,7 +144,7 @@ static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int ...@@ -144,7 +144,7 @@ static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate) static void __devinit snd_ice1712_stdsp24_midi2(struct snd_ice1712 *ice, int activate)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate); ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate);
...@@ -152,7 +152,7 @@ static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate) ...@@ -152,7 +152,7 @@ static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate)
up(&ice->gpio_mutex); up(&ice->gpio_mutex);
} }
static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice) static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
{ {
int box, chn; int box, chn;
...@@ -221,9 +221,9 @@ static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice) ...@@ -221,9 +221,9 @@ static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice)
*/ */
/* start callback for STDSP24 with modified hardware */ /* start callback for STDSP24 with modified hardware */
static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip) static void stdsp24_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{ {
ice1712_t *ice = ak->private_data[0]; struct snd_ice1712 *ice = ak->private_data[0];
unsigned char tmp; unsigned char tmp;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
tmp = ICE1712_STDSP24_SERIAL_DATA | tmp = ICE1712_STDSP24_SERIAL_DATA |
...@@ -234,10 +234,10 @@ static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip) ...@@ -234,10 +234,10 @@ static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip)
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
} }
static int __devinit snd_ice1712_value_init(ice1712_t *ice) static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice)
{ {
/* Hoontech STDSP24 with modified hardware */ /* Hoontech STDSP24 with modified hardware */
static akm4xxx_t akm_stdsp24_mv __devinitdata = { static struct snd_akm4xxx akm_stdsp24_mv __devinitdata = {
.num_adcs = 2, .num_adcs = 2,
.num_dacs = 2, .num_dacs = 2,
.type = SND_AK4524, .type = SND_AK4524,
...@@ -258,7 +258,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice) ...@@ -258,7 +258,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
}; };
int err; int err;
akm4xxx_t *ak; struct snd_akm4xxx *ak;
/* set the analog DACs */ /* set the analog DACs */
ice->num_total_dacs = 2; ice->num_total_dacs = 2;
...@@ -267,7 +267,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice) ...@@ -267,7 +267,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
ice->num_total_adcs = 2; ice->num_total_adcs = 2;
/* analog section */ /* analog section */
ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
if (! ak) if (! ak)
return -ENOMEM; return -ENOMEM;
ice->akm_codecs = 1; ice->akm_codecs = 1;
...@@ -284,7 +284,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice) ...@@ -284,7 +284,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
return 0; return 0;
} }
static int __devinit snd_ice1712_ez8_init(ice1712_t *ice) static int __devinit snd_ice1712_ez8_init(struct snd_ice1712 *ice)
{ {
ice->gpio.write_mask = ice->eeprom.gpiomask; ice->gpio.write_mask = ice->eeprom.gpiomask;
ice->gpio.direction = ice->eeprom.gpiodir; ice->gpio.direction = ice->eeprom.gpiodir;
......
...@@ -108,8 +108,8 @@ static struct pci_device_id snd_ice1712_ids[] = { ...@@ -108,8 +108,8 @@ static struct pci_device_id snd_ice1712_ids[] = {
MODULE_DEVICE_TABLE(pci, snd_ice1712_ids); MODULE_DEVICE_TABLE(pci, snd_ice1712_ids);
static int snd_ice1712_build_pro_mixer(ice1712_t *ice); static int snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice);
static int snd_ice1712_build_controls(ice1712_t *ice); static int snd_ice1712_build_controls(struct snd_ice1712 *ice);
static int PRO_RATE_LOCKED; static int PRO_RATE_LOCKED;
static int PRO_RATE_RESET = 1; static int PRO_RATE_RESET = 1;
...@@ -120,33 +120,33 @@ static unsigned int PRO_RATE_DEFAULT = 44100; ...@@ -120,33 +120,33 @@ static unsigned int PRO_RATE_DEFAULT = 44100;
*/ */
/* check whether the clock mode is spdif-in */ /* check whether the clock mode is spdif-in */
static inline int is_spdif_master(ice1712_t *ice) static inline int is_spdif_master(struct snd_ice1712 *ice)
{ {
return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0; return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0;
} }
static inline int is_pro_rate_locked(ice1712_t *ice) static inline int is_pro_rate_locked(struct snd_ice1712 *ice)
{ {
return is_spdif_master(ice) || PRO_RATE_LOCKED; return is_spdif_master(ice) || PRO_RATE_LOCKED;
} }
static inline void snd_ice1712_ds_write(ice1712_t * ice, u8 channel, u8 addr, u32 data) static inline void snd_ice1712_ds_write(struct snd_ice1712 * ice, u8 channel, u8 addr, u32 data)
{ {
outb((channel << 4) | addr, ICEDS(ice, INDEX)); outb((channel << 4) | addr, ICEDS(ice, INDEX));
outl(data, ICEDS(ice, DATA)); outl(data, ICEDS(ice, DATA));
} }
static inline u32 snd_ice1712_ds_read(ice1712_t * ice, u8 channel, u8 addr) static inline u32 snd_ice1712_ds_read(struct snd_ice1712 * ice, u8 channel, u8 addr)
{ {
outb((channel << 4) | addr, ICEDS(ice, INDEX)); outb((channel << 4) | addr, ICEDS(ice, INDEX));
return inl(ICEDS(ice, DATA)); return inl(ICEDS(ice, DATA));
} }
static void snd_ice1712_ac97_write(ac97_t *ac97, static void snd_ice1712_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short reg,
unsigned short val) unsigned short val)
{ {
ice1712_t *ice = (ice1712_t *)ac97->private_data; struct snd_ice1712 *ice = ac97->private_data;
int tm; int tm;
unsigned char old_cmd = 0; unsigned char old_cmd = 0;
...@@ -167,10 +167,10 @@ static void snd_ice1712_ac97_write(ac97_t *ac97, ...@@ -167,10 +167,10 @@ static void snd_ice1712_ac97_write(ac97_t *ac97,
break; break;
} }
static unsigned short snd_ice1712_ac97_read(ac97_t *ac97, static unsigned short snd_ice1712_ac97_read(struct snd_ac97 *ac97,
unsigned short reg) unsigned short reg)
{ {
ice1712_t *ice = (ice1712_t *)ac97->private_data; struct snd_ice1712 *ice = ac97->private_data;
int tm; int tm;
unsigned char old_cmd = 0; unsigned char old_cmd = 0;
...@@ -196,11 +196,11 @@ static unsigned short snd_ice1712_ac97_read(ac97_t *ac97, ...@@ -196,11 +196,11 @@ static unsigned short snd_ice1712_ac97_read(ac97_t *ac97,
* pro ac97 section * pro ac97 section
*/ */
static void snd_ice1712_pro_ac97_write(ac97_t *ac97, static void snd_ice1712_pro_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short reg,
unsigned short val) unsigned short val)
{ {
ice1712_t *ice = (ice1712_t *)ac97->private_data; struct snd_ice1712 *ice = ac97->private_data;
int tm; int tm;
unsigned char old_cmd = 0; unsigned char old_cmd = 0;
...@@ -222,10 +222,10 @@ static void snd_ice1712_pro_ac97_write(ac97_t *ac97, ...@@ -222,10 +222,10 @@ static void snd_ice1712_pro_ac97_write(ac97_t *ac97,
} }
static unsigned short snd_ice1712_pro_ac97_read(ac97_t *ac97, static unsigned short snd_ice1712_pro_ac97_read(struct snd_ac97 *ac97,
unsigned short reg) unsigned short reg)
{ {
ice1712_t *ice = (ice1712_t *)ac97->private_data; struct snd_ice1712 *ice = ac97->private_data;
int tm; int tm;
unsigned char old_cmd = 0; unsigned char old_cmd = 0;
...@@ -250,7 +250,7 @@ static unsigned short snd_ice1712_pro_ac97_read(ac97_t *ac97, ...@@ -250,7 +250,7 @@ static unsigned short snd_ice1712_pro_ac97_read(ac97_t *ac97,
/* /*
* consumer ac97 digital mix * consumer ac97 digital mix
*/ */
static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int snd_ice1712_digmix_route_ac97_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -259,17 +259,17 @@ static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_ ...@@ -259,17 +259,17 @@ static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_
return 0; return 0;
} }
static int snd_ice1712_digmix_route_ac97_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_digmix_route_ac97_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0; ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0;
return 0; return 0;
} }
static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val, nval; unsigned char val, nval;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -281,7 +281,7 @@ static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_e ...@@ -281,7 +281,7 @@ static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_e
return val != nval; return val != nval;
} }
static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { static struct snd_kcontrol_new snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Digital Mixer To AC97", .name = "Digital Mixer To AC97",
.info = snd_ice1712_digmix_route_ac97_info, .info = snd_ice1712_digmix_route_ac97_info,
...@@ -293,24 +293,24 @@ static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { ...@@ -293,24 +293,24 @@ static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
/* /*
* gpio operations * gpio operations
*/ */
static void snd_ice1712_set_gpio_dir(ice1712_t *ice, unsigned int data) static void snd_ice1712_set_gpio_dir(struct snd_ice1712 *ice, unsigned int data)
{ {
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, data); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, data);
inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
} }
static void snd_ice1712_set_gpio_mask(ice1712_t *ice, unsigned int data) static void snd_ice1712_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data)
{ {
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, data); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, data);
inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
} }
static unsigned int snd_ice1712_get_gpio_data(ice1712_t *ice) static unsigned int snd_ice1712_get_gpio_data(struct snd_ice1712 *ice)
{ {
return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
} }
static void snd_ice1712_set_gpio_data(ice1712_t *ice, unsigned int val) static void snd_ice1712_set_gpio_data(struct snd_ice1712 *ice, unsigned int val)
{ {
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, val); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, val);
inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
...@@ -327,7 +327,7 @@ static void snd_ice1712_set_gpio_data(ice1712_t *ice, unsigned int val) ...@@ -327,7 +327,7 @@ static void snd_ice1712_set_gpio_data(ice1712_t *ice, unsigned int val)
* change the input clock selection * change the input clock selection
* spdif_clock = 1 - IEC958 input, 0 - Envy24 * spdif_clock = 1 - IEC958 input, 0 - Envy24
*/ */
static int snd_ice1712_cs8427_set_input_clock(ice1712_t *ice, int spdif_clock) static int snd_ice1712_cs8427_set_input_clock(struct snd_ice1712 *ice, int spdif_clock)
{ {
unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */ unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */
unsigned char val, nval; unsigned char val, nval;
...@@ -362,17 +362,17 @@ static int snd_ice1712_cs8427_set_input_clock(ice1712_t *ice, int spdif_clock) ...@@ -362,17 +362,17 @@ static int snd_ice1712_cs8427_set_input_clock(ice1712_t *ice, int spdif_clock)
/* /*
* spdif callbacks * spdif callbacks
*/ */
static void open_cs8427(ice1712_t *ice, snd_pcm_substream_t * substream) static void open_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ {
snd_cs8427_iec958_active(ice->cs8427, 1); snd_cs8427_iec958_active(ice->cs8427, 1);
} }
static void close_cs8427(ice1712_t *ice, snd_pcm_substream_t * substream) static void close_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{ {
snd_cs8427_iec958_active(ice->cs8427, 0); snd_cs8427_iec958_active(ice->cs8427, 0);
} }
static void setup_cs8427(ice1712_t *ice, int rate) static void setup_cs8427(struct snd_ice1712 *ice, int rate)
{ {
snd_cs8427_iec958_pcm(ice->cs8427, rate); snd_cs8427_iec958_pcm(ice->cs8427, rate);
} }
...@@ -380,7 +380,7 @@ static void setup_cs8427(ice1712_t *ice, int rate) ...@@ -380,7 +380,7 @@ static void setup_cs8427(ice1712_t *ice, int rate)
/* /*
* create and initialize callbacks for cs8427 interface * create and initialize callbacks for cs8427 interface
*/ */
int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr) int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
{ {
int err; int err;
...@@ -403,7 +403,7 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr) ...@@ -403,7 +403,7 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr)
static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
ice1712_t *ice = dev_id; struct snd_ice1712 *ice = dev_id;
unsigned char status; unsigned char status;
int handled = 0; int handled = 0;
...@@ -444,7 +444,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs * ...@@ -444,7 +444,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *
if (status & ICE1712_IRQ_PBKDS) { if (status & ICE1712_IRQ_PBKDS) {
u32 idx; u32 idx;
u16 pbkstatus; u16 pbkstatus;
snd_pcm_substream_t *substream; struct snd_pcm_substream *substream;
pbkstatus = inw(ICEDS(ice, INTSTAT)); pbkstatus = inw(ICEDS(ice, INTSTAT));
//printk("pbkstatus = 0x%x\n", pbkstatus); //printk("pbkstatus = 0x%x\n", pbkstatus);
for (idx = 0; idx < 6; idx++) { for (idx = 0; idx < 6; idx++) {
...@@ -475,13 +475,13 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs * ...@@ -475,13 +475,13 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *
* PCM part - misc * PCM part - misc
*/ */
static int snd_ice1712_hw_params(snd_pcm_substream_t * substream, static int snd_ice1712_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
} }
static int snd_ice1712_hw_free(snd_pcm_substream_t * substream) static int snd_ice1712_hw_free(struct snd_pcm_substream *substream)
{ {
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
} }
...@@ -490,10 +490,10 @@ static int snd_ice1712_hw_free(snd_pcm_substream_t * substream) ...@@ -490,10 +490,10 @@ static int snd_ice1712_hw_free(snd_pcm_substream_t * substream)
* PCM part - consumer I/O * PCM part - consumer I/O
*/ */
static int snd_ice1712_playback_trigger(snd_pcm_substream_t * substream, static int snd_ice1712_playback_trigger(struct snd_pcm_substream *substream,
int cmd) int cmd)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0; int result = 0;
u32 tmp; u32 tmp;
...@@ -515,10 +515,10 @@ static int snd_ice1712_playback_trigger(snd_pcm_substream_t * substream, ...@@ -515,10 +515,10 @@ static int snd_ice1712_playback_trigger(snd_pcm_substream_t * substream,
return result; return result;
} }
static int snd_ice1712_playback_ds_trigger(snd_pcm_substream_t * substream, static int snd_ice1712_playback_ds_trigger(struct snd_pcm_substream *substream,
int cmd) int cmd)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0; int result = 0;
u32 tmp; u32 tmp;
...@@ -540,10 +540,10 @@ static int snd_ice1712_playback_ds_trigger(snd_pcm_substream_t * substream, ...@@ -540,10 +540,10 @@ static int snd_ice1712_playback_ds_trigger(snd_pcm_substream_t * substream,
return result; return result;
} }
static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream, static int snd_ice1712_capture_trigger(struct snd_pcm_substream *substream,
int cmd) int cmd)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0; int result = 0;
u8 tmp; u8 tmp;
...@@ -561,10 +561,10 @@ static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream, ...@@ -561,10 +561,10 @@ static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream,
return result; return result;
} }
static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream) static int snd_ice1712_playback_prepare(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
u32 period_size, buf_size, rate, tmp; u32 period_size, buf_size, rate, tmp;
period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1;
...@@ -594,10 +594,10 @@ static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream) ...@@ -594,10 +594,10 @@ static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream) static int snd_ice1712_playback_ds_prepare(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
u32 period_size, buf_size, rate, tmp, chn; u32 period_size, buf_size, rate, tmp, chn;
period_size = snd_pcm_lib_period_bytes(substream) - 1; period_size = snd_pcm_lib_period_bytes(substream) - 1;
...@@ -629,10 +629,10 @@ static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream) ...@@ -629,10 +629,10 @@ static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream) static int snd_ice1712_capture_prepare(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
u32 period_size, buf_size; u32 period_size, buf_size;
u8 tmp; u8 tmp;
...@@ -654,10 +654,10 @@ static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream) ...@@ -654,10 +654,10 @@ static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static snd_pcm_uframes_t snd_ice1712_playback_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
size_t ptr; size_t ptr;
if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1)) if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1))
...@@ -668,9 +668,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pointer(snd_pcm_substream_t * subs ...@@ -668,9 +668,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pointer(snd_pcm_substream_t * subs
return bytes_to_frames(substream->runtime, ptr); return bytes_to_frames(substream->runtime, ptr);
} }
static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
u8 addr; u8 addr;
size_t ptr; size_t ptr;
...@@ -687,9 +687,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(snd_pcm_substream_t * s ...@@ -687,9 +687,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(snd_pcm_substream_t * s
return bytes_to_frames(substream->runtime, ptr); return bytes_to_frames(substream->runtime, ptr);
} }
static snd_pcm_uframes_t snd_ice1712_capture_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
size_t ptr; size_t ptr;
if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1)) if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1))
...@@ -700,7 +700,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(snd_pcm_substream_t * subst ...@@ -700,7 +700,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(snd_pcm_substream_t * subst
return bytes_to_frames(substream->runtime, ptr); return bytes_to_frames(substream->runtime, ptr);
} }
static snd_pcm_hardware_t snd_ice1712_playback = static struct snd_pcm_hardware snd_ice1712_playback =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -720,7 +720,7 @@ static snd_pcm_hardware_t snd_ice1712_playback = ...@@ -720,7 +720,7 @@ static snd_pcm_hardware_t snd_ice1712_playback =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_ice1712_playback_ds = static struct snd_pcm_hardware snd_ice1712_playback_ds =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -740,7 +740,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_ds = ...@@ -740,7 +740,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_ds =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_ice1712_capture = static struct snd_pcm_hardware snd_ice1712_capture =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -759,20 +759,20 @@ static snd_pcm_hardware_t snd_ice1712_capture = ...@@ -759,20 +759,20 @@ static snd_pcm_hardware_t snd_ice1712_capture =
.fifo_size = 0, .fifo_size = 0,
}; };
static int snd_ice1712_playback_open(snd_pcm_substream_t * substream) static int snd_ice1712_playback_open(struct snd_pcm_substream *substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->playback_con_substream = substream; ice->playback_con_substream = substream;
runtime->hw = snd_ice1712_playback; runtime->hw = snd_ice1712_playback;
return 0; return 0;
} }
static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream) static int snd_ice1712_playback_ds_open(struct snd_pcm_substream *substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
u32 tmp; u32 tmp;
ice->playback_con_substream_ds[substream->number] = substream; ice->playback_con_substream_ds[substream->number] = substream;
...@@ -784,10 +784,10 @@ static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream) ...@@ -784,10 +784,10 @@ static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_open(snd_pcm_substream_t * substream) static int snd_ice1712_capture_open(struct snd_pcm_substream *substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->capture_con_substream = substream; ice->capture_con_substream = substream;
runtime->hw = snd_ice1712_capture; runtime->hw = snd_ice1712_capture;
...@@ -797,17 +797,17 @@ static int snd_ice1712_capture_open(snd_pcm_substream_t * substream) ...@@ -797,17 +797,17 @@ static int snd_ice1712_capture_open(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_playback_close(snd_pcm_substream_t * substream) static int snd_ice1712_playback_close(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->playback_con_substream = NULL; ice->playback_con_substream = NULL;
return 0; return 0;
} }
static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream) static int snd_ice1712_playback_ds_close(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
u32 tmp; u32 tmp;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -818,15 +818,15 @@ static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream) ...@@ -818,15 +818,15 @@ static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_close(snd_pcm_substream_t * substream) static int snd_ice1712_capture_close(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->capture_con_substream = NULL; ice->capture_con_substream = NULL;
return 0; return 0;
} }
static snd_pcm_ops_t snd_ice1712_playback_ops = { static struct snd_pcm_ops snd_ice1712_playback_ops = {
.open = snd_ice1712_playback_open, .open = snd_ice1712_playback_open,
.close = snd_ice1712_playback_close, .close = snd_ice1712_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -837,7 +837,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ops = { ...@@ -837,7 +837,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ops = {
.pointer = snd_ice1712_playback_pointer, .pointer = snd_ice1712_playback_pointer,
}; };
static snd_pcm_ops_t snd_ice1712_playback_ds_ops = { static struct snd_pcm_ops snd_ice1712_playback_ds_ops = {
.open = snd_ice1712_playback_ds_open, .open = snd_ice1712_playback_ds_open,
.close = snd_ice1712_playback_ds_close, .close = snd_ice1712_playback_ds_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -848,7 +848,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ds_ops = { ...@@ -848,7 +848,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ds_ops = {
.pointer = snd_ice1712_playback_ds_pointer, .pointer = snd_ice1712_playback_ds_pointer,
}; };
static snd_pcm_ops_t snd_ice1712_capture_ops = { static struct snd_pcm_ops snd_ice1712_capture_ops = {
.open = snd_ice1712_capture_open, .open = snd_ice1712_capture_open,
.close = snd_ice1712_capture_close, .close = snd_ice1712_capture_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -859,9 +859,9 @@ static snd_pcm_ops_t snd_ice1712_capture_ops = { ...@@ -859,9 +859,9 @@ static snd_pcm_ops_t snd_ice1712_capture_ops = {
.pointer = snd_ice1712_capture_pointer, .pointer = snd_ice1712_capture_pointer,
}; };
static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** rpcm) static int __devinit snd_ice1712_pcm(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
{ {
snd_pcm_t *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm) if (rpcm)
...@@ -889,9 +889,9 @@ static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** r ...@@ -889,9 +889,9 @@ static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** r
return 0; return 0;
} }
static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t ** rpcm) static int __devinit snd_ice1712_pcm_ds(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
{ {
snd_pcm_t *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm) if (rpcm)
...@@ -923,16 +923,16 @@ static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t * ...@@ -923,16 +923,16 @@ static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t *
static unsigned int rates[] = { 8000, 9600, 11025, 12000, 16000, 22050, 24000, static unsigned int rates[] = { 8000, 9600, 11025, 12000, 16000, 22050, 24000,
32000, 44100, 48000, 64000, 88200, 96000 }; 32000, 44100, 48000, 64000, 88200, 96000 };
static snd_pcm_hw_constraint_list_t hw_constraints_rates = { static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
}; };
static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream, static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream,
int cmd) int cmd)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
...@@ -959,7 +959,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream, ...@@ -959,7 +959,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
unsigned int what = 0; unsigned int what = 0;
unsigned int old; unsigned int old;
struct list_head *pos; struct list_head *pos;
snd_pcm_substream_t *s; struct snd_pcm_substream *s;
snd_pcm_group_for_each(pos, substream) { snd_pcm_group_for_each(pos, substream) {
s = snd_pcm_group_substream_entry(pos); s = snd_pcm_group_substream_entry(pos);
...@@ -989,7 +989,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream, ...@@ -989,7 +989,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
/* /*
*/ */
static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int force) static void snd_ice1712_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate, int force)
{ {
unsigned long flags; unsigned long flags;
unsigned char val, old; unsigned char val, old;
...@@ -1043,9 +1043,9 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int forc ...@@ -1043,9 +1043,9 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int forc
ice->spdif.ops.setup_rate(ice, rate); ice->spdif.ops.setup_rate(ice, rate);
} }
static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream) static int snd_ice1712_playback_pro_prepare(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream); ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream);
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -1057,18 +1057,18 @@ static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream) ...@@ -1057,18 +1057,18 @@ static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_playback_pro_hw_params(snd_pcm_substream_t * substream, static int snd_ice1712_playback_pro_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0); snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0);
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
} }
static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream) static int snd_ice1712_capture_pro_prepare(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream); ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream);
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -1079,18 +1079,18 @@ static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream) ...@@ -1079,18 +1079,18 @@ static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_pro_hw_params(snd_pcm_substream_t * substream, static int snd_ice1712_capture_pro_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0); snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0);
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
} }
static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
size_t ptr; size_t ptr;
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START)) if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START))
...@@ -1101,9 +1101,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t * ...@@ -1101,9 +1101,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t *
return bytes_to_frames(substream->runtime, ptr); return bytes_to_frames(substream->runtime, ptr);
} }
static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
size_t ptr; size_t ptr;
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW)) if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW))
...@@ -1114,7 +1114,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(snd_pcm_substream_t * s ...@@ -1114,7 +1114,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(snd_pcm_substream_t * s
return bytes_to_frames(substream->runtime, ptr); return bytes_to_frames(substream->runtime, ptr);
} }
static snd_pcm_hardware_t snd_ice1712_playback_pro = static struct snd_pcm_hardware snd_ice1712_playback_pro =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -1134,7 +1134,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_pro = ...@@ -1134,7 +1134,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_pro =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_ice1712_capture_pro = static struct snd_pcm_hardware snd_ice1712_capture_pro =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -1154,10 +1154,10 @@ static snd_pcm_hardware_t snd_ice1712_capture_pro = ...@@ -1154,10 +1154,10 @@ static snd_pcm_hardware_t snd_ice1712_capture_pro =
.fifo_size = 0, .fifo_size = 0,
}; };
static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream) static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
ice->playback_pro_substream = substream; ice->playback_pro_substream = substream;
runtime->hw = snd_ice1712_playback_pro; runtime->hw = snd_ice1712_playback_pro;
...@@ -1171,10 +1171,10 @@ static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream) ...@@ -1171,10 +1171,10 @@ static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream) static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
ice->capture_pro_substream = substream; ice->capture_pro_substream = substream;
runtime->hw = snd_ice1712_capture_pro; runtime->hw = snd_ice1712_capture_pro;
...@@ -1184,9 +1184,9 @@ static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream) ...@@ -1184,9 +1184,9 @@ static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream) static int snd_ice1712_playback_pro_close(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
if (PRO_RATE_RESET) if (PRO_RATE_RESET)
snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
...@@ -1197,9 +1197,9 @@ static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream) ...@@ -1197,9 +1197,9 @@ static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream) static int snd_ice1712_capture_pro_close(struct snd_pcm_substream *substream)
{ {
ice1712_t *ice = snd_pcm_substream_chip(substream); struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
if (PRO_RATE_RESET) if (PRO_RATE_RESET)
snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
...@@ -1207,7 +1207,7 @@ static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream) ...@@ -1207,7 +1207,7 @@ static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static snd_pcm_ops_t snd_ice1712_playback_pro_ops = { static struct snd_pcm_ops snd_ice1712_playback_pro_ops = {
.open = snd_ice1712_playback_pro_open, .open = snd_ice1712_playback_pro_open,
.close = snd_ice1712_playback_pro_close, .close = snd_ice1712_playback_pro_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1218,7 +1218,7 @@ static snd_pcm_ops_t snd_ice1712_playback_pro_ops = { ...@@ -1218,7 +1218,7 @@ static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {
.pointer = snd_ice1712_playback_pro_pointer, .pointer = snd_ice1712_playback_pro_pointer,
}; };
static snd_pcm_ops_t snd_ice1712_capture_pro_ops = { static struct snd_pcm_ops snd_ice1712_capture_pro_ops = {
.open = snd_ice1712_capture_pro_open, .open = snd_ice1712_capture_pro_open,
.close = snd_ice1712_capture_pro_close, .close = snd_ice1712_capture_pro_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1229,9 +1229,9 @@ static snd_pcm_ops_t snd_ice1712_capture_pro_ops = { ...@@ -1229,9 +1229,9 @@ static snd_pcm_ops_t snd_ice1712_capture_pro_ops = {
.pointer = snd_ice1712_capture_pro_pointer, .pointer = snd_ice1712_capture_pro_pointer,
}; };
static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm) static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
{ {
snd_pcm_t *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm) if (rpcm)
...@@ -1272,7 +1272,7 @@ static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_ ...@@ -1272,7 +1272,7 @@ static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_
* Mixer section * Mixer section
*/ */
static void snd_ice1712_update_volume(ice1712_t *ice, int index) static void snd_ice1712_update_volume(struct snd_ice1712 *ice, int index)
{ {
unsigned int vol = ice->pro_volumes[index]; unsigned int vol = ice->pro_volumes[index];
unsigned short val = 0; unsigned short val = 0;
...@@ -1283,7 +1283,7 @@ static void snd_ice1712_update_volume(ice1712_t *ice, int index) ...@@ -1283,7 +1283,7 @@ static void snd_ice1712_update_volume(ice1712_t *ice, int index)
outw(val, ICEMT(ice, MONITOR_VOLUME)); outw(val, ICEMT(ice, MONITOR_VOLUME));
} }
static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_mixer_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2; uinfo->count = 2;
...@@ -1292,9 +1292,9 @@ static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_e ...@@ -1292,9 +1292,9 @@ static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -1304,9 +1304,9 @@ static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -1304,9 +1304,9 @@ static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
unsigned int nval, change; unsigned int nval, change;
...@@ -1321,7 +1321,7 @@ static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -1321,7 +1321,7 @@ static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_e
return change; return change;
} }
static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_mixer_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -1330,9 +1330,9 @@ static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_e ...@@ -1330,9 +1330,9 @@ static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -1342,9 +1342,9 @@ static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -1342,9 +1342,9 @@ static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
unsigned int nval, change; unsigned int nval, change;
...@@ -1360,7 +1360,7 @@ static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -1360,7 +1360,7 @@ static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_e
} }
static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = { static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] __devinitdata = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Playback Switch", .name = "Multi Playback Switch",
...@@ -1381,7 +1381,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = { ...@@ -1381,7 +1381,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = {
}, },
}; };
static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata = { static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "H/W Multi Capture Switch", .name = "H/W Multi Capture Switch",
.info = snd_ice1712_pro_mixer_switch_info, .info = snd_ice1712_pro_mixer_switch_info,
...@@ -1390,7 +1390,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata ...@@ -1390,7 +1390,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata
.private_value = 10, .private_value = 10,
}; };
static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata = { static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH), .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH),
.info = snd_ice1712_pro_mixer_switch_info, .info = snd_ice1712_pro_mixer_switch_info,
...@@ -1400,7 +1400,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata = ...@@ -1400,7 +1400,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata =
.count = 2, .count = 2,
}; };
static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata = { static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "H/W Multi Capture Volume", .name = "H/W Multi Capture Volume",
.info = snd_ice1712_pro_mixer_volume_info, .info = snd_ice1712_pro_mixer_volume_info,
...@@ -1409,7 +1409,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata ...@@ -1409,7 +1409,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata
.private_value = 10, .private_value = 10,
}; };
static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata = { static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME), .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME),
.info = snd_ice1712_pro_mixer_volume_info, .info = snd_ice1712_pro_mixer_volume_info,
...@@ -1419,9 +1419,9 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata = ...@@ -1419,9 +1419,9 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata =
.count = 2, .count = 2,
}; };
static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice) static int __devinit snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice)
{ {
snd_card_t * card = ice->card; struct snd_card *card = ice->card;
unsigned int idx; unsigned int idx;
int err; int err;
...@@ -1433,7 +1433,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice) ...@@ -1433,7 +1433,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
} }
if (ice->num_total_adcs > 0) { if (ice->num_total_adcs > 0) {
snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_switch; struct snd_kcontrol_new tmp = snd_ice1712_multi_capture_analog_switch;
tmp.count = ice->num_total_adcs; tmp.count = ice->num_total_adcs;
err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
if (err < 0) if (err < 0)
...@@ -1445,7 +1445,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice) ...@@ -1445,7 +1445,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
return err; return err;
if (ice->num_total_adcs > 0) { if (ice->num_total_adcs > 0) {
snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_volume; struct snd_kcontrol_new tmp = snd_ice1712_multi_capture_analog_volume;
tmp.count = ice->num_total_adcs; tmp.count = ice->num_total_adcs;
err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
if (err < 0) if (err < 0)
...@@ -1472,22 +1472,22 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice) ...@@ -1472,22 +1472,22 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
return 0; return 0;
} }
static void snd_ice1712_mixer_free_ac97(ac97_t *ac97) static void snd_ice1712_mixer_free_ac97(struct snd_ac97 *ac97)
{ {
ice1712_t *ice = ac97->private_data; struct snd_ice1712 *ice = ac97->private_data;
ice->ac97 = NULL; ice->ac97 = NULL;
} }
static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 * ice)
{ {
int err, bus_num = 0; int err, bus_num = 0;
ac97_template_t ac97; struct snd_ac97_template ac97;
ac97_bus_t *pbus; struct snd_ac97_bus *pbus;
static ac97_bus_ops_t con_ops = { static struct snd_ac97_bus_ops con_ops = {
.write = snd_ice1712_ac97_write, .write = snd_ice1712_ac97_write,
.read = snd_ice1712_ac97_read, .read = snd_ice1712_ac97_read,
}; };
static ac97_bus_ops_t pro_ops = { static struct snd_ac97_bus_ops pro_ops = {
.write = snd_ice1712_pro_ac97_write, .write = snd_ice1712_pro_ac97_write,
.read = snd_ice1712_pro_ac97_read, .read = snd_ice1712_pro_ac97_read,
}; };
...@@ -1527,15 +1527,15 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) ...@@ -1527,15 +1527,15 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice)
* *
*/ */
static inline unsigned int eeprom_double(ice1712_t *ice, int idx) static inline unsigned int eeprom_double(struct snd_ice1712 *ice, int idx)
{ {
return (unsigned int)ice->eeprom.data[idx] | ((unsigned int)ice->eeprom.data[idx + 1] << 8); return (unsigned int)ice->eeprom.data[idx] | ((unsigned int)ice->eeprom.data[idx + 1] << 8);
} }
static void snd_ice1712_proc_read(snd_info_entry_t *entry, static void snd_ice1712_proc_read(struct snd_info_entry *entry,
snd_info_buffer_t * buffer) struct snd_info_buffer *buffer)
{ {
ice1712_t *ice = entry->private_data; struct snd_ice1712 *ice = entry->private_data;
unsigned int idx; unsigned int idx;
snd_iprintf(buffer, "%s\n\n", ice->card->longname); snd_iprintf(buffer, "%s\n\n", ice->card->longname);
...@@ -1569,9 +1569,9 @@ static void snd_ice1712_proc_read(snd_info_entry_t *entry, ...@@ -1569,9 +1569,9 @@ static void snd_ice1712_proc_read(snd_info_entry_t *entry,
snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE))); snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE)));
} }
static void __devinit snd_ice1712_proc_init(ice1712_t * ice) static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice)
{ {
snd_info_entry_t *entry; struct snd_info_entry *entry;
if (! snd_card_proc_new(ice->card, "ice1712", &entry)) if (! snd_card_proc_new(ice->card, "ice1712", &entry))
snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read); snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read);
...@@ -1581,22 +1581,24 @@ static void __devinit snd_ice1712_proc_init(ice1712_t * ice) ...@@ -1581,22 +1581,24 @@ static void __devinit snd_ice1712_proc_init(ice1712_t * ice)
* *
*/ */
static int snd_ice1712_eeprom_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_eeprom_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
uinfo->count = sizeof(ice1712_eeprom_t); uinfo->count = sizeof(struct snd_ice1712_eeprom);
return 0; return 0;
} }
static int snd_ice1712_eeprom_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_eeprom_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom)); memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom));
return 0; return 0;
} }
static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = { static struct snd_kcontrol_new snd_ice1712_eeprom __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_CARD, .iface = SNDRV_CTL_ELEM_IFACE_CARD,
.name = "ICE1712 EEPROM", .name = "ICE1712 EEPROM",
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
...@@ -1606,32 +1608,33 @@ static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = { ...@@ -1606,32 +1608,33 @@ static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = {
/* /*
*/ */
static int snd_ice1712_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_spdif_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1; uinfo->count = 1;
return 0; return 0;
} }
static int snd_ice1712_spdif_default_get(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_default_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.default_get) if (ice->spdif.ops.default_get)
ice->spdif.ops.default_get(ice, ucontrol); ice->spdif.ops.default_get(ice, ucontrol);
return 0; return 0;
} }
static int snd_ice1712_spdif_default_put(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_default_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.default_put) if (ice->spdif.ops.default_put)
return ice->spdif.ops.default_put(ice, ucontrol); return ice->spdif.ops.default_put(ice, ucontrol);
return 0; return 0;
} }
static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata = static struct snd_kcontrol_new snd_ice1712_spdif_default __devinitdata =
{ {
.iface = SNDRV_CTL_ELEM_IFACE_PCM, .iface = SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
...@@ -1640,10 +1643,10 @@ static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata = ...@@ -1640,10 +1643,10 @@ static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata =
.put = snd_ice1712_spdif_default_put .put = snd_ice1712_spdif_default_put
}; };
static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_maskc_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.default_get) { if (ice->spdif.ops.default_get) {
ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO | ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL | IEC958_AES0_PROFESSIONAL |
...@@ -1662,10 +1665,10 @@ static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol, ...@@ -1662,10 +1665,10 @@ static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static int snd_ice1712_spdif_maskp_get(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_maskp_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.default_get) { if (ice->spdif.ops.default_get) {
ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO | ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL | IEC958_AES0_PROFESSIONAL |
...@@ -1682,7 +1685,7 @@ static int snd_ice1712_spdif_maskp_get(snd_kcontrol_t * kcontrol, ...@@ -1682,7 +1685,7 @@ static int snd_ice1712_spdif_maskp_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata = static struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata =
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM, .iface = SNDRV_CTL_ELEM_IFACE_PCM,
...@@ -1691,7 +1694,7 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata = ...@@ -1691,7 +1694,7 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata =
.get = snd_ice1712_spdif_maskc_get, .get = snd_ice1712_spdif_maskc_get,
}; };
static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata = static struct snd_kcontrol_new snd_ice1712_spdif_maskp __devinitdata =
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM, .iface = SNDRV_CTL_ELEM_IFACE_PCM,
...@@ -1700,27 +1703,28 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata = ...@@ -1700,27 +1703,28 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata =
.get = snd_ice1712_spdif_maskp_get, .get = snd_ice1712_spdif_maskp_get,
}; };
static int snd_ice1712_spdif_stream_get(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_stream_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.stream_get) if (ice->spdif.ops.stream_get)
ice->spdif.ops.stream_get(ice, ucontrol); ice->spdif.ops.stream_get(ice, ucontrol);
return 0; return 0;
} }
static int snd_ice1712_spdif_stream_put(snd_kcontrol_t * kcontrol, static int snd_ice1712_spdif_stream_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.stream_put) if (ice->spdif.ops.stream_put)
return ice->spdif.ops.stream_put(ice, ucontrol); return ice->spdif.ops.stream_put(ice, ucontrol);
return 0; return 0;
} }
static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata = static struct snd_kcontrol_new snd_ice1712_spdif_stream __devinitdata =
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_INACTIVE),
.iface = SNDRV_CTL_ELEM_IFACE_PCM, .iface = SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
.info = snd_ice1712_spdif_info, .info = snd_ice1712_spdif_info,
...@@ -1728,7 +1732,8 @@ static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata = ...@@ -1728,7 +1732,8 @@ static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata =
.put = snd_ice1712_spdif_stream_put .put = snd_ice1712_spdif_stream_put
}; };
int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) int snd_ice1712_gpio_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -1737,21 +1742,24 @@ int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) ...@@ -1737,21 +1742,24 @@ int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
return 0; return 0;
} }
int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff; unsigned char mask = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0; int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0;
snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice);
ucontrol->value.integer.value[0] = (snd_ice1712_gpio_read(ice) & mask ? 1 : 0) ^ invert; ucontrol->value.integer.value[0] =
(snd_ice1712_gpio_read(ice) & mask ? 1 : 0) ^ invert;
snd_ice1712_restore_gpio_status(ice); snd_ice1712_restore_gpio_status(ice);
return 0; return 0;
} }
int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff; unsigned char mask = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? mask : 0; int invert = (kcontrol->private_value & (1<<24)) ? mask : 0;
unsigned int val, nval; unsigned int val, nval;
...@@ -1771,7 +1779,8 @@ int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucont ...@@ -1771,7 +1779,8 @@ int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucont
/* /*
* rate * rate
*/ */
static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_internal_clock_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[] = { static char *texts[] = {
"8000", /* 0: 6 */ "8000", /* 0: 6 */
...@@ -1798,9 +1807,10 @@ static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl ...@@ -1798,9 +1807,10 @@ static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl
return 0; return 0;
} }
static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_internal_clock_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
static unsigned char xlate[16] = { static unsigned char xlate[16] = {
9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10
}; };
...@@ -1821,9 +1831,10 @@ static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl ...@@ -1821,9 +1831,10 @@ static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl
return 0; return 0;
} }
static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
static unsigned int xrate[13] = { static unsigned int xrate[13] = {
8000, 9600, 11025, 12000, 1600, 22050, 24000, 8000, 9600, 11025, 12000, 1600, 22050, 24000,
32000, 44100, 48000, 64000, 88200, 96000 32000, 44100, 48000, 64000, 88200, 96000
...@@ -1844,7 +1855,8 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl ...@@ -1844,7 +1855,8 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl
change = inb(ICEMT(ice, RATE)) != oval; change = inb(ICEMT(ice, RATE)) != oval;
spin_unlock_irq(&ice->reg_lock); spin_unlock_irq(&ice->reg_lock);
if ((oval & ICE1712_SPDIF_MASTER) != (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) { if ((oval & ICE1712_SPDIF_MASTER) !=
(inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) {
/* change CS8427 clock source too */ /* change CS8427 clock source too */
if (ice->cs8427) { if (ice->cs8427) {
snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice)); snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice));
...@@ -1862,7 +1874,7 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl ...@@ -1862,7 +1874,7 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = { static struct snd_kcontrol_new snd_ice1712_pro_internal_clock __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Internal Clock", .name = "Multi Track Internal Clock",
.info = snd_ice1712_pro_internal_clock_info, .info = snd_ice1712_pro_internal_clock_info,
...@@ -1870,7 +1882,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = { ...@@ -1870,7 +1882,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = {
.put = snd_ice1712_pro_internal_clock_put .put = snd_ice1712_pro_internal_clock_put
}; };
static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[] = { static char *texts[] = {
"8000", /* 0: 6 */ "8000", /* 0: 6 */
...@@ -1897,7 +1910,8 @@ static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol, ...@@ -1897,7 +1910,8 @@ static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_internal_clock_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
int val; int val;
static unsigned int xrate[13] = { static unsigned int xrate[13] = {
...@@ -1914,7 +1928,8 @@ static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol, ...@@ -1914,7 +1928,8 @@ static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
static unsigned int xrate[13] = { static unsigned int xrate[13] = {
8000, 9600, 11025, 12000, 1600, 22050, 24000, 8000, 9600, 11025, 12000, 1600, 22050, 24000,
...@@ -1930,7 +1945,7 @@ static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol, ...@@ -1930,7 +1945,7 @@ static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol,
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata = { static struct snd_kcontrol_new snd_ice1712_pro_internal_clock_default __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Internal Clock Default", .name = "Multi Track Internal Clock Default",
.info = snd_ice1712_pro_internal_clock_default_info, .info = snd_ice1712_pro_internal_clock_default_info,
...@@ -1938,7 +1953,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata = ...@@ -1938,7 +1953,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata =
.put = snd_ice1712_pro_internal_clock_default_put .put = snd_ice1712_pro_internal_clock_default_put
}; };
static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_rate_locking_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -1947,15 +1963,17 @@ static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_e ...@@ -1947,15 +1963,17 @@ static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_rate_locking_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_rate_locking_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = PRO_RATE_LOCKED; ucontrol->value.integer.value[0] = PRO_RATE_LOCKED;
return 0; return 0;
} }
static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_rate_locking_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int change = 0, nval; int change = 0, nval;
nval = ucontrol->value.integer.value[0] ? 1 : 0; nval = ucontrol->value.integer.value[0] ? 1 : 0;
...@@ -1966,7 +1984,7 @@ static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -1966,7 +1984,7 @@ static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_e
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = { static struct snd_kcontrol_new snd_ice1712_pro_rate_locking __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Rate Locking", .name = "Multi Track Rate Locking",
.info = snd_ice1712_pro_rate_locking_info, .info = snd_ice1712_pro_rate_locking_info,
...@@ -1974,7 +1992,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = { ...@@ -1974,7 +1992,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = {
.put = snd_ice1712_pro_rate_locking_put .put = snd_ice1712_pro_rate_locking_put
}; };
static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_rate_reset_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -1983,15 +2002,17 @@ static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_ele ...@@ -1983,15 +2002,17 @@ static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_ele
return 0; return 0;
} }
static int snd_ice1712_pro_rate_reset_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_rate_reset_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = PRO_RATE_RESET; ucontrol->value.integer.value[0] = PRO_RATE_RESET;
return 0; return 0;
} }
static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_rate_reset_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int change = 0, nval; int change = 0, nval;
nval = ucontrol->value.integer.value[0] ? 1 : 0; nval = ucontrol->value.integer.value[0] ? 1 : 0;
...@@ -2002,7 +2023,7 @@ static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_ele ...@@ -2002,7 +2023,7 @@ static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_ele
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = { static struct snd_kcontrol_new snd_ice1712_pro_rate_reset __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Rate Reset", .name = "Multi Track Rate Reset",
.info = snd_ice1712_pro_rate_reset_info, .info = snd_ice1712_pro_rate_reset_info,
...@@ -2013,7 +2034,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = { ...@@ -2013,7 +2034,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = {
/* /*
* routing * routing
*/ */
static int snd_ice1712_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[] = { static char *texts[] = {
"PCM Out", /* 0 */ "PCM Out", /* 0 */
...@@ -2025,16 +2047,18 @@ static int snd_ice1712_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf ...@@ -2025,16 +2047,18 @@ static int snd_ice1712_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1; uinfo->count = 1;
uinfo->value.enumerated.items = snd_ctl_get_ioffidx(kcontrol, &uinfo->id) < 2 ? 12 : 11; uinfo->value.enumerated.items =
snd_ctl_get_ioffidx(kcontrol, &uinfo->id) < 2 ? 12 : 11;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0; return 0;
} }
static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_pro_route_analog_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, cval; unsigned int val, cval;
...@@ -2057,9 +2081,10 @@ static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -2057,9 +2081,10 @@ static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_e
return 0; return 0;
} }
static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_pro_route_analog_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int change, shift; int change, shift;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, old_val, nval; unsigned int val, old_val, nval;
...@@ -2106,9 +2131,10 @@ static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_e ...@@ -2106,9 +2131,10 @@ static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_e
return change; return change;
} }
static int snd_ice1712_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_pro_route_spdif_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, cval; unsigned int val, cval;
val = inw(ICEMT(ice, ROUTE_SPDOUT)); val = inw(ICEMT(ice, ROUTE_SPDOUT));
...@@ -2125,9 +2151,10 @@ static int snd_ice1712_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_el ...@@ -2125,9 +2151,10 @@ static int snd_ice1712_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_el
return 0; return 0;
} }
static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) static int snd_ice1712_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int change, shift; int change, shift;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, old_val, nval; unsigned int val, old_val, nval;
...@@ -2163,7 +2190,7 @@ static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_el ...@@ -2163,7 +2190,7 @@ static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_el
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = { static struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "H/W Playback Route", .name = "H/W Playback Route",
.info = snd_ice1712_pro_route_info, .info = snd_ice1712_pro_route_info,
...@@ -2171,7 +2198,7 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = { ...@@ -2171,7 +2198,7 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = {
.put = snd_ice1712_pro_route_analog_put, .put = snd_ice1712_pro_route_analog_put,
}; };
static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = { static struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route",
.info = snd_ice1712_pro_route_info, .info = snd_ice1712_pro_route_info,
...@@ -2181,7 +2208,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = { ...@@ -2181,7 +2208,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = {
}; };
static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_volume_rate_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1; uinfo->count = 1;
...@@ -2190,17 +2218,19 @@ static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_el ...@@ -2190,17 +2218,19 @@ static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_el
return 0; return 0;
} }
static int snd_ice1712_pro_volume_rate_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_volume_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE)); ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE));
return 0; return 0;
} }
static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_volume_rate_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int change; int change;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -2210,7 +2240,7 @@ static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_el ...@@ -2210,7 +2240,7 @@ static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_el
return change; return change;
} }
static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = { static struct snd_kcontrol_new snd_ice1712_mixer_pro_volume_rate __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Volume Rate", .name = "Multi Track Volume Rate",
.info = snd_ice1712_pro_volume_rate_info, .info = snd_ice1712_pro_volume_rate_info,
...@@ -2218,7 +2248,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = { ...@@ -2218,7 +2248,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = {
.put = snd_ice1712_pro_volume_rate_put .put = snd_ice1712_pro_volume_rate_put
}; };
static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_ice1712_pro_peak_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 22; uinfo->count = 22;
...@@ -2227,9 +2258,10 @@ static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info ...@@ -2227,9 +2258,10 @@ static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info
return 0; return 0;
} }
static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ice1712_t *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx; int idx;
spin_lock_irq(&ice->reg_lock); spin_lock_irq(&ice->reg_lock);
...@@ -2241,7 +2273,7 @@ static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_valu ...@@ -2241,7 +2273,7 @@ static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_valu
return 0; return 0;
} }
static snd_kcontrol_new_t snd_ice1712_mixer_pro_peak __devinitdata = { static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Multi Track Peak", .name = "Multi Track Peak",
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
...@@ -2263,7 +2295,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = { ...@@ -2263,7 +2295,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
NULL, NULL,
}; };
static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice, static unsigned char __devinit snd_ice1712_read_i2c(struct snd_ice1712 *ice,
unsigned char dev, unsigned char dev,
unsigned char addr) unsigned char addr)
{ {
...@@ -2275,7 +2307,8 @@ static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice, ...@@ -2275,7 +2307,8 @@ static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
return inb(ICEREG(ice, I2C_DATA)); return inb(ICEREG(ice, I2C_DATA));
} }
static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelname) static int __devinit snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
const char *modelname)
{ {
int dev = 0xa0; /* EEPROM device address */ int dev = 0xa0; /* EEPROM device address */
unsigned int i, size; unsigned int i, size;
...@@ -2288,7 +2321,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna ...@@ -2288,7 +2321,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
(snd_ice1712_read_i2c(ice, dev, 0x01) << 8) | (snd_ice1712_read_i2c(ice, dev, 0x01) << 8) |
(snd_ice1712_read_i2c(ice, dev, 0x02) << 16) | (snd_ice1712_read_i2c(ice, dev, 0x02) << 16) |
(snd_ice1712_read_i2c(ice, dev, 0x03) << 24); (snd_ice1712_read_i2c(ice, dev, 0x03) << 24);
if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { if (ice->eeprom.subvendor == 0 ||
ice->eeprom.subvendor == (unsigned int)-1) {
/* invalid subvendor from EEPROM, try the PCI subststem ID instead */ /* invalid subvendor from EEPROM, try the PCI subststem ID instead */
u16 vendor, device; u16 vendor, device;
pci_read_config_word(ice->pci, PCI_SUBSYSTEM_VENDOR_ID, &vendor); pci_read_config_word(ice->pci, PCI_SUBSYSTEM_VENDOR_ID, &vendor);
...@@ -2317,7 +2351,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna ...@@ -2317,7 +2351,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
goto read_skipped; goto read_skipped;
} }
} }
printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n", ice->eeprom.subvendor); printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n",
ice->eeprom.subvendor);
found: found:
ice->eeprom.size = snd_ice1712_read_i2c(ice, dev, 0x04); ice->eeprom.size = snd_ice1712_read_i2c(ice, dev, 0x04);
...@@ -2329,7 +2364,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna ...@@ -2329,7 +2364,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
} }
ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05);
if (ice->eeprom.version != 1) { if (ice->eeprom.version != 1) {
snd_printk(KERN_ERR "invalid EEPROM version %i\n", ice->eeprom.version); snd_printk(KERN_ERR "invalid EEPROM version %i\n",
ice->eeprom.version);
/* return -EIO; */ /* return -EIO; */
} }
size = ice->eeprom.size - 6; size = ice->eeprom.size - 6;
...@@ -2346,7 +2382,7 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna ...@@ -2346,7 +2382,7 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
static int __devinit snd_ice1712_chip_init(ice1712_t *ice) static int __devinit snd_ice1712_chip_init(struct snd_ice1712 *ice)
{ {
outb(ICE1712_RESET | ICE1712_NATIVE, ICEREG(ice, CONTROL)); outb(ICE1712_RESET | ICE1712_NATIVE, ICEREG(ice, CONTROL));
udelay(200); udelay(200);
...@@ -2359,15 +2395,19 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice) ...@@ -2359,15 +2395,19 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice)
if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24) { if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24) {
ice->gpio.write_mask = ice->eeprom.gpiomask; ice->gpio.write_mask = ice->eeprom.gpiomask;
ice->gpio.direction = ice->eeprom.gpiodir; ice->gpio.direction = ice->eeprom.gpiodir;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ice->eeprom.gpiomask); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK,
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->eeprom.gpiodir); ice->eeprom.gpiomask);
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ice->eeprom.gpiostate); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
ice->eeprom.gpiodir);
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA,
ice->eeprom.gpiostate);
} else { } else {
ice->gpio.write_mask = 0xc0; ice->gpio.write_mask = 0xc0;
ice->gpio.direction = 0xff; ice->gpio.direction = 0xff;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, 0xc0); snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, 0xc0);
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, 0xff); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, 0xff);
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ICE1712_STDSP24_CLOCK_BIT); snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA,
ICE1712_STDSP24_CLOCK_BIT);
} }
snd_ice1712_write(ice, ICE1712_IREG_PRO_POWERDOWN, 0); snd_ice1712_write(ice, ICE1712_IREG_PRO_POWERDOWN, 0);
if (!(ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97)) { if (!(ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97)) {
...@@ -2382,10 +2422,10 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice) ...@@ -2382,10 +2422,10 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice)
return 0; return 0;
} }
int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice) int __devinit snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice)
{ {
int err; int err;
snd_kcontrol_t *kctl; struct snd_kcontrol *kctl;
snd_assert(ice->pcm_pro != NULL, return -EIO); snd_assert(ice->pcm_pro != NULL, return -EIO);
err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice)); err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice));
...@@ -2409,7 +2449,7 @@ int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice) ...@@ -2409,7 +2449,7 @@ int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice)
} }
static int __devinit snd_ice1712_build_controls(ice1712_t *ice) static int __devinit snd_ice1712_build_controls(struct snd_ice1712 *ice)
{ {
int err; int err;
...@@ -2431,7 +2471,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice) ...@@ -2431,7 +2471,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
return err; return err;
if (ice->num_total_dacs > 0) { if (ice->num_total_dacs > 0) {
snd_kcontrol_new_t tmp = snd_ice1712_mixer_pro_analog_route; struct snd_kcontrol_new tmp = snd_ice1712_mixer_pro_analog_route;
tmp.count = ice->num_total_dacs; tmp.count = ice->num_total_dacs;
err = snd_ctl_add(ice->card, snd_ctl_new1(&tmp, ice)); err = snd_ctl_add(ice->card, snd_ctl_new1(&tmp, ice));
if (err < 0) if (err < 0)
...@@ -2452,7 +2492,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice) ...@@ -2452,7 +2492,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
return 0; return 0;
} }
static int snd_ice1712_free(ice1712_t *ice) static int snd_ice1712_free(struct snd_ice1712 *ice)
{ {
if (! ice->port) if (! ice->port)
goto __hw_end; goto __hw_end;
...@@ -2463,7 +2503,7 @@ static int snd_ice1712_free(ice1712_t *ice) ...@@ -2463,7 +2503,7 @@ static int snd_ice1712_free(ice1712_t *ice)
__hw_end: __hw_end:
if (ice->irq >= 0) { if (ice->irq >= 0) {
synchronize_irq(ice->irq); synchronize_irq(ice->irq);
free_irq(ice->irq, (void *) ice); free_irq(ice->irq, ice);
} }
if (ice->port) if (ice->port)
pci_release_regions(ice->pci); pci_release_regions(ice->pci);
...@@ -2473,22 +2513,22 @@ static int snd_ice1712_free(ice1712_t *ice) ...@@ -2473,22 +2513,22 @@ static int snd_ice1712_free(ice1712_t *ice)
return 0; return 0;
} }
static int snd_ice1712_dev_free(snd_device_t *device) static int snd_ice1712_dev_free(struct snd_device *device)
{ {
ice1712_t *ice = device->device_data; struct snd_ice1712 *ice = device->device_data;
return snd_ice1712_free(ice); return snd_ice1712_free(ice);
} }
static int __devinit snd_ice1712_create(snd_card_t * card, static int __devinit snd_ice1712_create(struct snd_card *card,
struct pci_dev *pci, struct pci_dev *pci,
const char *modelname, const char *modelname,
int omni, int omni,
int cs8427_timeout, int cs8427_timeout,
ice1712_t ** r_ice1712) struct snd_ice1712 ** r_ice1712)
{ {
ice1712_t *ice; struct snd_ice1712 *ice;
int err; int err;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_ice1712_dev_free, .dev_free = snd_ice1712_dev_free,
}; };
...@@ -2548,7 +2588,8 @@ static int __devinit snd_ice1712_create(snd_card_t * card, ...@@ -2548,7 +2588,8 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
ice->dmapath_port = pci_resource_start(pci, 2); ice->dmapath_port = pci_resource_start(pci, 2);
ice->profi_port = pci_resource_start(pci, 3); ice->profi_port = pci_resource_start(pci, 3);
if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1712", (void *) ice)) { if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ,
"ICE1712", ice)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
snd_ice1712_free(ice); snd_ice1712_free(ice);
return -EIO; return -EIO;
...@@ -2566,8 +2607,10 @@ static int __devinit snd_ice1712_create(snd_card_t * card, ...@@ -2566,8 +2607,10 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
} }
/* unmask used interrupts */ /* unmask used interrupts */
outb((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) == 0 ? ICE1712_IRQ_MPU2 : 0 | outb(((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) == 0 ?
(ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97) ? ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0, ICE1712_IRQ_MPU2 : 0) |
((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97) ?
ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0),
ICEREG(ice, IRQMASK)); ICEREG(ice, IRQMASK));
outb(0x00, ICEMT(ice, IRQ)); outb(0x00, ICEMT(ice, IRQ));
...@@ -2595,8 +2638,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, ...@@ -2595,8 +2638,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
static int dev; static int dev;
snd_card_t *card; struct snd_card *card;
ice1712_t *ice; struct snd_ice1712 *ice;
int pcm_dev = 0, err; int pcm_dev = 0, err;
struct snd_ice1712_card_info **tbl, *c; struct snd_ice1712_card_info **tbl, *c;
...@@ -2614,7 +2657,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, ...@@ -2614,7 +2657,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
strcpy(card->driver, "ICE1712"); strcpy(card->driver, "ICE1712");
strcpy(card->shortname, "ICEnsemble ICE1712"); strcpy(card->shortname, "ICEnsemble ICE1712");
if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev], cs8427_timeout[dev], &ice)) < 0) { if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev],
cs8427_timeout[dev], &ice)) < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
......
...@@ -215,9 +215,9 @@ ...@@ -215,9 +215,9 @@
* *
*/ */
typedef struct _snd_ice1712 ice1712_t; struct snd_ice1712;
typedef struct { struct snd_ice1712_eeprom {
unsigned int subvendor; /* PCI[2c-2f] */ unsigned int subvendor; /* PCI[2c-2f] */
unsigned char size; /* size of EEPROM image in bytes */ unsigned char size; /* size of EEPROM image in bytes */
unsigned char version; /* must be 1 (or 2 for vt1724) */ unsigned char version; /* must be 1 (or 2 for vt1724) */
...@@ -225,7 +225,7 @@ typedef struct { ...@@ -225,7 +225,7 @@ typedef struct {
unsigned int gpiomask; unsigned int gpiomask;
unsigned int gpiostate; unsigned int gpiostate;
unsigned int gpiodir; unsigned int gpiodir;
} ice1712_eeprom_t; };
enum { enum {
ICE_EEP1_CODEC = 0, /* 06 */ ICE_EEP1_CODEC = 0, /* 06 */
...@@ -266,28 +266,28 @@ struct snd_ak4xxx_private { ...@@ -266,28 +266,28 @@ struct snd_ak4xxx_private {
unsigned int add_flags; /* additional bits at init */ unsigned int add_flags; /* additional bits at init */
unsigned int mask_flags; /* total mask bits */ unsigned int mask_flags; /* total mask bits */
struct snd_akm4xxx_ops { struct snd_akm4xxx_ops {
void (*set_rate_val)(akm4xxx_t *ak, unsigned int rate); void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate);
} ops; } ops;
}; };
struct snd_ice1712_spdif { struct snd_ice1712_spdif {
unsigned char cs8403_bits; unsigned char cs8403_bits;
unsigned char cs8403_stream_bits; unsigned char cs8403_stream_bits;
snd_kcontrol_t *stream_ctl; struct snd_kcontrol *stream_ctl;
struct snd_ice1712_spdif_ops { struct snd_ice1712_spdif_ops {
void (*open)(ice1712_t *, snd_pcm_substream_t *); void (*open)(struct snd_ice1712 *, struct snd_pcm_substream *);
void (*setup_rate)(ice1712_t *, int rate); void (*setup_rate)(struct snd_ice1712 *, int rate);
void (*close)(ice1712_t *, snd_pcm_substream_t *); void (*close)(struct snd_ice1712 *, struct snd_pcm_substream *);
void (*default_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); void (*default_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
int (*default_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); int (*default_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
void (*stream_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); void (*stream_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
int (*stream_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); int (*stream_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
} ops; } ops;
}; };
struct _snd_ice1712 { struct snd_ice1712 {
unsigned long conp_dma_size; unsigned long conp_dma_size;
unsigned long conc_dma_size; unsigned long conc_dma_size;
unsigned long prop_dma_size; unsigned long prop_dma_size;
...@@ -300,28 +300,28 @@ struct _snd_ice1712 { ...@@ -300,28 +300,28 @@ struct _snd_ice1712 {
unsigned long profi_port; unsigned long profi_port;
struct pci_dev *pci; struct pci_dev *pci;
snd_card_t *card; struct snd_card *card;
snd_pcm_t *pcm; struct snd_pcm *pcm;
snd_pcm_t *pcm_ds; struct snd_pcm *pcm_ds;
snd_pcm_t *pcm_pro; struct snd_pcm *pcm_pro;
snd_pcm_substream_t *playback_con_substream; struct snd_pcm_substream *playback_con_substream;
snd_pcm_substream_t *playback_con_substream_ds[6]; struct snd_pcm_substream *playback_con_substream_ds[6];
snd_pcm_substream_t *capture_con_substream; struct snd_pcm_substream *capture_con_substream;
snd_pcm_substream_t *playback_pro_substream; struct snd_pcm_substream *playback_pro_substream;
snd_pcm_substream_t *capture_pro_substream; struct snd_pcm_substream *capture_pro_substream;
unsigned int playback_pro_size; unsigned int playback_pro_size;
unsigned int capture_pro_size; unsigned int capture_pro_size;
unsigned int playback_con_virt_addr[6]; unsigned int playback_con_virt_addr[6];
unsigned int playback_con_active_buf[6]; unsigned int playback_con_active_buf[6];
unsigned int capture_con_virt_addr; unsigned int capture_con_virt_addr;
unsigned int ac97_ext_id; unsigned int ac97_ext_id;
ac97_t *ac97; struct snd_ac97 *ac97;
snd_rawmidi_t *rmidi[2]; struct snd_rawmidi *rmidi[2];
spinlock_t reg_lock; spinlock_t reg_lock;
snd_info_entry_t *proc_entry; struct snd_info_entry *proc_entry;
ice1712_eeprom_t eeprom; struct snd_ice1712_eeprom eeprom;
unsigned int pro_volumes[20]; unsigned int pro_volumes[20];
unsigned int omni: 1; /* Delta Omni I/O */ unsigned int omni: 1; /* Delta Omni I/O */
...@@ -335,16 +335,16 @@ struct _snd_ice1712 { ...@@ -335,16 +335,16 @@ struct _snd_ice1712 {
unsigned int cur_rate; /* current rate */ unsigned int cur_rate; /* current rate */
struct semaphore open_mutex; struct semaphore open_mutex;
snd_pcm_substream_t *pcm_reserved[4]; struct snd_pcm_substream *pcm_reserved[4];
snd_pcm_hw_constraint_list_t *hw_rates; /* card-specific rate constraints */ struct snd_pcm_hw_constraint_list *hw_rates; /* card-specific rate constraints */
unsigned int akm_codecs; unsigned int akm_codecs;
akm4xxx_t *akm; struct snd_akm4xxx *akm;
struct snd_ice1712_spdif spdif; struct snd_ice1712_spdif spdif;
struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */ struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */
snd_i2c_bus_t *i2c; /* I2C bus */ struct snd_i2c_bus *i2c; /* I2C bus */
snd_i2c_device_t *cs8427; /* CS8427 I2C device */ struct snd_i2c_device *cs8427; /* CS8427 I2C device */
unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */
struct ice1712_gpio { struct ice1712_gpio {
...@@ -352,20 +352,20 @@ struct _snd_ice1712 { ...@@ -352,20 +352,20 @@ struct _snd_ice1712 {
unsigned int write_mask; /* current mask bits */ unsigned int write_mask; /* current mask bits */
unsigned int saved[2]; /* for ewx_i2c */ unsigned int saved[2]; /* for ewx_i2c */
/* operators */ /* operators */
void (*set_mask)(ice1712_t *ice, unsigned int data); void (*set_mask)(struct snd_ice1712 *ice, unsigned int data);
void (*set_dir)(ice1712_t *ice, unsigned int data); void (*set_dir)(struct snd_ice1712 *ice, unsigned int data);
void (*set_data)(ice1712_t *ice, unsigned int data); void (*set_data)(struct snd_ice1712 *ice, unsigned int data);
unsigned int (*get_data)(ice1712_t *ice); unsigned int (*get_data)(struct snd_ice1712 *ice);
/* misc operators - move to another place? */ /* misc operators - move to another place? */
void (*set_pro_rate)(ice1712_t *ice, unsigned int rate); void (*set_pro_rate)(struct snd_ice1712 *ice, unsigned int rate);
void (*i2s_mclk_changed)(ice1712_t *ice); void (*i2s_mclk_changed)(struct snd_ice1712 *ice);
} gpio; } gpio;
struct semaphore gpio_mutex; struct semaphore gpio_mutex;
/* other board-specific data */ /* other board-specific data */
union { union {
/* additional i2c devices for EWS boards */ /* additional i2c devices for EWS boards */
snd_i2c_device_t *i2cdevs[3]; struct snd_i2c_device *i2cdevs[3];
/* AC97 register cache for Aureon */ /* AC97 register cache for Aureon */
struct aureon_spec { struct aureon_spec {
unsigned short stac9744[64]; unsigned short stac9744[64];
...@@ -385,7 +385,7 @@ struct _snd_ice1712 { ...@@ -385,7 +385,7 @@ struct _snd_ice1712 {
unsigned short boxconfig[4]; unsigned short boxconfig[4];
} hoontech; } hoontech;
struct { struct {
ak4114_t *ak4114; struct ak4114 *ak4114;
unsigned int analog: 1; unsigned int analog: 1;
} juli; } juli;
} spec; } spec;
...@@ -396,22 +396,22 @@ struct _snd_ice1712 { ...@@ -396,22 +396,22 @@ struct _snd_ice1712 {
/* /*
* gpio access functions * gpio access functions
*/ */
static inline void snd_ice1712_gpio_set_dir(ice1712_t *ice, unsigned int bits) static inline void snd_ice1712_gpio_set_dir(struct snd_ice1712 *ice, unsigned int bits)
{ {
ice->gpio.set_dir(ice, bits); ice->gpio.set_dir(ice, bits);
} }
static inline void snd_ice1712_gpio_set_mask(ice1712_t *ice, unsigned int bits) static inline void snd_ice1712_gpio_set_mask(struct snd_ice1712 *ice, unsigned int bits)
{ {
ice->gpio.set_mask(ice, bits); ice->gpio.set_mask(ice, bits);
} }
static inline void snd_ice1712_gpio_write(ice1712_t *ice, unsigned int val) static inline void snd_ice1712_gpio_write(struct snd_ice1712 *ice, unsigned int val)
{ {
ice->gpio.set_data(ice, val); ice->gpio.set_data(ice, val);
} }
static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice) static inline unsigned int snd_ice1712_gpio_read(struct snd_ice1712 *ice)
{ {
return ice->gpio.get_data(ice); return ice->gpio.get_data(ice);
} }
...@@ -421,14 +421,14 @@ static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice) ...@@ -421,14 +421,14 @@ static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice)
* The access to gpio will be protected by mutex, so don't forget to * The access to gpio will be protected by mutex, so don't forget to
* restore! * restore!
*/ */
static inline void snd_ice1712_save_gpio_status(ice1712_t *ice) static inline void snd_ice1712_save_gpio_status(struct snd_ice1712 *ice)
{ {
down(&ice->gpio_mutex); down(&ice->gpio_mutex);
ice->gpio.saved[0] = ice->gpio.direction; ice->gpio.saved[0] = ice->gpio.direction;
ice->gpio.saved[1] = ice->gpio.write_mask; ice->gpio.saved[1] = ice->gpio.write_mask;
} }
static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice) static inline void snd_ice1712_restore_gpio_status(struct snd_ice1712 *ice)
{ {
ice->gpio.set_dir(ice, ice->gpio.saved[0]); ice->gpio.set_dir(ice, ice->gpio.saved[0]);
ice->gpio.set_mask(ice, ice->gpio.saved[1]); ice->gpio.set_mask(ice, ice->gpio.saved[1]);
...@@ -443,14 +443,15 @@ static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice) ...@@ -443,14 +443,15 @@ static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice)
.get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \ .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \
.private_value = mask | (invert << 24) } .private_value = mask | (invert << 24) }
int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); int snd_ice1712_gpio_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
/* /*
* set gpio direction, write mask and data * set gpio direction, write mask and data
*/ */
static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask, unsigned int bits) static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice,
unsigned int mask, unsigned int bits)
{ {
ice->gpio.direction |= mask; ice->gpio.direction |= mask;
snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
...@@ -458,21 +459,22 @@ static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask ...@@ -458,21 +459,22 @@ static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask
snd_ice1712_gpio_write(ice, mask & bits); snd_ice1712_gpio_write(ice, mask & bits);
} }
int snd_ice1712_spdif_build_controls(ice1712_t *ice); int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice);
int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *template, const struct snd_ak4xxx_private *priv, ice1712_t *ice); int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template,
void snd_ice1712_akm4xxx_free(ice1712_t *ice); const struct snd_ak4xxx_private *priv, struct snd_ice1712 *ice);
int snd_ice1712_akm4xxx_build_controls(ice1712_t *ice); void snd_ice1712_akm4xxx_free(struct snd_ice1712 *ice);
int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice);
int snd_ice1712_init_cs8427(ice1712_t *ice, int addr); int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr);
static inline void snd_ice1712_write(ice1712_t * ice, u8 addr, u8 data) static inline void snd_ice1712_write(struct snd_ice1712 * ice, u8 addr, u8 data)
{ {
outb(addr, ICEREG(ice, INDEX)); outb(addr, ICEREG(ice, INDEX));
outb(data, ICEREG(ice, DATA)); outb(data, ICEREG(ice, DATA));
} }
static inline u8 snd_ice1712_read(ice1712_t * ice, u8 addr) static inline u8 snd_ice1712_read(struct snd_ice1712 * ice, u8 addr)
{ {
outb(addr, ICEREG(ice, INDEX)); outb(addr, ICEREG(ice, INDEX));
return inb(ICEREG(ice, DATA)); return inb(ICEREG(ice, DATA));
...@@ -488,8 +490,8 @@ struct snd_ice1712_card_info { ...@@ -488,8 +490,8 @@ struct snd_ice1712_card_info {
char *name; char *name;
char *model; char *model;
char *driver; char *driver;
int (*chip_init)(ice1712_t *); int (*chip_init)(struct snd_ice1712 *);
int (*build_controls)(ice1712_t *); int (*build_controls)(struct snd_ice1712 *);
unsigned int no_mpu401: 1; unsigned int no_mpu401: 1;
unsigned int eeprom_size; unsigned int eeprom_size;
unsigned char *eeprom_data; unsigned char *eeprom_data;
......
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