Changeset 215
- Timestamp:
- Jul 16, 2007, 2:45:34 AM (18 years ago)
- Location:
- GPL/branches/alsa-resync1/alsa-kernel
- Files:
-
- 34 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_sgbuf.c
r212 r215 67 67 sgbuf->table = kmalloc(sizeof(struct snd_sg_page) * tblsize, GFP_KERNEL); 68 68 if (! sgbuf->table) { 69 snd_pcm_sgbuf_ free(substream);69 snd_pcm_sgbuf_delete(substream); 70 70 return -ENOMEM; 71 71 } … … 159 159 /* 160 160 * get the page pointer on the given offset 161 * used as the page callback of pcm ops 162 */ 163 void *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset) 161 */ 162 static void *sgbuf_get_addr(snd_pcm_substream_t *substream, unsigned long offset) 164 163 { 165 164 struct snd_sg_buf *sgbuf; … … 172 171 return sgbuf->table[idx].buf; 173 172 } 173 174 /* 175 * get the page struct at the given offset 176 * used as the page callback of pcm ops 177 */ 178 struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset) 179 { 180 void *addr = sgbuf_get_addr(substream, offset); 181 if (addr) 182 return virt_to_page(addr); 183 else 184 return 0; 185 } 174 186 #endif 187 175 188 /* 176 189 * do copy_from_user to the sg buffer … … 185 198 len = PAGE_SIZE - hwoff; 186 199 for (;;) { 187 addr = s nd_pcm_sgbuf_ops_page(substream, p);200 addr = sgbuf_get_addr(substream, p); 188 201 if (! addr) 189 202 return -EFAULT; … … 215 228 len = PAGE_SIZE - hwoff; 216 229 for (;;) { 217 addr = s nd_pcm_sgbuf_ops_page(substream, p);230 addr = sgbuf_get_addr(substream, p); 218 231 if (! addr) 219 232 return -EFAULT; … … 247 260 page_len = bytes_to_samples(substream->runtime, PAGE_SIZE); 248 261 for (;;) { 249 addr = s nd_pcm_sgbuf_ops_page(substream, p);262 addr = sgbuf_get_addr(substream, p); 250 263 if (! addr) 251 264 return -EFAULT; -
GPL/branches/alsa-resync1/alsa-kernel/drivers/mtpav.c
r212 r215 685 685 spin_lock_init(&ncrd->spinlock); 686 686 687 init_timer(&ncrd->timer); 687 688 ncrd->card = NULL; 688 689 ncrd->irq = -1; -
GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c
r212 r215 888 888 uart->rstatus = 0; 889 889 memset(uart->prev_status, 0x80, sizeof(unsigned char) * SNDRV_SERIAL_MAX_OUTS); 890 init_timer(&uart->buffer_timer); 890 891 uart->buffer_timer.function = snd_uart16550_buffer_timer; 891 892 uart->buffer_timer.data = (unsigned long)uart; -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/adriver.h
-
Property svn:eol-style
set to
native
-
Property svn:eol-style
set to
-
GPL/branches/alsa-resync1/alsa-kernel/include/sound/core.h
r212 r215 262 262 #define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) 263 263 #define kfree(obj) snd_hidden_kfree(obj) 264 #define kfree_nocheck(obj) snd_wrapper_kfree(obj)265 264 #define vmalloc(size) snd_hidden_vmalloc(size) 266 265 #define vfree(obj) snd_hidden_vfree(obj) 267 266 #define kstrdup(s, flags) snd_hidden_kstrdup(s, flags) 268 267 #else 268 #define kmalloc_nocheck(size, flags) kmalloc(size, flags) 269 #define vmalloc_nocheck(size) vmalloc(size) 269 270 #define kfree_nocheck(obj) kfree(obj) 270 271 #endif -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/cs4231.h
r212 r215 27 27 #include "timer.h" 28 28 29 #ifdef CONFIG_SBUS 30 #define SBUS_SUPPORT 31 #include <asm/sbus.h> 32 #endif 33 34 #if defined(CONFIG_PCI) && defined(CONFIG_SPARC64) 35 #define EBUS_SUPPORT 36 #include <linux/pci.h> 37 #include <asm/ebus.h> 38 #endif 39 40 #if !defined(SBUS_SUPPORT) && !defined(EBUS_SUPPORT) 41 #define LEGACY_SUPPORT 42 #endif 43 29 44 /* IO ports */ 30 45 31 #define CS4231P( chip, x) ((chip)->port +c_d_c_CS4231##x)46 #define CS4231P(x) (c_d_c_CS4231##x) 32 47 33 48 #define c_d_c_CS4231REGSEL 0 … … 222 237 struct _snd_cs4231 { 223 238 unsigned long port; /* base i/o port */ 239 #ifdef LEGACY_SUPPORT 224 240 struct resource *res_port; 225 241 unsigned long cport; /* control base i/o port (CS4236) */ … … 228 244 int dma1; /* playback DMA */ 229 245 int dma2; /* record DMA */ 246 #endif 230 247 unsigned short version; /* version of CODEC chip */ 231 248 unsigned short mode; /* see to CS4231_MODE_XXXX */ 232 249 unsigned short hardware; /* see to CS4231_HW_XXXX */ 233 250 unsigned short hwshare; /* shared resources */ 234 unsigned short single_dma:1; /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */ 251 unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */ 252 ebus_flag:1; /* SPARC: EBUS present */ 253 254 #ifdef EBUS_SUPPORT 255 struct ebus_dma_info eb2c; 256 struct ebus_dma_info eb2p; 257 #endif 258 259 #if defined(SBUS_SUPPORT) || defined(EBUS_SUPPORT) 260 union { 261 #ifdef SBUS_SUPPORT 262 struct sbus_dev *sdev; 263 #endif 264 #ifdef EBUS_SUPPORT 265 struct pci_dev *pdev; 266 #endif 267 } dev_u; 268 unsigned int p_periods_sent; 269 unsigned int c_periods_sent; 270 #endif 235 271 236 272 snd_card_t *card; … … 246 282 int calibrate_mute; 247 283 int sw_3d_bit; 284 #ifdef LEGACY_SUPPORT 248 285 unsigned int p_dma_size; 249 286 unsigned int c_dma_size; 287 #endif 250 288 251 289 spinlock_t reg_lock; … … 256 294 void (*set_playback_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, unsigned char pdfr); 257 295 void (*set_capture_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, unsigned char cdfr); 296 void (*trigger) (cs4231_t *chip, unsigned int what, int start); 258 297 #ifdef CONFIG_PM 259 298 void (*suspend) (cs4231_t *chip); … … 261 300 #endif 262 301 void *dma_private_data; 302 #ifdef LEGACY_SUPPORT 263 303 int (*claim_dma) (cs4231_t *chip, void *dma_private_data, int dma); 264 304 int (*release_dma) (cs4231_t *chip, void *dma_private_data, int dma); 305 #endif 265 306 }; 266 307 -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm_sgbuf.h
r32 r215 110 110 int snd_pcm_sgbuf_ops_copy_capture(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t hwoff, void *buf, snd_pcm_uframes_t count); 111 111 int snd_pcm_sgbuf_ops_silence(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t hwoff, snd_pcm_uframes_t count); 112 void*snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset);112 struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); 113 113 114 114 -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/uda1341.h
-
Property svn:eol-style
set to
native
-
Property svn:eol-style
set to
-
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c
r212 r215 125 125 */ 126 126 127 #if !defined(EBUS_SUPPORT) && !defined(SBUS_SUPPORT) 128 #define __CS4231_INLINE__ inline 129 #else 130 #define __CS4231_INLINE__ /* nothing */ 131 #endif 132 133 static __CS4231_INLINE__ void cs4231_outb(cs4231_t *chip, u8 offset, u8 val) 134 { 135 #ifdef EBUS_SUPPORT 136 if (chip->ebus->flag) { 137 writeb(val, chip->port + (offset << 2)); 138 } else { 139 #endif 140 #ifdef SBUS_SUPPORT 141 sbus_writeb(val, chip->port + (offset << 2)); 142 #endif 143 #ifdef EBUS_SUPPORT 144 } 145 #endif 146 #ifdef LEGACY_SUPPORT 147 outb(val, chip->port + offset); 148 #endif 149 } 150 151 static __CS4231_INLINE__ u8 cs4231_inb(cs4231_t *chip, u8 offset) 152 { 153 #ifdef EBUS_SUPPORT 154 if (chip->ebus_flag) { 155 return readb(chip->port + (offset << 2)); 156 } else { 157 #endif 158 #ifdef SBUS_SUPPORT 159 return sbus_writeb(chip->port + (offset << 2)); 160 #endif 161 #ifdef EBUS_SUPPORT 162 } 163 #endif 164 #ifdef LEGACY_SUPPORT 165 return inb(chip->port + offset); 166 #endif 167 } 168 127 169 void snd_cs4231_outm(cs4231_t *chip, unsigned char reg, 128 170 unsigned char mask, unsigned char value) … … 132 174 133 175 for (timeout = 250; 134 timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT);176 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 135 177 timeout--) 136 178 udelay(100); 137 179 #ifdef CONFIG_SND_DEBUG 138 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)180 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 139 181 snd_printk("outm: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 140 182 #endif … … 143 185 chip->image[reg] |= value; 144 186 } else { 145 outb(chip->mce_bit | reg, CS4231P(chip, REGSEL));187 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 146 188 mb(); 147 189 tmp = (chip->image[reg] & mask) | value; 148 outb(tmp, CS4231P(chip, REG));190 cs4231_outb(chip, CS4231P(REG), tmp); 149 191 chip->image[reg] = tmp; 150 192 mb(); … … 157 199 158 200 for (timeout = 250; 159 timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT);201 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 160 202 timeout--) 161 203 udelay(10); 162 outb(chip->mce_bit | reg, CS4231P(chip, REGSEL));163 outb(value, CS4231P(chip, REG));204 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 205 cs4231_outb(chip, CS4231P(REG), value); 164 206 mb(); 165 207 } … … 170 212 171 213 for (timeout = 250; 172 timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT);214 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 173 215 timeout--) 174 216 udelay(100); 175 217 #ifdef CONFIG_SND_DEBUG 176 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)218 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 177 219 snd_printk("out: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 178 220 #endif 179 outb(chip->mce_bit | reg, CS4231P(chip, REGSEL));180 outb(value, CS4231P(chip, REG));221 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 222 cs4231_outb(chip, CS4231P(REG), value); 181 223 chip->image[reg] = value; 182 224 mb(); … … 191 233 192 234 for (timeout = 250; 193 timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT);235 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 194 236 timeout--) 195 237 udelay(100); 196 238 #ifdef CONFIG_SND_DEBUG 197 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)239 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 198 240 snd_printk("in: auto calibration time out - reg = 0x%x\n", reg); 199 241 #endif 200 outb(chip->mce_bit | reg, CS4231P(chip, REGSEL));242 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 201 243 mb(); 202 return inb(CS4231P(chip,REG));244 return cs4231_inb(chip, CS4231P(REG)); 203 245 } 204 246 205 247 void snd_cs4236_ext_out(cs4231_t *chip, unsigned char reg, unsigned char val) 206 248 { 207 outb(chip->mce_bit | 0x17, CS4231P(chip, REGSEL));208 outb(reg | (chip->image[CS4236_EXT_REG] & 0x01), CS4231P(chip, REG));209 outb(val, CS4231P(chip, REG));249 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | 0x17); 250 cs4231_outb(chip, CS4231P(REG), reg | (chip->image[CS4236_EXT_REG] & 0x01)); 251 cs4231_outb(chip, CS4231P(REG), val); 210 252 chip->eimage[CS4236_REG(reg)] = val; 211 253 #if 0 … … 216 258 unsigned char snd_cs4236_ext_in(cs4231_t *chip, unsigned char reg) 217 259 { 218 outb(chip->mce_bit | 0x17, CS4231P(chip, REGSEL));219 outb(reg | (chip->image[CS4236_EXT_REG] & 0x01), CS4231P(chip, REG));260 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | 0x17); 261 cs4231_outb(chip, CS4231P(REG), reg | (chip->image[CS4236_EXT_REG] & 0x01)); 220 262 #if 1 221 return inb(CS4231P(chip,REG));263 return cs4231_inb(chip, CS4231P(REG)); 222 264 #else 223 265 { 224 266 unsigned char res; 225 res = inb(CS4231P(chip,REG));267 res = cs4231_inb(chip, CS4231P(REG)); 226 268 printk("ext in : reg = 0x%x, val = 0x%x\n", reg, res); 227 269 return res; … … 234 276 void snd_cs4231_debug(cs4231_t *chip) 235 277 { 236 printk("CS4231 REGS: INDEX = 0x%02x ", inb(CS4231P(chip,REGSEL)));237 printk(" STATUS = 0x%02x\n", inb(CS4231P(chip,STATUS)));278 printk("CS4231 REGS: INDEX = 0x%02x ", cs4231_inb(chip, CS4231P(REGSEL))); 279 printk(" STATUS = 0x%02x\n", cs4231_inb(chip, CS4231P(STATUS))); 238 280 printk(" 0x00: left input = 0x%02x ", snd_cs4231_in(chip, 0x00)); 239 281 printk(" 0x10: alt 1 (CFIG 2) = 0x%02x\n", snd_cs4231_in(chip, 0x10)); … … 282 324 /* huh.. looks like this sequence is proper for CS4231A chip (GUS MAX) */ 283 325 for (timeout = 5; timeout > 0; timeout--) 284 inb(CS4231P(chip,REGSEL));326 cs4231_inb(chip, CS4231P(REGSEL)); 285 327 /* end of cleanup sequence */ 286 328 for (timeout = 250; 287 timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT);329 timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); 288 330 timeout--) 289 331 udelay(10); … … 296 338 297 339 spin_lock_irqsave(&chip->reg_lock, flags); 298 for (timeout = 250; timeout > 0 && ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT); timeout--)340 for (timeout = 250; timeout > 0 && (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT); timeout--) 299 341 udelay(100); 300 342 #ifdef CONFIG_SND_DEBUG 301 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)343 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 302 344 snd_printk("mce_up - auto calibration time out (0)\n"); 303 345 #endif 304 346 chip->mce_bit |= CS4231_MCE; 305 timeout = inb(CS4231P(chip,REGSEL));347 timeout = cs4231_inb(chip, CS4231P(REGSEL)); 306 348 if (timeout == 0x80) 307 349 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 308 350 if (!(timeout & CS4231_MCE)) 309 outb(chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));351 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 310 352 spin_unlock_irqrestore(&chip->reg_lock, flags); 311 353 } … … 323 365 #endif 324 366 #ifdef CONFIG_SND_DEBUG 325 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)326 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", CS4231P(chip,REGSEL));367 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 368 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", (long)CS4231P(REGSEL)); 327 369 #endif 328 370 chip->mce_bit &= ~CS4231_MCE; 329 timeout = inb(CS4231P(chip,REGSEL));330 outb(chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));371 timeout = cs4231_inb(chip, CS4231P(REGSEL)); 372 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 331 373 if (timeout == 0x80) 332 374 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); … … 365 407 #endif 366 408 time = HZ / 10; 367 while ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT) {409 while (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) { 368 410 spin_unlock_irqrestore(&chip->reg_lock, flags); 369 411 if (time <= 0) { … … 378 420 #if 0 379 421 printk("(4) jiffies = %li\n", jiffies); 380 snd_printk("mce_down - exit = 0x%x\n", inb(CS4231P(chip,REGSEL)));422 snd_printk("mce_down - exit = 0x%x\n", cs4231_inb(chip, CS4231P(REGSEL))); 381 423 #endif 382 424 } … … 404 446 405 447 #if 0 406 printk("codec trigger!!! - what = %i, enable = %i, status = 0x%x\n", what, enable, inb(CS4231P(card,STATUS)));448 printk("codec trigger!!! - what = %i, enable = %i, status = 0x%x\n", what, enable, cs4231_inb(chip, CS4231P(STATUS))); 407 449 #endif 408 450 … … 424 466 } while (s != substream); 425 467 spin_lock(&chip->reg_lock); 426 if (cmd == SNDRV_PCM_TRIGGER_START) 468 if (cmd == SNDRV_PCM_TRIGGER_START) { 427 469 chip->image[CS4231_IFACE_CTRL] |= what; 428 else 470 if (chip->trigger) 471 chip->trigger(chip, what, 1); 472 } else { 429 473 chip->image[CS4231_IFACE_CTRL] &= ~what; 474 if (chip->trigger) 475 chip->trigger(chip, what, 0); 476 } 430 477 snd_cs4231_out(chip, CS4231_IFACE_CTRL, chip->image[CS4231_IFACE_CTRL]); 431 478 spin_unlock(&chip->reg_lock); … … 714 761 CS4231_TIMER_IRQ); 715 762 snd_cs4231_out(chip, CS4231_IRQ_STATUS, 0); 716 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */717 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */763 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 764 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 718 765 chip->image[CS4231_PIN_CTRL] |= CS4231_IRQ_ENABLE; 719 766 snd_cs4231_out(chip, CS4231_PIN_CTRL, chip->image[CS4231_PIN_CTRL]); … … 744 791 spin_lock_irqsave(&chip->reg_lock, flags); 745 792 snd_cs4231_out(chip, CS4231_IRQ_STATUS, 0); 746 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */747 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */793 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 794 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 748 795 chip->image[CS4231_PIN_CTRL] &= ~CS4231_IRQ_ENABLE; 749 796 snd_cs4231_out(chip, CS4231_PIN_CTRL, chip->image[CS4231_PIN_CTRL]); … … 766 813 /* clear IRQ again */ 767 814 snd_cs4231_out(chip, CS4231_IRQ_STATUS, 0); 768 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */769 outb(0, CS4231P(chip, STATUS)); /* clear IRQ */815 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 816 cs4231_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 770 817 spin_unlock_irqrestore(&chip->reg_lock, flags); 771 818 … … 830 877 } 831 878 879 #ifdef LEGACY_SUPPORT 832 880 static int snd_cs4231_playback_prepare(snd_pcm_substream_t * substream) 833 881 { … … 851 899 return 0; 852 900 } 901 #endif /* LEGACY_SUPPORT */ 853 902 854 903 static int snd_cs4231_capture_hw_params(snd_pcm_substream_t * substream, … … 872 921 } 873 922 923 #ifdef LEGACY_SUPPORT 874 924 static int snd_cs4231_capture_prepare(snd_pcm_substream_t * substream) 875 925 { … … 895 945 return 0; 896 946 } 947 #endif 897 948 898 949 static void snd_cs4231_overrange(cs4231_t *chip) … … 941 992 } 942 993 994 #ifdef LEGACY_SUPPORT 943 995 static snd_pcm_uframes_t snd_cs4231_playback_pointer(snd_pcm_substream_t * substream) 944 996 { … … 962 1014 return bytes_to_frames(substream->runtime, ptr); 963 1015 } 1016 #endif /* LEGACY_SUPPORT */ 964 1017 965 1018 /* … … 967 1020 */ 968 1021 969 staticint snd_cs4231_probe(cs4231_t *chip)1022 int snd_cs4231_probe(cs4231_t *chip) 970 1023 { 971 1024 unsigned long flags; … … 980 1033 for (i = 0; i < 50; i++) { 981 1034 mb(); 982 if ( inb(CS4231P(chip,REGSEL)) & CS4231_INIT)1035 if (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 983 1036 udelay(2000); 984 1037 else { … … 1021 1074 } 1022 1075 spin_lock_irqsave(&chip->reg_lock, flags); 1023 inb(CS4231P(chip,STATUS)); /* clear any pendings IRQ */1024 outb(0, CS4231P(chip, STATUS));1076 cs4231_inb(chip, CS4231P(STATUS)); /* clear any pendings IRQ */ 1077 cs4231_outb(chip, CS4231P(STATUS), 0); 1025 1078 mb(); 1026 1079 spin_unlock_irqrestore(&chip->reg_lock, flags); … … 1190 1243 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE; 1191 1244 1245 #ifdef LEGACY_SUPPORT 1192 1246 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max); 1193 1247 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max); … … 1197 1251 return err; 1198 1252 } 1253 #endif 1199 1254 1200 1255 if ((err = snd_cs4231_open(chip, CS4231_MODE_PLAY)) < 0) { 1256 #ifdef LEGACY_SUPPORT 1201 1257 if (chip->release_dma) 1202 1258 chip->release_dma(chip, chip->dma_private_data, chip->dma1); 1259 #endif 1203 1260 snd_free_pages(runtime->dma_area, runtime->dma_bytes); 1204 1261 return err; 1205 1262 } 1206 1263 chip->playback_substream = substream; 1264 #if defined(SBUS_SUPPORT) || defined(EBUS_SUPPORT) 1265 chip->p_periods_sent = 0; 1266 #endif 1207 1267 snd_pcm_set_sync(substream); 1208 1268 chip->rate_constraint(runtime); … … 1223 1283 runtime->hw.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE; 1224 1284 1285 #ifdef LEGACY_SUPPORT 1286 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); 1287 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max); 1288 1225 1289 if (chip->claim_dma) { 1226 1290 if ((err = chip->claim_dma(chip, chip->dma_private_data, chip->dma2)) < 0) 1227 1291 return err; 1228 1292 } 1229 1230 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); 1231 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max); 1293 #endif 1232 1294 1233 1295 if ((err = snd_cs4231_open(chip, CS4231_MODE_RECORD)) < 0) { 1296 #ifdef LEGACY_SUPPORT 1234 1297 if (chip->release_dma) 1235 1298 chip->release_dma(chip, chip->dma_private_data, chip->dma2); 1299 #endif 1236 1300 snd_free_pages(runtime->dma_area, runtime->dma_bytes); 1237 1301 return err; 1238 1302 } 1239 1303 chip->capture_substream = substream; 1304 #if defined(SBUS_SUPPORT) || defined(EBUS_SUPPORT) 1305 chip->c_periods_sent = 0; 1306 #endif 1240 1307 snd_pcm_set_sync(substream); 1241 1308 chip->rate_constraint(runtime); … … 1302 1369 snd_cs4231_busy_wait(chip); 1303 1370 chip->mce_bit &= ~CS4231_MCE; 1304 timeout = inb(CS4231P(chip,REGSEL));1305 outb(chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));1371 timeout = cs4231_inb(chip, CS4231P(REGSEL)); 1372 cs4231_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 1306 1373 if (timeout == 0x80) 1307 1374 snd_printk("down [0x%lx]: serious init problem - codec still busy\n", chip->port); … … 1335 1402 #endif /* CONFIG_PM */ 1336 1403 1404 #ifdef LEGACY_SUPPORT 1405 1337 1406 static int snd_cs4231_free(cs4231_t *chip) 1338 1407 { … … 1373 1442 return snd_cs4231_free(chip); 1374 1443 } 1444 1445 #endif /* LEGACY_SUPPORT */ 1375 1446 1376 1447 const char *snd_cs4231_chip_id(cs4231_t *chip) … … 1393 1464 } 1394 1465 1395 int snd_cs4231_create(snd_card_t * card, 1396 unsigned long port, 1397 unsigned long cport, 1398 int irq, int dma1, int dma2, 1466 static int snd_cs4231_new(snd_card_t * card, 1399 1467 unsigned short hardware, 1400 1468 unsigned short hwshare, 1401 1469 cs4231_t ** rchip) 1402 1470 { 1403 static snd_device_ops_t ops = {1404 .dev_free = snd_cs4231_dev_free,1405 };1406 1471 cs4231_t *chip; 1407 int err;1408 1472 1409 1473 *rchip = NULL; … … 1411 1475 if (chip == NULL) 1412 1476 return -ENOMEM; 1413 chip->irq = -1;1414 chip->dma1 = -1;1415 chip->dma2 = -1;1416 1477 chip->hardware = hardware; 1417 1478 chip->hwshare = hwshare; 1418 1419 if ((chip->res_port = request_region(port, 4, "CS4231")) == NULL) {1420 snd_cs4231_free(chip);1421 return -EBUSY;1422 }1423 chip->port = port;1424 if ((long)cport >= 0 && (chip->res_cport = request_region(cport, 8, "CS4232 Control")) == NULL) {1425 snd_cs4231_free(chip);1426 return -ENODEV;1427 }1428 chip->cport = cport;1429 if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, SA_INTERRUPT, "CS4231", (void *) chip)) {1430 snd_cs4231_free(chip);1431 return -EBUSY;1432 }1433 chip->irq = irq;1434 if (!(hwshare & CS4231_HWSHARE_DMA1) && request_dma(dma1, "CS4231 - 1")) {1435 snd_cs4231_free(chip);1436 return -EBUSY;1437 }1438 chip->dma1 = dma1;1439 if (!(hwshare & CS4231_HWSHARE_DMA2) && dma1 != dma2 && dma2 >= 0 && request_dma(dma2, "CS4231 - 2")) {1440 snd_cs4231_free(chip);1441 return -EBUSY;1442 }1443 if (dma1 == dma2 || dma2 < 0) {1444 chip->single_dma = 1;1445 chip->dma2 = chip->dma1;1446 } else1447 chip->dma2 = dma2;1448 1479 1449 1480 spin_lock_init(&chip->reg_lock); … … 1456 1487 memcpy(&chip->image, &snd_cs4231_original_image, sizeof(snd_cs4231_original_image)); 1457 1488 1489 *rchip = chip; 1490 return 0; 1491 } 1492 1493 #ifdef LEGACY_SUPPORT 1494 1495 int snd_cs4231_create(snd_card_t * card, 1496 unsigned long port, 1497 unsigned long cport, 1498 int irq, int dma1, int dma2, 1499 unsigned short hardware, 1500 unsigned short hwshare, 1501 cs4231_t ** rchip) 1502 { 1503 static snd_device_ops_t ops = { 1504 .dev_free = snd_cs4231_dev_free, 1505 }; 1506 cs4231_t *chip; 1507 int err; 1508 1509 err = snd_cs4231_new(card, hardware, hwshare, &chip); 1510 if (err < 0) 1511 return err; 1512 1513 chip->irq = -1; 1514 chip->dma1 = -1; 1515 chip->dma2 = -1; 1516 1517 if ((chip->res_port = request_region(port, 4, "CS4231")) == NULL) { 1518 snd_cs4231_free(chip); 1519 return -EBUSY; 1520 } 1521 chip->port = port; 1522 if ((long)cport >= 0 && (chip->res_cport = request_region(cport, 8, "CS4232 Control")) == NULL) { 1523 snd_cs4231_free(chip); 1524 return -ENODEV; 1525 } 1526 chip->cport = cport; 1527 if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, SA_INTERRUPT, "CS4231", (void *) chip)) { 1528 snd_cs4231_free(chip); 1529 return -EBUSY; 1530 } 1531 chip->irq = irq; 1532 if (!(hwshare & CS4231_HWSHARE_DMA1) && request_dma(dma1, "CS4231 - 1")) { 1533 snd_cs4231_free(chip); 1534 return -EBUSY; 1535 } 1536 chip->dma1 = dma1; 1537 if (!(hwshare & CS4231_HWSHARE_DMA2) && dma1 != dma2 && dma2 >= 0 && request_dma(dma2, "CS4231 - 2")) { 1538 snd_cs4231_free(chip); 1539 return -EBUSY; 1540 } 1541 if (dma1 == dma2 || dma2 < 0) { 1542 chip->single_dma = 1; 1543 chip->dma2 = chip->dma1; 1544 } else 1545 chip->dma2 = dma2; 1546 1458 1547 /* global setup */ 1459 1548 if (snd_cs4231_probe(chip) < 0) { … … 1486 1575 return 0; 1487 1576 } 1577 1578 #endif /* LEGACY_SUPPORT */ 1488 1579 1489 1580 static snd_pcm_ops_t snd_cs4231_playback_ops = { … … 1541 1632 strcpy(pcm->name, snd_cs4231_chip_id(chip)); 1542 1633 1634 #ifdef LEGACY_SUPPORT 1543 1635 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 1636 #else 1637 # ifdef EBUS_SUPPORT 1638 if (chip->ebus_flag) { 1639 snd_pcm_lib_preallocate_pci_pages_for_all(chip->dev_u.pdev, pcm, 1640 64*1024, 128*1024); 1641 } else { 1642 # endif 1643 # ifdef SBUS_SUPPORT 1644 snd_pcm_lib_preallocate_sbus_pages_for_all(chip->dev_u.sdev, pcm, 1645 64*1024, 128*1024); 1646 # endif 1647 # ifdef EBUS_SUPPORT 1648 } 1649 # endif 1650 #endif 1544 1651 1545 1652 chip->pcm = pcm; -
GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c
r212 r215 155 155 #define ES18XX_PM_GPO0 0x01 156 156 #define ES18XX_PM_GPO1 0x02 157 #define ES18XX_PM_PDR 0x0 3158 #define ES18XX_PM_ANA 0x0 4159 #define ES18XX_PM_FM 0x0 6160 #define ES18XX_PM_SUS 0x08 157 #define ES18XX_PM_PDR 0x04 158 #define ES18XX_PM_ANA 0x08 159 #define ES18XX_PM_FM 0x020 160 #define ES18XX_PM_SUS 0x080 161 161 162 162 typedef struct _snd_es18xx es18xx_t; -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_pcm.c
r212 r215 116 116 */ 117 117 static void 118 snd_emu8000_write_wait(emu8000_t *emu )118 snd_emu8000_write_wait(emu8000_t *emu, int can_schedule) 119 119 { 120 120 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { 121 set_current_state(TASK_INTERRUPTIBLE); 122 schedule_timeout(1); 123 if (signal_pending(current)) 124 break; 121 if (can_schedule) { 122 set_current_state(TASK_INTERRUPTIBLE); 123 schedule_timeout(1); 124 if (signal_pending(current)) 125 break; 126 } 125 127 } 126 128 } … … 458 460 emu8000_t *emu = rec->emu; 459 461 460 snd_emu8000_write_wait(emu );462 snd_emu8000_write_wait(emu, 1); 461 463 if (voice == -1) { 462 464 unsigned short *buf = src; … … 495 497 emu8000_t *emu = rec->emu; 496 498 497 snd_emu8000_write_wait(emu );499 snd_emu8000_write_wait(emu, 1); 498 500 if (voice == -1 && rec->voices == 1) 499 501 voice = 0; … … 525 527 unsigned short *buf = src; 526 528 527 snd_emu8000_write_wait(emu );529 snd_emu8000_write_wait(emu, 1); 528 530 EMU8000_SMALW_WRITE(emu, pos + rec->loop_start[0]); 529 531 if (rec->voices > 1) … … 554 556 emu8000_t *emu = rec->emu; 555 557 556 snd_emu8000_write_wait(emu );558 snd_emu8000_write_wait(emu, 1); 557 559 EMU8000_SMALW_WRITE(emu, rec->loop_start[0] + pos); 558 560 if (rec->voices > 1) … … 646 648 647 649 /* clear loop blanks */ 648 snd_emu8000_write_wait(rec->emu );650 snd_emu8000_write_wait(rec->emu, 0); 649 651 EMU8000_SMALW_WRITE(rec->emu, rec->offset); 650 652 for (i = 0; i < LOOP_BLANK_SIZE; i++) -
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.