Changeset 215 for GPL/branches/alsa-resync1/alsa-kernel/pci
- Timestamp:
- Jul 16, 2007, 2:45:34 AM (18 years ago)
- Location:
- GPL/branches/alsa-resync1/alsa-kernel/pci
- Files:
-
- 18 deleted
- 9 edited
-
ac97/bin (deleted)
-
ali5451/bin (deleted)
-
au88x0/CVS (deleted)
-
au88x0/bin (deleted)
-
au88x0/diff.cmd (deleted)
-
au88x0/diff1.cmd (deleted)
-
au88x0/test/CVS (deleted)
-
bin (deleted)
-
ca0106/CVS (deleted)
-
ca0106/bin (deleted)
-
cs46xx/bin (deleted)
-
cs46xx/dsp_spos_scb_lib.c (modified) (3 diffs)
-
emu10k1/bin (deleted)
-
hda/CVS (deleted)
-
hda/bin (deleted)
-
ice1712/ak4524.c (modified) (16 diffs)
-
ice1712/delta.c (modified) (11 diffs)
-
ice1712/delta.h (modified) (3 diffs)
-
ice1712/ews.c (modified) (3 diffs)
-
ice1712/ice1712.c (modified) (17 diffs)
-
ice1712/ice1712.h (modified) (2 diffs)
-
nm256/bin (deleted)
-
rme9652/bin (deleted)
-
rme9652/hammerfall_mem.c (modified) (2 diffs, 1 prop)
-
rme9652/hdsp.c (modified) (1 diff, 1 prop)
-
trident/bin (deleted)
-
ymfpci/bin (deleted)
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/pci/cs46xx/dsp_spos_scb_lib.c
r76 r215 792 792 { 793 793 /* E */ 0x8000,0x8000, 794 /* F */ 0x 8000,0x8000794 /* F */ 0xffff,0xffff 795 795 } 796 796 }; … … 981 981 0x18000000, /* Phi increment for approx 32k operation */ 982 982 0x8000,0x8000, /* Volume controls are unused at this time */ 983 0x 8000,0x8000983 0xffff,0xffff 984 984 }; 985 985 … … 1358 1358 } 1359 1359 1360 /* cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate); */ 1360 if (pcm_channel_id != DSP_IEC958_CHANNEL || 1361 !(ins->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE)) 1362 cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate); 1361 1363 1362 1364 ins->nsrc_scb ++; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ak4524.c
r212 r215 2 2 * ALSA driver for ICEnsemble ICE1712 (Envy24) 3 3 * 4 * AK4524 / AK4528 interface4 * AK4524 / AK4528 / AK4529 interface 5 5 * 6 6 * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz> … … 68 68 addr &= 0x07; 69 69 /* build I2C address + data byte */ 70 /* assume C1=1, C0=0 */ 70 71 addrdata = 0xa000 | (addr << 8) | data; 71 72 for (idx = 15; idx >= 0; idx--) { … … 81 82 } 82 83 84 if (ak->type == SND_AK4524) { 83 85 if ((addr != 0x04 && addr != 0x05) || (data & 0x80) == 0) 84 86 ak->images[chip][addr] = data; 85 87 else 86 88 ak->ipga_gain[chip][addr-4] = data; 89 } 87 90 88 91 if (ak->cs_mask == ak->cs_addr) { … … 113 116 ak4524_t *ak = &ice->ak4524; 114 117 118 switch (ak->type) { 119 case SND_AK4524: 120 case SND_AK4528: 115 121 for (chip = 0; chip < ak->num_dacs/2; chip++) { 116 122 snd_ice1712_ak4524_write(ice, chip, 0x01, state ? 0x00 : 0x03); 117 123 if (state) 118 124 continue; 119 for (reg = 0x04; reg < (ak->is_ak4528 ? 0x06 : 0x08); reg++) 125 /* DAC volumes */ 126 for (reg = 0x04; reg < (ak->type == SND_AK4528 ? 0x06 : 0x08); reg++) 120 127 snd_ice1712_ak4524_write(ice, chip, reg, ak->images[chip][reg]); 121 if (ak->is_ak4528)128 if (ak->type == SND_AK4528) 122 129 continue; 130 /* IPGA */ 123 131 for (reg = 0x04; reg < 0x06; reg++) 124 132 snd_ice1712_ak4524_write(ice, chip, reg, ak->ipga_gain[chip][reg-4]); 133 } 134 break; 135 case SND_AK4529: 136 /* FIXME: needed for ak4529? */ 137 break; 125 138 } 126 139 } … … 131 144 void __devinit snd_ice1712_ak4524_init(ice1712_t *ice) 132 145 { 133 static unsigned char inits [] = {146 static unsigned char inits_ak4524[] = { 134 147 0x00, 0x07, /* 0: all power up */ 135 148 0x01, 0x00, /* 1: ADC/DAC reset */ … … 145 158 0xff, 0xff 146 159 }; 147 int chip, idx; 148 unsigned char *ptr, reg, data; 160 static unsigned char inits_ak4528[] = { 161 0x00, 0x07, /* 0: all power up */ 162 0x01, 0x00, /* 1: ADC/DAC reset */ 163 0x02, 0x60, /* 2: 24bit I2S */ 164 0x03, 0x0d, /* 3: deemphasis off, turn LR highpass filters on */ 165 0x01, 0x03, /* 1: ADC/DAC enable */ 166 0x04, 0x00, /* 4: ADC left muted */ 167 0x05, 0x00, /* 5: ADC right muted */ 168 0xff, 0xff 169 }; 170 static unsigned char inits_ak4529[] = { 171 0x09, 0x01, /* 9: ATS=0, RSTN=1 */ 172 0x0a, 0x3f, /* A: all power up, no zero/overflow detection */ 173 0x00, 0x08, /* 0: TDM=0, 24bit I2S, SMUTE=0 */ 174 0x01, 0x00, /* 1: ACKS=0, ADC, loop off */ 175 0x02, 0xff, /* 2: LOUT1 muted */ 176 0x03, 0xff, /* 3: ROUT1 muted */ 177 0x04, 0xff, /* 4: LOUT2 muted */ 178 0x05, 0xff, /* 5: ROUT2 muted */ 179 0x06, 0xff, /* 6: LOUT3 muted */ 180 0x07, 0xff, /* 7: ROUT3 muted */ 181 0x0b, 0xff, /* B: LOUT4 muted */ 182 0x0c, 0xff, /* C: ROUT4 muted */ 183 0x08, 0x55, /* 8: deemphasis all off */ 184 0xff, 0xff 185 }; 186 int chip, num_chips; 187 unsigned char *ptr, reg, data, *inits; 149 188 ak4524_t *ak = &ice->ak4524; 150 189 151 for (chip = idx = 0; chip < ak->num_dacs/2; chip++) { 190 switch (ak->type) { 191 case SND_AK4524: 192 inits = inits_ak4524; 193 num_chips = ak->num_dacs / 2; 194 break; 195 case SND_AK4528: 196 inits = inits_ak4528; 197 num_chips = ak->num_dacs / 2; 198 break; 199 case SND_AK4529: 200 default: 201 inits = inits_ak4529; 202 num_chips = 1; 203 break; 204 } 205 206 for (chip = 0; chip < num_chips; chip++) { 152 207 ptr = inits; 153 208 while (*ptr != 0xff) { 154 209 reg = *ptr++; 155 210 data = *ptr++; 156 if (ak->is_ak4528) {157 if (reg > 5)158 continue;159 if (reg >= 4 && (data & 0x80))160 continue;161 }162 if (reg == 0x03 && ak->is_ak4528)163 data = 0x0d; /* deemphasis off, turn LR highpass filters on */164 211 snd_ice1712_ak4524_write(ice, chip, reg, data); 165 212 } 166 213 } 167 214 } 215 216 217 #define AK_GET_CHIP(val) (((val) >> 8) & 0xff) 218 #define AK_GET_ADDR(val) ((val) & 0xff) 219 #define AK_GET_SHIFT(val) (((val) >> 16) & 0xff) 220 #define AK_COMPOSE(chip,addr,shift) (((chip) << 8) | (addr) | ((shift) << 16)) 168 221 169 222 static int snd_ice1712_ak4524_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 179 232 { 180 233 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 181 int chip = kcontrol->private_value / 8;182 int addr = kcontrol->private_value % 8;234 int chip = AK_GET_CHIP(kcontrol->private_value); 235 int addr = AK_GET_ADDR(kcontrol->private_value); 183 236 ucontrol->value.integer.value[0] = ice->ak4524.images[chip][addr]; 184 237 return 0; … … 188 241 { 189 242 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 190 int chip = kcontrol->private_value / 8;191 int addr = kcontrol->private_value % 8;243 int chip = AK_GET_CHIP(kcontrol->private_value); 244 int addr = AK_GET_ADDR(kcontrol->private_value); 192 245 unsigned char nval = ucontrol->value.integer.value[0]; 193 246 int change = ice->ak4524.images[chip][addr] != nval; … … 209 262 { 210 263 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 211 int chip = kcontrol->private_value / 8;212 int addr = kcontrol->private_value % 8;264 int chip = AK_GET_CHIP(kcontrol->private_value); 265 int addr = AK_GET_ADDR(kcontrol->private_value); 213 266 ucontrol->value.integer.value[0] = ice->ak4524.ipga_gain[chip][addr-4] & 0x7f; 214 267 return 0; … … 218 271 { 219 272 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 220 int chip = kcontrol->private_value / 8;221 int addr = kcontrol->private_value % 8;273 int chip = AK_GET_CHIP(kcontrol->private_value); 274 int addr = AK_GET_ADDR(kcontrol->private_value); 222 275 unsigned char nval = (ucontrol->value.integer.value[0] % 37) | 0x80; 223 276 int change = ice->ak4524.ipga_gain[chip][addr] != nval; … … 244 297 { 245 298 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 246 int chip = kcontrol->id.index; 247 ucontrol->value.enumerated.item[0] = ice->ak4524.images[chip][3] & 3; 299 int chip = AK_GET_CHIP(kcontrol->private_value); 300 int addr = AK_GET_ADDR(kcontrol->private_value); 301 int shift = AK_GET_SHIFT(kcontrol->private_value); 302 ucontrol->value.enumerated.item[0] = (ice->ak4524.images[chip][addr] >> shift) & 3; 248 303 return 0; 249 304 } … … 252 307 { 253 308 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 254 int chip = kcontrol->id.index; 255 unsigned char nval = ucontrol->value.enumerated.item[0]; 309 int chip = AK_GET_CHIP(kcontrol->private_value); 310 int addr = AK_GET_ADDR(kcontrol->private_value); 311 int shift = AK_GET_SHIFT(kcontrol->private_value); 312 unsigned char nval = ucontrol->value.enumerated.item[0] & 3; 256 313 int change; 257 nval |= (nval & 3) | (ice->ak4524.images[chip][3] & ~3); 258 change = ice->ak4524.images[chip][3] != nval; 314 315 nval = (nval << shift) | (ice->ak4524.images[chip][addr] & ~(3 << shift)); 316 change = ice->ak4524.images[chip][addr] != nval; 259 317 if (change) 260 snd_ice1712_ak4524_write(ice, chip, 3, nval);318 snd_ice1712_ak4524_write(ice, chip, addr, nval); 261 319 return change; 262 320 } … … 281 339 ctl.get = snd_ice1712_ak4524_volume_get; 282 340 ctl.put = snd_ice1712_ak4524_volume_put; 283 if (ak->is_ak4528) 284 ctl.private_value = (idx / 2) * 8 + (idx % 2) + 4; /* register 4 & 5 */ 285 else 286 ctl.private_value = (idx / 2) * 8 + (idx % 2) + 6; /* register 6 & 7 */ 341 switch (ak->type) { 342 case SND_AK4524: 343 ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 6, 0); /* register 6 & 7 */ 344 break; 345 case SND_AK4528: 346 ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */ 347 break; 348 case SND_AK4529: { 349 int val = idx < 6 ? idx + 2 : (idx - 6) + 0xb; /* registers 2-7 and b,c */ 350 ctl.private_value = AK_COMPOSE(0, val, 0); 351 break; 352 } 353 } 287 354 ctl.private_data = ice; 288 355 if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0) 289 356 return err; 290 357 } 291 for (idx = 0; idx < ak->num_adcs && !ak->is_ak4528; ++idx) {358 for (idx = 0; idx < ak->num_adcs && ak->type == SND_AK4524; ++idx) { 292 359 snd_kcontrol_t ctl; 293 360 memset(&ctl, 0, sizeof(ctl)); … … 299 366 ctl.get = snd_ice1712_ak4524_volume_get; 300 367 ctl.put = snd_ice1712_ak4524_volume_put; 301 ctl.private_value = (idx / 2) * 8 + (idx % 2) + 4; /* register 4 & 5 */368 ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */ 302 369 ctl.private_data = ice; 303 370 if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0) … … 311 378 ctl.get = snd_ice1712_ak4524_ipga_gain_get; 312 379 ctl.put = snd_ice1712_ak4524_ipga_gain_put; 313 ctl.private_value = (idx / 2) * 8 + (idx % 2) + 4; /* register 4 & 5 */380 ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */ 314 381 ctl.private_data = ice; 315 382 if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0) … … 326 393 ctl.get = snd_ice1712_ak4524_deemphasis_get; 327 394 ctl.put = snd_ice1712_ak4524_deemphasis_put; 395 switch (ak->type) { 396 case SND_AK4524: 397 case SND_AK4528: 398 ctl.private_value = AK_COMPOSE(idx, 3, 0); /* register 3 */ 399 break; 400 case SND_AK4529: { 401 int shift = idx == 3 ? 6 : (2 - idx) * 2; 402 ctl.private_value = AK_COMPOSE(0, 8, shift); /* register 8 with shift */ 403 break; 404 } 405 } 328 406 ctl.private_data = ice; 329 407 if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0) -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/delta.c
r212 r215 258 258 * change the rate of AK4524 on Delta 44/66, AP, 1010LT 259 259 */ 260 static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned char val)260 static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned int rate) 261 261 { 262 262 unsigned char tmp, tmp2; 263 264 if (rate == 0) /* no hint - S/PDIF input is master, simply return */ 265 return; 263 266 264 267 /* check before reset ak4524 to avoid unnecessary clicks */ … … 268 271 tmp2 = tmp; 269 272 tmp2 &= ~ICE1712_DELTA_DFS; 270 if ( val == 15 || val == 11 || val == 7)273 if (rate > 48000) 271 274 tmp2 |= ICE1712_DELTA_DFS; 272 275 if (tmp == tmp2) … … 276 279 snd_ice1712_ak4524_reset(ice, 1); 277 280 down(&ice->gpio_mutex); 278 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) ;279 if ( val == 15 || val == 11 || val == 7) {281 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ~ICE1712_DELTA_DFS; 282 if (rate > 48000) 280 283 tmp |= ICE1712_DELTA_DFS; 281 } else {282 tmp &= ~ICE1712_DELTA_DFS;283 }284 284 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); 285 285 up(&ice->gpio_mutex); … … 338 338 ice->num_total_dacs = 2; 339 339 break; 340 case ICE1712_SUBDEVICE_DELTA410: 341 ice->num_total_dacs = 8; 342 break; 340 343 case ICE1712_SUBDEVICE_DELTA44: 341 344 case ICE1712_SUBDEVICE_DELTA66: … … 351 354 switch (ice->eeprom.subvendor) { 352 355 case ICE1712_SUBDEVICE_AUDIOPHILE: 356 case ICE1712_SUBDEVICE_DELTA410: 353 357 case ICE1712_SUBDEVICE_DELTA1010LT: 354 358 if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { … … 379 383 switch (ice->eeprom.subvendor) { 380 384 case ICE1712_SUBDEVICE_AUDIOPHILE: 385 case ICE1712_SUBDEVICE_DELTA410: 381 386 ak->num_adcs = ak->num_dacs = 2; 382 ak->is_ak4528 = 1; 383 ak->cif = 0; /* the default level of the CIF pin from AK4524 */ 387 ak->type = SND_AK4528; 388 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA410) { 389 ak->num_dacs = 8; 390 ak->type = SND_AK4529; 391 } 392 ak->cif = 0; /* the default level of the CIF pin from AK4528/4529 */ 384 393 ak->data_mask = ICE1712_DELTA_AP_DOUT; 385 394 ak->clk_mask = ICE1712_DELTA_AP_CCLK; 386 ak->cs_mask = ak->cs_addr = ICE1712_DELTA_AP_CS_CODEC; /* select AK4528 codec */395 ak->cs_mask = ak->cs_addr = ICE1712_DELTA_AP_CS_CODEC; /* select AK4528/4529 codec */ 387 396 ak->cs_none = 0; 388 397 ak->add_flags = ICE1712_DELTA_AP_CS_DIGITAL; /* assert digital high */ … … 393 402 case ICE1712_SUBDEVICE_DELTA1010LT: 394 403 ak->num_adcs = ak->num_dacs = 8; 404 ak->type = SND_AK4524; 395 405 ak->cif = 0; /* the default level of the CIF pin from AK4524 */ 396 406 ak->data_mask = ICE1712_DELTA_1010LT_DOUT; … … 407 417 case ICE1712_SUBDEVICE_DELTA44: 408 418 ak->num_adcs = ak->num_dacs = 4; 419 ak->type = SND_AK4524; 409 420 ak->cif = 0; /* the default level of the CIF pin from AK4524 */ 410 421 ak->data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA; … … 472 483 case ICE1712_SUBDEVICE_DELTA66: 473 484 case ICE1712_SUBDEVICE_AUDIOPHILE: 485 case ICE1712_SUBDEVICE_DELTA410: 486 case ICE1712_SUBDEVICE_DELTA1010LT: 474 487 err = snd_ice1712_spdif_build_controls(ice); 475 488 if (err < 0) … … 491 504 /* ak4524 controls */ 492 505 switch (ice->eeprom.subvendor) { 506 case ICE1712_SUBDEVICE_DELTA1010LT: 493 507 case ICE1712_SUBDEVICE_AUDIOPHILE: 508 case ICE1712_SUBDEVICE_DELTA410: 494 509 case ICE1712_SUBDEVICE_DELTA44: 495 510 case ICE1712_SUBDEVICE_DELTA66: … … 539 554 }, 540 555 { 556 ICE1712_SUBDEVICE_DELTA410, 557 "M Audio Delta 410", 558 snd_ice1712_delta_init, 559 snd_ice1712_delta_add_controls, 560 }, 561 { 541 562 ICE1712_SUBDEVICE_DELTA1010LT, 542 563 "M Audio Delta 1010LT", -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/delta.h
r212 r215 38 38 #define ICE1712_SUBDEVICE_DELTA44 0x121433d6 39 39 #define ICE1712_SUBDEVICE_AUDIOPHILE 0x121434d6 40 #define ICE1712_SUBDEVICE_DELTA410 0x121438d6 40 41 #define ICE1712_SUBDEVICE_DELTA1010LT 0x12143bd6 41 42 … … 107 108 /* 0x80 = CODEC_CHIP_B */ 108 109 109 /* MidiMan M-Audio Audiophile definitions */ 110 /* MidiMan M-Audio Audiophile/Delta410 definitions */ 111 /* thanks to Kristof Pelckmans <Kristof.Pelckmans@antwerpen.be> for Delta410 info */ 110 112 /* 0x01 = DFS */ 111 113 #define ICE1712_DELTA_AP_CCLK 0x02 /* SPI clock */ … … 115 117 #define ICE1712_DELTA_AP_CS_DIGITAL 0x10 /* CS8427 chip select */ 116 118 /* low signal = select */ 117 #define ICE1712_DELTA_AP_CS_CODEC 0x20 /* AK4528 chip select */119 #define ICE1712_DELTA_AP_CS_CODEC 0x20 /* AK4528 (audiophile), AK4529 (Delta410) chip select */ 118 120 /* low signal = select */ 119 121 -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ews.c
r212 r215 407 407 case ICE1712_SUBDEVICE_EWS88MT: 408 408 ak->num_adcs = ak->num_dacs = 8; 409 ak->type = SND_AK4524; 409 410 ak->cif = 1; /* CIF high */ 410 411 ak->data_mask = ICE1712_EWS88_SERIAL_DATA; … … 419 420 case ICE1712_SUBDEVICE_EWX2496: 420 421 ak->num_adcs = ak->num_dacs = 2; 422 ak->type = SND_AK4524; 421 423 ak->cif = 1; /* CIF high */ 422 424 ak->data_mask = ICE1712_EWS88_SERIAL_DATA; … … 431 433 case ICE1712_SUBDEVICE_DMX6FIRE: 432 434 ak->num_adcs = ak->num_dacs = 6; 435 ak->type = SND_AK4524; 433 436 ak->cif = 1; /* CIF high */ 434 437 ak->data_mask = ICE1712_6FIRE_SERIAL_DATA; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c
r212 r215 105 105 static int snd_ice1712_build_controls(ice1712_t *ice); 106 106 107 static int PRO_RATE_LOCKED = 0; 108 static int PRO_RATE_RESET = 1; 109 static unsigned int PRO_RATE_DEFAULT = 44100; 110 107 111 /* 108 112 * Basic I/O 109 113 */ 114 115 static inline int is_spdif_master(ice1712_t *ice) 116 { 117 return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0; 118 } 119 120 static inline int is_pro_rate_locked(ice1712_t *ice) 121 { 122 return is_spdif_master(ice) || PRO_RATE_LOCKED; 123 } 110 124 111 125 static inline void snd_ice1712_ds_write(ice1712_t * ice, u8 channel, u8 addr, u32 data) … … 981 995 /* 982 996 */ 983 static void snd_ice1712_set_pro_rate(ice1712_t *ice, snd_pcm_substream_t *substream)997 static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int do_not_lock) 984 998 { 985 999 unsigned long flags; 986 unsigned int rate;987 1000 unsigned char val; 1001 int old_lock_value; 988 1002 989 1003 spin_lock_irqsave(&ice->reg_lock, flags); 990 if ((inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW| 1004 old_lock_value = PRO_RATE_LOCKED; 1005 if (do_not_lock) 1006 PRO_RATE_LOCKED = 0; 1007 if (inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW| 991 1008 ICE1712_PLAYBACK_PAUSE| 992 ICE1712_PLAYBACK_START)) || 993 (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) { 1009 ICE1712_PLAYBACK_START)) { 994 1010 spin_unlock_irqrestore(&ice->reg_lock, flags); 995 1011 return; 996 1012 } 997 rate = substream->runtime->rate; 1013 if (!is_pro_rate_locked(ice)) 1014 goto __unlock; 1015 998 1016 switch (rate) { 999 1017 case 8000: val = 6; break; … … 1016 1034 } 1017 1035 outb(val, ICEMT(ice, RATE)); 1036 PRO_RATE_LOCKED = old_lock_value; 1037 1038 __unlock: 1018 1039 spin_unlock_irqrestore(&ice->reg_lock, flags); 1019 1040 1020 1041 if (ice->ak4524.ops.set_rate_val) 1021 ice->ak4524.ops.set_rate_val(ice, val);1042 ice->ak4524.ops.set_rate_val(ice, rate); 1022 1043 } 1023 1044 … … 1028 1049 1029 1050 ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream); 1030 snd_ice1712_set_pro_rate(ice, substream );1051 snd_ice1712_set_pro_rate(ice, substream->runtime->rate, 0); 1031 1052 spin_lock_irqsave(&ice->reg_lock, flags); 1032 1053 outl(substream->runtime->dma_addr, ICEMT(ice, PLAYBACK_ADDR)); … … 1047 1068 1048 1069 ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream); 1049 snd_ice1712_set_pro_rate(ice, substream );1070 snd_ice1712_set_pro_rate(ice, substream->runtime->rate, 0); 1050 1071 spin_lock_irqsave(&ice->reg_lock, flags); 1051 1072 outl(substream->runtime->dma_addr, ICEMT(ice, CAPTURE_ADDR)); … … 1152 1173 ice1712_t *ice = snd_pcm_substream_chip(substream); 1153 1174 1175 if (PRO_RATE_RESET) 1176 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); 1154 1177 ice->playback_pro_substream = NULL; 1155 1178 if (ice->spdif.ops.close) … … 1163 1186 ice1712_t *ice = snd_pcm_substream_chip(substream); 1164 1187 1188 if (PRO_RATE_RESET) 1189 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); 1165 1190 ice->capture_pro_substream = NULL; 1166 1191 return 0; … … 1496 1521 } 1497 1522 1498 static void __exitsnd_ice1712_proc_done(ice1712_t * ice)1523 static void snd_ice1712_proc_done(ice1712_t * ice) 1499 1524 { 1500 1525 if (ice->proc_entry) { … … 1533 1558 /* 1534 1559 */ 1535 static int snd_ice1712_spdif_ default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)1560 static int snd_ice1712_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1536 1561 { 1537 1562 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; … … 1562 1587 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1563 1588 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1564 .info = snd_ice1712_spdif_ default_info,1589 .info = snd_ice1712_spdif_info, 1565 1590 .get = snd_ice1712_spdif_default_get, 1566 1591 .put = snd_ice1712_spdif_default_put 1567 1592 }; 1568 1569 static int snd_ice1712_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)1570 {1571 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;1572 uinfo->count = 1;1573 return 0;1574 }1575 1593 1576 1594 static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol, … … 1621 1639 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1622 1640 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1623 .info = snd_ice1712_spdif_ mask_info,1641 .info = snd_ice1712_spdif_info, 1624 1642 .get = snd_ice1712_spdif_maskc_get, 1625 1643 }; … … 1630 1648 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1631 1649 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 1632 .info = snd_ice1712_spdif_ mask_info,1650 .info = snd_ice1712_spdif_info, 1633 1651 .get = snd_ice1712_spdif_maskp_get, 1634 1652 }; 1635 1636 static int snd_ice1712_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)1637 {1638 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;1639 uinfo->count = 1;1640 return 0;1641 }1642 1653 1643 1654 static int snd_ice1712_spdif_stream_get(snd_kcontrol_t * kcontrol, … … 1664 1675 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1665 1676 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1666 .info = snd_ice1712_spdif_ stream_info,1677 .info = snd_ice1712_spdif_info, 1667 1678 .get = snd_ice1712_spdif_stream_get, 1668 1679 .put = snd_ice1712_spdif_stream_put … … 1710 1721 } 1711 1722 1712 static int snd_ice1712_pro_spdif_master_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1723 /* 1724 * rate 1725 */ 1726 static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1727 { 1728 static char *texts[] = { 1729 "8000", /* 0: 6 */ 1730 "9600", /* 1: 3 */ 1731 "11025", /* 2: 10 */ 1732 "12000", /* 3: 2 */ 1733 "16000", /* 4: 5 */ 1734 "22050", /* 5: 9 */ 1735 "24000", /* 6: 1 */ 1736 "32000", /* 7: 4 */ 1737 "44100", /* 8: 8 */ 1738 "48000", /* 9: 0 */ 1739 "64000", /* 10: 15 */ 1740 "88200", /* 11: 11 */ 1741 "96000", /* 12: 7 */ 1742 "IEC958 Input", /* 13: -- */ 1743 }; 1744 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1745 uinfo->count = 1; 1746 uinfo->value.enumerated.items = 14; 1747 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 1748 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 1749 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 1750 return 0; 1751 } 1752 1753 static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1754 { 1755 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1756 static unsigned char xlate[16] = { 1757 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10 1758 }; 1759 unsigned char val; 1760 1761 spin_lock_irq(&ice->reg_lock); 1762 if (is_spdif_master(ice)) { 1763 ucontrol->value.enumerated.item[0] = 13; 1764 } else { 1765 val = xlate[inb(ICEMT(ice, RATE)) & 15]; 1766 if (val == 255) { 1767 snd_BUG(); 1768 val = 0; 1769 } 1770 ucontrol->value.enumerated.item[0] = val; 1771 } 1772 spin_unlock_irq(&ice->reg_lock); 1773 return 0; 1774 } 1775 1776 static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1777 { 1778 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1779 static unsigned int xrate[13] = { 1780 8000, 9600, 11025, 12000, 1600, 22050, 24000, 1781 32000, 44100, 48000, 64000, 88200, 96000 1782 }; 1783 unsigned char oval; 1784 int change = 0; 1785 1786 spin_lock_irq(&ice->reg_lock); 1787 oval = inb(ICEMT(ice, RATE)); 1788 if (ucontrol->value.enumerated.item[0] == 13) { 1789 outb(oval | ICE1712_SPDIF_MASTER, ICEMT(ice, RATE)); 1790 } else { 1791 PRO_RATE_DEFAULT = xrate[ucontrol->value.integer.value[0] % 13]; 1792 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 1); 1793 } 1794 change = inb(ICEMT(ice, RATE)) != oval; 1795 1796 if ((oval & ICE1712_SPDIF_MASTER) != (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) { 1797 /* change CS8427 clock source too */ 1798 if (ice->cs8427) { 1799 snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice)); 1800 } 1801 /* notify ak4524 chip as well */ 1802 if (is_spdif_master(ice) && ice->ak4524.ops.set_rate_val) 1803 ice->ak4524.ops.set_rate_val(ice, 0); 1804 } 1805 1806 return change; 1807 } 1808 1809 static snd_kcontrol_new_t snd_ice1712_pro_internal_clock = __devinitdata { 1810 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1811 .name = "Multi Track Internal Clock", 1812 .info = snd_ice1712_pro_internal_clock_info, 1813 .get = snd_ice1712_pro_internal_clock_get, 1814 .put = snd_ice1712_pro_internal_clock_put 1815 }; 1816 1817 static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1713 1818 { 1714 1819 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; … … 1719 1824 } 1720 1825 1721 static int snd_ice1712_pro_spdif_master_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1722 { 1723 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1724 unsigned long flags; 1725 1726 spin_lock_irqsave(&ice->reg_lock, flags); 1727 ucontrol->value.integer.value[0] = inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER ? 1 : 0; 1728 spin_unlock_irqrestore(&ice->reg_lock, flags); 1729 return 0; 1730 } 1731 1732 static int snd_ice1712_pro_spdif_master_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1733 { 1734 unsigned long flags; 1735 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1736 int nval, change; 1737 1738 nval = ucontrol->value.integer.value[0] ? ICE1712_SPDIF_MASTER : 0; 1739 spin_lock_irqsave(&ice->reg_lock, flags); 1740 nval |= inb(ICEMT(ice, RATE)) & ~ICE1712_SPDIF_MASTER; 1741 change = inb(ICEMT(ice, RATE)) != nval; 1742 outb(nval, ICEMT(ice, RATE)); 1743 spin_unlock_irqrestore(&ice->reg_lock, flags); 1744 1745 if (ice->cs8427) { 1746 /* change CS8427 clock source too */ 1747 snd_ice1712_cs8427_set_input_clock(ice, ucontrol->value.integer.value[0]); 1748 } 1749 1826 static int snd_ice1712_pro_rate_locking_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1827 { 1828 ucontrol->value.integer.value[0] = PRO_RATE_LOCKED ? 1 : 0; 1829 return 0; 1830 } 1831 1832 static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1833 { 1834 int change = 0; 1835 1836 change = PRO_RATE_LOCKED ? 1 : 0 != ucontrol->value.integer.value[0] ? 1 : 0; 1837 PRO_RATE_LOCKED = ucontrol->value.integer.value[0] ? 1 : 0; 1750 1838 return change; 1751 1839 } 1752 1840 1753 static snd_kcontrol_new_t snd_ice1712_pro_ spdif_master__devinitdata = {1841 static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = { 1754 1842 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1755 .name = "Multi Track IEC958 Master", 1756 .info = snd_ice1712_pro_spdif_master_info, 1757 .get = snd_ice1712_pro_spdif_master_get, 1758 .put = snd_ice1712_pro_spdif_master_put 1843 .name = "Multi Track Rate Locking", 1844 .info = snd_ice1712_pro_rate_locking_info, 1845 .get = snd_ice1712_pro_rate_locking_get, 1846 .put = snd_ice1712_pro_rate_locking_put 1847 }; 1848 1849 static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1850 { 1851 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1852 uinfo->count = 1; 1853 uinfo->value.integer.min = 0; 1854 uinfo->value.integer.max = 1; 1855 return 0; 1856 } 1857 1858 static int snd_ice1712_pro_rate_reset_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1859 { 1860 ucontrol->value.integer.value[0] = PRO_RATE_RESET ? 1 : 0; 1861 return 0; 1862 } 1863 1864 static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1865 { 1866 int change = 0; 1867 1868 change = PRO_RATE_LOCKED ? 1 : 0 != ucontrol->value.integer.value[0] ? 1 : 0; 1869 PRO_RATE_RESET = ucontrol->value.integer.value[0] ? 1 : 0; 1870 return change; 1871 } 1872 1873 static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = { 1874 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1875 .name = "Multi Track Rate Reset", 1876 .info = snd_ice1712_pro_rate_reset_info, 1877 .get = snd_ice1712_pro_rate_reset_get, 1878 .put = snd_ice1712_pro_rate_reset_put 1759 1879 }; 1760 1880 … … 2128 2248 if (err < 0) 2129 2249 return err; 2130 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_spdif_master, ice)); 2250 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_internal_clock, ice)); 2251 if (err < 0) 2252 return err; 2253 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_rate_locking, ice)); 2254 if (err < 0) 2255 return err; 2256 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_rate_reset, ice)); 2131 2257 if (err < 0) 2132 2258 return err; … … 2298 2424 /* 2299 2425 * 2300 * Registrat on2426 * Registration 2301 2427 * 2302 2428 */ -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.h
r212 r215 240 240 int num_adcs; /* AK4524 or AK4528 ADCs */ 241 241 int num_dacs; /* AK4524 or AK4528 DACs */ 242 unsigned char images[4][ 8];242 unsigned char images[4][16]; 243 243 unsigned char ipga_gain[4][2]; 244 244 /* */ 245 unsigned int is_ak4528: 1; /* AK4524 or AK4528 */ 245 enum { 246 SND_AK4524, SND_AK4528, SND_AK4529 247 } type; 246 248 unsigned int cif: 1; 247 249 unsigned char data_mask; … … 255 257 int (*start)(ice1712_t *, unsigned char *, int); 256 258 void (*stop)(ice1712_t *, unsigned char *); 257 void (*set_rate_val)(ice1712_t *, unsigned char);259 void (*set_rate_val)(ice1712_t *, unsigned int); 258 260 } ops; 259 261 }; -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hammerfall_mem.c
-
Property svn:eol-style
set to
native
r212 r215 26 26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 27 27 28 hammerfall_mem.c,v 1. 4 2002/10/21 18:28:25perex Exp28 hammerfall_mem.c,v 1.5 2002/11/04 09:11:42 perex Exp 29 29 30 30 … … 38 38 #include <sound/driver.h> 39 39 #endif 40 #include <linux/config.h>41 40 #include <linux/version.h> 42 41 #include <linux/module.h> -
Property svn:eol-style
set to
-
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c
-
Property svn:eol-style
set to
native
r212 r215 950 950 if (up) { 951 951 if (!hmidi->istimer) { 952 init_timer(&hmidi->timer); 952 953 hmidi->timer.function = snd_hdsp_midi_output_timer; 953 954 hmidi->timer.data = (unsigned long) hmidi; -
Property svn:eol-style
set to
Note:
See TracChangeset
for help on using the changeset viewer.
