aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/ice1724.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r--sound/pci/ice1712/ice1724.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 1127ebdf5fec..ee620dea7ef3 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -337,13 +337,11 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
337 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); 337 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
338 unsigned char what; 338 unsigned char what;
339 unsigned char old; 339 unsigned char old;
340 struct list_head *pos;
341 struct snd_pcm_substream *s; 340 struct snd_pcm_substream *s;
342 341
343 what = 0; 342 what = 0;
344 snd_pcm_group_for_each(pos, substream) { 343 snd_pcm_group_for_each_entry(s, substream) {
345 const struct vt1724_pcm_reg *reg; 344 const struct vt1724_pcm_reg *reg;
346 s = snd_pcm_group_substream_entry(pos);
347 reg = s->runtime->private_data; 345 reg = s->runtime->private_data;
348 what |= reg->start; 346 what |= reg->start;
349 snd_pcm_trigger_done(s, substream); 347 snd_pcm_trigger_done(s, substream);
@@ -1318,7 +1316,7 @@ static int snd_vt1724_eeprom_get(struct snd_kcontrol *kcontrol,
1318 return 0; 1316 return 0;
1319} 1317}
1320 1318
1321static const struct snd_kcontrol_new snd_vt1724_eeprom __devinitdata = { 1319static struct snd_kcontrol_new snd_vt1724_eeprom __devinitdata = {
1322 .iface = SNDRV_CTL_ELEM_IFACE_CARD, 1320 .iface = SNDRV_CTL_ELEM_IFACE_CARD,
1323 .name = "ICE1724 EEPROM", 1321 .name = "ICE1724 EEPROM",
1324 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1322 .access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -1431,7 +1429,7 @@ static int snd_vt1724_spdif_default_put(struct snd_kcontrol *kcontrol,
1431 return (val != old); 1429 return (val != old);
1432} 1430}
1433 1431
1434static const struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata = 1432static struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata =
1435{ 1433{
1436 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1434 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1437 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1435 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
@@ -1463,7 +1461,7 @@ static int snd_vt1724_spdif_maskp_get(struct snd_kcontrol *kcontrol,
1463 return 0; 1461 return 0;
1464} 1462}
1465 1463
1466static const struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata = 1464static struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata =
1467{ 1465{
1468 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1466 .access = SNDRV_CTL_ELEM_ACCESS_READ,
1469 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1467 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -1472,7 +1470,7 @@ static const struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata =
1472 .get = snd_vt1724_spdif_maskc_get, 1470 .get = snd_vt1724_spdif_maskc_get,
1473}; 1471};
1474 1472
1475static const struct snd_kcontrol_new snd_vt1724_spdif_maskp __devinitdata = 1473static struct snd_kcontrol_new snd_vt1724_spdif_maskp __devinitdata =
1476{ 1474{
1477 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1475 .access = SNDRV_CTL_ELEM_ACCESS_READ,
1478 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1476 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -1517,7 +1515,7 @@ static int snd_vt1724_spdif_sw_put(struct snd_kcontrol *kcontrol,
1517 return old != val; 1515 return old != val;
1518} 1516}
1519 1517
1520static const struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata = 1518static struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata =
1521{ 1519{
1522 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1520 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1523 /* FIXME: the following conflict with IEC958 Playback Route */ 1521 /* FIXME: the following conflict with IEC958 Playback Route */
@@ -1668,7 +1666,12 @@ static int snd_vt1724_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
1668 spin_lock_irq(&ice->reg_lock); 1666 spin_lock_irq(&ice->reg_lock);
1669 oval = inb(ICEMT1724(ice, RATE)); 1667 oval = inb(ICEMT1724(ice, RATE));
1670 if (ucontrol->value.enumerated.item[0] == spdif) { 1668 if (ucontrol->value.enumerated.item[0] == spdif) {
1669 unsigned char i2s_oval;
1671 outb(oval | VT1724_SPDIF_MASTER, ICEMT1724(ice, RATE)); 1670 outb(oval | VT1724_SPDIF_MASTER, ICEMT1724(ice, RATE));
1671 /* setting 256fs */
1672 i2s_oval = inb(ICEMT1724(ice, I2S_FORMAT));
1673 outb(i2s_oval & ~VT1724_MT_I2S_MCLK_128X,
1674 ICEMT1724(ice, I2S_FORMAT));
1672 } else { 1675 } else {
1673 rate = rates[ucontrol->value.integer.value[0] % 15]; 1676 rate = rates[ucontrol->value.integer.value[0] % 15];
1674 if (rate <= get_max_rate(ice)) { 1677 if (rate <= get_max_rate(ice)) {
@@ -1695,7 +1698,7 @@ static int snd_vt1724_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
1695 return change; 1698 return change;
1696} 1699}
1697 1700
1698static const struct snd_kcontrol_new snd_vt1724_pro_internal_clock __devinitdata = { 1701static struct snd_kcontrol_new snd_vt1724_pro_internal_clock __devinitdata = {
1699 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1702 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1700 .name = "Multi Track Internal Clock", 1703 .name = "Multi Track Internal Clock",
1701 .info = snd_vt1724_pro_internal_clock_info, 1704 .info = snd_vt1724_pro_internal_clock_info,
@@ -1734,7 +1737,7 @@ static int snd_vt1724_pro_rate_locking_put(struct snd_kcontrol *kcontrol,
1734 return change; 1737 return change;
1735} 1738}
1736 1739
1737static const struct snd_kcontrol_new snd_vt1724_pro_rate_locking __devinitdata = { 1740static struct snd_kcontrol_new snd_vt1724_pro_rate_locking __devinitdata = {
1738 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1741 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1739 .name = "Multi Track Rate Locking", 1742 .name = "Multi Track Rate Locking",
1740 .info = snd_vt1724_pro_rate_locking_info, 1743 .info = snd_vt1724_pro_rate_locking_info,
@@ -1773,7 +1776,7 @@ static int snd_vt1724_pro_rate_reset_put(struct snd_kcontrol *kcontrol,
1773 return change; 1776 return change;
1774} 1777}
1775 1778
1776static const struct snd_kcontrol_new snd_vt1724_pro_rate_reset __devinitdata = { 1779static struct snd_kcontrol_new snd_vt1724_pro_rate_reset __devinitdata = {
1777 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1780 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1778 .name = "Multi Track Rate Reset", 1781 .name = "Multi Track Rate Reset",
1779 .info = snd_vt1724_pro_rate_reset_info, 1782 .info = snd_vt1724_pro_rate_reset_info,
@@ -1892,7 +1895,7 @@ static int snd_vt1724_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
1892 digital_route_shift(idx)); 1895 digital_route_shift(idx));
1893} 1896}
1894 1897
1895static const struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = { 1898static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = {
1896 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1899 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1897 .name = "H/W Playback Route", 1900 .name = "H/W Playback Route",
1898 .info = snd_vt1724_pro_route_info, 1901 .info = snd_vt1724_pro_route_info,
@@ -1900,7 +1903,7 @@ static const struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinit
1900 .put = snd_vt1724_pro_route_analog_put, 1903 .put = snd_vt1724_pro_route_analog_put,
1901}; 1904};
1902 1905
1903static const struct snd_kcontrol_new snd_vt1724_mixer_pro_spdif_route __devinitdata = { 1906static struct snd_kcontrol_new snd_vt1724_mixer_pro_spdif_route __devinitdata = {
1904 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1907 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1905 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", 1908 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route",
1906 .info = snd_vt1724_pro_route_info, 1909 .info = snd_vt1724_pro_route_info,
@@ -1936,7 +1939,7 @@ static int snd_vt1724_pro_peak_get(struct snd_kcontrol *kcontrol,
1936 return 0; 1939 return 0;
1937} 1940}
1938 1941
1939static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { 1942static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = {
1940 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1943 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1941 .name = "Multi Track Peak", 1944 .name = "Multi Track Peak",
1942 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 1945 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
@@ -1948,9 +1951,9 @@ static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = {
1948 * 1951 *
1949 */ 1952 */
1950 1953
1951static const struct snd_ice1712_card_info no_matched __devinitdata; 1954static struct snd_ice1712_card_info no_matched __devinitdata;
1952 1955
1953static const struct snd_ice1712_card_info *card_tables[] __devinitdata = { 1956static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
1954 snd_vt1724_revo_cards, 1957 snd_vt1724_revo_cards,
1955 snd_vt1724_amp_cards, 1958 snd_vt1724_amp_cards,
1956 snd_vt1724_aureon_cards, 1959 snd_vt1724_aureon_cards,
@@ -2009,7 +2012,7 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice,
2009{ 2012{
2010 const int dev = 0xa0; /* EEPROM device address */ 2013 const int dev = 0xa0; /* EEPROM device address */
2011 unsigned int i, size; 2014 unsigned int i, size;
2012 const struct snd_ice1712_card_info **tbl, *c; 2015 struct snd_ice1712_card_info * const *tbl, *c;
2013 2016
2014 if (! modelname || ! *modelname) { 2017 if (! modelname || ! *modelname) {
2015 ice->eeprom.subvendor = 0; 2018 ice->eeprom.subvendor = 0;
@@ -2308,7 +2311,7 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
2308 struct snd_card *card; 2311 struct snd_card *card;
2309 struct snd_ice1712 *ice; 2312 struct snd_ice1712 *ice;
2310 int pcm_dev = 0, err; 2313 int pcm_dev = 0, err;
2311 const struct snd_ice1712_card_info **tbl, *c; 2314 struct snd_ice1712_card_info * const *tbl, *c;
2312 2315
2313 if (dev >= SNDRV_CARDS) 2316 if (dev >= SNDRV_CARDS)
2314 return -ENODEV; 2317 return -ENODEV;
@@ -2347,6 +2350,14 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
2347 } 2350 }
2348 c = &no_matched; 2351 c = &no_matched;
2349 __found: 2352 __found:
2353 /*
2354 * VT1724 has separate DMAs for the analog and the SPDIF streams while
2355 * ICE1712 has only one for both (mixed up).
2356 *
2357 * Confusingly the analog PCM is named "professional" here because it
2358 * was called so in ice1712 driver, and vt1724 driver is derived from
2359 * ice1712 driver.
2360 */
2350 2361
2351 if ((err = snd_vt1724_pcm_profi(ice, pcm_dev++)) < 0) { 2362 if ((err = snd_vt1724_pcm_profi(ice, pcm_dev++)) < 0) {
2352 snd_card_free(card); 2363 snd_card_free(card);