diff options
Diffstat (limited to 'sound/pci/ice1712')
28 files changed, 1281 insertions, 370 deletions
diff --git a/sound/pci/ice1712/Makefile b/sound/pci/ice1712/Makefile index 7837cef8855c..6efdd62f6837 100644 --- a/sound/pci/ice1712/Makefile +++ b/sound/pci/ice1712/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | snd-ice17xx-ak4xxx-objs := ak4xxx.o | 6 | snd-ice17xx-ak4xxx-objs := ak4xxx.o |
7 | snd-ice1712-objs := ice1712.o delta.o hoontech.o ews.o | 7 | snd-ice1712-objs := ice1712.o delta.o hoontech.o ews.o |
8 | snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o vt1720_mobo.o pontis.o prodigy192.o juli.o phase.o | 8 | snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o vt1720_mobo.o pontis.o prodigy192.o juli.o phase.o wtm.o |
9 | 9 | ||
10 | # Toplevel Module Dependency | 10 | # Toplevel Module Dependency |
11 | obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o snd-ice17xx-ak4xxx.o | 11 | obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o snd-ice17xx-ak4xxx.o |
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c index 59c4078ad331..6e22d326df32 100644 --- a/sound/pci/ice1712/amp.c +++ b/sound/pci/ice1712/amp.c | |||
@@ -42,7 +42,7 @@ static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val) | |||
42 | 42 | ||
43 | static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice) | 43 | static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice) |
44 | { | 44 | { |
45 | static unsigned short wm_inits[] = { | 45 | static const unsigned short wm_inits[] = { |
46 | WM_ATTEN_L, 0x0000, /* 0 db */ | 46 | WM_ATTEN_L, 0x0000, /* 0 db */ |
47 | WM_ATTEN_R, 0x0000, /* 0 db */ | 47 | WM_ATTEN_R, 0x0000, /* 0 db */ |
48 | WM_DAC_CTRL, 0x0008, /* 24bit I2S */ | 48 | WM_DAC_CTRL, 0x0008, /* 24bit I2S */ |
@@ -75,7 +75,7 @@ static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) | |||
75 | 75 | ||
76 | 76 | ||
77 | /* entry point */ | 77 | /* entry point */ |
78 | struct snd_ice1712_card_info snd_vt1724_amp_cards[] __devinitdata = { | 78 | const struct snd_ice1712_card_info snd_vt1724_amp_cards[] __devinitdata = { |
79 | { | 79 | { |
80 | .subvendor = VT1724_SUBDEVICE_AV710, | 80 | .subvendor = VT1724_SUBDEVICE_AV710, |
81 | .name = "Chaintech AV-710", | 81 | .name = "Chaintech AV-710", |
diff --git a/sound/pci/ice1712/amp.h b/sound/pci/ice1712/amp.h index a0fc89b48122..7b667bad0c6b 100644 --- a/sound/pci/ice1712/amp.h +++ b/sound/pci/ice1712/amp.h | |||
@@ -42,7 +42,7 @@ | |||
42 | #define WM_DAC_CTRL 0x02 | 42 | #define WM_DAC_CTRL 0x02 |
43 | #define WM_INT_CTRL 0x03 | 43 | #define WM_INT_CTRL 0x03 |
44 | 44 | ||
45 | extern struct snd_ice1712_card_info snd_vt1724_amp_cards[]; | 45 | extern const struct snd_ice1712_card_info snd_vt1724_amp_cards[]; |
46 | 46 | ||
47 | 47 | ||
48 | #endif /* __SOUND_AMP_H */ | 48 | #endif /* __SOUND_AMP_H */ |
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 9e76cebd2d22..6941d85dfec9 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -294,7 +294,7 @@ static unsigned short aureon_ac97_read(struct snd_ice1712 *ice, unsigned short r | |||
294 | static int aureon_ac97_init (struct snd_ice1712 *ice) | 294 | static int aureon_ac97_init (struct snd_ice1712 *ice) |
295 | { | 295 | { |
296 | int i; | 296 | int i; |
297 | static unsigned short ac97_defaults[] = { | 297 | static const unsigned short ac97_defaults[] = { |
298 | 0x00, 0x9640, | 298 | 0x00, 0x9640, |
299 | 0x02, 0x8000, | 299 | 0x02, 0x8000, |
300 | 0x04, 0x8000, | 300 | 0x04, 0x8000, |
@@ -474,7 +474,8 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned | |||
474 | 474 | ||
475 | tmp = snd_ice1712_gpio_read(ice); | 475 | tmp = snd_ice1712_gpio_read(ice); |
476 | 476 | ||
477 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT) { | 477 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT || |
478 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT) { | ||
478 | snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS)); | 479 | snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS)); |
479 | mosi = PRODIGY_SPI_MOSI; | 480 | mosi = PRODIGY_SPI_MOSI; |
480 | clk = PRODIGY_SPI_CLK; | 481 | clk = PRODIGY_SPI_CLK; |
@@ -601,7 +602,9 @@ static unsigned short wm_get(struct snd_ice1712 *ice, int reg) | |||
601 | static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val) | 602 | static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val) |
602 | { | 603 | { |
603 | aureon_spi_write(ice, | 604 | aureon_spi_write(ice, |
604 | (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT ? PRODIGY_WM_CS : AUREON_WM_CS), | 605 | ((ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT || |
606 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT) ? | ||
607 | PRODIGY_WM_CS : AUREON_WM_CS), | ||
605 | (reg << 9) | (val & 0x1ff), 16); | 608 | (reg << 9) | (val & 0x1ff), 16); |
606 | } | 609 | } |
607 | 610 | ||
@@ -661,17 +664,17 @@ static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e | |||
661 | return change; | 664 | return change; |
662 | } | 665 | } |
663 | 666 | ||
664 | static DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); | 667 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); |
665 | static DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); | 668 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); |
666 | static DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0); | 669 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0); |
667 | static DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0); | 670 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0); |
668 | static DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0); | 671 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0); |
669 | 672 | ||
670 | /* | 673 | /* |
671 | * Logarithmic volume values for WM8770 | 674 | * Logarithmic volume values for WM8770 |
672 | * Computed as 20 * Log10(255 / x) | 675 | * Computed as 20 * Log10(255 / x) |
673 | */ | 676 | */ |
674 | static unsigned char wm_vol[256] = { | 677 | static const unsigned char wm_vol[256] = { |
675 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, | 678 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, |
676 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, | 679 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, |
677 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, | 680 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, |
@@ -1064,14 +1067,14 @@ static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
1064 | */ | 1067 | */ |
1065 | static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1068 | static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1066 | { | 1069 | { |
1067 | static char *texts[] = { | 1070 | static const char * const texts[] = { |
1068 | "CD", //AIN1 | 1071 | "CD", //AIN1 |
1069 | "Aux", //AIN2 | 1072 | "Aux", //AIN2 |
1070 | "Line", //AIN3 | 1073 | "Line", //AIN3 |
1071 | "Mic", //AIN4 | 1074 | "Mic", //AIN4 |
1072 | "AC97" //AIN5 | 1075 | "AC97" //AIN5 |
1073 | }; | 1076 | }; |
1074 | static char *universe_texts[] = { | 1077 | static const char * const universe_texts[] = { |
1075 | "Aux1", //AIN1 | 1078 | "Aux1", //AIN1 |
1076 | "CD", //AIN2 | 1079 | "CD", //AIN2 |
1077 | "Phono", //AIN3 | 1080 | "Phono", //AIN3 |
@@ -1137,11 +1140,11 @@ static int wm_adc_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
1137 | static int aureon_cs8415_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1140 | static int aureon_cs8415_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1138 | { | 1141 | { |
1139 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 1142 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
1140 | static char *aureon_texts[] = { | 1143 | static const char * const aureon_texts[] = { |
1141 | "CD", //RXP0 | 1144 | "CD", //RXP0 |
1142 | "Optical" //RXP1 | 1145 | "Optical" //RXP1 |
1143 | }; | 1146 | }; |
1144 | static char *prodigy_texts[] = { | 1147 | static const char * const prodigy_texts[] = { |
1145 | "CD", | 1148 | "CD", |
1146 | "Coax" | 1149 | "Coax" |
1147 | }; | 1150 | }; |
@@ -1288,12 +1291,14 @@ static int aureon_set_headphone_amp(struct snd_ice1712 *ice, int enable) | |||
1288 | 1291 | ||
1289 | tmp2 = tmp = snd_ice1712_gpio_read(ice); | 1292 | tmp2 = tmp = snd_ice1712_gpio_read(ice); |
1290 | if (enable) | 1293 | if (enable) |
1291 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) | 1294 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && |
1295 | ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) | ||
1292 | tmp |= AUREON_HP_SEL; | 1296 | tmp |= AUREON_HP_SEL; |
1293 | else | 1297 | else |
1294 | tmp |= PRODIGY_HP_SEL; | 1298 | tmp |= PRODIGY_HP_SEL; |
1295 | else | 1299 | else |
1296 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) | 1300 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && |
1301 | ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) | ||
1297 | tmp &= ~ AUREON_HP_SEL; | 1302 | tmp &= ~ AUREON_HP_SEL; |
1298 | else | 1303 | else |
1299 | tmp &= ~ PRODIGY_HP_SEL; | 1304 | tmp &= ~ PRODIGY_HP_SEL; |
@@ -1363,7 +1368,7 @@ static int aureon_deemp_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
1363 | */ | 1368 | */ |
1364 | static int aureon_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_info *uinfo) | 1369 | static int aureon_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_info *uinfo) |
1365 | { | 1370 | { |
1366 | static char *texts[2] = { "128x", "64x" }; | 1371 | static const char * const texts[2] = { "128x", "64x" }; |
1367 | 1372 | ||
1368 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1373 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1369 | uinfo->count = 1; | 1374 | uinfo->count = 1; |
@@ -1406,7 +1411,7 @@ static int aureon_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl | |||
1406 | * mixers | 1411 | * mixers |
1407 | */ | 1412 | */ |
1408 | 1413 | ||
1409 | static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = { | 1414 | static const struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = { |
1410 | { | 1415 | { |
1411 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1416 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1412 | .name = "Master Playback Switch", | 1417 | .name = "Master Playback Switch", |
@@ -1521,7 +1526,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = { | |||
1521 | } | 1526 | } |
1522 | }; | 1527 | }; |
1523 | 1528 | ||
1524 | static struct snd_kcontrol_new wm_controls[] __devinitdata = { | 1529 | static const struct snd_kcontrol_new wm_controls[] __devinitdata = { |
1525 | { | 1530 | { |
1526 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1531 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1527 | .name = "PCM Playback Switch", | 1532 | .name = "PCM Playback Switch", |
@@ -1587,7 +1592,7 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = { | |||
1587 | } | 1592 | } |
1588 | }; | 1593 | }; |
1589 | 1594 | ||
1590 | static struct snd_kcontrol_new ac97_controls[] __devinitdata = { | 1595 | static const struct snd_kcontrol_new ac97_controls[] __devinitdata = { |
1591 | { | 1596 | { |
1592 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1597 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1593 | .name = "AC97 Playback Switch", | 1598 | .name = "AC97 Playback Switch", |
@@ -1692,7 +1697,7 @@ static struct snd_kcontrol_new ac97_controls[] __devinitdata = { | |||
1692 | } | 1697 | } |
1693 | }; | 1698 | }; |
1694 | 1699 | ||
1695 | static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = { | 1700 | static const struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = { |
1696 | { | 1701 | { |
1697 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1702 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1698 | .name = "AC97 Playback Switch", | 1703 | .name = "AC97 Playback Switch", |
@@ -1824,8 +1829,7 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = { | |||
1824 | 1829 | ||
1825 | }; | 1830 | }; |
1826 | 1831 | ||
1827 | 1832 | static const struct snd_kcontrol_new cs8415_controls[] __devinitdata = { | |
1828 | static struct snd_kcontrol_new cs8415_controls[] __devinitdata = { | ||
1829 | { | 1833 | { |
1830 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1834 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1831 | .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), | 1835 | .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), |
@@ -1870,7 +1874,6 @@ static struct snd_kcontrol_new cs8415_controls[] __devinitdata = { | |||
1870 | } | 1874 | } |
1871 | }; | 1875 | }; |
1872 | 1876 | ||
1873 | |||
1874 | static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | 1877 | static int __devinit aureon_add_controls(struct snd_ice1712 *ice) |
1875 | { | 1878 | { |
1876 | unsigned int i, counts; | 1879 | unsigned int i, counts; |
@@ -1898,7 +1901,8 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | |||
1898 | return err; | 1901 | return err; |
1899 | } | 1902 | } |
1900 | } | 1903 | } |
1901 | else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { | 1904 | else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && |
1905 | ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) { | ||
1902 | for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) { | 1906 | for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) { |
1903 | err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice)); | 1907 | err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice)); |
1904 | if (err < 0) | 1908 | if (err < 0) |
@@ -1906,7 +1910,8 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | |||
1906 | } | 1910 | } |
1907 | } | 1911 | } |
1908 | 1912 | ||
1909 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { | 1913 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && |
1914 | ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) { | ||
1910 | unsigned char id; | 1915 | unsigned char id; |
1911 | snd_ice1712_save_gpio_status(ice); | 1916 | snd_ice1712_save_gpio_status(ice); |
1912 | id = aureon_cs8415_get(ice, CS8415_ID); | 1917 | id = aureon_cs8415_get(ice, CS8415_ID); |
@@ -1936,7 +1941,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | |||
1936 | */ | 1941 | */ |
1937 | static int __devinit aureon_init(struct snd_ice1712 *ice) | 1942 | static int __devinit aureon_init(struct snd_ice1712 *ice) |
1938 | { | 1943 | { |
1939 | static unsigned short wm_inits_aureon[] = { | 1944 | static const unsigned short wm_inits_aureon[] = { |
1940 | /* These come first to reduce init pop noise */ | 1945 | /* These come first to reduce init pop noise */ |
1941 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ | 1946 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ |
1942 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ | 1947 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ |
@@ -1972,7 +1977,7 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
1972 | 0x1a, 0x000, /* -12dB ADC/R */ | 1977 | 0x1a, 0x000, /* -12dB ADC/R */ |
1973 | (unsigned short)-1 | 1978 | (unsigned short)-1 |
1974 | }; | 1979 | }; |
1975 | static unsigned short wm_inits_prodigy[] = { | 1980 | static const unsigned short wm_inits_prodigy[] = { |
1976 | 1981 | ||
1977 | /* These come first to reduce init pop noise */ | 1982 | /* These come first to reduce init pop noise */ |
1978 | 0x1b, 0x000, /* ADC Mux */ | 1983 | 0x1b, 0x000, /* ADC Mux */ |
@@ -2014,7 +2019,7 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
2014 | (unsigned short)-1 | 2019 | (unsigned short)-1 |
2015 | 2020 | ||
2016 | }; | 2021 | }; |
2017 | static unsigned short cs_inits[] = { | 2022 | static const unsigned short cs_inits[] = { |
2018 | 0x0441, /* RUN */ | 2023 | 0x0441, /* RUN */ |
2019 | 0x0180, /* no mute, OMCK output on RMCK pin */ | 2024 | 0x0180, /* no mute, OMCK output on RMCK pin */ |
2020 | 0x0201, /* S/PDIF source on RXP1 */ | 2025 | 0x0201, /* S/PDIF source on RXP1 */ |
@@ -2022,7 +2027,7 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
2022 | (unsigned short)-1 | 2027 | (unsigned short)-1 |
2023 | }; | 2028 | }; |
2024 | unsigned int tmp; | 2029 | unsigned int tmp; |
2025 | unsigned short *p; | 2030 | const unsigned short *p; |
2026 | int err, i; | 2031 | int err, i; |
2027 | 2032 | ||
2028 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) { | 2033 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) { |
@@ -2062,7 +2067,8 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
2062 | 2067 | ||
2063 | /* initialize WM8770 codec */ | 2068 | /* initialize WM8770 codec */ |
2064 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 || | 2069 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 || |
2065 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT) | 2070 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT || |
2071 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT) | ||
2066 | p = wm_inits_prodigy; | 2072 | p = wm_inits_prodigy; |
2067 | else | 2073 | else |
2068 | p = wm_inits_aureon; | 2074 | p = wm_inits_aureon; |
@@ -2070,7 +2076,8 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
2070 | wm_put(ice, p[0], p[1]); | 2076 | wm_put(ice, p[0], p[1]); |
2071 | 2077 | ||
2072 | /* initialize CS8415A codec */ | 2078 | /* initialize CS8415A codec */ |
2073 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { | 2079 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT && |
2080 | ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) { | ||
2074 | for (p = cs_inits; *p != (unsigned short)-1; p++) | 2081 | for (p = cs_inits; *p != (unsigned short)-1; p++) |
2075 | aureon_spi_write(ice, AUREON_CS8415_CS, *p | 0x200000, 24); | 2082 | aureon_spi_write(ice, AUREON_CS8415_CS, *p | 0x200000, 24); |
2076 | ice->spec.aureon.cs8415_mux = 1; | 2083 | ice->spec.aureon.cs8415_mux = 1; |
@@ -2100,73 +2107,58 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
2100 | * hence the driver needs to sets up it properly. | 2107 | * hence the driver needs to sets up it properly. |
2101 | */ | 2108 | */ |
2102 | 2109 | ||
2103 | static unsigned char aureon51_eeprom[] __devinitdata = { | 2110 | static const unsigned char aureon51_eeprom[] __devinitdata = { |
2104 | 0x0a, /* SYSCONF: clock 512, spdif-in/ADC, 3DACs */ | 2111 | [ICE_EEP2_SYSCONF] = 0x0a, /* clock 512, spdif-in/ADC, 3DACs */ |
2105 | 0x80, /* ACLINK: I2S */ | 2112 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
2106 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | 2113 | [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ |
2107 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 2114 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
2108 | 0xff, /* GPIO_DIR */ | 2115 | [ICE_EEP2_GPIO_DIR] = 0xff, |
2109 | 0xff, /* GPIO_DIR1 */ | 2116 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
2110 | 0x5f, /* GPIO_DIR2 */ | 2117 | [ICE_EEP2_GPIO_DIR2] = 0x5f, |
2111 | 0x00, /* GPIO_MASK */ | 2118 | [ICE_EEP2_GPIO_MASK] = 0x00, |
2112 | 0x00, /* GPIO_MASK1 */ | 2119 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
2113 | 0x00, /* GPIO_MASK2 */ | 2120 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
2114 | 0x00, /* GPIO_STATE */ | 2121 | [ICE_EEP2_GPIO_STATE] = 0x00, |
2115 | 0x00, /* GPIO_STATE1 */ | 2122 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
2116 | 0x00, /* GPIO_STATE2 */ | 2123 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
2117 | }; | 2124 | }; |
2118 | 2125 | ||
2119 | static unsigned char aureon71_eeprom[] __devinitdata = { | 2126 | static const unsigned char aureon71_eeprom[] __devinitdata = { |
2120 | 0x0b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ | 2127 | [ICE_EEP2_SYSCONF] = 0x0b, /* clock 512, spdif-in/ADC, 4DACs */ |
2121 | 0x80, /* ACLINK: I2S */ | 2128 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
2122 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | 2129 | [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ |
2123 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 2130 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
2124 | 0xff, /* GPIO_DIR */ | 2131 | [ICE_EEP2_GPIO_DIR] = 0xff, |
2125 | 0xff, /* GPIO_DIR1 */ | 2132 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
2126 | 0x5f, /* GPIO_DIR2 */ | 2133 | [ICE_EEP2_GPIO_DIR2] = 0x5f, |
2127 | 0x00, /* GPIO_MASK */ | 2134 | [ICE_EEP2_GPIO_MASK] = 0x00, |
2128 | 0x00, /* GPIO_MASK1 */ | 2135 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
2129 | 0x00, /* GPIO_MASK2 */ | 2136 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
2130 | 0x00, /* GPIO_STATE */ | 2137 | [ICE_EEP2_GPIO_STATE] = 0x00, |
2131 | 0x00, /* GPIO_STATE1 */ | 2138 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
2132 | 0x00, /* GPIO_STATE2 */ | 2139 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
2133 | }; | 2140 | }; |
2134 | 2141 | #define prodigy71_eeprom aureon71_eeprom | |
2135 | static unsigned char prodigy71_eeprom[] __devinitdata = { | 2142 | |
2136 | 0x0b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ | 2143 | static const unsigned char prodigy71lt_eeprom[] __devinitdata = { |
2137 | 0x80, /* ACLINK: I2S */ | 2144 | [ICE_EEP2_SYSCONF] = 0x4b, /* clock 384, spdif-in/ADC, 4DACs */ |
2138 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | 2145 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
2139 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 2146 | [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ |
2140 | 0xff, /* GPIO_DIR */ | 2147 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
2141 | 0xff, /* GPIO_DIR1 */ | 2148 | [ICE_EEP2_GPIO_DIR] = 0xff, |
2142 | 0x5f, /* GPIO_DIR2 */ | 2149 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
2143 | 0x00, /* GPIO_MASK */ | 2150 | [ICE_EEP2_GPIO_DIR2] = 0x5f, |
2144 | 0x00, /* GPIO_MASK1 */ | 2151 | [ICE_EEP2_GPIO_MASK] = 0x00, |
2145 | 0x00, /* GPIO_MASK2 */ | 2152 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
2146 | 0x00, /* GPIO_STATE */ | 2153 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
2147 | 0x00, /* GPIO_STATE1 */ | 2154 | [ICE_EEP2_GPIO_STATE] = 0x00, |
2148 | 0x00, /* GPIO_STATE2 */ | 2155 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
2156 | [ICE_EEP2_GPIO_STATE2] = 0x00, | ||
2149 | }; | 2157 | }; |
2150 | 2158 | #define prodigy71xt_eeprom prodigy71lt_eeprom | |
2151 | static unsigned char prodigy71lt_eeprom[] __devinitdata = { | ||
2152 | 0x4b, /* SYSCINF: clock 512, spdif-in/ADC, 4DACs */ | ||
2153 | 0x80, /* ACLINK: I2S */ | ||
2154 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | ||
2155 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | ||
2156 | 0xff, /* GPIO_DIR */ | ||
2157 | 0xff, /* GPIO_DIR1 */ | ||
2158 | 0x5f, /* GPIO_DIR2 */ | ||
2159 | 0x00, /* GPIO_MASK */ | ||
2160 | 0x00, /* GPIO_MASK1 */ | ||
2161 | 0x00, /* GPIO_MASK2 */ | ||
2162 | 0x00, /* GPIO_STATE */ | ||
2163 | 0x00, /* GPIO_STATE1 */ | ||
2164 | 0x00, /* GPIO_STATE2 */ | ||
2165 | }; | ||
2166 | |||
2167 | 2159 | ||
2168 | /* entry point */ | 2160 | /* entry point */ |
2169 | struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { | 2161 | const struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { |
2170 | { | 2162 | { |
2171 | .subvendor = VT1724_SUBDEVICE_AUREON51_SKY, | 2163 | .subvendor = VT1724_SUBDEVICE_AUREON51_SKY, |
2172 | .name = "Terratec Aureon 5.1-Sky", | 2164 | .name = "Terratec Aureon 5.1-Sky", |
@@ -2217,5 +2209,15 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { | |||
2217 | .eeprom_data = prodigy71lt_eeprom, | 2209 | .eeprom_data = prodigy71lt_eeprom, |
2218 | .driver = "Prodigy71LT", | 2210 | .driver = "Prodigy71LT", |
2219 | }, | 2211 | }, |
2212 | { | ||
2213 | .subvendor = VT1724_SUBDEVICE_PRODIGY71XT, | ||
2214 | .name = "Audiotrak Prodigy 7.1 XT", | ||
2215 | .model = "prodigy71xt", | ||
2216 | .chip_init = aureon_init, | ||
2217 | .build_controls = aureon_add_controls, | ||
2218 | .eeprom_size = sizeof(prodigy71xt_eeprom), | ||
2219 | .eeprom_data = prodigy71xt_eeprom, | ||
2220 | .driver = "Prodigy71LT", | ||
2221 | }, | ||
2220 | { } /* terminator */ | 2222 | { } /* terminator */ |
2221 | }; | 2223 | }; |
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h index 3b7bea656c57..79e58e88ed47 100644 --- a/sound/pci/ice1712/aureon.h +++ b/sound/pci/ice1712/aureon.h | |||
@@ -28,15 +28,17 @@ | |||
28 | "{Terratec,Aureon 7.1 Space},"\ | 28 | "{Terratec,Aureon 7.1 Space},"\ |
29 | "{Terratec,Aureon 7.1 Universe}," \ | 29 | "{Terratec,Aureon 7.1 Universe}," \ |
30 | "{AudioTrak,Prodigy 7.1}," \ | 30 | "{AudioTrak,Prodigy 7.1}," \ |
31 | "{AudioTrak,Prodigy 7.1 LT}," | 31 | "{AudioTrak,Prodigy 7.1 LT},"\ |
32 | "{AudioTrak,Prodigy 7.1 XT}," | ||
32 | 33 | ||
33 | #define VT1724_SUBDEVICE_AUREON51_SKY 0x3b154711 /* Aureon 5.1 Sky */ | 34 | #define VT1724_SUBDEVICE_AUREON51_SKY 0x3b154711 /* Aureon 5.1 Sky */ |
34 | #define VT1724_SUBDEVICE_AUREON71_SPACE 0x3b154511 /* Aureon 7.1 Space */ | 35 | #define VT1724_SUBDEVICE_AUREON71_SPACE 0x3b154511 /* Aureon 7.1 Space */ |
35 | #define VT1724_SUBDEVICE_AUREON71_UNIVERSE 0x3b155311 /* Aureon 7.1 Universe */ | 36 | #define VT1724_SUBDEVICE_AUREON71_UNIVERSE 0x3b155311 /* Aureon 7.1 Universe */ |
36 | #define VT1724_SUBDEVICE_PRODIGY71 0x33495345 /* PRODIGY 7.1 */ | 37 | #define VT1724_SUBDEVICE_PRODIGY71 0x33495345 /* PRODIGY 7.1 */ |
37 | #define VT1724_SUBDEVICE_PRODIGY71LT 0x32315441 /* PRODIGY 7.1 LT */ | 38 | #define VT1724_SUBDEVICE_PRODIGY71LT 0x32315441 /* PRODIGY 7.1 LT */ |
39 | #define VT1724_SUBDEVICE_PRODIGY71XT 0x36315441 /* PRODIGY 7.1 XT*/ | ||
38 | 40 | ||
39 | extern struct snd_ice1712_card_info snd_vt1724_aureon_cards[]; | 41 | extern const struct snd_ice1712_card_info snd_vt1724_aureon_cards[]; |
40 | 42 | ||
41 | /* GPIO bits */ | 43 | /* GPIO bits */ |
42 | #define AUREON_CS8415_CS (1 << 22) | 44 | #define AUREON_CS8415_CS (1 << 22) |
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index af659800c9b0..3eeb36c6e985 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c | |||
@@ -416,7 +416,7 @@ static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kco | |||
416 | return 0; | 416 | return 0; |
417 | } | 417 | } |
418 | 418 | ||
419 | static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status __devinitdata = | 419 | static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status __devinitdata = |
420 | { | 420 | { |
421 | .access = (SNDRV_CTL_ELEM_ACCESS_READ), | 421 | .access = (SNDRV_CTL_ELEM_ACCESS_READ), |
422 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 422 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -429,7 +429,7 @@ static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status __devini | |||
429 | * initialize the chips on M-Audio cards | 429 | * initialize the chips on M-Audio cards |
430 | */ | 430 | */ |
431 | 431 | ||
432 | static struct snd_akm4xxx akm_audiophile __devinitdata = { | 432 | static const struct snd_akm4xxx akm_audiophile __devinitdata = { |
433 | .type = SND_AK4528, | 433 | .type = SND_AK4528, |
434 | .num_adcs = 2, | 434 | .num_adcs = 2, |
435 | .num_dacs = 2, | 435 | .num_dacs = 2, |
@@ -438,7 +438,7 @@ static struct snd_akm4xxx akm_audiophile __devinitdata = { | |||
438 | } | 438 | } |
439 | }; | 439 | }; |
440 | 440 | ||
441 | static struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = { | 441 | static const struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = { |
442 | .caddr = 2, | 442 | .caddr = 2, |
443 | .cif = 0, | 443 | .cif = 0, |
444 | .data_mask = ICE1712_DELTA_AP_DOUT, | 444 | .data_mask = ICE1712_DELTA_AP_DOUT, |
@@ -450,7 +450,7 @@ static struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = { | |||
450 | .mask_flags = 0, | 450 | .mask_flags = 0, |
451 | }; | 451 | }; |
452 | 452 | ||
453 | static struct snd_akm4xxx akm_delta410 __devinitdata = { | 453 | static const struct snd_akm4xxx akm_delta410 __devinitdata = { |
454 | .type = SND_AK4529, | 454 | .type = SND_AK4529, |
455 | .num_adcs = 2, | 455 | .num_adcs = 2, |
456 | .num_dacs = 8, | 456 | .num_dacs = 8, |
@@ -459,7 +459,7 @@ static struct snd_akm4xxx akm_delta410 __devinitdata = { | |||
459 | } | 459 | } |
460 | }; | 460 | }; |
461 | 461 | ||
462 | static struct snd_ak4xxx_private akm_delta410_priv __devinitdata = { | 462 | static const struct snd_ak4xxx_private akm_delta410_priv __devinitdata = { |
463 | .caddr = 0, | 463 | .caddr = 0, |
464 | .cif = 0, | 464 | .cif = 0, |
465 | .data_mask = ICE1712_DELTA_AP_DOUT, | 465 | .data_mask = ICE1712_DELTA_AP_DOUT, |
@@ -471,7 +471,7 @@ static struct snd_ak4xxx_private akm_delta410_priv __devinitdata = { | |||
471 | .mask_flags = 0, | 471 | .mask_flags = 0, |
472 | }; | 472 | }; |
473 | 473 | ||
474 | static struct snd_akm4xxx akm_delta1010lt __devinitdata = { | 474 | static const struct snd_akm4xxx akm_delta1010lt __devinitdata = { |
475 | .type = SND_AK4524, | 475 | .type = SND_AK4524, |
476 | .num_adcs = 8, | 476 | .num_adcs = 8, |
477 | .num_dacs = 8, | 477 | .num_dacs = 8, |
@@ -481,7 +481,7 @@ static struct snd_akm4xxx akm_delta1010lt __devinitdata = { | |||
481 | } | 481 | } |
482 | }; | 482 | }; |
483 | 483 | ||
484 | static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = { | 484 | static const struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = { |
485 | .caddr = 2, | 485 | .caddr = 2, |
486 | .cif = 0, /* the default level of the CIF pin from AK4524 */ | 486 | .cif = 0, /* the default level of the CIF pin from AK4524 */ |
487 | .data_mask = ICE1712_DELTA_1010LT_DOUT, | 487 | .data_mask = ICE1712_DELTA_1010LT_DOUT, |
@@ -493,7 +493,7 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = { | |||
493 | .mask_flags = 0, | 493 | .mask_flags = 0, |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static struct snd_akm4xxx akm_delta44 __devinitdata = { | 496 | static const struct snd_akm4xxx akm_delta44 __devinitdata = { |
497 | .type = SND_AK4524, | 497 | .type = SND_AK4524, |
498 | .num_adcs = 4, | 498 | .num_adcs = 4, |
499 | .num_dacs = 4, | 499 | .num_dacs = 4, |
@@ -503,7 +503,7 @@ static struct snd_akm4xxx akm_delta44 __devinitdata = { | |||
503 | } | 503 | } |
504 | }; | 504 | }; |
505 | 505 | ||
506 | static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = { | 506 | static const struct snd_ak4xxx_private akm_delta44_priv __devinitdata = { |
507 | .caddr = 2, | 507 | .caddr = 2, |
508 | .cif = 0, /* the default level of the CIF pin from AK4524 */ | 508 | .cif = 0, /* the default level of the CIF pin from AK4524 */ |
509 | .data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA, | 509 | .data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA, |
@@ -515,7 +515,7 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = { | |||
515 | .mask_flags = 0, | 515 | .mask_flags = 0, |
516 | }; | 516 | }; |
517 | 517 | ||
518 | static struct snd_akm4xxx akm_vx442 __devinitdata = { | 518 | static const struct snd_akm4xxx akm_vx442 __devinitdata = { |
519 | .type = SND_AK4524, | 519 | .type = SND_AK4524, |
520 | .num_adcs = 4, | 520 | .num_adcs = 4, |
521 | .num_dacs = 4, | 521 | .num_dacs = 4, |
@@ -525,7 +525,7 @@ static struct snd_akm4xxx akm_vx442 __devinitdata = { | |||
525 | } | 525 | } |
526 | }; | 526 | }; |
527 | 527 | ||
528 | static struct snd_ak4xxx_private akm_vx442_priv __devinitdata = { | 528 | static const struct snd_ak4xxx_private akm_vx442_priv __devinitdata = { |
529 | .caddr = 2, | 529 | .caddr = 2, |
530 | .cif = 0, | 530 | .cif = 0, |
531 | .data_mask = ICE1712_VX442_DOUT, | 531 | .data_mask = ICE1712_VX442_DOUT, |
@@ -650,15 +650,15 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice) | |||
650 | * additional controls for M-Audio cards | 650 | * additional controls for M-Audio cards |
651 | */ | 651 | */ |
652 | 652 | ||
653 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = | 653 | static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = |
654 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); | 654 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); |
655 | static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = | 655 | static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = |
656 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 0, 0); | 656 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 0, 0); |
657 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = | 657 | static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = |
658 | 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); | 658 | 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); |
659 | static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata = | 659 | static const struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata = |
660 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); | 660 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); |
661 | static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status __devinitdata = | 661 | static const struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status __devinitdata = |
662 | 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); | 662 | 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); |
663 | 663 | ||
664 | 664 | ||
@@ -735,7 +735,7 @@ static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice) | |||
735 | 735 | ||
736 | 736 | ||
737 | /* entry point */ | 737 | /* entry point */ |
738 | struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = { | 738 | const struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = { |
739 | { | 739 | { |
740 | .subvendor = ICE1712_SUBDEVICE_DELTA1010, | 740 | .subvendor = ICE1712_SUBDEVICE_DELTA1010, |
741 | .name = "M Audio Delta 1010", | 741 | .name = "M Audio Delta 1010", |
diff --git a/sound/pci/ice1712/delta.h b/sound/pci/ice1712/delta.h index 746ebde94522..e65d669af639 100644 --- a/sound/pci/ice1712/delta.h +++ b/sound/pci/ice1712/delta.h | |||
@@ -46,7 +46,7 @@ | |||
46 | #define ICE1712_SUBDEVICE_MEDIASTATION 0x694c0100 | 46 | #define ICE1712_SUBDEVICE_MEDIASTATION 0x694c0100 |
47 | 47 | ||
48 | /* entry point */ | 48 | /* entry point */ |
49 | extern struct snd_ice1712_card_info snd_ice1712_delta_cards[]; | 49 | extern const struct snd_ice1712_card_info snd_ice1712_delta_cards[]; |
50 | 50 | ||
51 | 51 | ||
52 | /* | 52 | /* |
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index b135389fec6c..9b7ff302c072 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c | |||
@@ -332,7 +332,7 @@ static void ews88_setup_spdif(struct snd_ice1712 *ice, int rate) | |||
332 | 332 | ||
333 | /* | 333 | /* |
334 | */ | 334 | */ |
335 | static struct snd_akm4xxx akm_ews88mt __devinitdata = { | 335 | static const struct snd_akm4xxx akm_ews88mt __devinitdata = { |
336 | .num_adcs = 8, | 336 | .num_adcs = 8, |
337 | .num_dacs = 8, | 337 | .num_dacs = 8, |
338 | .type = SND_AK4524, | 338 | .type = SND_AK4524, |
@@ -342,7 +342,7 @@ static struct snd_akm4xxx akm_ews88mt __devinitdata = { | |||
342 | } | 342 | } |
343 | }; | 343 | }; |
344 | 344 | ||
345 | static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = { | 345 | static const struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = { |
346 | .caddr = 2, | 346 | .caddr = 2, |
347 | .cif = 1, /* CIF high */ | 347 | .cif = 1, /* CIF high */ |
348 | .data_mask = ICE1712_EWS88_SERIAL_DATA, | 348 | .data_mask = ICE1712_EWS88_SERIAL_DATA, |
@@ -354,7 +354,7 @@ static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = { | |||
354 | .mask_flags = 0, | 354 | .mask_flags = 0, |
355 | }; | 355 | }; |
356 | 356 | ||
357 | static struct snd_akm4xxx akm_ewx2496 __devinitdata = { | 357 | static const struct snd_akm4xxx akm_ewx2496 __devinitdata = { |
358 | .num_adcs = 2, | 358 | .num_adcs = 2, |
359 | .num_dacs = 2, | 359 | .num_dacs = 2, |
360 | .type = SND_AK4524, | 360 | .type = SND_AK4524, |
@@ -363,7 +363,7 @@ static struct snd_akm4xxx akm_ewx2496 __devinitdata = { | |||
363 | } | 363 | } |
364 | }; | 364 | }; |
365 | 365 | ||
366 | static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = { | 366 | static const struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = { |
367 | .caddr = 2, | 367 | .caddr = 2, |
368 | .cif = 1, /* CIF high */ | 368 | .cif = 1, /* CIF high */ |
369 | .data_mask = ICE1712_EWS88_SERIAL_DATA, | 369 | .data_mask = ICE1712_EWS88_SERIAL_DATA, |
@@ -375,7 +375,7 @@ static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = { | |||
375 | .mask_flags = 0, | 375 | .mask_flags = 0, |
376 | }; | 376 | }; |
377 | 377 | ||
378 | static struct snd_akm4xxx akm_6fire __devinitdata = { | 378 | static const struct snd_akm4xxx akm_6fire __devinitdata = { |
379 | .num_adcs = 6, | 379 | .num_adcs = 6, |
380 | .num_dacs = 6, | 380 | .num_dacs = 6, |
381 | .type = SND_AK4524, | 381 | .type = SND_AK4524, |
@@ -384,7 +384,7 @@ static struct snd_akm4xxx akm_6fire __devinitdata = { | |||
384 | } | 384 | } |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static struct snd_ak4xxx_private akm_6fire_priv __devinitdata = { | 387 | static const struct snd_ak4xxx_private akm_6fire_priv __devinitdata = { |
388 | .caddr = 2, | 388 | .caddr = 2, |
389 | .cif = 1, /* CIF high */ | 389 | .cif = 1, /* CIF high */ |
390 | .data_mask = ICE1712_6FIRE_SERIAL_DATA, | 390 | .data_mask = ICE1712_6FIRE_SERIAL_DATA, |
@@ -578,7 +578,7 @@ static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct sn | |||
578 | return val != nval; | 578 | return val != nval; |
579 | } | 579 | } |
580 | 580 | ||
581 | static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] __devinitdata = { | 581 | static const struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] __devinitdata = { |
582 | { | 582 | { |
583 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 583 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
584 | .name = "Input Sensitivity Switch", | 584 | .name = "Input Sensitivity Switch", |
@@ -678,7 +678,7 @@ static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, st | |||
678 | return ndata != data; | 678 | return ndata != data; |
679 | } | 679 | } |
680 | 680 | ||
681 | static struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = { | 681 | static const struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = { |
682 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 682 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
683 | .name = "Input Sensitivity Switch", | 683 | .name = "Input Sensitivity Switch", |
684 | .info = snd_ice1712_ewx_io_sense_info, | 684 | .info = snd_ice1712_ewx_io_sense_info, |
@@ -687,7 +687,7 @@ static struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = { | |||
687 | .count = 8, | 687 | .count = 8, |
688 | }; | 688 | }; |
689 | 689 | ||
690 | static struct snd_kcontrol_new snd_ice1712_ews88mt_output_sense __devinitdata = { | 690 | static const struct snd_kcontrol_new snd_ice1712_ews88mt_output_sense __devinitdata = { |
691 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 691 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
692 | .name = "Output Sensitivity Switch", | 692 | .name = "Output Sensitivity Switch", |
693 | .info = snd_ice1712_ewx_io_sense_info, | 693 | .info = snd_ice1712_ewx_io_sense_info, |
@@ -769,7 +769,7 @@ static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct | |||
769 | .private_value = xshift | (xinvert << 8),\ | 769 | .private_value = xshift | (xinvert << 8),\ |
770 | } | 770 | } |
771 | 771 | ||
772 | static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] __devinitdata = { | 772 | static const struct snd_kcontrol_new snd_ice1712_ews88d_controls[] __devinitdata = { |
773 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ | 773 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ |
774 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), | 774 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), |
775 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), | 775 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), |
@@ -909,7 +909,7 @@ static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, str | |||
909 | .private_value = xshift | (xinvert << 8),\ | 909 | .private_value = xshift | (xinvert << 8),\ |
910 | } | 910 | } |
911 | 911 | ||
912 | static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = { | 912 | static const struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = { |
913 | { | 913 | { |
914 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 914 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
915 | .name = "Analog Input Select", | 915 | .name = "Analog Input Select", |
@@ -989,7 +989,7 @@ static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice) | |||
989 | 989 | ||
990 | 990 | ||
991 | /* entry point */ | 991 | /* entry point */ |
992 | struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = { | 992 | const struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = { |
993 | { | 993 | { |
994 | .subvendor = ICE1712_SUBDEVICE_EWX2496, | 994 | .subvendor = ICE1712_SUBDEVICE_EWX2496, |
995 | .name = "TerraTec EWX24/96", | 995 | .name = "TerraTec EWX24/96", |
diff --git a/sound/pci/ice1712/ews.h b/sound/pci/ice1712/ews.h index a12a0b053558..df449b4741f6 100644 --- a/sound/pci/ice1712/ews.h +++ b/sound/pci/ice1712/ews.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #define ICE1712_SUBDEVICE_PHASE88 0x3b155111 | 40 | #define ICE1712_SUBDEVICE_PHASE88 0x3b155111 |
41 | 41 | ||
42 | /* entry point */ | 42 | /* entry point */ |
43 | extern struct snd_ice1712_card_info snd_ice1712_ews_cards[]; | 43 | extern const struct snd_ice1712_card_info snd_ice1712_ews_cards[]; |
44 | 44 | ||
45 | 45 | ||
46 | /* TerraTec EWX 24/96 configuration definitions */ | 46 | /* TerraTec EWX 24/96 configuration definitions */ |
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c index 3f27d04e7d3c..df97313aaf83 100644 --- a/sound/pci/ice1712/hoontech.c +++ b/sound/pci/ice1712/hoontech.c | |||
@@ -239,7 +239,7 @@ static void stdsp24_ak4524_lock(struct snd_akm4xxx *ak, int chip) | |||
239 | static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice) | 239 | static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice) |
240 | { | 240 | { |
241 | /* Hoontech STDSP24 with modified hardware */ | 241 | /* Hoontech STDSP24 with modified hardware */ |
242 | static struct snd_akm4xxx akm_stdsp24_mv __devinitdata = { | 242 | static const struct snd_akm4xxx akm_stdsp24_mv __devinitdata = { |
243 | .num_adcs = 2, | 243 | .num_adcs = 2, |
244 | .num_dacs = 2, | 244 | .num_dacs = 2, |
245 | .type = SND_AK4524, | 245 | .type = SND_AK4524, |
@@ -248,7 +248,7 @@ static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice) | |||
248 | } | 248 | } |
249 | }; | 249 | }; |
250 | 250 | ||
251 | static struct snd_ak4xxx_private akm_stdsp24_mv_priv __devinitdata = { | 251 | static const struct snd_ak4xxx_private akm_stdsp24_mv_priv __devinitdata = { |
252 | .caddr = 2, | 252 | .caddr = 2, |
253 | .cif = 1, /* CIF high */ | 253 | .cif = 1, /* CIF high */ |
254 | .data_mask = ICE1712_STDSP24_SERIAL_DATA, | 254 | .data_mask = ICE1712_STDSP24_SERIAL_DATA, |
@@ -298,7 +298,7 @@ static int __devinit snd_ice1712_ez8_init(struct snd_ice1712 *ice) | |||
298 | 298 | ||
299 | 299 | ||
300 | /* entry point */ | 300 | /* entry point */ |
301 | struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = { | 301 | const struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = { |
302 | { | 302 | { |
303 | .subvendor = ICE1712_SUBDEVICE_STDSP24, | 303 | .subvendor = ICE1712_SUBDEVICE_STDSP24, |
304 | .name = "Hoontech SoundTrack Audio DSP24", | 304 | .name = "Hoontech SoundTrack Audio DSP24", |
@@ -325,4 +325,3 @@ struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = { | |||
325 | }, | 325 | }, |
326 | { } /* terminator */ | 326 | { } /* terminator */ |
327 | }; | 327 | }; |
328 | |||
diff --git a/sound/pci/ice1712/hoontech.h b/sound/pci/ice1712/hoontech.h index 1ee538b20fbf..b62d6e4f6c71 100644 --- a/sound/pci/ice1712/hoontech.h +++ b/sound/pci/ice1712/hoontech.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217 /* Hoontech ST Audio DSP24 Media 7.1 */ | 35 | #define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217 /* Hoontech ST Audio DSP24 Media 7.1 */ |
36 | #define ICE1712_SUBDEVICE_EVENT_EZ8 0x00010001 /* A dummy id for EZ8 */ | 36 | #define ICE1712_SUBDEVICE_EVENT_EZ8 0x00010001 /* A dummy id for EZ8 */ |
37 | 37 | ||
38 | extern struct snd_ice1712_card_info snd_ice1712_hoontech_cards[]; | 38 | extern const struct snd_ice1712_card_info snd_ice1712_hoontech_cards[]; |
39 | 39 | ||
40 | 40 | ||
41 | /* Hoontech SoundTrack Audio DSP 24 GPIO definitions */ | 41 | /* Hoontech SoundTrack Audio DSP 24 GPIO definitions */ |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 8ba31cfb9045..830a1bbd7110 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -107,7 +107,7 @@ module_param_array(dxr_enable, int, NULL, 0444); | |||
107 | MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); | 107 | MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); |
108 | 108 | ||
109 | 109 | ||
110 | static struct pci_device_id snd_ice1712_ids[] = { | 110 | static const struct pci_device_id snd_ice1712_ids[] = { |
111 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ | 111 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ |
112 | { 0, } | 112 | { 0, } |
113 | }; | 113 | }; |
@@ -287,7 +287,7 @@ static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, stru | |||
287 | return val != nval; | 287 | return val != nval; |
288 | } | 288 | } |
289 | 289 | ||
290 | static struct snd_kcontrol_new snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { | 290 | static const struct snd_kcontrol_new snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { |
291 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 291 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
292 | .name = "Digital Mixer To AC97", | 292 | .name = "Digital Mixer To AC97", |
293 | .info = snd_ice1712_digmix_route_ac97_info, | 293 | .info = snd_ice1712_digmix_route_ac97_info, |
@@ -719,7 +719,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *s | |||
719 | return bytes_to_frames(substream->runtime, ptr); | 719 | return bytes_to_frames(substream->runtime, ptr); |
720 | } | 720 | } |
721 | 721 | ||
722 | static struct snd_pcm_hardware snd_ice1712_playback = | 722 | static const struct snd_pcm_hardware snd_ice1712_playback = |
723 | { | 723 | { |
724 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 724 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
725 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 725 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -739,7 +739,7 @@ static struct snd_pcm_hardware snd_ice1712_playback = | |||
739 | .fifo_size = 0, | 739 | .fifo_size = 0, |
740 | }; | 740 | }; |
741 | 741 | ||
742 | static struct snd_pcm_hardware snd_ice1712_playback_ds = | 742 | static const struct snd_pcm_hardware snd_ice1712_playback_ds = |
743 | { | 743 | { |
744 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 744 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
745 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 745 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -759,7 +759,7 @@ static struct snd_pcm_hardware snd_ice1712_playback_ds = | |||
759 | .fifo_size = 0, | 759 | .fifo_size = 0, |
760 | }; | 760 | }; |
761 | 761 | ||
762 | static struct snd_pcm_hardware snd_ice1712_capture = | 762 | static const struct snd_pcm_hardware snd_ice1712_capture = |
763 | { | 763 | { |
764 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 764 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
765 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 765 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -1133,7 +1133,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substrea | |||
1133 | return bytes_to_frames(substream->runtime, ptr); | 1133 | return bytes_to_frames(substream->runtime, ptr); |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static struct snd_pcm_hardware snd_ice1712_playback_pro = | 1136 | static const struct snd_pcm_hardware snd_ice1712_playback_pro = |
1137 | { | 1137 | { |
1138 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1138 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1139 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 1139 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -1153,7 +1153,7 @@ static struct snd_pcm_hardware snd_ice1712_playback_pro = | |||
1153 | .fifo_size = 0, | 1153 | .fifo_size = 0, |
1154 | }; | 1154 | }; |
1155 | 1155 | ||
1156 | static struct snd_pcm_hardware snd_ice1712_capture_pro = | 1156 | static const struct snd_pcm_hardware snd_ice1712_capture_pro = |
1157 | { | 1157 | { |
1158 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1158 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1159 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 1159 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -1378,9 +1378,9 @@ static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struc | |||
1378 | return change; | 1378 | return change; |
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | static DECLARE_TLV_DB_SCALE(db_scale_playback, -14400, 150, 0); | 1381 | static const DECLARE_TLV_DB_SCALE(db_scale_playback, -14400, 150, 0); |
1382 | 1382 | ||
1383 | static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] __devinitdata = { | 1383 | static const struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] __devinitdata = { |
1384 | { | 1384 | { |
1385 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1385 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1386 | .name = "Multi Playback Switch", | 1386 | .name = "Multi Playback Switch", |
@@ -1404,7 +1404,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] __devinitdata | |||
1404 | }, | 1404 | }, |
1405 | }; | 1405 | }; |
1406 | 1406 | ||
1407 | static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinitdata = { | 1407 | static const struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinitdata = { |
1408 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1408 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1409 | .name = "H/W Multi Capture Switch", | 1409 | .name = "H/W Multi Capture Switch", |
1410 | .info = snd_ice1712_pro_mixer_switch_info, | 1410 | .info = snd_ice1712_pro_mixer_switch_info, |
@@ -1413,7 +1413,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinit | |||
1413 | .private_value = 10, | 1413 | .private_value = 10, |
1414 | }; | 1414 | }; |
1415 | 1415 | ||
1416 | static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitdata = { | 1416 | static const struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitdata = { |
1417 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1417 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1418 | .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH), | 1418 | .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH), |
1419 | .info = snd_ice1712_pro_mixer_switch_info, | 1419 | .info = snd_ice1712_pro_mixer_switch_info, |
@@ -1423,7 +1423,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitd | |||
1423 | .count = 2, | 1423 | .count = 2, |
1424 | }; | 1424 | }; |
1425 | 1425 | ||
1426 | static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinitdata = { | 1426 | static const struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinitdata = { |
1427 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1427 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1428 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | | 1428 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | |
1429 | SNDRV_CTL_ELEM_ACCESS_TLV_READ), | 1429 | SNDRV_CTL_ELEM_ACCESS_TLV_READ), |
@@ -1435,7 +1435,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinit | |||
1435 | .tlv = { .p = db_scale_playback } | 1435 | .tlv = { .p = db_scale_playback } |
1436 | }; | 1436 | }; |
1437 | 1437 | ||
1438 | static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume __devinitdata = { | 1438 | static const struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume __devinitdata = { |
1439 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1439 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1440 | .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME), | 1440 | .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME), |
1441 | .info = snd_ice1712_pro_mixer_volume_info, | 1441 | .info = snd_ice1712_pro_mixer_volume_info, |
@@ -1627,7 +1627,7 @@ static int snd_ice1712_eeprom_get(struct snd_kcontrol *kcontrol, | |||
1627 | return 0; | 1627 | return 0; |
1628 | } | 1628 | } |
1629 | 1629 | ||
1630 | static struct snd_kcontrol_new snd_ice1712_eeprom __devinitdata = { | 1630 | static const struct snd_kcontrol_new snd_ice1712_eeprom __devinitdata = { |
1631 | .iface = SNDRV_CTL_ELEM_IFACE_CARD, | 1631 | .iface = SNDRV_CTL_ELEM_IFACE_CARD, |
1632 | .name = "ICE1712 EEPROM", | 1632 | .name = "ICE1712 EEPROM", |
1633 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1633 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
@@ -1663,7 +1663,7 @@ static int snd_ice1712_spdif_default_put(struct snd_kcontrol *kcontrol, | |||
1663 | return 0; | 1663 | return 0; |
1664 | } | 1664 | } |
1665 | 1665 | ||
1666 | static struct snd_kcontrol_new snd_ice1712_spdif_default __devinitdata = | 1666 | static const struct snd_kcontrol_new snd_ice1712_spdif_default __devinitdata = |
1667 | { | 1667 | { |
1668 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1668 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1669 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 1669 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -1714,7 +1714,7 @@ static int snd_ice1712_spdif_maskp_get(struct snd_kcontrol *kcontrol, | |||
1714 | return 0; | 1714 | return 0; |
1715 | } | 1715 | } |
1716 | 1716 | ||
1717 | static struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata = | 1717 | static const struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata = |
1718 | { | 1718 | { |
1719 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1719 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1720 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1720 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1723,7 +1723,7 @@ static struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata = | |||
1723 | .get = snd_ice1712_spdif_maskc_get, | 1723 | .get = snd_ice1712_spdif_maskc_get, |
1724 | }; | 1724 | }; |
1725 | 1725 | ||
1726 | static struct snd_kcontrol_new snd_ice1712_spdif_maskp __devinitdata = | 1726 | static const struct snd_kcontrol_new snd_ice1712_spdif_maskp __devinitdata = |
1727 | { | 1727 | { |
1728 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1728 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1729 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1729 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1750,7 +1750,7 @@ static int snd_ice1712_spdif_stream_put(struct snd_kcontrol *kcontrol, | |||
1750 | return 0; | 1750 | return 0; |
1751 | } | 1751 | } |
1752 | 1752 | ||
1753 | static struct snd_kcontrol_new snd_ice1712_spdif_stream __devinitdata = | 1753 | static const struct snd_kcontrol_new snd_ice1712_spdif_stream __devinitdata = |
1754 | { | 1754 | { |
1755 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | | 1755 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | |
1756 | SNDRV_CTL_ELEM_ACCESS_INACTIVE), | 1756 | SNDRV_CTL_ELEM_ACCESS_INACTIVE), |
@@ -1811,7 +1811,7 @@ int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, | |||
1811 | static int snd_ice1712_pro_internal_clock_info(struct snd_kcontrol *kcontrol, | 1811 | static int snd_ice1712_pro_internal_clock_info(struct snd_kcontrol *kcontrol, |
1812 | struct snd_ctl_elem_info *uinfo) | 1812 | struct snd_ctl_elem_info *uinfo) |
1813 | { | 1813 | { |
1814 | static char *texts[] = { | 1814 | static const char * const texts[] = { |
1815 | "8000", /* 0: 6 */ | 1815 | "8000", /* 0: 6 */ |
1816 | "9600", /* 1: 3 */ | 1816 | "9600", /* 1: 3 */ |
1817 | "11025", /* 2: 10 */ | 1817 | "11025", /* 2: 10 */ |
@@ -1840,7 +1840,7 @@ static int snd_ice1712_pro_internal_clock_get(struct snd_kcontrol *kcontrol, | |||
1840 | struct snd_ctl_elem_value *ucontrol) | 1840 | struct snd_ctl_elem_value *ucontrol) |
1841 | { | 1841 | { |
1842 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 1842 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
1843 | static unsigned char xlate[16] = { | 1843 | static const unsigned char xlate[16] = { |
1844 | 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10 | 1844 | 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10 |
1845 | }; | 1845 | }; |
1846 | unsigned char val; | 1846 | unsigned char val; |
@@ -1864,7 +1864,7 @@ static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol, | |||
1864 | struct snd_ctl_elem_value *ucontrol) | 1864 | struct snd_ctl_elem_value *ucontrol) |
1865 | { | 1865 | { |
1866 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 1866 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
1867 | static unsigned int xrate[13] = { | 1867 | static const unsigned int xrate[13] = { |
1868 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, | 1868 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, |
1869 | 32000, 44100, 48000, 64000, 88200, 96000 | 1869 | 32000, 44100, 48000, 64000, 88200, 96000 |
1870 | }; | 1870 | }; |
@@ -1891,7 +1891,7 @@ static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol, | |||
1891 | return change; | 1891 | return change; |
1892 | } | 1892 | } |
1893 | 1893 | ||
1894 | static struct snd_kcontrol_new snd_ice1712_pro_internal_clock __devinitdata = { | 1894 | static const struct snd_kcontrol_new snd_ice1712_pro_internal_clock __devinitdata = { |
1895 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1895 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1896 | .name = "Multi Track Internal Clock", | 1896 | .name = "Multi Track Internal Clock", |
1897 | .info = snd_ice1712_pro_internal_clock_info, | 1897 | .info = snd_ice1712_pro_internal_clock_info, |
@@ -1902,7 +1902,7 @@ static struct snd_kcontrol_new snd_ice1712_pro_internal_clock __devinitdata = { | |||
1902 | static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcontrol, | 1902 | static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcontrol, |
1903 | struct snd_ctl_elem_info *uinfo) | 1903 | struct snd_ctl_elem_info *uinfo) |
1904 | { | 1904 | { |
1905 | static char *texts[] = { | 1905 | static const char * const texts[] = { |
1906 | "8000", /* 0: 6 */ | 1906 | "8000", /* 0: 6 */ |
1907 | "9600", /* 1: 3 */ | 1907 | "9600", /* 1: 3 */ |
1908 | "11025", /* 2: 10 */ | 1908 | "11025", /* 2: 10 */ |
@@ -1931,7 +1931,7 @@ static int snd_ice1712_pro_internal_clock_default_get(struct snd_kcontrol *kcont | |||
1931 | struct snd_ctl_elem_value *ucontrol) | 1931 | struct snd_ctl_elem_value *ucontrol) |
1932 | { | 1932 | { |
1933 | int val; | 1933 | int val; |
1934 | static unsigned int xrate[13] = { | 1934 | static const unsigned int xrate[13] = { |
1935 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, | 1935 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, |
1936 | 32000, 44100, 48000, 64000, 88200, 96000 | 1936 | 32000, 44100, 48000, 64000, 88200, 96000 |
1937 | }; | 1937 | }; |
@@ -1948,7 +1948,7 @@ static int snd_ice1712_pro_internal_clock_default_get(struct snd_kcontrol *kcont | |||
1948 | static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcontrol, | 1948 | static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcontrol, |
1949 | struct snd_ctl_elem_value *ucontrol) | 1949 | struct snd_ctl_elem_value *ucontrol) |
1950 | { | 1950 | { |
1951 | static unsigned int xrate[13] = { | 1951 | static const unsigned int xrate[13] = { |
1952 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, | 1952 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, |
1953 | 32000, 44100, 48000, 64000, 88200, 96000 | 1953 | 32000, 44100, 48000, 64000, 88200, 96000 |
1954 | }; | 1954 | }; |
@@ -1962,7 +1962,7 @@ static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcont | |||
1962 | return change; | 1962 | return change; |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | static struct snd_kcontrol_new snd_ice1712_pro_internal_clock_default __devinitdata = { | 1965 | static const struct snd_kcontrol_new snd_ice1712_pro_internal_clock_default __devinitdata = { |
1966 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1966 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1967 | .name = "Multi Track Internal Clock Default", | 1967 | .name = "Multi Track Internal Clock Default", |
1968 | .info = snd_ice1712_pro_internal_clock_default_info, | 1968 | .info = snd_ice1712_pro_internal_clock_default_info, |
@@ -2001,7 +2001,7 @@ static int snd_ice1712_pro_rate_locking_put(struct snd_kcontrol *kcontrol, | |||
2001 | return change; | 2001 | return change; |
2002 | } | 2002 | } |
2003 | 2003 | ||
2004 | static struct snd_kcontrol_new snd_ice1712_pro_rate_locking __devinitdata = { | 2004 | static const struct snd_kcontrol_new snd_ice1712_pro_rate_locking __devinitdata = { |
2005 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2005 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2006 | .name = "Multi Track Rate Locking", | 2006 | .name = "Multi Track Rate Locking", |
2007 | .info = snd_ice1712_pro_rate_locking_info, | 2007 | .info = snd_ice1712_pro_rate_locking_info, |
@@ -2040,7 +2040,7 @@ static int snd_ice1712_pro_rate_reset_put(struct snd_kcontrol *kcontrol, | |||
2040 | return change; | 2040 | return change; |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | static struct snd_kcontrol_new snd_ice1712_pro_rate_reset __devinitdata = { | 2043 | static const struct snd_kcontrol_new snd_ice1712_pro_rate_reset __devinitdata = { |
2044 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2044 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2045 | .name = "Multi Track Rate Reset", | 2045 | .name = "Multi Track Rate Reset", |
2046 | .info = snd_ice1712_pro_rate_reset_info, | 2046 | .info = snd_ice1712_pro_rate_reset_info, |
@@ -2054,7 +2054,7 @@ static struct snd_kcontrol_new snd_ice1712_pro_rate_reset __devinitdata = { | |||
2054 | static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol, | 2054 | static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol, |
2055 | struct snd_ctl_elem_info *uinfo) | 2055 | struct snd_ctl_elem_info *uinfo) |
2056 | { | 2056 | { |
2057 | static char *texts[] = { | 2057 | static const char * const texts[] = { |
2058 | "PCM Out", /* 0 */ | 2058 | "PCM Out", /* 0 */ |
2059 | "H/W In 0", "H/W In 1", "H/W In 2", "H/W In 3", /* 1-4 */ | 2059 | "H/W In 0", "H/W In 1", "H/W In 2", "H/W In 3", /* 1-4 */ |
2060 | "H/W In 4", "H/W In 5", "H/W In 6", "H/W In 7", /* 5-8 */ | 2060 | "H/W In 4", "H/W In 5", "H/W In 6", "H/W In 7", /* 5-8 */ |
@@ -2207,7 +2207,7 @@ static int snd_ice1712_pro_route_spdif_put(struct snd_kcontrol *kcontrol, | |||
2207 | return change; | 2207 | return change; |
2208 | } | 2208 | } |
2209 | 2209 | ||
2210 | static struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata = { | 2210 | static const struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata = { |
2211 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2211 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2212 | .name = "H/W Playback Route", | 2212 | .name = "H/W Playback Route", |
2213 | .info = snd_ice1712_pro_route_info, | 2213 | .info = snd_ice1712_pro_route_info, |
@@ -2215,7 +2215,7 @@ static struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata | |||
2215 | .put = snd_ice1712_pro_route_analog_put, | 2215 | .put = snd_ice1712_pro_route_analog_put, |
2216 | }; | 2216 | }; |
2217 | 2217 | ||
2218 | static struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route __devinitdata = { | 2218 | static const struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route __devinitdata = { |
2219 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2219 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2220 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", | 2220 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", |
2221 | .info = snd_ice1712_pro_route_info, | 2221 | .info = snd_ice1712_pro_route_info, |
@@ -2257,7 +2257,7 @@ static int snd_ice1712_pro_volume_rate_put(struct snd_kcontrol *kcontrol, | |||
2257 | return change; | 2257 | return change; |
2258 | } | 2258 | } |
2259 | 2259 | ||
2260 | static struct snd_kcontrol_new snd_ice1712_mixer_pro_volume_rate __devinitdata = { | 2260 | static const struct snd_kcontrol_new snd_ice1712_mixer_pro_volume_rate __devinitdata = { |
2261 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2261 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2262 | .name = "Multi Track Volume Rate", | 2262 | .name = "Multi Track Volume Rate", |
2263 | .info = snd_ice1712_pro_volume_rate_info, | 2263 | .info = snd_ice1712_pro_volume_rate_info, |
@@ -2290,7 +2290,7 @@ static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol, | |||
2290 | return 0; | 2290 | return 0; |
2291 | } | 2291 | } |
2292 | 2292 | ||
2293 | static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = { | 2293 | static const struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = { |
2294 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2294 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2295 | .name = "Multi Track Peak", | 2295 | .name = "Multi Track Peak", |
2296 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 2296 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
@@ -2305,7 +2305,7 @@ static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = { | |||
2305 | /* | 2305 | /* |
2306 | * list of available boards | 2306 | * list of available boards |
2307 | */ | 2307 | */ |
2308 | static struct snd_ice1712_card_info *card_tables[] __devinitdata = { | 2308 | static const struct snd_ice1712_card_info *card_tables[] __devinitdata = { |
2309 | snd_ice1712_hoontech_cards, | 2309 | snd_ice1712_hoontech_cards, |
2310 | snd_ice1712_delta_cards, | 2310 | snd_ice1712_delta_cards, |
2311 | snd_ice1712_ews_cards, | 2311 | snd_ice1712_ews_cards, |
@@ -2329,7 +2329,7 @@ static int __devinit snd_ice1712_read_eeprom(struct snd_ice1712 *ice, | |||
2329 | { | 2329 | { |
2330 | int dev = 0xa0; /* EEPROM device address */ | 2330 | int dev = 0xa0; /* EEPROM device address */ |
2331 | unsigned int i, size; | 2331 | unsigned int i, size; |
2332 | struct snd_ice1712_card_info **tbl, *c; | 2332 | const struct snd_ice1712_card_info **tbl, *c; |
2333 | 2333 | ||
2334 | if (! modelname || ! *modelname) { | 2334 | if (! modelname || ! *modelname) { |
2335 | ice->eeprom.subvendor = 0; | 2335 | ice->eeprom.subvendor = 0; |
@@ -2658,7 +2658,7 @@ static int __devinit snd_ice1712_create(struct snd_card *card, | |||
2658 | * | 2658 | * |
2659 | */ | 2659 | */ |
2660 | 2660 | ||
2661 | static struct snd_ice1712_card_info no_matched __devinitdata; | 2661 | static const struct snd_ice1712_card_info no_matched __devinitdata; |
2662 | 2662 | ||
2663 | static int __devinit snd_ice1712_probe(struct pci_dev *pci, | 2663 | static int __devinit snd_ice1712_probe(struct pci_dev *pci, |
2664 | const struct pci_device_id *pci_id) | 2664 | const struct pci_device_id *pci_id) |
@@ -2667,7 +2667,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, | |||
2667 | struct snd_card *card; | 2667 | struct snd_card *card; |
2668 | struct snd_ice1712 *ice; | 2668 | struct snd_ice1712 *ice; |
2669 | int pcm_dev = 0, err; | 2669 | int pcm_dev = 0, err; |
2670 | struct snd_ice1712_card_info **tbl, *c; | 2670 | const struct snd_ice1712_card_info **tbl, *c; |
2671 | 2671 | ||
2672 | if (dev >= SNDRV_CARDS) | 2672 | if (dev >= SNDRV_CARDS) |
2673 | return -ENODEV; | 2673 | return -ENODEV; |
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h index ce27eac40d4e..c3d9feaaf57d 100644 --- a/sound/pci/ice1712/ice1712.h +++ b/sound/pci/ice1712/ice1712.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <sound/i2c.h> | 28 | #include <sound/i2c.h> |
29 | #include <sound/ak4xxx-adda.h> | 29 | #include <sound/ak4xxx-adda.h> |
30 | #include <sound/ak4114.h> | 30 | #include <sound/ak4114.h> |
31 | #include <sound/pt2258.h> | ||
31 | #include <sound/pcm.h> | 32 | #include <sound/pcm.h> |
32 | #include <sound/mpu401.h> | 33 | #include <sound/mpu401.h> |
33 | 34 | ||
@@ -381,6 +382,11 @@ struct snd_ice1712 { | |||
381 | unsigned short master[2]; | 382 | unsigned short master[2]; |
382 | unsigned short vol[8]; | 383 | unsigned short vol[8]; |
383 | } phase28; | 384 | } phase28; |
385 | /* a non-standard I2C device for revo51 */ | ||
386 | struct revo51_spec { | ||
387 | struct snd_i2c_device *dev; | ||
388 | struct snd_pt2258 *pt2258; | ||
389 | } revo51; | ||
384 | /* Hoontech-specific setting */ | 390 | /* Hoontech-specific setting */ |
385 | struct hoontech_spec { | 391 | struct hoontech_spec { |
386 | unsigned char boxbits[4]; | 392 | unsigned char boxbits[4]; |
@@ -462,6 +468,14 @@ static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice, | |||
462 | snd_ice1712_gpio_write(ice, mask & bits); | 468 | snd_ice1712_gpio_write(ice, mask & bits); |
463 | } | 469 | } |
464 | 470 | ||
471 | static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice, | ||
472 | unsigned int mask) | ||
473 | { | ||
474 | ice->gpio.direction &= ~mask; | ||
475 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); | ||
476 | return (snd_ice1712_gpio_read(ice) & mask); | ||
477 | } | ||
478 | |||
465 | int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice); | 479 | int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice); |
466 | 480 | ||
467 | int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template, | 481 | int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template, |
@@ -500,8 +514,8 @@ struct snd_ice1712_card_info { | |||
500 | unsigned int mpu401_2_info_flags; | 514 | unsigned int mpu401_2_info_flags; |
501 | const char *mpu401_1_name; | 515 | const char *mpu401_1_name; |
502 | const char *mpu401_2_name; | 516 | const char *mpu401_2_name; |
503 | unsigned int eeprom_size; | 517 | const unsigned int eeprom_size; |
504 | unsigned char *eeprom_data; | 518 | const unsigned char *eeprom_data; |
505 | }; | 519 | }; |
506 | 520 | ||
507 | 521 | ||
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 3e3a102e6c34..1127ebdf5fec 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include "prodigy192.h" | 50 | #include "prodigy192.h" |
51 | #include "juli.h" | 51 | #include "juli.h" |
52 | #include "phase.h" | 52 | #include "phase.h" |
53 | 53 | #include "wtm.h" | |
54 | 54 | ||
55 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); | 55 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); |
56 | MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)"); | 56 | MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)"); |
@@ -64,6 +64,7 @@ MODULE_SUPPORTED_DEVICE("{" | |||
64 | PRODIGY192_DEVICE_DESC | 64 | PRODIGY192_DEVICE_DESC |
65 | JULI_DEVICE_DESC | 65 | JULI_DEVICE_DESC |
66 | PHASE_DEVICE_DESC | 66 | PHASE_DEVICE_DESC |
67 | WTM_DEVICE_DESC | ||
67 | "{VIA,VT1720}," | 68 | "{VIA,VT1720}," |
68 | "{VIA,VT1724}," | 69 | "{VIA,VT1724}," |
69 | "{ICEnsemble,Generic ICE1724}," | 70 | "{ICEnsemble,Generic ICE1724}," |
@@ -86,7 +87,7 @@ MODULE_PARM_DESC(model, "Use the given board model."); | |||
86 | 87 | ||
87 | 88 | ||
88 | /* Both VT1720 and VT1724 have the same PCI IDs */ | 89 | /* Both VT1720 and VT1724 have the same PCI IDs */ |
89 | static struct pci_device_id snd_vt1724_ids[] = { | 90 | static const struct pci_device_id snd_vt1724_ids[] = { |
90 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 91 | { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
91 | { 0, } | 92 | { 0, } |
92 | }; | 93 | }; |
@@ -341,7 +342,7 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
341 | 342 | ||
342 | what = 0; | 343 | what = 0; |
343 | snd_pcm_group_for_each(pos, substream) { | 344 | snd_pcm_group_for_each(pos, substream) { |
344 | struct vt1724_pcm_reg *reg; | 345 | const struct vt1724_pcm_reg *reg; |
345 | s = snd_pcm_group_substream_entry(pos); | 346 | s = snd_pcm_group_substream_entry(pos); |
346 | reg = s->runtime->private_data; | 347 | reg = s->runtime->private_data; |
347 | what |= reg->start; | 348 | what |= reg->start; |
@@ -605,7 +606,7 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea | |||
605 | static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) | 606 | static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) |
606 | { | 607 | { |
607 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 608 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
608 | struct vt1724_pcm_reg *reg = substream->runtime->private_data; | 609 | const struct vt1724_pcm_reg *reg = substream->runtime->private_data; |
609 | 610 | ||
610 | spin_lock_irq(&ice->reg_lock); | 611 | spin_lock_irq(&ice->reg_lock); |
611 | outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); | 612 | outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); |
@@ -620,7 +621,7 @@ static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) | |||
620 | static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substream) | 621 | static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substream) |
621 | { | 622 | { |
622 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 623 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
623 | struct vt1724_pcm_reg *reg = substream->runtime->private_data; | 624 | const struct vt1724_pcm_reg *reg = substream->runtime->private_data; |
624 | size_t ptr; | 625 | size_t ptr; |
625 | 626 | ||
626 | if (!(inl(ICEMT1724(ice, DMA_CONTROL)) & reg->start)) | 627 | if (!(inl(ICEMT1724(ice, DMA_CONTROL)) & reg->start)) |
@@ -646,21 +647,21 @@ static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substr | |||
646 | #endif | 647 | #endif |
647 | } | 648 | } |
648 | 649 | ||
649 | static struct vt1724_pcm_reg vt1724_playback_pro_reg = { | 650 | static const struct vt1724_pcm_reg vt1724_playback_pro_reg = { |
650 | .addr = VT1724_MT_PLAYBACK_ADDR, | 651 | .addr = VT1724_MT_PLAYBACK_ADDR, |
651 | .size = VT1724_MT_PLAYBACK_SIZE, | 652 | .size = VT1724_MT_PLAYBACK_SIZE, |
652 | .count = VT1724_MT_PLAYBACK_COUNT, | 653 | .count = VT1724_MT_PLAYBACK_COUNT, |
653 | .start = VT1724_PDMA0_START, | 654 | .start = VT1724_PDMA0_START, |
654 | }; | 655 | }; |
655 | 656 | ||
656 | static struct vt1724_pcm_reg vt1724_capture_pro_reg = { | 657 | static const struct vt1724_pcm_reg vt1724_capture_pro_reg = { |
657 | .addr = VT1724_MT_CAPTURE_ADDR, | 658 | .addr = VT1724_MT_CAPTURE_ADDR, |
658 | .size = VT1724_MT_CAPTURE_SIZE, | 659 | .size = VT1724_MT_CAPTURE_SIZE, |
659 | .count = VT1724_MT_CAPTURE_COUNT, | 660 | .count = VT1724_MT_CAPTURE_COUNT, |
660 | .start = VT1724_RDMA0_START, | 661 | .start = VT1724_RDMA0_START, |
661 | }; | 662 | }; |
662 | 663 | ||
663 | static struct snd_pcm_hardware snd_vt1724_playback_pro = | 664 | static const struct snd_pcm_hardware snd_vt1724_playback_pro = |
664 | { | 665 | { |
665 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 666 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
666 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 667 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -679,7 +680,7 @@ static struct snd_pcm_hardware snd_vt1724_playback_pro = | |||
679 | .periods_max = 1024, | 680 | .periods_max = 1024, |
680 | }; | 681 | }; |
681 | 682 | ||
682 | static struct snd_pcm_hardware snd_vt1724_spdif = | 683 | static const struct snd_pcm_hardware snd_vt1724_spdif = |
683 | { | 684 | { |
684 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 685 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
685 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 686 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -701,7 +702,7 @@ static struct snd_pcm_hardware snd_vt1724_spdif = | |||
701 | .periods_max = 1024, | 702 | .periods_max = 1024, |
702 | }; | 703 | }; |
703 | 704 | ||
704 | static struct snd_pcm_hardware snd_vt1724_2ch_stereo = | 705 | static const struct snd_pcm_hardware snd_vt1724_2ch_stereo = |
705 | { | 706 | { |
706 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 707 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
707 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 708 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -773,7 +774,7 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream) | |||
773 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 774 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
774 | int chs; | 775 | int chs; |
775 | 776 | ||
776 | runtime->private_data = &vt1724_playback_pro_reg; | 777 | runtime->private_data = (void *)&vt1724_playback_pro_reg; |
777 | ice->playback_pro_substream = substream; | 778 | ice->playback_pro_substream = substream; |
778 | runtime->hw = snd_vt1724_playback_pro; | 779 | runtime->hw = snd_vt1724_playback_pro; |
779 | snd_pcm_set_sync(substream); | 780 | snd_pcm_set_sync(substream); |
@@ -802,7 +803,7 @@ static int snd_vt1724_capture_pro_open(struct snd_pcm_substream *substream) | |||
802 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 803 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
803 | struct snd_pcm_runtime *runtime = substream->runtime; | 804 | struct snd_pcm_runtime *runtime = substream->runtime; |
804 | 805 | ||
805 | runtime->private_data = &vt1724_capture_pro_reg; | 806 | runtime->private_data = (void *)&vt1724_capture_pro_reg; |
806 | ice->capture_pro_substream = substream; | 807 | ice->capture_pro_substream = substream; |
807 | runtime->hw = snd_vt1724_2ch_stereo; | 808 | runtime->hw = snd_vt1724_2ch_stereo; |
808 | snd_pcm_set_sync(substream); | 809 | snd_pcm_set_sync(substream); |
@@ -888,14 +889,14 @@ static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 * ice, int device) | |||
888 | * SPDIF PCM | 889 | * SPDIF PCM |
889 | */ | 890 | */ |
890 | 891 | ||
891 | static struct vt1724_pcm_reg vt1724_playback_spdif_reg = { | 892 | static const struct vt1724_pcm_reg vt1724_playback_spdif_reg = { |
892 | .addr = VT1724_MT_PDMA4_ADDR, | 893 | .addr = VT1724_MT_PDMA4_ADDR, |
893 | .size = VT1724_MT_PDMA4_SIZE, | 894 | .size = VT1724_MT_PDMA4_SIZE, |
894 | .count = VT1724_MT_PDMA4_COUNT, | 895 | .count = VT1724_MT_PDMA4_COUNT, |
895 | .start = VT1724_PDMA4_START, | 896 | .start = VT1724_PDMA4_START, |
896 | }; | 897 | }; |
897 | 898 | ||
898 | static struct vt1724_pcm_reg vt1724_capture_spdif_reg = { | 899 | static const struct vt1724_pcm_reg vt1724_capture_spdif_reg = { |
899 | .addr = VT1724_MT_RDMA1_ADDR, | 900 | .addr = VT1724_MT_RDMA1_ADDR, |
900 | .size = VT1724_MT_RDMA1_SIZE, | 901 | .size = VT1724_MT_RDMA1_SIZE, |
901 | .count = VT1724_MT_RDMA1_COUNT, | 902 | .count = VT1724_MT_RDMA1_COUNT, |
@@ -953,7 +954,7 @@ static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream) | |||
953 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 954 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
954 | struct snd_pcm_runtime *runtime = substream->runtime; | 955 | struct snd_pcm_runtime *runtime = substream->runtime; |
955 | 956 | ||
956 | runtime->private_data = &vt1724_playback_spdif_reg; | 957 | runtime->private_data = (void *)&vt1724_playback_spdif_reg; |
957 | ice->playback_con_substream = substream; | 958 | ice->playback_con_substream = substream; |
958 | if (ice->force_pdma4) { | 959 | if (ice->force_pdma4) { |
959 | runtime->hw = snd_vt1724_2ch_stereo; | 960 | runtime->hw = snd_vt1724_2ch_stereo; |
@@ -985,7 +986,7 @@ static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream) | |||
985 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); | 986 | struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); |
986 | struct snd_pcm_runtime *runtime = substream->runtime; | 987 | struct snd_pcm_runtime *runtime = substream->runtime; |
987 | 988 | ||
988 | runtime->private_data = &vt1724_capture_spdif_reg; | 989 | runtime->private_data = (void *)&vt1724_capture_spdif_reg; |
989 | ice->capture_con_substream = substream; | 990 | ice->capture_con_substream = substream; |
990 | if (ice->force_rdma1) { | 991 | if (ice->force_rdma1) { |
991 | runtime->hw = snd_vt1724_2ch_stereo; | 992 | runtime->hw = snd_vt1724_2ch_stereo; |
@@ -1090,7 +1091,7 @@ static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 * ice, int device) | |||
1090 | * independent surround PCMs | 1091 | * independent surround PCMs |
1091 | */ | 1092 | */ |
1092 | 1093 | ||
1093 | static struct vt1724_pcm_reg vt1724_playback_dma_regs[3] = { | 1094 | static const struct vt1724_pcm_reg vt1724_playback_dma_regs[3] = { |
1094 | { | 1095 | { |
1095 | .addr = VT1724_MT_PDMA1_ADDR, | 1096 | .addr = VT1724_MT_PDMA1_ADDR, |
1096 | .size = VT1724_MT_PDMA1_SIZE, | 1097 | .size = VT1724_MT_PDMA1_SIZE, |
@@ -1136,7 +1137,7 @@ static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream) | |||
1136 | return -EBUSY; /* FIXME: should handle blocking mode properly */ | 1137 | return -EBUSY; /* FIXME: should handle blocking mode properly */ |
1137 | } | 1138 | } |
1138 | mutex_unlock(&ice->open_mutex); | 1139 | mutex_unlock(&ice->open_mutex); |
1139 | runtime->private_data = &vt1724_playback_dma_regs[substream->number]; | 1140 | runtime->private_data = (void *)&vt1724_playback_dma_regs[substream->number]; |
1140 | ice->playback_con_substream_ds[substream->number] = substream; | 1141 | ice->playback_con_substream_ds[substream->number] = substream; |
1141 | runtime->hw = snd_vt1724_2ch_stereo; | 1142 | runtime->hw = snd_vt1724_2ch_stereo; |
1142 | snd_pcm_set_sync(substream); | 1143 | snd_pcm_set_sync(substream); |
@@ -1317,7 +1318,7 @@ static int snd_vt1724_eeprom_get(struct snd_kcontrol *kcontrol, | |||
1317 | return 0; | 1318 | return 0; |
1318 | } | 1319 | } |
1319 | 1320 | ||
1320 | static struct snd_kcontrol_new snd_vt1724_eeprom __devinitdata = { | 1321 | static const struct snd_kcontrol_new snd_vt1724_eeprom __devinitdata = { |
1321 | .iface = SNDRV_CTL_ELEM_IFACE_CARD, | 1322 | .iface = SNDRV_CTL_ELEM_IFACE_CARD, |
1322 | .name = "ICE1724 EEPROM", | 1323 | .name = "ICE1724 EEPROM", |
1323 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1324 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
@@ -1430,7 +1431,7 @@ static int snd_vt1724_spdif_default_put(struct snd_kcontrol *kcontrol, | |||
1430 | return (val != old); | 1431 | return (val != old); |
1431 | } | 1432 | } |
1432 | 1433 | ||
1433 | static struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata = | 1434 | static const struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata = |
1434 | { | 1435 | { |
1435 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1436 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1436 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 1437 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -1462,7 +1463,7 @@ static int snd_vt1724_spdif_maskp_get(struct snd_kcontrol *kcontrol, | |||
1462 | return 0; | 1463 | return 0; |
1463 | } | 1464 | } |
1464 | 1465 | ||
1465 | static struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata = | 1466 | static const struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata = |
1466 | { | 1467 | { |
1467 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1468 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1468 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1469 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1471,7 +1472,7 @@ static struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata = | |||
1471 | .get = snd_vt1724_spdif_maskc_get, | 1472 | .get = snd_vt1724_spdif_maskc_get, |
1472 | }; | 1473 | }; |
1473 | 1474 | ||
1474 | static struct snd_kcontrol_new snd_vt1724_spdif_maskp __devinitdata = | 1475 | static const struct snd_kcontrol_new snd_vt1724_spdif_maskp __devinitdata = |
1475 | { | 1476 | { |
1476 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1477 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1477 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1478 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1516,7 +1517,7 @@ static int snd_vt1724_spdif_sw_put(struct snd_kcontrol *kcontrol, | |||
1516 | return old != val; | 1517 | return old != val; |
1517 | } | 1518 | } |
1518 | 1519 | ||
1519 | static struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata = | 1520 | static const struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata = |
1520 | { | 1521 | { |
1521 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1522 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1522 | /* FIXME: the following conflict with IEC958 Playback Route */ | 1523 | /* FIXME: the following conflict with IEC958 Playback Route */ |
@@ -1584,7 +1585,7 @@ int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, | |||
1584 | static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, | 1585 | static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, |
1585 | struct snd_ctl_elem_info *uinfo) | 1586 | struct snd_ctl_elem_info *uinfo) |
1586 | { | 1587 | { |
1587 | static char *texts_1724[] = { | 1588 | static const char * const texts_1724[] = { |
1588 | "8000", /* 0: 6 */ | 1589 | "8000", /* 0: 6 */ |
1589 | "9600", /* 1: 3 */ | 1590 | "9600", /* 1: 3 */ |
1590 | "11025", /* 2: 10 */ | 1591 | "11025", /* 2: 10 */ |
@@ -1602,7 +1603,7 @@ static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, | |||
1602 | "192000", /* 14: 14 */ | 1603 | "192000", /* 14: 14 */ |
1603 | "IEC958 Input", /* 15: -- */ | 1604 | "IEC958 Input", /* 15: -- */ |
1604 | }; | 1605 | }; |
1605 | static char *texts_1720[] = { | 1606 | static const char * const texts_1720[] = { |
1606 | "8000", /* 0: 6 */ | 1607 | "8000", /* 0: 6 */ |
1607 | "9600", /* 1: 3 */ | 1608 | "9600", /* 1: 3 */ |
1608 | "11025", /* 2: 10 */ | 1609 | "11025", /* 2: 10 */ |
@@ -1635,7 +1636,7 @@ static int snd_vt1724_pro_internal_clock_get(struct snd_kcontrol *kcontrol, | |||
1635 | struct snd_ctl_elem_value *ucontrol) | 1636 | struct snd_ctl_elem_value *ucontrol) |
1636 | { | 1637 | { |
1637 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 1638 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
1638 | static unsigned char xlate[16] = { | 1639 | static const unsigned char xlate[16] = { |
1639 | 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 13, 255, 14, 10 | 1640 | 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 13, 255, 14, 10 |
1640 | }; | 1641 | }; |
1641 | unsigned char val; | 1642 | unsigned char val; |
@@ -1694,7 +1695,7 @@ static int snd_vt1724_pro_internal_clock_put(struct snd_kcontrol *kcontrol, | |||
1694 | return change; | 1695 | return change; |
1695 | } | 1696 | } |
1696 | 1697 | ||
1697 | static struct snd_kcontrol_new snd_vt1724_pro_internal_clock __devinitdata = { | 1698 | static const struct snd_kcontrol_new snd_vt1724_pro_internal_clock __devinitdata = { |
1698 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1699 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1699 | .name = "Multi Track Internal Clock", | 1700 | .name = "Multi Track Internal Clock", |
1700 | .info = snd_vt1724_pro_internal_clock_info, | 1701 | .info = snd_vt1724_pro_internal_clock_info, |
@@ -1733,7 +1734,7 @@ static int snd_vt1724_pro_rate_locking_put(struct snd_kcontrol *kcontrol, | |||
1733 | return change; | 1734 | return change; |
1734 | } | 1735 | } |
1735 | 1736 | ||
1736 | static struct snd_kcontrol_new snd_vt1724_pro_rate_locking __devinitdata = { | 1737 | static const struct snd_kcontrol_new snd_vt1724_pro_rate_locking __devinitdata = { |
1737 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1738 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1738 | .name = "Multi Track Rate Locking", | 1739 | .name = "Multi Track Rate Locking", |
1739 | .info = snd_vt1724_pro_rate_locking_info, | 1740 | .info = snd_vt1724_pro_rate_locking_info, |
@@ -1772,7 +1773,7 @@ static int snd_vt1724_pro_rate_reset_put(struct snd_kcontrol *kcontrol, | |||
1772 | return change; | 1773 | return change; |
1773 | } | 1774 | } |
1774 | 1775 | ||
1775 | static struct snd_kcontrol_new snd_vt1724_pro_rate_reset __devinitdata = { | 1776 | static const struct snd_kcontrol_new snd_vt1724_pro_rate_reset __devinitdata = { |
1776 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1777 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1777 | .name = "Multi Track Rate Reset", | 1778 | .name = "Multi Track Rate Reset", |
1778 | .info = snd_vt1724_pro_rate_reset_info, | 1779 | .info = snd_vt1724_pro_rate_reset_info, |
@@ -1816,7 +1817,7 @@ static int get_route_val(struct snd_ice1712 *ice, int shift) | |||
1816 | { | 1817 | { |
1817 | unsigned long val; | 1818 | unsigned long val; |
1818 | unsigned char eitem; | 1819 | unsigned char eitem; |
1819 | static unsigned char xlate[8] = { | 1820 | static const unsigned char xlate[8] = { |
1820 | 0, 255, 1, 2, 255, 255, 3, 4, | 1821 | 0, 255, 1, 2, 255, 255, 3, 4, |
1821 | }; | 1822 | }; |
1822 | 1823 | ||
@@ -1835,7 +1836,7 @@ static int put_route_val(struct snd_ice1712 *ice, unsigned int val, int shift) | |||
1835 | { | 1836 | { |
1836 | unsigned int old_val, nval; | 1837 | unsigned int old_val, nval; |
1837 | int change; | 1838 | int change; |
1838 | static unsigned char xroute[8] = { | 1839 | static const unsigned char xroute[8] = { |
1839 | 0, /* PCM */ | 1840 | 0, /* PCM */ |
1840 | 2, /* PSDIN0 Left */ | 1841 | 2, /* PSDIN0 Left */ |
1841 | 3, /* PSDIN0 Right */ | 1842 | 3, /* PSDIN0 Right */ |
@@ -1891,7 +1892,7 @@ static int snd_vt1724_pro_route_spdif_put(struct snd_kcontrol *kcontrol, | |||
1891 | digital_route_shift(idx)); | 1892 | digital_route_shift(idx)); |
1892 | } | 1893 | } |
1893 | 1894 | ||
1894 | static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = { | 1895 | static const struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = { |
1895 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1896 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1896 | .name = "H/W Playback Route", | 1897 | .name = "H/W Playback Route", |
1897 | .info = snd_vt1724_pro_route_info, | 1898 | .info = snd_vt1724_pro_route_info, |
@@ -1899,7 +1900,7 @@ static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = | |||
1899 | .put = snd_vt1724_pro_route_analog_put, | 1900 | .put = snd_vt1724_pro_route_analog_put, |
1900 | }; | 1901 | }; |
1901 | 1902 | ||
1902 | static struct snd_kcontrol_new snd_vt1724_mixer_pro_spdif_route __devinitdata = { | 1903 | static const struct snd_kcontrol_new snd_vt1724_mixer_pro_spdif_route __devinitdata = { |
1903 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1904 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1904 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", | 1905 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", |
1905 | .info = snd_vt1724_pro_route_info, | 1906 | .info = snd_vt1724_pro_route_info, |
@@ -1935,7 +1936,7 @@ static int snd_vt1724_pro_peak_get(struct snd_kcontrol *kcontrol, | |||
1935 | return 0; | 1936 | return 0; |
1936 | } | 1937 | } |
1937 | 1938 | ||
1938 | static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { | 1939 | static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { |
1939 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1940 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1940 | .name = "Multi Track Peak", | 1941 | .name = "Multi Track Peak", |
1941 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 1942 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
@@ -1947,9 +1948,9 @@ static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { | |||
1947 | * | 1948 | * |
1948 | */ | 1949 | */ |
1949 | 1950 | ||
1950 | static struct snd_ice1712_card_info no_matched __devinitdata; | 1951 | static const struct snd_ice1712_card_info no_matched __devinitdata; |
1951 | 1952 | ||
1952 | static struct snd_ice1712_card_info *card_tables[] __devinitdata = { | 1953 | static const struct snd_ice1712_card_info *card_tables[] __devinitdata = { |
1953 | snd_vt1724_revo_cards, | 1954 | snd_vt1724_revo_cards, |
1954 | snd_vt1724_amp_cards, | 1955 | snd_vt1724_amp_cards, |
1955 | snd_vt1724_aureon_cards, | 1956 | snd_vt1724_aureon_cards, |
@@ -1958,6 +1959,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = { | |||
1958 | snd_vt1724_prodigy192_cards, | 1959 | snd_vt1724_prodigy192_cards, |
1959 | snd_vt1724_juli_cards, | 1960 | snd_vt1724_juli_cards, |
1960 | snd_vt1724_phase_cards, | 1961 | snd_vt1724_phase_cards, |
1962 | snd_vt1724_wtm_cards, | ||
1961 | NULL, | 1963 | NULL, |
1962 | }; | 1964 | }; |
1963 | 1965 | ||
@@ -2007,7 +2009,7 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice, | |||
2007 | { | 2009 | { |
2008 | const int dev = 0xa0; /* EEPROM device address */ | 2010 | const int dev = 0xa0; /* EEPROM device address */ |
2009 | unsigned int i, size; | 2011 | unsigned int i, size; |
2010 | struct snd_ice1712_card_info **tbl, *c; | 2012 | const struct snd_ice1712_card_info **tbl, *c; |
2011 | 2013 | ||
2012 | if (! modelname || ! *modelname) { | 2014 | if (! modelname || ! *modelname) { |
2013 | ice->eeprom.subvendor = 0; | 2015 | ice->eeprom.subvendor = 0; |
@@ -2306,7 +2308,7 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci, | |||
2306 | struct snd_card *card; | 2308 | struct snd_card *card; |
2307 | struct snd_ice1712 *ice; | 2309 | struct snd_ice1712 *ice; |
2308 | int pcm_dev = 0, err; | 2310 | int pcm_dev = 0, err; |
2309 | struct snd_ice1712_card_info **tbl, *c; | 2311 | const struct snd_ice1712_card_info **tbl, *c; |
2310 | 2312 | ||
2311 | if (dev >= SNDRV_CARDS) | 2313 | if (dev >= SNDRV_CARDS) |
2312 | return -ENODEV; | 2314 | return -ENODEV; |
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 5176b41ea9d3..d88172fa95da 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c | |||
@@ -125,7 +125,7 @@ static void juli_akm_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
125 | snd_akm4xxx_reset(ak, 0); | 125 | snd_akm4xxx_reset(ak, 0); |
126 | } | 126 | } |
127 | 127 | ||
128 | static struct snd_akm4xxx akm_juli_dac __devinitdata = { | 128 | static const struct snd_akm4xxx akm_juli_dac __devinitdata = { |
129 | .type = SND_AK4358, | 129 | .type = SND_AK4358, |
130 | .num_dacs = 2, | 130 | .num_dacs = 2, |
131 | .ops = { | 131 | .ops = { |
@@ -146,7 +146,7 @@ static int __devinit juli_add_controls(struct snd_ice1712 *ice) | |||
146 | */ | 146 | */ |
147 | static int __devinit juli_init(struct snd_ice1712 *ice) | 147 | static int __devinit juli_init(struct snd_ice1712 *ice) |
148 | { | 148 | { |
149 | static unsigned char ak4114_init_vals[] = { | 149 | static const unsigned char ak4114_init_vals[] = { |
150 | /* AK4117_REG_PWRDN */ AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1, | 150 | /* AK4117_REG_PWRDN */ AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1, |
151 | /* AK4114_REQ_FORMAT */ AK4114_DIF_I24I2S, | 151 | /* AK4114_REQ_FORMAT */ AK4114_DIF_I24I2S, |
152 | /* AK4114_REG_IO0 */ AK4114_TX1E, | 152 | /* AK4114_REG_IO0 */ AK4114_TX1E, |
@@ -154,7 +154,7 @@ static int __devinit juli_init(struct snd_ice1712 *ice) | |||
154 | /* AK4114_REG_INT0_MASK */ 0, | 154 | /* AK4114_REG_INT0_MASK */ 0, |
155 | /* AK4114_REG_INT1_MASK */ 0 | 155 | /* AK4114_REG_INT1_MASK */ 0 |
156 | }; | 156 | }; |
157 | static unsigned char ak4114_init_txcsb[] = { | 157 | static const unsigned char ak4114_init_txcsb[] = { |
158 | 0x41, 0x02, 0x2c, 0x00, 0x00 | 158 | 0x41, 0x02, 0x2c, 0x00, 0x00 |
159 | }; | 159 | }; |
160 | int err; | 160 | int err; |
@@ -206,24 +206,24 @@ static int __devinit juli_init(struct snd_ice1712 *ice) | |||
206 | * hence the driver needs to sets up it properly. | 206 | * hence the driver needs to sets up it properly. |
207 | */ | 207 | */ |
208 | 208 | ||
209 | static unsigned char juli_eeprom[] __devinitdata = { | 209 | static const unsigned char juli_eeprom[] __devinitdata = { |
210 | 0x20, /* SYSCONF: clock 512, mpu401, 1xADC, 1xDACs */ | 210 | [ICE_EEP2_SYSCONF] = 0x20, /* clock 512, mpu401, 1xADC, 1xDACs */ |
211 | 0x80, /* ACLINK: I2S */ | 211 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
212 | 0xf8, /* I2S: vol, 96k, 24bit, 192k */ | 212 | [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit, 192k */ |
213 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 213 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
214 | 0x9f, /* GPIO_DIR */ | 214 | [ICE_EEP2_GPIO_DIR] = 0x9f, |
215 | 0xff, /* GPIO_DIR1 */ | 215 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
216 | 0x7f, /* GPIO_DIR2 */ | 216 | [ICE_EEP2_GPIO_DIR2] = 0x7f, |
217 | 0x9f, /* GPIO_MASK */ | 217 | [ICE_EEP2_GPIO_MASK] = 0x9f, |
218 | 0xff, /* GPIO_MASK1 */ | 218 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
219 | 0x7f, /* GPIO_MASK2 */ | 219 | [ICE_EEP2_GPIO_MASK2] = 0x7f, |
220 | 0x16, /* GPIO_STATE: internal clock, multiple 1x, 48kHz */ | 220 | [ICE_EEP2_GPIO_STATE] = 0x16, /* internal clock, multiple 1x, 48kHz */ |
221 | 0x80, /* GPIO_STATE1: mute */ | 221 | [ICE_EEP2_GPIO_STATE1] = 0x80, /* mute */ |
222 | 0x00, /* GPIO_STATE2 */ | 222 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
223 | }; | 223 | }; |
224 | 224 | ||
225 | /* entry point */ | 225 | /* entry point */ |
226 | struct snd_ice1712_card_info snd_vt1724_juli_cards[] __devinitdata = { | 226 | const struct snd_ice1712_card_info snd_vt1724_juli_cards[] __devinitdata = { |
227 | { | 227 | { |
228 | .subvendor = VT1724_SUBDEVICE_JULI, | 228 | .subvendor = VT1724_SUBDEVICE_JULI, |
229 | .name = "ESI Juli@", | 229 | .name = "ESI Juli@", |
diff --git a/sound/pci/ice1712/juli.h b/sound/pci/ice1712/juli.h index d9f8534fd92e..1b9294f8bce3 100644 --- a/sound/pci/ice1712/juli.h +++ b/sound/pci/ice1712/juli.h | |||
@@ -5,6 +5,6 @@ | |||
5 | 5 | ||
6 | #define VT1724_SUBDEVICE_JULI 0x31305345 /* Juli@ */ | 6 | #define VT1724_SUBDEVICE_JULI 0x31305345 /* Juli@ */ |
7 | 7 | ||
8 | extern struct snd_ice1712_card_info snd_vt1724_juli_cards[]; | 8 | extern const struct snd_ice1712_card_info snd_vt1724_juli_cards[]; |
9 | 9 | ||
10 | #endif /* __SOUND_JULI_H */ | 10 | #endif /* __SOUND_JULI_H */ |
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index e08d73f4ff85..0751718f4d7b 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c | |||
@@ -71,7 +71,7 @@ | |||
71 | * Logarithmic volume values for WM8770 | 71 | * Logarithmic volume values for WM8770 |
72 | * Computed as 20 * Log10(255 / x) | 72 | * Computed as 20 * Log10(255 / x) |
73 | */ | 73 | */ |
74 | static unsigned char wm_vol[256] = { | 74 | static const unsigned char wm_vol[256] = { |
75 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, | 75 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, |
76 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, | 76 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, |
77 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, | 77 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, |
@@ -89,13 +89,13 @@ static unsigned char wm_vol[256] = { | |||
89 | #define WM_VOL_MAX (sizeof(wm_vol) - 1) | 89 | #define WM_VOL_MAX (sizeof(wm_vol) - 1) |
90 | #define WM_VOL_MUTE 0x8000 | 90 | #define WM_VOL_MUTE 0x8000 |
91 | 91 | ||
92 | static struct snd_akm4xxx akm_phase22 __devinitdata = { | 92 | static const struct snd_akm4xxx akm_phase22 __devinitdata = { |
93 | .type = SND_AK4524, | 93 | .type = SND_AK4524, |
94 | .num_dacs = 2, | 94 | .num_dacs = 2, |
95 | .num_adcs = 2, | 95 | .num_adcs = 2, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static struct snd_ak4xxx_private akm_phase22_priv __devinitdata = { | 98 | static const struct snd_ak4xxx_private akm_phase22_priv __devinitdata = { |
99 | .caddr = 2, | 99 | .caddr = 2, |
100 | .cif = 1, | 100 | .cif = 1, |
101 | .data_mask = 1 << 4, | 101 | .data_mask = 1 << 4, |
@@ -152,36 +152,36 @@ static int __devinit phase22_add_controls(struct snd_ice1712 *ice) | |||
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | static unsigned char phase22_eeprom[] __devinitdata = { | 155 | static const unsigned char phase22_eeprom[] __devinitdata = { |
156 | 0x00, /* SYSCONF: 1xADC, 1xDACs */ | 156 | [ICE_EEP2_SYSCONF] = 0x00, /* 1xADC, 1xDACs */ |
157 | 0x80, /* ACLINK: I2S */ | 157 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
158 | 0xf8, /* I2S: vol, 96k, 24bit*/ | 158 | [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit */ |
159 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 159 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
160 | 0xFF, /* GPIO_DIR */ | 160 | [ICE_EEP2_GPIO_DIR] = 0xff, |
161 | 0xFF, /* GPIO_DIR1 */ | 161 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
162 | 0xFF, /* GPIO_DIR2 */ | 162 | [ICE_EEP2_GPIO_DIR2] = 0xff, |
163 | 0x00, /* GPIO_MASK */ | 163 | [ICE_EEP2_GPIO_MASK] = 0x00, |
164 | 0x00, /* GPIO_MASK1 */ | 164 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
165 | 0x00, /* GPIO_MASK2 */ | 165 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
166 | 0x00, /* GPIO_STATE: */ | 166 | [ICE_EEP2_GPIO_STATE] = 0x00, |
167 | 0x00, /* GPIO_STATE1: */ | 167 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
168 | 0x00, /* GPIO_STATE2 */ | 168 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static unsigned char phase28_eeprom[] __devinitdata = { | 171 | static const unsigned char phase28_eeprom[] __devinitdata = { |
172 | 0x0b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ | 172 | [ICE_EEP2_SYSCONF] = 0x0b, /* clock 512, spdif-in/ADC, 4DACs */ |
173 | 0x80, /* ACLINK: I2S */ | 173 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
174 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | 174 | [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ |
175 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 175 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
176 | 0xff, /* GPIO_DIR */ | 176 | [ICE_EEP2_GPIO_DIR] = 0xff, |
177 | 0xff, /* GPIO_DIR1 */ | 177 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
178 | 0x5f, /* GPIO_DIR2 */ | 178 | [ICE_EEP2_GPIO_DIR2] = 0x5f, |
179 | 0x00, /* GPIO_MASK */ | 179 | [ICE_EEP2_GPIO_MASK] = 0x00, |
180 | 0x00, /* GPIO_MASK1 */ | 180 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
181 | 0x00, /* GPIO_MASK2 */ | 181 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
182 | 0x00, /* GPIO_STATE */ | 182 | [ICE_EEP2_GPIO_STATE] = 0x00, |
183 | 0x00, /* GPIO_STATE1 */ | 183 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
184 | 0x00, /* GPIO_STATE2 */ | 184 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
185 | }; | 185 | }; |
186 | 186 | ||
187 | /* | 187 | /* |
@@ -343,7 +343,7 @@ static int wm_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
343 | 343 | ||
344 | static int __devinit phase28_init(struct snd_ice1712 *ice) | 344 | static int __devinit phase28_init(struct snd_ice1712 *ice) |
345 | { | 345 | { |
346 | static unsigned short wm_inits_phase28[] = { | 346 | static const unsigned short wm_inits_phase28[] = { |
347 | /* These come first to reduce init pop noise */ | 347 | /* These come first to reduce init pop noise */ |
348 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ | 348 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ |
349 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ | 349 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ |
@@ -382,7 +382,7 @@ static int __devinit phase28_init(struct snd_ice1712 *ice) | |||
382 | 382 | ||
383 | unsigned int tmp; | 383 | unsigned int tmp; |
384 | struct snd_akm4xxx *ak; | 384 | struct snd_akm4xxx *ak; |
385 | unsigned short *p; | 385 | const unsigned short *p; |
386 | int i; | 386 | int i; |
387 | 387 | ||
388 | ice->num_total_dacs = 8; | 388 | ice->num_total_dacs = 8; |
@@ -697,10 +697,10 @@ static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ct | |||
697 | return 0; | 697 | return 0; |
698 | } | 698 | } |
699 | 699 | ||
700 | static DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); | 700 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); |
701 | static DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); | 701 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); |
702 | 702 | ||
703 | static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = { | 703 | static const struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = { |
704 | { | 704 | { |
705 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 705 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
706 | .name = "Master Playback Switch", | 706 | .name = "Master Playback Switch", |
@@ -815,7 +815,7 @@ static struct snd_kcontrol_new phase28_dac_controls[] __devinitdata = { | |||
815 | } | 815 | } |
816 | }; | 816 | }; |
817 | 817 | ||
818 | static struct snd_kcontrol_new wm_controls[] __devinitdata = { | 818 | static const struct snd_kcontrol_new wm_controls[] __devinitdata = { |
819 | { | 819 | { |
820 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 820 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
821 | .name = "PCM Playback Switch", | 821 | .name = "PCM Playback Switch", |
@@ -870,7 +870,7 @@ static int __devinit phase28_add_controls(struct snd_ice1712 *ice) | |||
870 | return 0; | 870 | return 0; |
871 | } | 871 | } |
872 | 872 | ||
873 | struct snd_ice1712_card_info snd_vt1724_phase_cards[] __devinitdata = { | 873 | const struct snd_ice1712_card_info snd_vt1724_phase_cards[] __devinitdata = { |
874 | { | 874 | { |
875 | .subvendor = VT1724_SUBDEVICE_PHASE22, | 875 | .subvendor = VT1724_SUBDEVICE_PHASE22, |
876 | .name = "Terratec PHASE 22", | 876 | .name = "Terratec PHASE 22", |
diff --git a/sound/pci/ice1712/phase.h b/sound/pci/ice1712/phase.h index 13e841b55488..ad379a99bf92 100644 --- a/sound/pci/ice1712/phase.h +++ b/sound/pci/ice1712/phase.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #define VT1724_SUBDEVICE_PHASE28 0x3b154911 | 31 | #define VT1724_SUBDEVICE_PHASE28 0x3b154911 |
32 | 32 | ||
33 | /* entry point */ | 33 | /* entry point */ |
34 | extern struct snd_ice1712_card_info snd_vt1724_phase_cards[]; | 34 | extern const struct snd_ice1712_card_info snd_vt1724_phase_cards[]; |
35 | 35 | ||
36 | /* PHASE28 GPIO bits */ | 36 | /* PHASE28 GPIO bits */ |
37 | #define PHASE28_SPI_MISO (1 << 21) | 37 | #define PHASE28_SPI_MISO (1 << 21) |
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 6c74c2d2e7f3..9552497f0765 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c | |||
@@ -434,7 +434,7 @@ static unsigned int spi_read(struct snd_ice1712 *ice, unsigned int dev, unsigned | |||
434 | */ | 434 | */ |
435 | static int cs_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 435 | static int cs_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
436 | { | 436 | { |
437 | static char *texts[] = { | 437 | static const char * const texts[] = { |
438 | "Coax", /* RXP0 */ | 438 | "Coax", /* RXP0 */ |
439 | "Optical", /* RXP1 */ | 439 | "Optical", /* RXP1 */ |
440 | "CD", /* RXP2 */ | 440 | "CD", /* RXP2 */ |
@@ -565,13 +565,13 @@ static int pontis_gpio_data_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
565 | return changed; | 565 | return changed; |
566 | } | 566 | } |
567 | 567 | ||
568 | static DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1); | 568 | static const DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1); |
569 | 569 | ||
570 | /* | 570 | /* |
571 | * mixers | 571 | * mixers |
572 | */ | 572 | */ |
573 | 573 | ||
574 | static struct snd_kcontrol_new pontis_controls[] __devinitdata = { | 574 | static const struct snd_kcontrol_new pontis_controls[] __devinitdata = { |
575 | { | 575 | { |
576 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 576 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
577 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | | 577 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | |
@@ -741,7 +741,7 @@ static int __devinit pontis_add_controls(struct snd_ice1712 *ice) | |||
741 | */ | 741 | */ |
742 | static int __devinit pontis_init(struct snd_ice1712 *ice) | 742 | static int __devinit pontis_init(struct snd_ice1712 *ice) |
743 | { | 743 | { |
744 | static unsigned short wm_inits[] = { | 744 | static const unsigned short wm_inits[] = { |
745 | /* These come first to reduce init pop noise */ | 745 | /* These come first to reduce init pop noise */ |
746 | WM_ADC_MUX, 0x00c0, /* ADC mute */ | 746 | WM_ADC_MUX, 0x00c0, /* ADC mute */ |
747 | WM_DAC_MUTE, 0x0001, /* DAC softmute */ | 747 | WM_DAC_MUTE, 0x0001, /* DAC softmute */ |
@@ -750,7 +750,7 @@ static int __devinit pontis_init(struct snd_ice1712 *ice) | |||
750 | WM_POWERDOWN, 0x0008, /* All power-up except HP */ | 750 | WM_POWERDOWN, 0x0008, /* All power-up except HP */ |
751 | WM_RESET, 0x0000, /* reset */ | 751 | WM_RESET, 0x0000, /* reset */ |
752 | }; | 752 | }; |
753 | static unsigned short wm_inits2[] = { | 753 | static const unsigned short wm_inits2[] = { |
754 | WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */ | 754 | WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */ |
755 | WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */ | 755 | WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */ |
756 | WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */ | 756 | WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */ |
@@ -776,7 +776,7 @@ static int __devinit pontis_init(struct snd_ice1712 *ice) | |||
776 | WM_DAC_MUTE, 0x0000, /* DAC unmute */ | 776 | WM_DAC_MUTE, 0x0000, /* DAC unmute */ |
777 | WM_ADC_MUX, 0x0003, /* ADC unmute, both CD/Line On */ | 777 | WM_ADC_MUX, 0x0003, /* ADC unmute, both CD/Line On */ |
778 | }; | 778 | }; |
779 | static unsigned char cs_inits[] = { | 779 | static const unsigned char cs_inits[] = { |
780 | 0x04, 0x80, /* RUN, RXP0 */ | 780 | 0x04, 0x80, /* RUN, RXP0 */ |
781 | 0x05, 0x05, /* slave, 24bit */ | 781 | 0x05, 0x05, /* slave, 24bit */ |
782 | 0x01, 0x00, | 782 | 0x01, 0x00, |
@@ -826,24 +826,24 @@ static int __devinit pontis_init(struct snd_ice1712 *ice) | |||
826 | * hence the driver needs to sets up it properly. | 826 | * hence the driver needs to sets up it properly. |
827 | */ | 827 | */ |
828 | 828 | ||
829 | static unsigned char pontis_eeprom[] __devinitdata = { | 829 | static const unsigned char pontis_eeprom[] __devinitdata = { |
830 | 0x08, /* SYSCONF: clock 256, mpu401, spdif-in/ADC, 1DAC */ | 830 | [ICE_EEP2_SYSCONF] = 0x08, /* clock 256, mpu401, spdif-in/ADC, 1DAC */ |
831 | 0x80, /* ACLINK: I2S */ | 831 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
832 | 0xf8, /* I2S: vol, 96k, 24bit, 192k */ | 832 | [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit, 192k */ |
833 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 833 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
834 | 0x07, /* GPIO_DIR */ | 834 | [ICE_EEP2_GPIO_DIR] = 0x07, |
835 | 0x00, /* GPIO_DIR1 */ | 835 | [ICE_EEP2_GPIO_DIR1] = 0x00, |
836 | 0x00, /* GPIO_DIR2 (ignored) */ | 836 | [ICE_EEP2_GPIO_DIR2] = 0x00, /* ignored */ |
837 | 0x0f, /* GPIO_MASK (4-7 reserved for CS8416) */ | 837 | [ICE_EEP2_GPIO_MASK] = 0x0f, /* 4-7 reserved for CS8416 */ |
838 | 0xff, /* GPIO_MASK1 */ | 838 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
839 | 0x00, /* GPIO_MASK2 (ignored) */ | 839 | [ICE_EEP2_GPIO_MASK2] = 0x00, /* ignored */ |
840 | 0x06, /* GPIO_STATE (0-low, 1-high, 2-high) */ | 840 | [ICE_EEP2_GPIO_STATE] = 0x06, /* 0-low, 1-high, 2-high */ |
841 | 0x00, /* GPIO_STATE1 */ | 841 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
842 | 0x00, /* GPIO_STATE2 (ignored) */ | 842 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* ignored */ |
843 | }; | 843 | }; |
844 | 844 | ||
845 | /* entry point */ | 845 | /* entry point */ |
846 | struct snd_ice1712_card_info snd_vt1720_pontis_cards[] __devinitdata = { | 846 | const struct snd_ice1712_card_info snd_vt1720_pontis_cards[] __devinitdata = { |
847 | { | 847 | { |
848 | .subvendor = VT1720_SUBDEVICE_PONTIS_MS300, | 848 | .subvendor = VT1720_SUBDEVICE_PONTIS_MS300, |
849 | .name = "Pontis MS300", | 849 | .name = "Pontis MS300", |
diff --git a/sound/pci/ice1712/pontis.h b/sound/pci/ice1712/pontis.h index d0d1378b935c..1a418255c19e 100644 --- a/sound/pci/ice1712/pontis.h +++ b/sound/pci/ice1712/pontis.h | |||
@@ -28,6 +28,6 @@ | |||
28 | 28 | ||
29 | #define VT1720_SUBDEVICE_PONTIS_MS300 0x00020002 /* a dummy id for MS300 */ | 29 | #define VT1720_SUBDEVICE_PONTIS_MS300 0x00020002 /* a dummy id for MS300 */ |
30 | 30 | ||
31 | extern struct snd_ice1712_card_info snd_vt1720_pontis_cards[]; | 31 | extern const struct snd_ice1712_card_info snd_vt1720_pontis_cards[]; |
32 | 32 | ||
33 | #endif /* __SOUND_PONTIS_H */ | 33 | #endif /* __SOUND_PONTIS_H */ |
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 41b2605daa3a..31cc66eb9f8f 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c | |||
@@ -357,14 +357,14 @@ static int aureon_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl | |||
357 | } | 357 | } |
358 | #endif | 358 | #endif |
359 | 359 | ||
360 | static DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0); | 360 | static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0); |
361 | static DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); | 361 | static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); |
362 | 362 | ||
363 | /* | 363 | /* |
364 | * mixers | 364 | * mixers |
365 | */ | 365 | */ |
366 | 366 | ||
367 | static struct snd_kcontrol_new stac_controls[] __devinitdata = { | 367 | static const struct snd_kcontrol_new stac_controls[] __devinitdata = { |
368 | { | 368 | { |
369 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 369 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
370 | .name = "Master Playback Switch", | 370 | .name = "Master Playback Switch", |
@@ -475,7 +475,7 @@ static int __devinit prodigy192_add_controls(struct snd_ice1712 *ice) | |||
475 | */ | 475 | */ |
476 | static int __devinit prodigy192_init(struct snd_ice1712 *ice) | 476 | static int __devinit prodigy192_init(struct snd_ice1712 *ice) |
477 | { | 477 | { |
478 | static unsigned short stac_inits_prodigy[] = { | 478 | static const unsigned short stac_inits_prodigy[] = { |
479 | STAC946X_RESET, 0, | 479 | STAC946X_RESET, 0, |
480 | /* STAC946X_MASTER_VOLUME, 0, | 480 | /* STAC946X_MASTER_VOLUME, 0, |
481 | STAC946X_LF_VOLUME, 0, | 481 | STAC946X_LF_VOLUME, 0, |
@@ -486,7 +486,7 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice) | |||
486 | STAC946X_LFE_VOLUME, 0,*/ | 486 | STAC946X_LFE_VOLUME, 0,*/ |
487 | (unsigned short)-1 | 487 | (unsigned short)-1 |
488 | }; | 488 | }; |
489 | unsigned short *p; | 489 | const unsigned short *p; |
490 | 490 | ||
491 | /* prodigy 192 */ | 491 | /* prodigy 192 */ |
492 | ice->num_total_dacs = 6; | 492 | ice->num_total_dacs = 6; |
@@ -506,25 +506,25 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice) | |||
506 | * hence the driver needs to sets up it properly. | 506 | * hence the driver needs to sets up it properly. |
507 | */ | 507 | */ |
508 | 508 | ||
509 | static unsigned char prodigy71_eeprom[] __devinitdata = { | 509 | static const unsigned char prodigy71_eeprom[] __devinitdata = { |
510 | 0x2b, /* SYSCONF: clock 512, mpu401, spdif-in/ADC, 4DACs */ | 510 | [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/ADC, 4DACs */ |
511 | 0x80, /* ACLINK: I2S */ | 511 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
512 | 0xf8, /* I2S: vol, 96k, 24bit, 192k */ | 512 | [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit, 192k */ |
513 | 0xc3, /* SPDIF: out-en, out-int, spdif-in */ | 513 | [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */ |
514 | 0xff, /* GPIO_DIR */ | 514 | [ICE_EEP2_GPIO_DIR] = 0xff, |
515 | 0xff, /* GPIO_DIR1 */ | 515 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
516 | 0xbf, /* GPIO_DIR2 */ | 516 | [ICE_EEP2_GPIO_DIR2] = 0xbf, |
517 | 0x00, /* GPIO_MASK */ | 517 | [ICE_EEP2_GPIO_MASK] = 0x00, |
518 | 0x00, /* GPIO_MASK1 */ | 518 | [ICE_EEP2_GPIO_MASK1] = 0x00, |
519 | 0x00, /* GPIO_MASK2 */ | 519 | [ICE_EEP2_GPIO_MASK2] = 0x00, |
520 | 0x00, /* GPIO_STATE */ | 520 | [ICE_EEP2_GPIO_STATE] = 0x00, |
521 | 0x00, /* GPIO_STATE1 */ | 521 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
522 | 0x00, /* GPIO_STATE2 */ | 522 | [ICE_EEP2_GPIO_STATE2] = 0x00, |
523 | }; | 523 | }; |
524 | 524 | ||
525 | 525 | ||
526 | /* entry point */ | 526 | /* entry point */ |
527 | struct snd_ice1712_card_info snd_vt1724_prodigy192_cards[] __devinitdata = { | 527 | const struct snd_ice1712_card_info snd_vt1724_prodigy192_cards[] __devinitdata = { |
528 | { | 528 | { |
529 | .subvendor = VT1724_SUBDEVICE_PRODIGY192VE, | 529 | .subvendor = VT1724_SUBDEVICE_PRODIGY192VE, |
530 | .name = "Audiotrak Prodigy 192", | 530 | .name = "Audiotrak Prodigy 192", |
diff --git a/sound/pci/ice1712/prodigy192.h b/sound/pci/ice1712/prodigy192.h index 94c824e24e06..2fa2e62b9e04 100644 --- a/sound/pci/ice1712/prodigy192.h +++ b/sound/pci/ice1712/prodigy192.h | |||
@@ -6,6 +6,6 @@ | |||
6 | 6 | ||
7 | #define VT1724_SUBDEVICE_PRODIGY192VE 0x34495345 /* PRODIGY 192 VE */ | 7 | #define VT1724_SUBDEVICE_PRODIGY192VE 0x34495345 /* PRODIGY 192 VE */ |
8 | 8 | ||
9 | extern struct snd_ice1712_card_info snd_vt1724_prodigy192_cards[]; | 9 | extern const struct snd_ice1712_card_info snd_vt1724_prodigy192_cards[]; |
10 | 10 | ||
11 | #endif /* __SOUND_PRODIGY192_H */ | 11 | #endif /* __SOUND_PRODIGY192_H */ |
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index bf98ea34feb0..025a7e8497c3 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c | |||
@@ -84,38 +84,142 @@ static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * I2C access to the PT2258 volume controller on GPIO 6/7 (Revolution 5.1) | ||
88 | */ | ||
89 | |||
90 | static void revo_i2c_start(struct snd_i2c_bus *bus) | ||
91 | { | ||
92 | struct snd_ice1712 *ice = bus->private_data; | ||
93 | snd_ice1712_save_gpio_status(ice); | ||
94 | } | ||
95 | |||
96 | static void revo_i2c_stop(struct snd_i2c_bus *bus) | ||
97 | { | ||
98 | struct snd_ice1712 *ice = bus->private_data; | ||
99 | snd_ice1712_restore_gpio_status(ice); | ||
100 | } | ||
101 | |||
102 | static void revo_i2c_direction(struct snd_i2c_bus *bus, int clock, int data) | ||
103 | { | ||
104 | struct snd_ice1712 *ice = bus->private_data; | ||
105 | unsigned int mask, val; | ||
106 | |||
107 | val = 0; | ||
108 | if (clock) | ||
109 | val |= VT1724_REVO_I2C_CLOCK; /* write SCL */ | ||
110 | if (data) | ||
111 | val |= VT1724_REVO_I2C_DATA; /* write SDA */ | ||
112 | mask = VT1724_REVO_I2C_CLOCK | VT1724_REVO_I2C_DATA; | ||
113 | ice->gpio.direction &= ~mask; | ||
114 | ice->gpio.direction |= val; | ||
115 | snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); | ||
116 | snd_ice1712_gpio_set_mask(ice, ~mask); | ||
117 | } | ||
118 | |||
119 | static void revo_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data) | ||
120 | { | ||
121 | struct snd_ice1712 *ice = bus->private_data; | ||
122 | unsigned int val = 0; | ||
123 | |||
124 | if (clk) | ||
125 | val |= VT1724_REVO_I2C_CLOCK; | ||
126 | if (data) | ||
127 | val |= VT1724_REVO_I2C_DATA; | ||
128 | snd_ice1712_gpio_write_bits(ice, | ||
129 | VT1724_REVO_I2C_DATA | | ||
130 | VT1724_REVO_I2C_CLOCK, val); | ||
131 | udelay(5); | ||
132 | } | ||
133 | |||
134 | static int revo_i2c_getdata(struct snd_i2c_bus *bus, int ack) | ||
135 | { | ||
136 | struct snd_ice1712 *ice = bus->private_data; | ||
137 | int bit; | ||
138 | |||
139 | if (ack) | ||
140 | udelay(5); | ||
141 | bit = snd_ice1712_gpio_read_bits(ice, VT1724_REVO_I2C_DATA) ? 1 : 0; | ||
142 | return bit; | ||
143 | } | ||
144 | |||
145 | static struct snd_i2c_bit_ops revo51_bit_ops = { | ||
146 | .start = revo_i2c_start, | ||
147 | .stop = revo_i2c_stop, | ||
148 | .direction = revo_i2c_direction, | ||
149 | .setlines = revo_i2c_setlines, | ||
150 | .getdata = revo_i2c_getdata, | ||
151 | }; | ||
152 | |||
153 | static int revo51_i2c_init(struct snd_ice1712 *ice, | ||
154 | struct snd_pt2258 *pt) | ||
155 | { | ||
156 | int err; | ||
157 | |||
158 | /* create the I2C bus */ | ||
159 | err = snd_i2c_bus_create(ice->card, "ICE1724 GPIO6", NULL, &ice->i2c); | ||
160 | if (err < 0) | ||
161 | return err; | ||
162 | |||
163 | ice->i2c->private_data = ice; | ||
164 | ice->i2c->hw_ops.bit = &revo51_bit_ops; | ||
165 | |||
166 | /* create the I2C device */ | ||
167 | err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, | ||
168 | &ice->spec.revo51.dev); | ||
169 | if (err < 0) | ||
170 | return err; | ||
171 | |||
172 | pt->card = ice->card; | ||
173 | pt->i2c_bus = ice->i2c; | ||
174 | pt->i2c_dev = ice->spec.revo51.dev; | ||
175 | ice->spec.revo51.pt2258 = pt; | ||
176 | |||
177 | snd_pt2258_reset(pt); | ||
178 | |||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | /* | ||
87 | * initialize the chips on M-Audio Revolution cards | 183 | * initialize the chips on M-Audio Revolution cards |
88 | */ | 184 | */ |
89 | 185 | ||
90 | #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch } | 186 | #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch } |
91 | 187 | ||
92 | static struct snd_akm4xxx_dac_channel revo71_front[] = { | 188 | static const struct snd_akm4xxx_dac_channel revo71_front[] = { |
93 | AK_DAC("PCM Playback Volume", 2) | 189 | AK_DAC("PCM Playback Volume", 2) |
94 | }; | 190 | }; |
95 | 191 | ||
96 | static struct snd_akm4xxx_dac_channel revo71_surround[] = { | 192 | static const struct snd_akm4xxx_dac_channel revo71_surround[] = { |
97 | AK_DAC("PCM Center Playback Volume", 1), | 193 | AK_DAC("PCM Center Playback Volume", 1), |
98 | AK_DAC("PCM LFE Playback Volume", 1), | 194 | AK_DAC("PCM LFE Playback Volume", 1), |
99 | AK_DAC("PCM Side Playback Volume", 2), | 195 | AK_DAC("PCM Side Playback Volume", 2), |
100 | AK_DAC("PCM Rear Playback Volume", 2), | 196 | AK_DAC("PCM Rear Playback Volume", 2), |
101 | }; | 197 | }; |
102 | 198 | ||
103 | static struct snd_akm4xxx_dac_channel revo51_dac[] = { | 199 | static const struct snd_akm4xxx_dac_channel revo51_dac[] = { |
104 | AK_DAC("PCM Playback Volume", 2), | 200 | AK_DAC("PCM Playback Volume", 2), |
105 | AK_DAC("PCM Center Playback Volume", 1), | 201 | AK_DAC("PCM Center Playback Volume", 1), |
106 | AK_DAC("PCM LFE Playback Volume", 1), | 202 | AK_DAC("PCM LFE Playback Volume", 1), |
107 | AK_DAC("PCM Rear Playback Volume", 2), | 203 | AK_DAC("PCM Rear Playback Volume", 2), |
108 | }; | 204 | }; |
109 | 205 | ||
110 | static struct snd_akm4xxx_adc_channel revo51_adc[] = { | 206 | static const char *revo51_adc_input_names[] = { |
207 | "Mic", | ||
208 | "Line", | ||
209 | "CD", | ||
210 | NULL | ||
211 | }; | ||
212 | |||
213 | static const struct snd_akm4xxx_adc_channel revo51_adc[] = { | ||
111 | { | 214 | { |
112 | .name = "PCM Capture Volume", | 215 | .name = "PCM Capture Volume", |
113 | .switch_name = "PCM Capture Switch", | 216 | .switch_name = "PCM Capture Switch", |
114 | .num_channels = 2 | 217 | .num_channels = 2, |
218 | .input_names = revo51_adc_input_names | ||
115 | }, | 219 | }, |
116 | }; | 220 | }; |
117 | 221 | ||
118 | static struct snd_akm4xxx akm_revo_front __devinitdata = { | 222 | static const struct snd_akm4xxx akm_revo_front __devinitdata = { |
119 | .type = SND_AK4381, | 223 | .type = SND_AK4381, |
120 | .num_dacs = 2, | 224 | .num_dacs = 2, |
121 | .ops = { | 225 | .ops = { |
@@ -124,7 +228,7 @@ static struct snd_akm4xxx akm_revo_front __devinitdata = { | |||
124 | .dac_info = revo71_front, | 228 | .dac_info = revo71_front, |
125 | }; | 229 | }; |
126 | 230 | ||
127 | static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { | 231 | static const struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { |
128 | .caddr = 1, | 232 | .caddr = 1, |
129 | .cif = 0, | 233 | .cif = 0, |
130 | .data_mask = VT1724_REVO_CDOUT, | 234 | .data_mask = VT1724_REVO_CDOUT, |
@@ -136,7 +240,7 @@ static struct snd_ak4xxx_private akm_revo_front_priv __devinitdata = { | |||
136 | .mask_flags = 0, | 240 | .mask_flags = 0, |
137 | }; | 241 | }; |
138 | 242 | ||
139 | static struct snd_akm4xxx akm_revo_surround __devinitdata = { | 243 | static const struct snd_akm4xxx akm_revo_surround __devinitdata = { |
140 | .type = SND_AK4355, | 244 | .type = SND_AK4355, |
141 | .idx_offset = 1, | 245 | .idx_offset = 1, |
142 | .num_dacs = 6, | 246 | .num_dacs = 6, |
@@ -146,7 +250,7 @@ static struct snd_akm4xxx akm_revo_surround __devinitdata = { | |||
146 | .dac_info = revo71_surround, | 250 | .dac_info = revo71_surround, |
147 | }; | 251 | }; |
148 | 252 | ||
149 | static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { | 253 | static const struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { |
150 | .caddr = 3, | 254 | .caddr = 3, |
151 | .cif = 0, | 255 | .cif = 0, |
152 | .data_mask = VT1724_REVO_CDOUT, | 256 | .data_mask = VT1724_REVO_CDOUT, |
@@ -158,7 +262,7 @@ static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = { | |||
158 | .mask_flags = 0, | 262 | .mask_flags = 0, |
159 | }; | 263 | }; |
160 | 264 | ||
161 | static struct snd_akm4xxx akm_revo51 __devinitdata = { | 265 | static const struct snd_akm4xxx akm_revo51 __devinitdata = { |
162 | .type = SND_AK4358, | 266 | .type = SND_AK4358, |
163 | .num_dacs = 6, | 267 | .num_dacs = 6, |
164 | .ops = { | 268 | .ops = { |
@@ -167,36 +271,213 @@ static struct snd_akm4xxx akm_revo51 __devinitdata = { | |||
167 | .dac_info = revo51_dac, | 271 | .dac_info = revo51_dac, |
168 | }; | 272 | }; |
169 | 273 | ||
170 | static struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { | 274 | static const struct snd_ak4xxx_private akm_revo51_priv __devinitdata = { |
171 | .caddr = 2, | 275 | .caddr = 2, |
172 | .cif = 0, | 276 | .cif = 0, |
173 | .data_mask = VT1724_REVO_CDOUT, | 277 | .data_mask = VT1724_REVO_CDOUT, |
174 | .clk_mask = VT1724_REVO_CCLK, | 278 | .clk_mask = VT1724_REVO_CCLK, |
175 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, | 279 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
176 | .cs_addr = VT1724_REVO_CS1 | VT1724_REVO_CS2, | 280 | .cs_addr = VT1724_REVO_CS1, |
177 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, | 281 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
178 | .add_flags = VT1724_REVO_CCLK, /* high at init */ | 282 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
179 | .mask_flags = 0, | 283 | .mask_flags = 0, |
180 | }; | 284 | }; |
181 | 285 | ||
182 | static struct snd_akm4xxx akm_revo51_adc __devinitdata = { | 286 | static const struct snd_akm4xxx akm_revo51_adc __devinitdata = { |
183 | .type = SND_AK5365, | 287 | .type = SND_AK5365, |
184 | .num_adcs = 2, | 288 | .num_adcs = 2, |
185 | .adc_info = revo51_adc, | 289 | .adc_info = revo51_adc, |
186 | }; | 290 | }; |
187 | 291 | ||
188 | static struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = { | 292 | static const struct snd_ak4xxx_private akm_revo51_adc_priv __devinitdata = { |
189 | .caddr = 2, | 293 | .caddr = 2, |
190 | .cif = 0, | 294 | .cif = 0, |
191 | .data_mask = VT1724_REVO_CDOUT, | 295 | .data_mask = VT1724_REVO_CDOUT, |
192 | .clk_mask = VT1724_REVO_CCLK, | 296 | .clk_mask = VT1724_REVO_CCLK, |
193 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, | 297 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
194 | .cs_addr = VT1724_REVO_CS0 | VT1724_REVO_CS2, | 298 | .cs_addr = VT1724_REVO_CS0, |
195 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1 | VT1724_REVO_CS2, | 299 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1, |
300 | .add_flags = VT1724_REVO_CCLK, /* high at init */ | ||
301 | .mask_flags = 0, | ||
302 | }; | ||
303 | |||
304 | static struct snd_pt2258 ptc_revo51_volume; | ||
305 | |||
306 | /* AK4358 for AP192 DAC, AK5385A for ADC */ | ||
307 | static void ap192_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | ||
308 | { | ||
309 | struct snd_ice1712 *ice = ak->private_data[0]; | ||
310 | |||
311 | revo_set_rate_val(ak, rate); | ||
312 | |||
313 | #if 1 /* FIXME: do we need this procedure? */ | ||
314 | /* reset DFS pin of AK5385A for ADC, too */ | ||
315 | /* DFS0 (pin 18) -- GPIO10 pin 77 */ | ||
316 | snd_ice1712_save_gpio_status(ice); | ||
317 | snd_ice1712_gpio_write_bits(ice, 1 << 10, | ||
318 | rate > 48000 ? (1 << 10) : 0); | ||
319 | snd_ice1712_restore_gpio_status(ice); | ||
320 | #endif | ||
321 | } | ||
322 | |||
323 | static const struct snd_akm4xxx_dac_channel ap192_dac[] = { | ||
324 | AK_DAC("PCM Playback Volume", 2) | ||
325 | }; | ||
326 | |||
327 | static const struct snd_akm4xxx akm_ap192 __devinitdata = { | ||
328 | .type = SND_AK4358, | ||
329 | .num_dacs = 2, | ||
330 | .ops = { | ||
331 | .set_rate_val = ap192_set_rate_val | ||
332 | }, | ||
333 | .dac_info = ap192_dac, | ||
334 | }; | ||
335 | |||
336 | static const struct snd_ak4xxx_private akm_ap192_priv __devinitdata = { | ||
337 | .caddr = 2, | ||
338 | .cif = 0, | ||
339 | .data_mask = VT1724_REVO_CDOUT, | ||
340 | .clk_mask = VT1724_REVO_CCLK, | ||
341 | .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS3, | ||
342 | .cs_addr = VT1724_REVO_CS3, | ||
343 | .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS3, | ||
196 | .add_flags = VT1724_REVO_CCLK, /* high at init */ | 344 | .add_flags = VT1724_REVO_CCLK, /* high at init */ |
197 | .mask_flags = 0, | 345 | .mask_flags = 0, |
198 | }; | 346 | }; |
199 | 347 | ||
348 | #if 0 | ||
349 | /* FIXME: ak4114 makes the sound much lower due to some confliction, | ||
350 | * so let's disable it right now... | ||
351 | */ | ||
352 | #define BUILD_AK4114_AP192 | ||
353 | #endif | ||
354 | |||
355 | #ifdef BUILD_AK4114_AP192 | ||
356 | /* AK4114 support on Audiophile 192 */ | ||
357 | /* CDTO (pin 32) -- GPIO2 pin 52 | ||
358 | * CDTI (pin 33) -- GPIO3 pin 53 (shared with AK4358) | ||
359 | * CCLK (pin 34) -- GPIO1 pin 51 (shared with AK4358) | ||
360 | * CSN (pin 35) -- GPIO7 pin 59 | ||
361 | */ | ||
362 | #define AK4114_ADDR 0x00 | ||
363 | |||
364 | static void write_data(struct snd_ice1712 *ice, unsigned int gpio, | ||
365 | unsigned int data, int idx) | ||
366 | { | ||
367 | for (; idx >= 0; idx--) { | ||
368 | /* drop clock */ | ||
369 | gpio &= ~VT1724_REVO_CCLK; | ||
370 | snd_ice1712_gpio_write(ice, gpio); | ||
371 | udelay(1); | ||
372 | /* set data */ | ||
373 | if (data & (1 << idx)) | ||
374 | gpio |= VT1724_REVO_CDOUT; | ||
375 | else | ||
376 | gpio &= ~VT1724_REVO_CDOUT; | ||
377 | snd_ice1712_gpio_write(ice, gpio); | ||
378 | udelay(1); | ||
379 | /* raise clock */ | ||
380 | gpio |= VT1724_REVO_CCLK; | ||
381 | snd_ice1712_gpio_write(ice, gpio); | ||
382 | udelay(1); | ||
383 | } | ||
384 | } | ||
385 | |||
386 | static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio, | ||
387 | int idx) | ||
388 | { | ||
389 | unsigned char data = 0; | ||
390 | |||
391 | for (; idx >= 0; idx--) { | ||
392 | /* drop clock */ | ||
393 | gpio &= ~VT1724_REVO_CCLK; | ||
394 | snd_ice1712_gpio_write(ice, gpio); | ||
395 | udelay(1); | ||
396 | /* read data */ | ||
397 | if (snd_ice1712_gpio_read(ice) & VT1724_REVO_CDIN) | ||
398 | data |= (1 << idx); | ||
399 | udelay(1); | ||
400 | /* raise clock */ | ||
401 | gpio |= VT1724_REVO_CCLK; | ||
402 | snd_ice1712_gpio_write(ice, gpio); | ||
403 | udelay(1); | ||
404 | } | ||
405 | return data; | ||
406 | } | ||
407 | |||
408 | static unsigned char ap192_4wire_start(struct snd_ice1712 *ice) | ||
409 | { | ||
410 | unsigned int tmp; | ||
411 | |||
412 | snd_ice1712_save_gpio_status(ice); | ||
413 | tmp = snd_ice1712_gpio_read(ice); | ||
414 | tmp |= VT1724_REVO_CCLK; /* high at init */ | ||
415 | tmp |= VT1724_REVO_CS0; | ||
416 | tmp &= ~VT1724_REVO_CS3; | ||
417 | snd_ice1712_gpio_write(ice, tmp); | ||
418 | udelay(1); | ||
419 | return tmp; | ||
420 | } | ||
421 | |||
422 | static void ap192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp) | ||
423 | { | ||
424 | tmp |= VT1724_REVO_CS3; | ||
425 | tmp |= VT1724_REVO_CS0; | ||
426 | snd_ice1712_gpio_write(ice, tmp); | ||
427 | udelay(1); | ||
428 | snd_ice1712_restore_gpio_status(ice); | ||
429 | } | ||
430 | |||
431 | static void ap192_ak4114_write(void *private_data, unsigned char addr, | ||
432 | unsigned char data) | ||
433 | { | ||
434 | struct snd_ice1712 *ice = private_data; | ||
435 | unsigned int tmp, addrdata; | ||
436 | |||
437 | tmp = ap192_4wire_start(ice); | ||
438 | addrdata = (AK4114_ADDR << 6) | 0x20 | (addr & 0x1f); | ||
439 | addrdata = (addrdata << 8) | data; | ||
440 | write_data(ice, tmp, addrdata, 15); | ||
441 | ap192_4wire_finish(ice, tmp); | ||
442 | } | ||
443 | |||
444 | static unsigned char ap192_ak4114_read(void *private_data, unsigned char addr) | ||
445 | { | ||
446 | struct snd_ice1712 *ice = private_data; | ||
447 | unsigned int tmp; | ||
448 | unsigned char data; | ||
449 | |||
450 | tmp = ap192_4wire_start(ice); | ||
451 | write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7); | ||
452 | data = read_data(ice, tmp, 7); | ||
453 | ap192_4wire_finish(ice, tmp); | ||
454 | return data; | ||
455 | } | ||
456 | |||
457 | static int ap192_ak4114_init(struct snd_ice1712 *ice) | ||
458 | { | ||
459 | static const unsigned char ak4114_init_vals[] = { | ||
460 | AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1, | ||
461 | AK4114_DIF_I24I2S, | ||
462 | AK4114_TX1E, | ||
463 | AK4114_EFH_1024 | AK4114_DIT | AK4114_IPS(1), | ||
464 | 0, | ||
465 | 0 | ||
466 | }; | ||
467 | static const unsigned char ak4114_init_txcsb[] = { | ||
468 | 0x41, 0x02, 0x2c, 0x00, 0x00 | ||
469 | }; | ||
470 | struct ak4114 *ak; | ||
471 | int err; | ||
472 | |||
473 | return snd_ak4114_create(ice->card, | ||
474 | ap192_ak4114_read, | ||
475 | ap192_ak4114_write, | ||
476 | ak4114_init_vals, ak4114_init_txcsb, | ||
477 | ice, &ak); | ||
478 | } | ||
479 | #endif /* BUILD_AK4114_AP192 */ | ||
480 | |||
200 | static int __devinit revo_init(struct snd_ice1712 *ice) | 481 | static int __devinit revo_init(struct snd_ice1712 *ice) |
201 | { | 482 | { |
202 | struct snd_akm4xxx *ak; | 483 | struct snd_akm4xxx *ak; |
@@ -213,6 +494,10 @@ static int __devinit revo_init(struct snd_ice1712 *ice) | |||
213 | ice->num_total_dacs = 6; | 494 | ice->num_total_dacs = 6; |
214 | ice->num_total_adcs = 2; | 495 | ice->num_total_adcs = 2; |
215 | break; | 496 | break; |
497 | case VT1724_SUBDEVICE_AUDIOPHILE192: | ||
498 | ice->num_total_dacs = 2; | ||
499 | ice->num_total_adcs = 2; | ||
500 | break; | ||
216 | default: | 501 | default: |
217 | snd_BUG(); | 502 | snd_BUG(); |
218 | return -EINVAL; | 503 | return -EINVAL; |
@@ -235,14 +520,28 @@ static int __devinit revo_init(struct snd_ice1712 *ice) | |||
235 | break; | 520 | break; |
236 | case VT1724_SUBDEVICE_REVOLUTION51: | 521 | case VT1724_SUBDEVICE_REVOLUTION51: |
237 | ice->akm_codecs = 2; | 522 | ice->akm_codecs = 2; |
238 | if ((err = snd_ice1712_akm4xxx_init(ak, &akm_revo51, &akm_revo51_priv, ice)) < 0) | 523 | err = snd_ice1712_akm4xxx_init(ak, &akm_revo51, |
524 | &akm_revo51_priv, ice); | ||
525 | if (err < 0) | ||
239 | return err; | 526 | return err; |
240 | err = snd_ice1712_akm4xxx_init(ak + 1, &akm_revo51_adc, | 527 | err = snd_ice1712_akm4xxx_init(ak+1, &akm_revo51_adc, |
241 | &akm_revo51_adc_priv, ice); | 528 | &akm_revo51_adc_priv, ice); |
242 | if (err < 0) | 529 | if (err < 0) |
243 | return err; | 530 | return err; |
244 | /* unmute all codecs - needed! */ | 531 | err = revo51_i2c_init(ice, &ptc_revo51_volume); |
245 | snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, VT1724_REVO_MUTE); | 532 | if (err < 0) |
533 | return err; | ||
534 | /* unmute all codecs */ | ||
535 | snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, | ||
536 | VT1724_REVO_MUTE); | ||
537 | break; | ||
538 | case VT1724_SUBDEVICE_AUDIOPHILE192: | ||
539 | ice->akm_codecs = 1; | ||
540 | err = snd_ice1712_akm4xxx_init(ak, &akm_ap192, &akm_ap192_priv, | ||
541 | ice); | ||
542 | if (err < 0) | ||
543 | return err; | ||
544 | |||
246 | break; | 545 | break; |
247 | } | 546 | } |
248 | 547 | ||
@@ -256,16 +555,34 @@ static int __devinit revo_add_controls(struct snd_ice1712 *ice) | |||
256 | 555 | ||
257 | switch (ice->eeprom.subvendor) { | 556 | switch (ice->eeprom.subvendor) { |
258 | case VT1724_SUBDEVICE_REVOLUTION71: | 557 | case VT1724_SUBDEVICE_REVOLUTION71: |
558 | err = snd_ice1712_akm4xxx_build_controls(ice); | ||
559 | if (err < 0) | ||
560 | return err; | ||
561 | break; | ||
259 | case VT1724_SUBDEVICE_REVOLUTION51: | 562 | case VT1724_SUBDEVICE_REVOLUTION51: |
260 | err = snd_ice1712_akm4xxx_build_controls(ice); | 563 | err = snd_ice1712_akm4xxx_build_controls(ice); |
261 | if (err < 0) | 564 | if (err < 0) |
262 | return err; | 565 | return err; |
566 | err = snd_pt2258_build_controls(ice->spec.revo51.pt2258); | ||
567 | if (err < 0) | ||
568 | return err; | ||
569 | break; | ||
570 | case VT1724_SUBDEVICE_AUDIOPHILE192: | ||
571 | err = snd_ice1712_akm4xxx_build_controls(ice); | ||
572 | if (err < 0) | ||
573 | return err; | ||
574 | #ifdef BUILD_AK4114_AP192 | ||
575 | err = ap192_ak4114_init(ice); | ||
576 | if (err < 0) | ||
577 | return err; | ||
578 | #endif | ||
579 | break; | ||
263 | } | 580 | } |
264 | return 0; | 581 | return 0; |
265 | } | 582 | } |
266 | 583 | ||
267 | /* entry point */ | 584 | /* entry point */ |
268 | struct snd_ice1712_card_info snd_vt1724_revo_cards[] __devinitdata = { | 585 | const struct snd_ice1712_card_info snd_vt1724_revo_cards[] __devinitdata = { |
269 | { | 586 | { |
270 | .subvendor = VT1724_SUBDEVICE_REVOLUTION71, | 587 | .subvendor = VT1724_SUBDEVICE_REVOLUTION71, |
271 | .name = "M Audio Revolution-7.1", | 588 | .name = "M Audio Revolution-7.1", |
@@ -280,5 +597,12 @@ struct snd_ice1712_card_info snd_vt1724_revo_cards[] __devinitdata = { | |||
280 | .chip_init = revo_init, | 597 | .chip_init = revo_init, |
281 | .build_controls = revo_add_controls, | 598 | .build_controls = revo_add_controls, |
282 | }, | 599 | }, |
600 | { | ||
601 | .subvendor = VT1724_SUBDEVICE_AUDIOPHILE192, | ||
602 | .name = "M Audio Audiophile192", | ||
603 | .model = "ap192", | ||
604 | .chip_init = revo_init, | ||
605 | .build_controls = revo_add_controls, | ||
606 | }, | ||
283 | { } /* terminator */ | 607 | { } /* terminator */ |
284 | }; | 608 | }; |
diff --git a/sound/pci/ice1712/revo.h b/sound/pci/ice1712/revo.h index efbb86ec3289..2a24488fad80 100644 --- a/sound/pci/ice1712/revo.h +++ b/sound/pci/ice1712/revo.h | |||
@@ -26,13 +26,15 @@ | |||
26 | 26 | ||
27 | #define REVO_DEVICE_DESC \ | 27 | #define REVO_DEVICE_DESC \ |
28 | "{MidiMan M Audio,Revolution 7.1},"\ | 28 | "{MidiMan M Audio,Revolution 7.1},"\ |
29 | "{MidiMan M Audio,Revolution 5.1}," | 29 | "{MidiMan M Audio,Revolution 5.1},"\ |
30 | "{MidiMan M Audio,Audiophile 192}," | ||
30 | 31 | ||
31 | #define VT1724_SUBDEVICE_REVOLUTION71 0x12143036 | 32 | #define VT1724_SUBDEVICE_REVOLUTION71 0x12143036 |
32 | #define VT1724_SUBDEVICE_REVOLUTION51 0x12143136 | 33 | #define VT1724_SUBDEVICE_REVOLUTION51 0x12143136 |
34 | #define VT1724_SUBDEVICE_AUDIOPHILE192 0x12143236 | ||
33 | 35 | ||
34 | /* entry point */ | 36 | /* entry point */ |
35 | extern struct snd_ice1712_card_info snd_vt1724_revo_cards[]; | 37 | extern const struct snd_ice1712_card_info snd_vt1724_revo_cards[]; |
36 | 38 | ||
37 | 39 | ||
38 | /* | 40 | /* |
@@ -42,9 +44,12 @@ extern struct snd_ice1712_card_info snd_vt1724_revo_cards[]; | |||
42 | #define VT1724_REVO_CCLK 0x02 | 44 | #define VT1724_REVO_CCLK 0x02 |
43 | #define VT1724_REVO_CDIN 0x04 /* not used */ | 45 | #define VT1724_REVO_CDIN 0x04 /* not used */ |
44 | #define VT1724_REVO_CDOUT 0x08 | 46 | #define VT1724_REVO_CDOUT 0x08 |
45 | #define VT1724_REVO_CS0 0x10 /* AK5365 chipselect for Rev. 5.1 */ | 47 | #define VT1724_REVO_CS0 0x10 /* AK5365 chipselect for (revo51) */ |
46 | #define VT1724_REVO_CS1 0x20 /* front AKM4381 chipselect */ | 48 | #define VT1724_REVO_CS1 0x20 /* front AKM4381 chipselect */ |
47 | #define VT1724_REVO_CS2 0x40 /* surround AKM4355 chipselect */ | 49 | #define VT1724_REVO_CS2 0x40 /* surround AKM4355 CS (revo71) */ |
50 | #define VT1724_REVO_I2C_DATA 0x40 /* I2C: PT 2258 SDA (on revo51) */ | ||
51 | #define VT1724_REVO_I2C_CLOCK 0x80 /* I2C: PT 2258 SCL (on revo51) */ | ||
52 | #define VT1724_REVO_CS3 0x80 /* AK4114 for AP192 */ | ||
48 | #define VT1724_REVO_MUTE (1<<22) /* 0 = all mute, 1 = normal operation */ | 53 | #define VT1724_REVO_MUTE (1<<22) /* 0 = all mute, 1 = normal operation */ |
49 | 54 | ||
50 | #endif /* __SOUND_REVO_H */ | 55 | #endif /* __SOUND_REVO_H */ |
diff --git a/sound/pci/ice1712/vt1720_mobo.c b/sound/pci/ice1712/vt1720_mobo.c index 7ca263c13091..72b060d63c29 100644 --- a/sound/pci/ice1712/vt1720_mobo.c +++ b/sound/pci/ice1712/vt1720_mobo.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <sound/core.h> | 30 | #include <sound/core.h> |
31 | 31 | ||
32 | #include "ice1712.h" | 32 | #include "ice1712.h" |
33 | #include "envy24ht.h" | ||
33 | #include "vt1720_mobo.h" | 34 | #include "vt1720_mobo.h" |
34 | 35 | ||
35 | 36 | ||
@@ -55,41 +56,41 @@ static int __devinit k8x800_add_controls(struct snd_ice1712 *ice) | |||
55 | 56 | ||
56 | /* EEPROM image */ | 57 | /* EEPROM image */ |
57 | 58 | ||
58 | static unsigned char k8x800_eeprom[] __devinitdata = { | 59 | static const unsigned char k8x800_eeprom[] __devinitdata = { |
59 | 0x01, /* SYSCONF: clock 256, 1ADC, 2DACs */ | 60 | [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ |
60 | 0x02, /* ACLINK: ACLINK, packed */ | 61 | [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ |
61 | 0x00, /* I2S: - */ | 62 | [ICE_EEP2_I2S] = 0x00, /* - */ |
62 | 0x00, /* SPDIF: - */ | 63 | [ICE_EEP2_SPDIF] = 0x00, /* - */ |
63 | 0xff, /* GPIO_DIR */ | 64 | [ICE_EEP2_GPIO_DIR] = 0xff, |
64 | 0xff, /* GPIO_DIR1 */ | 65 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
65 | 0x00, /* - */ | 66 | [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */ |
66 | 0xff, /* GPIO_MASK */ | 67 | [ICE_EEP2_GPIO_MASK] = 0xff, |
67 | 0xff, /* GPIO_MASK1 */ | 68 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
68 | 0x00, /* - */ | 69 | [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */ |
69 | 0x00, /* GPIO_STATE */ | 70 | [ICE_EEP2_GPIO_STATE] = 0x00, |
70 | 0x00, /* GPIO_STATE1 */ | 71 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
71 | 0x00, /* - */ | 72 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ |
72 | }; | 73 | }; |
73 | 74 | ||
74 | static unsigned char sn25p_eeprom[] __devinitdata = { | 75 | static const unsigned char sn25p_eeprom[] __devinitdata = { |
75 | 0x01, /* SYSCONF: clock 256, 1ADC, 2DACs */ | 76 | [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ |
76 | 0x02, /* ACLINK: ACLINK, packed */ | 77 | [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ |
77 | 0x00, /* I2S: - */ | 78 | [ICE_EEP2_I2S] = 0x00, /* - */ |
78 | 0x41, /* SPDIF: - */ | 79 | [ICE_EEP2_SPDIF] = 0x41, /* - */ |
79 | 0xff, /* GPIO_DIR */ | 80 | [ICE_EEP2_GPIO_DIR] = 0xff, |
80 | 0xff, /* GPIO_DIR1 */ | 81 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
81 | 0x00, /* - */ | 82 | [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */ |
82 | 0xff, /* GPIO_MASK */ | 83 | [ICE_EEP2_GPIO_MASK] = 0xff, |
83 | 0xff, /* GPIO_MASK1 */ | 84 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
84 | 0x00, /* - */ | 85 | [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */ |
85 | 0x00, /* GPIO_STATE */ | 86 | [ICE_EEP2_GPIO_STATE] = 0x00, |
86 | 0x00, /* GPIO_STATE1 */ | 87 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
87 | 0x00, /* - */ | 88 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ |
88 | }; | 89 | }; |
89 | 90 | ||
90 | 91 | ||
91 | /* entry point */ | 92 | /* entry point */ |
92 | struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = { | 93 | const struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = { |
93 | { | 94 | { |
94 | .subvendor = VT1720_SUBDEVICE_K8X800, | 95 | .subvendor = VT1720_SUBDEVICE_K8X800, |
95 | .name = "Albatron K8X800 Pro II", | 96 | .name = "Albatron K8X800 Pro II", |
diff --git a/sound/pci/ice1712/vt1720_mobo.h b/sound/pci/ice1712/vt1720_mobo.h index 0b1b0ee1bea7..70af3ad64a5d 100644 --- a/sound/pci/ice1712/vt1720_mobo.h +++ b/sound/pci/ice1712/vt1720_mobo.h | |||
@@ -36,6 +36,6 @@ | |||
36 | #define VT1720_SUBDEVICE_9CJS 0x0f272327 | 36 | #define VT1720_SUBDEVICE_9CJS 0x0f272327 |
37 | #define VT1720_SUBDEVICE_SN25P 0x97123650 | 37 | #define VT1720_SUBDEVICE_SN25P 0x97123650 |
38 | 38 | ||
39 | extern struct snd_ice1712_card_info snd_vt1720_mobo_cards[]; | 39 | extern const struct snd_ice1712_card_info snd_vt1720_mobo_cards[]; |
40 | 40 | ||
41 | #endif /* __SOUND_VT1720_MOBO_H */ | 41 | #endif /* __SOUND_VT1720_MOBO_H */ |
diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c new file mode 100644 index 000000000000..4a706b16a0b9 --- /dev/null +++ b/sound/pci/ice1712/wtm.c | |||
@@ -0,0 +1,542 @@ | |||
1 | /* | ||
2 | * ALSA driver for ICEnsemble VT1724 (Envy24HT) | ||
3 | * | ||
4 | * Lowlevel functions for Ego Sys Waveterminal 192M | ||
5 | * | ||
6 | * Copyright (c) 2006 Guedez Clement <klem.dev@gmail.com> | ||
7 | * Some functions are taken from the Prodigy192 driver | ||
8 | * source | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | |||
27 | |||
28 | #include <sound/driver.h> | ||
29 | #include <asm/io.h> | ||
30 | #include <linux/delay.h> | ||
31 | #include <linux/interrupt.h> | ||
32 | #include <linux/init.h> | ||
33 | #include <linux/slab.h> | ||
34 | #include <sound/core.h> | ||
35 | |||
36 | #include "ice1712.h" | ||
37 | #include "envy24ht.h" | ||
38 | #include "wtm.h" | ||
39 | #include "stac946x.h" | ||
40 | |||
41 | |||
42 | /* | ||
43 | * 2*ADC 6*DAC no1 ringbuffer r/w on i2c bus | ||
44 | */ | ||
45 | static inline void stac9460_put(struct snd_ice1712 *ice, int reg, | ||
46 | unsigned char val) | ||
47 | { | ||
48 | snd_vt1724_write_i2c(ice, STAC9460_I2C_ADDR, reg, val); | ||
49 | } | ||
50 | |||
51 | static inline unsigned char stac9460_get(struct snd_ice1712 *ice, int reg) | ||
52 | { | ||
53 | return snd_vt1724_read_i2c(ice, STAC9460_I2C_ADDR, reg); | ||
54 | } | ||
55 | |||
56 | /* | ||
57 | * 2*ADC 2*DAC no2 ringbuffer r/w on i2c bus | ||
58 | */ | ||
59 | static inline void stac9460_2_put(struct snd_ice1712 *ice, int reg, | ||
60 | unsigned char val) | ||
61 | { | ||
62 | snd_vt1724_write_i2c(ice, STAC9460_2_I2C_ADDR, reg, val); | ||
63 | } | ||
64 | |||
65 | static inline unsigned char stac9460_2_get(struct snd_ice1712 *ice, int reg) | ||
66 | { | ||
67 | return snd_vt1724_read_i2c(ice, STAC9460_2_I2C_ADDR, reg); | ||
68 | } | ||
69 | |||
70 | |||
71 | /* | ||
72 | * DAC mute control | ||
73 | */ | ||
74 | static int stac9460_dac_mute_info(struct snd_kcontrol *kcontrol, | ||
75 | struct snd_ctl_elem_info *uinfo) | ||
76 | { | ||
77 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
78 | uinfo->count = 1; | ||
79 | uinfo->value.integer.min = 0; | ||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol, | ||
84 | struct snd_ctl_elem_value *ucontrol) | ||
85 | { | ||
86 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
87 | unsigned char val; | ||
88 | int idx, id; | ||
89 | |||
90 | if (kcontrol->private_value) { | ||
91 | idx = STAC946X_MASTER_VOLUME; | ||
92 | id = 0; | ||
93 | } else { | ||
94 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
95 | idx = id + STAC946X_LF_VOLUME; | ||
96 | } | ||
97 | if (id < 6) | ||
98 | val = stac9460_get(ice, idx); | ||
99 | else | ||
100 | val = stac9460_2_get(ice,idx - 6); | ||
101 | ucontrol->value.integer.value[0] = (~val >> 7) & 0x1; | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol, | ||
106 | struct snd_ctl_elem_value *ucontrol) | ||
107 | { | ||
108 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
109 | unsigned char new, old; | ||
110 | int id, idx; | ||
111 | int change; | ||
112 | |||
113 | if (kcontrol->private_value) { | ||
114 | idx = STAC946X_MASTER_VOLUME; | ||
115 | old = stac9460_get(ice, idx); | ||
116 | new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) | | ||
117 | (old & ~0x80); | ||
118 | change = (new != old); | ||
119 | if (change) { | ||
120 | stac9460_put(ice, idx, new); | ||
121 | stac9460_2_put(ice, idx, new); | ||
122 | } | ||
123 | } else { | ||
124 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
125 | idx = id + STAC946X_LF_VOLUME; | ||
126 | if (id < 6) | ||
127 | old = stac9460_get(ice, idx); | ||
128 | else | ||
129 | old = stac9460_2_get(ice, idx - 6); | ||
130 | new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) | | ||
131 | (old & ~0x80); | ||
132 | change = (new != old); | ||
133 | if (change) { | ||
134 | if (id < 6) | ||
135 | stac9460_put(ice, idx, new); | ||
136 | else | ||
137 | stac9460_2_put(ice, idx - 6, new); | ||
138 | } | ||
139 | } | ||
140 | return change; | ||
141 | } | ||
142 | |||
143 | /* | ||
144 | * DAC volume attenuation mixer control | ||
145 | */ | ||
146 | static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol, | ||
147 | struct snd_ctl_elem_info *uinfo) | ||
148 | { | ||
149 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
150 | uinfo->count = 1; | ||
151 | uinfo->value.integer.min = 0; /* mute */ | ||
152 | uinfo->value.integer.max = 0x7f; /* 0dB */ | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol, | ||
157 | struct snd_ctl_elem_value *ucontrol) | ||
158 | { | ||
159 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
160 | int idx, id; | ||
161 | unsigned char vol; | ||
162 | |||
163 | if (kcontrol->private_value) { | ||
164 | idx = STAC946X_MASTER_VOLUME; | ||
165 | id = 0; | ||
166 | } else { | ||
167 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
168 | idx = id + STAC946X_LF_VOLUME; | ||
169 | } | ||
170 | if (id < 6) | ||
171 | vol = stac9460_get(ice, idx) & 0x7f; | ||
172 | else | ||
173 | vol = stac9460_2_get(ice, idx - 6) & 0x7f; | ||
174 | ucontrol->value.integer.value[0] = 0x7f - vol; | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol, | ||
179 | struct snd_ctl_elem_value *ucontrol) | ||
180 | { | ||
181 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
182 | int idx, id; | ||
183 | unsigned char tmp, ovol, nvol; | ||
184 | int change; | ||
185 | |||
186 | if (kcontrol->private_value) { | ||
187 | idx = STAC946X_MASTER_VOLUME; | ||
188 | nvol = ucontrol->value.integer.value[0]; | ||
189 | tmp = stac9460_get(ice, idx); | ||
190 | ovol = 0x7f - (tmp & 0x7f); | ||
191 | change = (ovol != nvol); | ||
192 | if (change) { | ||
193 | stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80)); | ||
194 | stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80)); | ||
195 | } | ||
196 | } else { | ||
197 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
198 | idx = id + STAC946X_LF_VOLUME; | ||
199 | nvol = ucontrol->value.integer.value[0]; | ||
200 | if (id < 6) | ||
201 | tmp = stac9460_get(ice, idx); | ||
202 | else | ||
203 | tmp = stac9460_2_get(ice, idx - 6); | ||
204 | ovol = 0x7f - (tmp & 0x7f); | ||
205 | change = (ovol != nvol); | ||
206 | if (change) { | ||
207 | if (id < 6) | ||
208 | stac9460_put(ice, idx, (0x7f - nvol) | | ||
209 | (tmp & 0x80)); | ||
210 | else | ||
211 | stac9460_2_put(ice, idx-6, (0x7f - nvol) | | ||
212 | (tmp & 0x80)); | ||
213 | } | ||
214 | } | ||
215 | return change; | ||
216 | } | ||
217 | |||
218 | /* | ||
219 | * ADC mute control | ||
220 | */ | ||
221 | static int stac9460_adc_mute_info(struct snd_kcontrol *kcontrol, | ||
222 | struct snd_ctl_elem_info *uinfo) | ||
223 | { | ||
224 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
225 | uinfo->count = 2; | ||
226 | uinfo->value.integer.min = 0; | ||
227 | uinfo->value.integer.max = 1; | ||
228 | return 0; | ||
229 | } | ||
230 | |||
231 | static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol, | ||
232 | struct snd_ctl_elem_value *ucontrol) | ||
233 | { | ||
234 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
235 | unsigned char val; | ||
236 | int i, id; | ||
237 | |||
238 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
239 | if (id == 0) { | ||
240 | for (i = 0; i < 2; ++i) { | ||
241 | val = stac9460_get(ice, STAC946X_MIC_L_VOLUME + i); | ||
242 | ucontrol->value.integer.value[i] = ~val>>7 & 0x1; | ||
243 | } | ||
244 | } else { | ||
245 | for (i = 0; i < 2; ++i) { | ||
246 | val = stac9460_2_get(ice, STAC946X_MIC_L_VOLUME + i); | ||
247 | ucontrol->value.integer.value[i] = ~val>>7 & 0x1; | ||
248 | } | ||
249 | } | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol, | ||
254 | struct snd_ctl_elem_value *ucontrol) | ||
255 | { | ||
256 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
257 | unsigned char new, old; | ||
258 | int i, reg, id; | ||
259 | int change; | ||
260 | |||
261 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
262 | if (id == 0) { | ||
263 | for (i = 0; i < 2; ++i) { | ||
264 | reg = STAC946X_MIC_L_VOLUME + i; | ||
265 | old = stac9460_get(ice, reg); | ||
266 | new = (~ucontrol->value.integer.value[i]<<7&0x80) | | ||
267 | (old&~0x80); | ||
268 | change = (new != old); | ||
269 | if (change) | ||
270 | stac9460_put(ice, reg, new); | ||
271 | } | ||
272 | } else { | ||
273 | for (i = 0; i < 2; ++i) { | ||
274 | reg = STAC946X_MIC_L_VOLUME + i; | ||
275 | old = stac9460_2_get(ice, reg); | ||
276 | new = (~ucontrol->value.integer.value[i]<<7&0x80) | | ||
277 | (old&~0x80); | ||
278 | change = (new != old); | ||
279 | if (change) | ||
280 | stac9460_2_put(ice, reg, new); | ||
281 | } | ||
282 | } | ||
283 | return change; | ||
284 | } | ||
285 | |||
286 | /* | ||
287 | *ADC gain mixer control | ||
288 | */ | ||
289 | static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol, | ||
290 | struct snd_ctl_elem_info *uinfo) | ||
291 | { | ||
292 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
293 | uinfo->count = 2; | ||
294 | uinfo->value.integer.min = 0; /* 0dB */ | ||
295 | uinfo->value.integer.max = 0x0f; /* 22.5dB */ | ||
296 | return 0; | ||
297 | } | ||
298 | |||
299 | static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol, | ||
300 | struct snd_ctl_elem_value *ucontrol) | ||
301 | { | ||
302 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
303 | int i, reg, id; | ||
304 | unsigned char vol; | ||
305 | |||
306 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
307 | if (id == 0) { | ||
308 | for (i = 0; i < 2; ++i) { | ||
309 | reg = STAC946X_MIC_L_VOLUME + i; | ||
310 | vol = stac9460_get(ice, reg) & 0x0f; | ||
311 | ucontrol->value.integer.value[i] = 0x0f - vol; | ||
312 | } | ||
313 | } else { | ||
314 | for (i = 0; i < 2; ++i) { | ||
315 | reg = STAC946X_MIC_L_VOLUME + i; | ||
316 | vol = stac9460_2_get(ice, reg) & 0x0f; | ||
317 | ucontrol->value.integer.value[i] = 0x0f - vol; | ||
318 | } | ||
319 | } | ||
320 | return 0; | ||
321 | } | ||
322 | |||
323 | static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol, | ||
324 | struct snd_ctl_elem_value *ucontrol) | ||
325 | { | ||
326 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
327 | int i, reg, id; | ||
328 | unsigned char ovol, nvol; | ||
329 | int change; | ||
330 | |||
331 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
332 | if (id == 0) { | ||
333 | for (i = 0; i < 2; ++i) { | ||
334 | reg = STAC946X_MIC_L_VOLUME + i; | ||
335 | nvol = ucontrol->value.integer.value[i]; | ||
336 | ovol = 0x0f - stac9460_get(ice, reg); | ||
337 | change = ((ovol & 0x0f) != nvol); | ||
338 | if (change) | ||
339 | stac9460_put(ice, reg, (0x0f - nvol) | | ||
340 | (ovol & ~0x0f)); | ||
341 | } | ||
342 | } else { | ||
343 | for (i = 0; i < 2; ++i) { | ||
344 | reg = STAC946X_MIC_L_VOLUME + i; | ||
345 | nvol = ucontrol->value.integer.value[i]; | ||
346 | ovol = 0x0f - stac9460_2_get(ice, reg); | ||
347 | change = ((ovol & 0x0f) != nvol); | ||
348 | if (change) | ||
349 | stac9460_2_put(ice, reg, (0x0f - nvol) | | ||
350 | (ovol & ~0x0f)); | ||
351 | } | ||
352 | } | ||
353 | return change; | ||
354 | } | ||
355 | |||
356 | /* | ||
357 | * MIC / LINE switch fonction | ||
358 | */ | ||
359 | |||
360 | static int stac9460_mic_sw_info(struct snd_kcontrol *kcontrol, | ||
361 | struct snd_ctl_elem_info *uinfo) | ||
362 | { | ||
363 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
364 | uinfo->count = 1; | ||
365 | uinfo->value.integer.min = 0; | ||
366 | uinfo->value.integer.max = 1; | ||
367 | return 0; | ||
368 | } | ||
369 | |||
370 | static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol, | ||
371 | struct snd_ctl_elem_value *ucontrol) | ||
372 | { | ||
373 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
374 | unsigned char val; | ||
375 | int id; | ||
376 | |||
377 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
378 | if (id == 0) | ||
379 | val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE); | ||
380 | else | ||
381 | val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE); | ||
382 | ucontrol->value.integer.value[0] = ~val>>7 & 0x1; | ||
383 | return 0; | ||
384 | } | ||
385 | |||
386 | static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol, | ||
387 | struct snd_ctl_elem_value *ucontrol) | ||
388 | { | ||
389 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | ||
390 | unsigned char new, old; | ||
391 | int change, id; | ||
392 | |||
393 | id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | ||
394 | if (id == 0) | ||
395 | old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE); | ||
396 | else | ||
397 | old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE); | ||
398 | new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) | (old & ~0x80); | ||
399 | change = (new != old); | ||
400 | if (change) { | ||
401 | if (id == 0) | ||
402 | stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new); | ||
403 | else | ||
404 | stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new); | ||
405 | } | ||
406 | return change; | ||
407 | } | ||
408 | |||
409 | /* | ||
410 | * Control tabs | ||
411 | */ | ||
412 | static const struct snd_kcontrol_new stac9640_controls[] __devinitdata = { | ||
413 | { | ||
414 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
415 | .name = "Master Playback Switch", | ||
416 | .info = stac9460_dac_mute_info, | ||
417 | .get = stac9460_dac_mute_get, | ||
418 | .put = stac9460_dac_mute_put, | ||
419 | .private_value = 1 | ||
420 | }, | ||
421 | { | ||
422 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
423 | .name = "Master Playback Volume", | ||
424 | .info = stac9460_dac_vol_info, | ||
425 | .get = stac9460_dac_vol_get, | ||
426 | .put = stac9460_dac_vol_put, | ||
427 | .private_value = 1, | ||
428 | }, | ||
429 | { | ||
430 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
431 | .name = "MIC/Line switch", | ||
432 | .count = 2, | ||
433 | .info = stac9460_mic_sw_info, | ||
434 | .get = stac9460_mic_sw_get, | ||
435 | .put = stac9460_mic_sw_put, | ||
436 | |||
437 | }, | ||
438 | { | ||
439 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
440 | .name = "DAC Switch", | ||
441 | .count = 8, | ||
442 | .info = stac9460_dac_mute_info, | ||
443 | .get = stac9460_dac_mute_get, | ||
444 | .put = stac9460_dac_mute_put, | ||
445 | }, | ||
446 | { | ||
447 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
448 | .name = "DAC Volume", | ||
449 | .count = 8, | ||
450 | .info = stac9460_dac_vol_info, | ||
451 | .get = stac9460_dac_vol_get, | ||
452 | .put = stac9460_dac_vol_put, | ||
453 | }, | ||
454 | { | ||
455 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
456 | .name = "ADC Switch", | ||
457 | .count = 2, | ||
458 | .info = stac9460_adc_mute_info, | ||
459 | .get = stac9460_adc_mute_get, | ||
460 | .put = stac9460_adc_mute_put, | ||
461 | }, | ||
462 | { | ||
463 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
464 | .name = "ADC Volume", | ||
465 | .count = 2, | ||
466 | .info = stac9460_adc_vol_info, | ||
467 | .get = stac9460_adc_vol_get, | ||
468 | .put = stac9460_adc_vol_put, | ||
469 | |||
470 | } | ||
471 | }; | ||
472 | |||
473 | |||
474 | |||
475 | /*INIT*/ | ||
476 | static int __devinit wtm_add_controls(struct snd_ice1712 *ice) | ||
477 | { | ||
478 | unsigned int i; | ||
479 | int err; | ||
480 | |||
481 | for (i = 0; i < ARRAY_SIZE(stac9640_controls); i++) { | ||
482 | err = snd_ctl_add(ice->card, | ||
483 | snd_ctl_new1(&stac9640_controls[i], ice)); | ||
484 | if (err < 0) | ||
485 | return err; | ||
486 | } | ||
487 | return 0; | ||
488 | } | ||
489 | |||
490 | static int __devinit wtm_init(struct snd_ice1712 *ice) | ||
491 | { | ||
492 | static unsigned short stac_inits_prodigy[] = { | ||
493 | STAC946X_RESET, 0, | ||
494 | (unsigned short)-1 | ||
495 | }; | ||
496 | unsigned short *p; | ||
497 | |||
498 | /*WTM 192M*/ | ||
499 | ice->num_total_dacs = 8; | ||
500 | ice->num_total_adcs = 4; | ||
501 | ice->force_rdma1 = 1; | ||
502 | |||
503 | /*initialize codec*/ | ||
504 | p = stac_inits_prodigy; | ||
505 | for (; *p != (unsigned short)-1; p += 2) { | ||
506 | stac9460_put(ice, p[0], p[1]); | ||
507 | stac9460_2_put(ice, p[0], p[1]); | ||
508 | } | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | |||
513 | static unsigned char wtm_eeprom[] __devinitdata = { | ||
514 | 0x47, /*SYSCONF: clock 192KHz, 4ADC, 8DAC */ | ||
515 | 0x80, /* ACLINK : I2S */ | ||
516 | 0xf8, /* I2S: vol; 96k, 24bit, 192k */ | ||
517 | 0xc1 /*SPDIF: out-en, spidf ext out*/, | ||
518 | 0x9f, /* GPIO_DIR */ | ||
519 | 0xff, /* GPIO_DIR1 */ | ||
520 | 0x7f, /* GPIO_DIR2 */ | ||
521 | 0x9f, /* GPIO_MASK */ | ||
522 | 0xff, /* GPIO_MASK1 */ | ||
523 | 0x7f, /* GPIO_MASK2 */ | ||
524 | 0x16, /* GPIO_STATE */ | ||
525 | 0x80, /* GPIO_STATE1 */ | ||
526 | 0x00, /* GPIO_STATE2 */ | ||
527 | }; | ||
528 | |||
529 | |||
530 | /*entry point*/ | ||
531 | struct snd_ice1712_card_info snd_vt1724_wtm_cards[] __devinitdata = { | ||
532 | { | ||
533 | .subvendor = VT1724_SUBDEVICE_WTM, | ||
534 | .name = "ESI Waveterminal 192M", | ||
535 | .model = "WT192M", | ||
536 | .chip_init = wtm_init, | ||
537 | .build_controls = wtm_add_controls, | ||
538 | .eeprom_size = sizeof(wtm_eeprom), | ||
539 | .eeprom_data = wtm_eeprom, | ||
540 | }, | ||
541 | {} /*terminator*/ | ||
542 | }; | ||
diff --git a/sound/pci/ice1712/wtm.h b/sound/pci/ice1712/wtm.h new file mode 100644 index 000000000000..03a394e442f1 --- /dev/null +++ b/sound/pci/ice1712/wtm.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __SOUND_WTM_H | ||
2 | #define __SOUND_WTM_H | ||
3 | |||
4 | /* ID */ | ||
5 | #define WTM_DEVICE_DESC "{EGO SYS INC,WaveTerminal 192M}," | ||
6 | #define VT1724_SUBDEVICE_WTM 0x36495345 /* WT192M ver1.0 */ | ||
7 | |||
8 | /* | ||
9 | *chip addresses on I2C bus | ||
10 | */ | ||
11 | |||
12 | #define AK4114_ADDR 0x20 /*S/PDIF receiver*/ | ||
13 | #define STAC9460_I2C_ADDR 0x54 /* ADC*2 | DAC*6 */ | ||
14 | #define STAC9460_2_I2C_ADDR 0x56 /* ADC|DAC *2 */ | ||
15 | |||
16 | |||
17 | extern struct snd_ice1712_card_info snd_vt1724_wtm_cards[]; | ||
18 | |||
19 | #endif /* __SOUND_WTM_H */ | ||
20 | |||