diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/ice1712/aureon.c | 78 | ||||
-rw-r--r-- | sound/pci/ice1712/aureon.h | 8 |
2 files changed, 68 insertions, 18 deletions
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 8809812a1c22..2175f6721347 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -322,36 +322,48 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned | |||
322 | { | 322 | { |
323 | unsigned int tmp; | 323 | unsigned int tmp; |
324 | int i; | 324 | int i; |
325 | unsigned int mosi, clk; | ||
325 | 326 | ||
326 | tmp = snd_ice1712_gpio_read(ice); | 327 | tmp = snd_ice1712_gpio_read(ice); |
327 | 328 | ||
328 | snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_SPI_MOSI|AUREON_SPI_CLK| | 329 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT) { |
329 | AUREON_WM_CS|AUREON_CS8415_CS)); | 330 | snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS)); |
330 | tmp |= AUREON_WM_RW; | 331 | mosi = PRODIGY_SPI_MOSI; |
332 | clk = PRODIGY_SPI_CLK; | ||
333 | } | ||
334 | else { | ||
335 | snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_SPI_MOSI|AUREON_SPI_CLK| | ||
336 | AUREON_WM_CS|AUREON_CS8415_CS)); | ||
337 | mosi = AUREON_SPI_MOSI; | ||
338 | clk = AUREON_SPI_CLK; | ||
339 | |||
340 | tmp |= AUREON_WM_RW; | ||
341 | } | ||
342 | |||
331 | tmp &= ~cs; | 343 | tmp &= ~cs; |
332 | snd_ice1712_gpio_write(ice, tmp); | 344 | snd_ice1712_gpio_write(ice, tmp); |
333 | udelay(1); | 345 | udelay(1); |
334 | 346 | ||
335 | for (i = bits - 1; i >= 0; i--) { | 347 | for (i = bits - 1; i >= 0; i--) { |
336 | tmp &= ~AUREON_SPI_CLK; | 348 | tmp &= ~clk; |
337 | snd_ice1712_gpio_write(ice, tmp); | 349 | snd_ice1712_gpio_write(ice, tmp); |
338 | udelay(1); | 350 | udelay(1); |
339 | if (data & (1 << i)) | 351 | if (data & (1 << i)) |
340 | tmp |= AUREON_SPI_MOSI; | 352 | tmp |= mosi; |
341 | else | 353 | else |
342 | tmp &= ~AUREON_SPI_MOSI; | 354 | tmp &= ~mosi; |
343 | snd_ice1712_gpio_write(ice, tmp); | 355 | snd_ice1712_gpio_write(ice, tmp); |
344 | udelay(1); | 356 | udelay(1); |
345 | tmp |= AUREON_SPI_CLK; | 357 | tmp |= clk; |
346 | snd_ice1712_gpio_write(ice, tmp); | 358 | snd_ice1712_gpio_write(ice, tmp); |
347 | udelay(1); | 359 | udelay(1); |
348 | } | 360 | } |
349 | 361 | ||
350 | tmp &= ~AUREON_SPI_CLK; | 362 | tmp &= ~clk; |
351 | tmp |= cs; | 363 | tmp |= cs; |
352 | snd_ice1712_gpio_write(ice, tmp); | 364 | snd_ice1712_gpio_write(ice, tmp); |
353 | udelay(1); | 365 | udelay(1); |
354 | tmp |= AUREON_SPI_CLK; | 366 | tmp |= clk; |
355 | snd_ice1712_gpio_write(ice, tmp); | 367 | snd_ice1712_gpio_write(ice, tmp); |
356 | udelay(1); | 368 | udelay(1); |
357 | } | 369 | } |
@@ -440,7 +452,9 @@ static unsigned short wm_get(struct snd_ice1712 *ice, int reg) | |||
440 | */ | 452 | */ |
441 | static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val) | 453 | static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val) |
442 | { | 454 | { |
443 | aureon_spi_write(ice, AUREON_WM_CS, (reg << 9) | (val & 0x1ff), 16); | 455 | aureon_spi_write(ice, |
456 | (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT ? PRODIGY_WM_CS : AUREON_WM_CS), | ||
457 | (reg << 9) | (val & 0x1ff), 16); | ||
444 | } | 458 | } |
445 | 459 | ||
446 | /* | 460 | /* |
@@ -1659,7 +1673,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | |||
1659 | return err; | 1673 | return err; |
1660 | } | 1674 | } |
1661 | } | 1675 | } |
1662 | else { | 1676 | else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { |
1663 | for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) { | 1677 | for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) { |
1664 | err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice)); | 1678 | err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice)); |
1665 | if (err < 0) | 1679 | if (err < 0) |
@@ -1667,7 +1681,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice) | |||
1667 | } | 1681 | } |
1668 | } | 1682 | } |
1669 | 1683 | ||
1670 | { | 1684 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { |
1671 | unsigned char id; | 1685 | unsigned char id; |
1672 | snd_ice1712_save_gpio_status(ice); | 1686 | snd_ice1712_save_gpio_status(ice); |
1673 | id = aureon_cs8415_get(ice, CS8415_ID); | 1687 | id = aureon_cs8415_get(ice, CS8415_ID); |
@@ -1822,7 +1836,8 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
1822 | udelay(1); | 1836 | udelay(1); |
1823 | 1837 | ||
1824 | /* initialize WM8770 codec */ | 1838 | /* initialize WM8770 codec */ |
1825 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71) | 1839 | if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 || |
1840 | ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT) | ||
1826 | p = wm_inits_prodigy; | 1841 | p = wm_inits_prodigy; |
1827 | else | 1842 | else |
1828 | p = wm_inits_aureon; | 1843 | p = wm_inits_aureon; |
@@ -1830,11 +1845,13 @@ static int __devinit aureon_init(struct snd_ice1712 *ice) | |||
1830 | wm_put(ice, p[0], p[1]); | 1845 | wm_put(ice, p[0], p[1]); |
1831 | 1846 | ||
1832 | /* initialize CS8415A codec */ | 1847 | /* initialize CS8415A codec */ |
1833 | for (p = cs_inits; *p != (unsigned short)-1; p++) | 1848 | if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT) { |
1834 | aureon_spi_write(ice, AUREON_CS8415_CS, *p | 0x200000, 24); | 1849 | for (p = cs_inits; *p != (unsigned short)-1; p++) |
1835 | ice->spec.aureon.cs8415_mux = 1; | 1850 | aureon_spi_write(ice, AUREON_CS8415_CS, *p | 0x200000, 24); |
1851 | ice->spec.aureon.cs8415_mux = 1; | ||
1836 | 1852 | ||
1837 | aureon_set_headphone_amp(ice, 1); | 1853 | aureon_set_headphone_amp(ice, 1); |
1854 | } | ||
1838 | 1855 | ||
1839 | snd_ice1712_restore_gpio_status(ice); | 1856 | snd_ice1712_restore_gpio_status(ice); |
1840 | 1857 | ||
@@ -1902,6 +1919,23 @@ static unsigned char prodigy71_eeprom[] __devinitdata = { | |||
1902 | 0x00, /* GPIO_STATE2 */ | 1919 | 0x00, /* GPIO_STATE2 */ |
1903 | }; | 1920 | }; |
1904 | 1921 | ||
1922 | static unsigned char prodigy71lt_eeprom[] __devinitdata = { | ||
1923 | 0x0b, /* SYSCINF: clock 512, spdif-in/ADC, 4DACs */ | ||
1924 | 0x80, /* ACLINK: I2S */ | ||
1925 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ | ||
1926 | 0xc3, /* SPDUF: out-en, out-int */ | ||
1927 | 0x00, /* GPIO_DIR */ | ||
1928 | 0x07, /* GPIO_DIR1 */ | ||
1929 | 0x00, /* GPIO_DIR2 */ | ||
1930 | 0xff, /* GPIO_MASK */ | ||
1931 | 0xf8, /* GPIO_MASK1 */ | ||
1932 | 0xff, /* GPIO_MASK2 */ | ||
1933 | 0x00, /* GPIO_STATE */ | ||
1934 | 0x00, /* GPIO_STATE1 */ | ||
1935 | 0x00, /* GPIO_STATE2 */ | ||
1936 | }; | ||
1937 | |||
1938 | |||
1905 | /* entry point */ | 1939 | /* entry point */ |
1906 | struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { | 1940 | struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { |
1907 | { | 1941 | { |
@@ -1944,5 +1978,15 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = { | |||
1944 | .eeprom_data = prodigy71_eeprom, | 1978 | .eeprom_data = prodigy71_eeprom, |
1945 | .driver = "Prodigy71", /* should be identical with Aureon71 */ | 1979 | .driver = "Prodigy71", /* should be identical with Aureon71 */ |
1946 | }, | 1980 | }, |
1981 | { | ||
1982 | .subvendor = VT1724_SUBDEVICE_PRODIGY71LT, | ||
1983 | .name = "Audiotrak Prodigy 7.1 LT", | ||
1984 | .model = "prodigy71lt", | ||
1985 | .chip_init = aureon_init, | ||
1986 | .build_controls = aureon_add_controls, | ||
1987 | .eeprom_size = sizeof(prodigy71lt_eeprom), | ||
1988 | .eeprom_data = prodigy71lt_eeprom, | ||
1989 | .driver = "Prodigy71LT", | ||
1990 | }, | ||
1947 | { } /* terminator */ | 1991 | { } /* terminator */ |
1948 | }; | 1992 | }; |
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h index 95d515f36f23..98a6752280f2 100644 --- a/sound/pci/ice1712/aureon.h +++ b/sound/pci/ice1712/aureon.h | |||
@@ -27,12 +27,14 @@ | |||
27 | #define AUREON_DEVICE_DESC "{Terratec,Aureon 5.1 Sky},"\ | 27 | #define AUREON_DEVICE_DESC "{Terratec,Aureon 5.1 Sky},"\ |
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 | 32 | ||
32 | #define VT1724_SUBDEVICE_AUREON51_SKY 0x3b154711 /* Aureon 5.1 Sky */ | 33 | #define VT1724_SUBDEVICE_AUREON51_SKY 0x3b154711 /* Aureon 5.1 Sky */ |
33 | #define VT1724_SUBDEVICE_AUREON71_SPACE 0x3b154511 /* Aureon 7.1 Space */ | 34 | #define VT1724_SUBDEVICE_AUREON71_SPACE 0x3b154511 /* Aureon 7.1 Space */ |
34 | #define VT1724_SUBDEVICE_AUREON71_UNIVERSE 0x3b155311 /* Aureon 7.1 Universe */ | 35 | #define VT1724_SUBDEVICE_AUREON71_UNIVERSE 0x3b155311 /* Aureon 7.1 Universe */ |
35 | #define VT1724_SUBDEVICE_PRODIGY71 0x33495345 /* PRODIGY 7.1 */ | 36 | #define VT1724_SUBDEVICE_PRODIGY71 0x33495345 /* PRODIGY 7.1 */ |
37 | #define VT1724_SUBDEVICE_PRODIGY71LT 0x32315441 /* PRODIGY 7.1 LT */ | ||
36 | 38 | ||
37 | extern struct snd_ice1712_card_info snd_vt1724_aureon_cards[]; | 39 | extern struct snd_ice1712_card_info snd_vt1724_aureon_cards[]; |
38 | 40 | ||
@@ -53,4 +55,8 @@ extern struct snd_ice1712_card_info snd_vt1724_aureon_cards[]; | |||
53 | #define AUREON_AC97_DATA_HIGH (1 << 8) | 55 | #define AUREON_AC97_DATA_HIGH (1 << 8) |
54 | #define AUREON_AC97_DATA_MASK 0xFF | 56 | #define AUREON_AC97_DATA_MASK 0xFF |
55 | 57 | ||
58 | #define PRODIGY_WM_CS (1 << 8) | ||
59 | #define PRODIGY_SPI_MOSI (1 << 10) | ||
60 | #define PRODIGY_SPI_CLK (1 << 9) | ||
61 | |||
56 | #endif /* __SOUND_AUREON_H */ | 62 | #endif /* __SOUND_AUREON_H */ |