amp.c (de3ab850a0e883329594f62ec18fecef4fcfe5ca) | amp.c (e23e7a1436207217000c2854214bc908936af3cb) |
---|---|
1/* 2 * ALSA driver for ICEnsemble VT1724 (Envy24HT) 3 * 4 * Lowlevel functions for Advanced Micro Peripherals Ltd AUDIO2000 5 * 6 * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 23 unchanged lines hidden (view full) --- 32 33static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val) 34{ 35 unsigned short cval; 36 cval = (reg << 9) | val; 37 snd_vt1724_write_i2c(ice, WM_DEV, cval >> 8, cval & 0xff); 38} 39 | 1/* 2 * ALSA driver for ICEnsemble VT1724 (Envy24HT) 3 * 4 * Lowlevel functions for Advanced Micro Peripherals Ltd AUDIO2000 5 * 6 * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 23 unchanged lines hidden (view full) --- 32 33static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val) 34{ 35 unsigned short cval; 36 cval = (reg << 9) | val; 37 snd_vt1724_write_i2c(ice, WM_DEV, cval >> 8, cval & 0xff); 38} 39 |
40static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice) | 40static int snd_vt1724_amp_init(struct snd_ice1712 *ice) |
41{ 42 static const unsigned short wm_inits[] = { 43 WM_ATTEN_L, 0x0000, /* 0 db */ 44 WM_ATTEN_R, 0x0000, /* 0 db */ 45 WM_DAC_CTRL, 0x0008, /* 24bit I2S */ 46 WM_INT_CTRL, 0x0001, /* 24bit I2S */ 47 }; 48 --- 11 unchanged lines hidden (view full) --- 60 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AV710) { 61 for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2) 62 wm_put(ice, wm_inits[i], wm_inits[i+1]); 63 } 64 65 return 0; 66} 67 | 41{ 42 static const unsigned short wm_inits[] = { 43 WM_ATTEN_L, 0x0000, /* 0 db */ 44 WM_ATTEN_R, 0x0000, /* 0 db */ 45 WM_DAC_CTRL, 0x0008, /* 24bit I2S */ 46 WM_INT_CTRL, 0x0001, /* 24bit I2S */ 47 }; 48 --- 11 unchanged lines hidden (view full) --- 60 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AV710) { 61 for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2) 62 wm_put(ice, wm_inits[i], wm_inits[i+1]); 63 } 64 65 return 0; 66} 67 |
68static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) | 68static int snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) |
69{ 70 if (ice->ac97) 71 /* we use pins 39 and 41 of the VT1616 for left and right 72 read outputs */ 73 snd_ac97_write_cache(ice->ac97, 0x5a, 74 snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); 75 return 0; 76} 77 78 79/* entry point */ | 69{ 70 if (ice->ac97) 71 /* we use pins 39 and 41 of the VT1616 for left and right 72 read outputs */ 73 snd_ac97_write_cache(ice->ac97, 0x5a, 74 snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); 75 return 0; 76} 77 78 79/* entry point */ |
80struct snd_ice1712_card_info snd_vt1724_amp_cards[] __devinitdata = { | 80struct snd_ice1712_card_info snd_vt1724_amp_cards[] = { |
81 { 82 .subvendor = VT1724_SUBDEVICE_AV710, 83 .name = "Chaintech AV-710", 84 .model = "av710", 85 .chip_init = snd_vt1724_amp_init, 86 .build_controls = snd_vt1724_amp_add_controls, 87 }, 88 { 89 .subvendor = VT1724_SUBDEVICE_AUDIO2000, 90 .name = "AMP Ltd AUDIO2000", 91 .model = "amp2000", 92 .chip_init = snd_vt1724_amp_init, 93 .build_controls = snd_vt1724_amp_add_controls, 94 }, 95 { } /* terminator */ 96}; 97 | 81 { 82 .subvendor = VT1724_SUBDEVICE_AV710, 83 .name = "Chaintech AV-710", 84 .model = "av710", 85 .chip_init = snd_vt1724_amp_init, 86 .build_controls = snd_vt1724_amp_add_controls, 87 }, 88 { 89 .subvendor = VT1724_SUBDEVICE_AUDIO2000, 90 .name = "AMP Ltd AUDIO2000", 91 .model = "amp2000", 92 .chip_init = snd_vt1724_amp_init, 93 .build_controls = snd_vt1724_amp_add_controls, 94 }, 95 { } /* terminator */ 96}; 97 |