Changeset 479 for GPL/trunk/alsa-kernel
- Timestamp:
- May 1, 2010, 9:49:10 PM (15 years ago)
- Location:
- GPL/trunk/alsa-kernel
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/core/control.c
r464 r479 29 29 #include <sound/info.h> 30 30 #include <sound/control.h> 31 #include <proto.h> 31 32 32 33 /* max number of user-defined controls */ … … 182 183 * @access: the default control access 183 184 * 184 * Allocates a new struct snd_kcontrol instance and copies the given template 185 * Allocates a new struct snd_kcontrol instance and copies the given template 185 186 * to the new instance. It does not copy volatile data (access). 186 187 * … … 213 214 * @private_data: the private data to set 214 215 * 215 * Allocates a new struct snd_kcontrol instance and initialize from the given 216 * Allocates a new struct snd_kcontrol instance and initialize from the given 216 217 * template. When the access field of ncontrol is 0, it's assumed as 217 218 * READWRITE access. When the count field is 0, it's assumes as one. … … 371 372 * You don't need to call snd_ctl_free_one(). You must be in 372 373 * the write lock - down_write(&card->controls_rwsem). 373 * 374 * 374 375 * Returns 0 if successful, or a negative error code on failure. 375 376 */ … … 399 400 * Finds the control instance with the given id, removes it from the 400 401 * card list and releases it. 401 * 402 * 402 403 * Returns 0 if successful, or a negative error code on failure. 403 404 */ … … 427 428 * Finds the control instance with the given id, removes it from the 428 429 * card list and releases it. 429 * 430 * 430 431 * Returns 0 if successful, or a negative error code on failure. 431 432 */ … … 1131 1132 goto __kctl_end; 1132 1133 } 1133 err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); 1134 err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); 1134 1135 if (err > 0) { 1135 1136 up_read(&card->controls_rwsem); -
GPL/trunk/alsa-kernel/core/info.c
r464 r479 640 640 int snd_info_card_register(struct snd_card *card) 641 641 { 642 #ifndef TARGET_OS2 642 643 struct proc_dir_entry *p; 644 #endif 643 645 644 646 if (snd_BUG_ON(!card)) … … 651 653 if (p == NULL) 652 654 return -ENOMEM; 653 #endif654 655 card->proc_root_link = p; 656 #endif 655 657 return 0; 656 658 } -
GPL/trunk/alsa-kernel/core/init.c
r464 r479 296 296 panic("%s(%p, %p) failed!", __func__, inode, file); 297 297 #endif 298 return -ENODEV; 298 299 } 299 300 … … 400 401 401 402 mfile->file->f_op = &snd_shutdown_f_ops; 402 fops_get(mfile->file->f_op);403 //fops_get(mfile->file->f_op); //DAZ meaningless use of expression 403 404 } 404 405 spin_unlock(&card->files_lock); … … 832 833 * Returns zero otherwise a negative error code. 833 834 */ 834 835 835 836 int snd_component_add(struct snd_card *card, const char *component) 836 837 { -
GPL/trunk/alsa-kernel/core/oss/pcm_oss.c
r464 r479 263 263 * @dir: pointer to the direction (-1,0,1) or NULL 264 264 * 265 * Inside configuration space defined by PARAMS remove from PAR all 265 * Inside configuration space defined by PARAMS remove from PAR all 266 266 * values < VAL. Reduce configuration space accordingly. 267 267 * Return new minimum or -EINVAL if the configuration space is empty … … 324 324 * @dir: pointer to the direction (-1,0,1) or NULL 325 325 * 326 * Inside configuration space defined by PARAMS remove from PAR all 326 * Inside configuration space defined by PARAMS remove from PAR all 327 327 * values >= VAL + 1. Reduce configuration space accordingly. 328 328 * Return new maximum or -EINVAL if the configuration space is empty … … 532 532 * @dir: pointer to the direction (-1,0,1) or NULL 533 533 * 534 * Inside configuration space defined by PARAMS remove from PAR all 534 * Inside configuration space defined by PARAMS remove from PAR all 535 535 * values != VAL. Reduce configuration space accordingly. 536 536 * Return VAL or -EINVAL if the configuration space is empty … … 705 705 } 706 706 707 static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream, 707 static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream, 708 708 struct snd_pcm_hw_params *oss_params, 709 709 struct snd_pcm_hw_params *slave_params) … … 937 937 snd_pcm_oss_plugin_clear(substream); 938 938 if ((err = snd_pcm_plug_format_plugins(substream, 939 params, 939 params, 940 940 sparams)) < 0) { 941 941 snd_printd("snd_pcm_plug_format_plugins failed: %i\n", err); … … 1382 1382 if (substream->oss.setup.partialfrag || 1383 1383 runtime->oss.buffer_used == runtime->oss.period_bytes) { 1384 tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer + runtime->oss.period_ptr, 1384 tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer + runtime->oss.period_ptr, 1385 1385 runtime->oss.buffer_used - runtime->oss.period_ptr, 1); 1386 1386 if (tmp <= 0) … … 1794 1794 _snd_pcm_hw_params_any(params); 1795 1795 err = snd_pcm_hw_refine(substream, params); 1796 format_mask = *hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 1796 format_mask = *hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 1797 1797 kfree(params); 1798 1798 if (err < 0) … … 2753 2753 } 2754 2754 2755 #ifndef TARGET_OS2 2755 2756 static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area) 2756 2757 { … … 2819 2820 return 0; 2820 2821 } 2822 #endif 2821 2823 2822 2824 #ifdef CONFIG_SND_VERBOSE_PROCFS … … 3021 3023 int duplex; 3022 3024 register_oss_dsp(pcm, 0); 3023 duplex = (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count > 0 && 3024 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count && 3025 duplex = (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count > 0 && 3026 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count && 3025 3027 !(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX)); 3026 3028 sprintf(name, "%s%s", pcm->name, duplex ? " (DUPLEX)" : ""); -
GPL/trunk/alsa-kernel/core/pcm.c
r470 r479 926 926 } 927 927 928 #ifndef TARGET_OS2 928 929 static ssize_t show_pcm_class(struct device *dev, 929 930 struct device_attribute *attr, char *buf) … … 949 950 return snprintf(buf, PAGE_SIZE, "%s\n", str); 950 951 } 952 #endif 951 953 952 954 #ifndef TARGET_OS2 -
GPL/trunk/alsa-kernel/core/pcm_compat.c
r426 r479 22 22 23 23 #include <linux/compat.h> 24 #include <proto.h> 24 25 25 26 static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream, … … 223 224 /* both for HW_PARAMS and HW_REFINE */ 224 225 static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, 225 int refine, 226 int refine, 226 227 struct snd_pcm_hw_params32 __user *data32) 227 228 { -
GPL/trunk/alsa-kernel/core/pcm_lib.c
r470 r479 30 30 #include <sound/pcm_params.h> 31 31 #include <sound/timer.h> 32 33 /* 34 * Uniaud API support 35 */ 36 int uniaud_set_interrupted_substream(struct snd_pcm_substream *substream); 32 #include <proto.h> 37 33 38 34 /* … … 160 156 snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp); 161 157 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 158 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 162 159 if (xrun_debug(substream, 1)) { 163 160 char name[16]; … … 166 163 dump_stack_on_xrun(substream); 167 164 } 165 #endif 168 166 } 169 167 … … 230 228 } while (0) 231 229 #else 232 #define hw_ptr_error 230 #define hw_ptr_error(substream, fmt, ...) ; 233 231 #endif 234 232 static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) … … 246 244 return -EPIPE; 247 245 } 246 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 248 247 if (xrun_debug(substream, 8)) { 249 248 char name[16]; … … 258 257 (unsigned long)runtime->hw_ptr_interrupt); 259 258 } 259 #endif 260 260 hw_base = runtime->hw_ptr_base; 261 261 new_hw_ptr = hw_base + pos; … … 272 272 delta += runtime->buffer_size; 273 273 if (delta < 0) { 274 hw_ptr_error(substream, 274 hw_ptr_error(substream, 275 275 "Unexpected hw_pointer value " 276 276 "(stream=%i, pos=%ld, intr_ptr=%ld)\n", … … 299 299 300 300 /* Do jiffies check only in xrun_debug mode */ 301 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 301 302 if (!xrun_debug(substream, 4)) 302 303 goto no_jiffies_check; 303 304 #endif 304 305 /* Skip the jiffies check for hardwares with BATCH flag. 305 306 * Such hardware usually just increases the position at each IRQ, … … 378 379 return -EPIPE; 379 380 } 381 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 380 382 if (xrun_debug(substream, 16)) { 381 383 char name[16]; … … 390 392 (unsigned long)runtime->hw_ptr_interrupt); 391 393 } 394 #endif 392 395 393 396 hw_base = runtime->hw_ptr_base; … … 399 402 delta += runtime->buffer_size; 400 403 if (delta < 0) { 401 hw_ptr_error(substream, 404 hw_ptr_error(substream, 402 405 "Unexpected hw_pointer value [2] " 403 406 "(stream=%i, pos=%ld, old_ptr=%ld, jdelta=%li)\n", 404 407 substream->stream, (long)pos, 405 408 (long)old_hw_ptr, jdelta); … … 412 415 } 413 416 /* Do jiffies check only in xrun_debug mode */ 417 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 414 418 if (!xrun_debug(substream, 4)) 415 419 goto no_jiffies_check; 420 #endif 416 421 if (delta < runtime->delay) 417 422 goto no_jiffies_check; … … 484 489 */ 485 490 486 static inline unsigned int div32(unsigned int a, unsigned int b, 491 static inline unsigned int div32(unsigned int a, unsigned int b, 487 492 unsigned int *r) 488 493 { … … 743 748 * snd_interval_ratnum - refine the interval value 744 749 * @i: interval to refine 745 * @rats_count: number of ratnum_t 750 * @rats_count: number of ratnum_t 746 751 * @rats: ratnum_t array 747 752 * @nump: pointer to store the resultant numerator … … 1053 1058 va_end(args); 1054 1059 return 0; 1055 } 1060 } 1056 1061 1057 1062 EXPORT_SYMBOL(snd_pcm_hw_rule_add); … … 1119 1124 * @min: the minimal value 1120 1125 * @max: the maximal value 1121 * 1126 * 1122 1127 * Apply the min/max range constraint to an interval parameter. 1123 1128 */ … … 1150 1155 * @var: hw_params variable to apply the list constraint 1151 1156 * @l: list 1152 * 1157 * 1153 1158 * Apply the list of constraints to an interval parameter. 1154 1159 */ … … 1187 1192 * @r: struct snd_ratnums constriants 1188 1193 */ 1189 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 1194 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 1190 1195 unsigned int cond, 1191 1196 snd_pcm_hw_param_t var, … … 1220 1225 * @r: struct snd_ratdens constriants 1221 1226 */ 1222 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 1227 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 1223 1228 unsigned int cond, 1224 1229 snd_pcm_hw_param_t var, … … 1251 1256 * @msbits: msbits width 1252 1257 */ 1253 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 1258 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 1254 1259 unsigned int cond, 1255 1260 unsigned int width, … … 1284 1289 unsigned long step) 1285 1290 { 1286 return snd_pcm_hw_rule_add(runtime, cond, var, 1291 return snd_pcm_hw_rule_add(runtime, cond, var, 1287 1292 snd_pcm_hw_rule_step, (void *) step, 1288 1293 var, -1); … … 1313 1318 snd_pcm_hw_param_t var) 1314 1319 { 1315 return snd_pcm_hw_rule_add(runtime, cond, var, 1320 return snd_pcm_hw_rule_add(runtime, cond, var, 1316 1321 snd_pcm_hw_rule_pow2, NULL, 1317 1322 var, -1); … … 1431 1436 * Return the minimum. 1432 1437 */ 1433 int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, 1434 struct snd_pcm_hw_params *params, 1438 int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, 1439 struct snd_pcm_hw_params *params, 1435 1440 snd_pcm_hw_param_t var, int *dir) 1436 1441 { … … 1477 1482 * Return the maximum. 1478 1483 */ 1479 int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, 1484 int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, 1480 1485 struct snd_pcm_hw_params *params, 1481 1486 snd_pcm_hw_param_t var, int *dir) … … 1709 1714 if (is_playback) 1710 1715 err = -EPIPE; 1711 else 1716 else 1712 1717 avail = 0; /* indicate draining */ 1713 1718 goto _endloop; … … 1755 1760 return 0; 1756 1761 } 1757 1762 1758 1763 typedef int (*transfer_f)(struct snd_pcm_substream *substream, unsigned int hwoff, 1759 1764 unsigned long data, unsigned int off, 1760 1765 snd_pcm_uframes_t size); 1761 1766 1762 static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream, 1767 static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream, 1763 1768 unsigned long data, 1764 1769 snd_pcm_uframes_t size, … … 1928 1933 return 0; 1929 1934 } 1930 1935 1931 1936 snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, 1932 1937 void __user **bufs, … … 1951 1956 EXPORT_SYMBOL(snd_pcm_lib_writev); 1952 1957 1953 static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, 1958 static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, 1954 1959 unsigned int hwoff, 1955 1960 unsigned long data, unsigned int off, … … 2125 2130 return 0; 2126 2131 } 2127 2132 2128 2133 snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, 2129 2134 void __user **bufs, -
GPL/trunk/alsa-kernel/core/pcm_native.c
r464 r479 38 38 #include <sound/minors.h> 39 39 #include <asm/io.h> 40 #include <proto.h> 40 41 41 42 /* … … 165 166 #endif 166 167 167 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, 168 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, 168 169 struct snd_pcm_hw_params *params) 169 170 { … … 222 223 printk("empty"); 223 224 else 224 printk("%c%u %u%c", 225 printk("%c%u %u%c", 225 226 i->openmin ? '(' : '[', i->min, 226 227 i->max, i->openmax ? ')' : ']'); … … 231 232 if (i->empty) 232 233 printk("empty\n"); 233 else 234 printk("%c%u %u%c\n", 234 else 235 printk("%c%u %u%c\n", 235 236 i->openmin ? '(' : '[', i->min, 236 237 i->max, i->openmax ? ')' : ']'); … … 244 245 for (k = 0; k < constrs->rules_num; k++) 245 246 rstamps[k] = 0; 246 for (k = 0; k <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; k++) 247 for (k = 0; k <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; k++) 247 248 vstamps[k] = (params->rmask & (1 << k)) ? 1 : 0; 248 249 do { … … 274 275 printk("empty"); 275 276 else 276 printk("%c%u %u%c", 277 printk("%c%u %u%c", 277 278 i->openmin ? '(' : '[', i->min, 278 279 i->max, i->openmax ? ')' : ']'); … … 290 291 printk("empty"); 291 292 else 292 printk("%c%u %u%c", 293 printk("%c%u %u%c", 293 294 i->openmin ? '(' : '[', i->min, 294 295 i->max, i->openmax ? ')' : ']'); … … 1833 1834 if (err < 0) 1834 1835 return err; 1835 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1836 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1836 1837 snd_pcm_hw_rule_sample_bits, NULL, 1837 SNDRV_PCM_HW_PARAM_FORMAT, 1838 SNDRV_PCM_HW_PARAM_FORMAT, 1838 1839 SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1); 1839 1840 if (err < 0) 1840 1841 return err; 1841 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1842 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1842 1843 snd_pcm_hw_rule_div, NULL, 1843 1844 SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1); 1844 1845 if (err < 0) 1845 1846 return err; 1846 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1847 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1847 1848 snd_pcm_hw_rule_mul, NULL, 1848 1849 SNDRV_PCM_HW_PARAM_SAMPLE_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1); 1849 1850 if (err < 0) 1850 1851 return err; 1851 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1852 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1852 1853 snd_pcm_hw_rule_mulkdiv, (void*) 8, 1853 1854 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1); 1854 1855 if (err < 0) 1855 1856 return err; 1856 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1857 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 1857 1858 snd_pcm_hw_rule_mulkdiv, (void*) 8, 1858 1859 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, -1); 1859 1860 if (err < 0) 1860 1861 return err; 1861 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 1862 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 1862 1863 snd_pcm_hw_rule_div, NULL, 1863 1864 SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1); 1864 1865 if (err < 0) 1865 1866 return err; 1866 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1867 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1867 1868 snd_pcm_hw_rule_mulkdiv, (void*) 1000000, 1868 1869 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_PERIOD_TIME, -1); 1869 1870 if (err < 0) 1870 1871 return err; 1871 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1872 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1872 1873 snd_pcm_hw_rule_mulkdiv, (void*) 1000000, 1873 1874 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_BUFFER_TIME, -1); 1874 1875 if (err < 0) 1875 1876 return err; 1876 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS, 1877 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS, 1877 1878 snd_pcm_hw_rule_div, NULL, 1878 1879 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1); 1879 1880 if (err < 0) 1880 1881 return err; 1881 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1882 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1882 1883 snd_pcm_hw_rule_div, NULL, 1883 1884 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1); 1884 1885 if (err < 0) 1885 1886 return err; 1886 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1887 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1887 1888 snd_pcm_hw_rule_mulkdiv, (void*) 8, 1888 1889 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1); 1889 1890 if (err < 0) 1890 1891 return err; 1891 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1892 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1892 1893 snd_pcm_hw_rule_muldivk, (void*) 1000000, 1893 1894 SNDRV_PCM_HW_PARAM_PERIOD_TIME, SNDRV_PCM_HW_PARAM_RATE, -1); 1894 1895 if (err < 0) 1895 1896 return err; 1896 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1897 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1897 1898 snd_pcm_hw_rule_mul, NULL, 1898 1899 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1); 1899 1900 if (err < 0) 1900 1901 return err; 1901 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1902 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1902 1903 snd_pcm_hw_rule_mulkdiv, (void*) 8, 1903 1904 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1); 1904 1905 if (err < 0) 1905 1906 return err; 1906 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1907 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 1907 1908 snd_pcm_hw_rule_muldivk, (void*) 1000000, 1908 1909 SNDRV_PCM_HW_PARAM_BUFFER_TIME, SNDRV_PCM_HW_PARAM_RATE, -1); 1909 1910 if (err < 0) 1910 1911 return err; 1911 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 1912 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 1912 1913 snd_pcm_hw_rule_muldivk, (void*) 8, 1913 1914 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1); 1914 1915 if (err < 0) 1915 1916 return err; 1916 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1917 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1917 1918 snd_pcm_hw_rule_muldivk, (void*) 8, 1918 1919 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1); 1919 1920 if (err < 0) 1920 1921 return err; 1921 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1922 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1922 1923 snd_pcm_hw_rule_mulkdiv, (void*) 1000000, 1923 1924 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_RATE, -1); 1924 1925 if (err < 0) 1925 1926 return err; 1926 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 1927 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_TIME, 1927 1928 snd_pcm_hw_rule_mulkdiv, (void*) 1000000, 1928 1929 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_RATE, -1); … … 1992 1993 return err; 1993 1994 1994 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1995 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1995 1996 snd_pcm_hw_rule_buffer_bytes_max, substream, 1996 1997 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, -1); … … 2005 2006 } 2006 2007 if (!(hw->rates & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))) { 2007 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 2008 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 2008 2009 snd_pcm_hw_rule_rate, hw, 2009 2010 SNDRV_PCM_HW_PARAM_RATE, -1); -
GPL/trunk/alsa-kernel/core/rawmidi.c
r464 r479 385 385 struct snd_ctl_file *kctl; 386 386 387 if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK)) 387 if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK)) 388 388 return -EINVAL; /* invalid combination */ 389 389 … … 574 574 } 575 575 576 #ifndef TARGET_OS2 576 577 static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream, 577 578 struct snd_rawmidi_info __user * _info) … … 585 586 return 0; 586 587 } 588 #endif 587 589 588 590 int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) … … 683 685 } 684 686 687 #ifndef TARGET_OS2 685 688 static int snd_rawmidi_output_status(struct snd_rawmidi_substream *substream, 686 689 struct snd_rawmidi_status * status) … … 820 823 return -ENOTTY; 821 824 } 825 #endif 822 826 823 827 static int snd_rawmidi_control_ioctl(struct snd_card *card, … … 1031 1035 * snd_rawmidi_transmit_empty - check whether the output buffer is empty 1032 1036 * @substream: the rawmidi substream 1033 * 1037 * 1034 1038 * Returns 1 if the internal output buffer is empty, 0 if not. 1035 1039 */ … … 1144 1148 * @buffer: the buffer pointer 1145 1149 * @count: the data size to transfer 1146 * 1150 * 1147 1151 * Copies data from the buffer to the device and advances the pointer. 1148 1152 * -
GPL/trunk/alsa-kernel/core/seq/seq_compat.c
r426 r479 22 22 23 23 #include <linux/compat.h> 24 #include <proto.h> 24 25 25 26 struct snd_seq_port_info32 { -
GPL/trunk/alsa-kernel/core/seq/seq_virmidi.c
r399 r479 47 47 #include <sound/seq_midi_event.h> 48 48 #include <sound/seq_virmidi.h> 49 #include <proto.h> 49 50 50 51 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); -
GPL/trunk/alsa-kernel/core/sgbuf.c
r426 r479 27 27 #include <linux/vmalloc.h> 28 28 #include <sound/memalloc.h> 29 29 #include <proto.h> 30 30 31 31 /* table entries are align to 32 */ … … 66 66 } 67 67 #else 68 /* 69 * shrink to the given pages. 70 * free the unused pages 71 */ 72 static void sgbuf_shrink(struct snd_sg_buf *sgbuf, int pages) 73 { 74 if (! sgbuf->table) 75 return; 76 while (sgbuf->pages > pages) { 77 sgbuf->pages--; 78 snd_free_dev_pages(sgbuf->dev, PAGE_SIZE, 79 sgbuf->table[sgbuf->pages].buf, 80 sgbuf->table[sgbuf->pages].addr); 81 } 82 } 83 68 84 /* base this fn on the one in Uniaud 1.1.4 */ 69 85 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) … … 82 98 return 0; 83 99 } 84 85 /*86 * shrink to the given pages.87 * free the unused pages88 */89 static void sgbuf_shrink(struct snd_sg_buf *sgbuf, int pages)90 {91 if (! sgbuf->table)92 return;93 while (sgbuf->pages > pages) {94 sgbuf->pages--;95 snd_free_dev_pages(sgbuf->dev, PAGE_SIZE,96 sgbuf->table[sgbuf->pages].buf,97 sgbuf->table[sgbuf->pages].addr);98 }99 }100 100 #endif 101 101 … … 123 123 dmab->addr = 0; 124 124 dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); 125 if (! sgbuf) 125 if (! sgbuf) 126 126 return NULL; 127 127 sgbuf->dev = device; -
GPL/trunk/alsa-kernel/core/sound_oss.c
r399 r479 158 158 return 0; 159 159 160 #ifndef TARGET_OS2 160 161 __end: 161 162 if (register2 >= 0) … … 167 168 kfree(preg); 168 169 return -EBUSY; 170 #endif 169 171 } 170 172 -
GPL/trunk/alsa-kernel/core/timer.c
r447 r479 34 34 #include <sound/initval.h> 35 35 #include <linux/kmod.h> 36 #include <proto.h> 36 37 37 38 #if defined(CONFIG_SND_HPET) || defined(CONFIG_SND_HPET_MODULE) -
GPL/trunk/alsa-kernel/isa/sb/sb16_csp.c
r426 r479 6 6 * 7 7 * CSP microcode loader: 8 * alsa-tools/sb16_csp/ 8 * alsa-tools/sb16_csp/ 9 9 * 10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify 11 11 * it under the terms of the GNU General Public License as published by 12 12 * the Free Software Foundation; either version 2 of the License, or … … 32 32 #include <sound/sb16_csp.h> 33 33 #include <sound/initval.h> 34 #include <proto.h> 34 35 35 36 MODULE_AUTHOR("Uros Bizjak <uros@kss-loka.si>"); … … 300 301 301 302 /* 302 * load microcode via ioctl: 303 * load microcode via ioctl: 303 304 * code is user-space pointer 304 305 */ … … 682 683 return result; 683 684 } 684 685 685 686 static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags) 686 687 { … … 731 732 732 733 /* if CSP is running or manually loaded then exit */ 733 if (p->running & (SNDRV_SB_CSP_ST_RUNNING | SNDRV_SB_CSP_ST_LOADED)) 734 if (p->running & (SNDRV_SB_CSP_ST_RUNNING | SNDRV_SB_CSP_ST_LOADED)) 734 735 return -EBUSY; 735 736 … … 764 765 } 765 766 p->acc_format = SNDRV_PCM_FMTBIT_IMA_ADPCM; 766 break; 767 break; 767 768 default: 768 769 /* Decouple CSP from IRQ and DMAREQ lines */ … … 788 789 p->acc_channels = SNDRV_SB_CSP_MONO | SNDRV_SB_CSP_STEREO; 789 790 p->acc_rates = SNDRV_SB_CSP_RATE_ALL; /* HW codecs accept all rates */ 790 } 791 } 791 792 792 793 } -
GPL/trunk/alsa-kernel/isa/wavefront/wavefront_fx.c
r426 r479 25 25 #include <sound/snd_wavefront.h> 26 26 #include <sound/initval.h> 27 #include <proto.h> 27 28 28 29 /* Control bits for the Load Control Register … … 152 153 } 153 154 154 int 155 int 155 156 snd_wavefront_fx_release (struct snd_hwdep *hw, struct file *file) 156 157 -
GPL/trunk/alsa-kernel/pci/cmipci.c
r464 r479 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 19 20 20 /* Does not work. Warning may block system in capture mode */ 21 21 /* #define USE_VAR48KRATE */ … … 1300 1300 substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE && 1301 1301 substream->runtime->channels == 2); 1302 if (do_spdif && cm->can_ac3_hw) 1302 if (do_spdif && cm->can_ac3_hw) 1303 1303 do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO; 1304 1304 if ((err = setup_spdif_playback(cm, substream, do_spdif, do_ac3)) < 0) … … 1313 1313 int err, do_ac3; 1314 1314 1315 if (cm->can_ac3_hw) 1315 if (cm->can_ac3_hw) 1316 1316 do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO; 1317 1317 else … … 2036 2036 return 0; 2037 2037 } 2038 2038 2039 2039 static int snd_cmipci_get_volume(struct snd_kcontrol *kcontrol, 2040 2040 struct snd_ctl_elem_value *ucontrol) … … 2118 2118 return 0; 2119 2119 } 2120 2120 2121 2121 static int snd_cmipci_get_input_sw(struct snd_kcontrol *kcontrol, 2122 2122 struct snd_ctl_elem_value *ucontrol) … … 2386 2386 else 2387 2387 val = snd_cmipci_read(cm, args->reg); 2388 change = (val & args->mask) != (ucontrol->value.integer.value[0] ? 2388 change = (val & args->mask) != (ucontrol->value.integer.value[0] ? 2389 2389 args->mask_on : (args->mask & ~args->mask_on)); 2390 2390 if (change) { … … 2589 2589 /* same bit as spdi_phase */ 2590 2590 spin_lock_irq(&cm->reg_lock); 2591 ucontrol->value.enumerated.item[0] = 2591 ucontrol->value.enumerated.item[0] = 2592 2592 (snd_cmipci_read_b(cm, CM_REG_MISC) & CM_SPDIF_INVERSE) ? 1 : 0; 2593 2593 spin_unlock_irq(&cm->reg_lock); … … 2783 2783 2784 2784 #ifdef CONFIG_PROC_FS 2785 static void snd_cmipci_proc_read(struct snd_info_entry *entry, 2785 static void snd_cmipci_proc_read(struct snd_info_entry *entry, 2786 2786 struct snd_info_buffer *buffer) 2787 2787 { … … 3132 3132 case PCI_DEVICE_ID_CMEDIA_CM8738: 3133 3133 case PCI_DEVICE_ID_CMEDIA_CM8738B: 3134 if (!pci_dev_present(intel_82437vx)) 3134 if (!pci_dev_present(intel_82437vx)) 3135 3135 snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX); 3136 3136 break; -
GPL/trunk/alsa-kernel/pci/emu10k1/emufx.c
r426 r479 40 40 #include <sound/tlv.h> 41 41 #include <sound/emu10k1.h> 42 #include <proto.h> 42 43 43 44 #if 0 /* for testing purposes - digital out -> capture */ … … 53 54 /* 54 55 * Tables 55 */ 56 */ 56 57 57 58 static char *fxbuses[16] = { … … 304 305 /* 305 306 */ 306 307 307 308 static inline mm_segment_t snd_enter_user(void) 308 309 { … … 1256 1257 snd_emu10k1_init_stereo_control(&controls[nctl++], "Synth Capture Volume", gpr, 0); 1257 1258 gpr += 2; 1258 1259 1259 1260 /* 1260 1261 * inputs … … 1332 1333 gpr, 0); 1333 1334 gpr += 2; 1334 1335 1335 1336 /* Philips ADC Playback Volume */ 1336 1337 A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L); … … 1530 1531 } 1531 1532 1532 /* IEC958 Optical Raw Playback Switch */ 1533 /* IEC958 Optical Raw Playback Switch */ 1533 1534 gpr_map[gpr++] = 0; 1534 1535 gpr_map[gpr++] = 0x1008; … … 1570 1571 snd_printk(KERN_INFO "EMU2 inputs on\n"); 1571 1572 for (z = 0; z < 0x10; z++) { 1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 1573 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 1573 1574 bit_shifter16, 1574 1575 A3_EMU32IN(z), … … 2295 2296 * and EXTOUT_ALFE, so we can't connect inputs to them for multitrack recording. 2296 2297 * 2297 * Since only 14 of the 16 EXTINs are used, this is not a big problem. 2298 * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture 2299 * 0 and 3, then the rest of the EXTINs to the corresponding FX capture 2300 * channel. Multitrack recorders will still see the center/lfe output signal 2298 * Since only 14 of the 16 EXTINs are used, this is not a big problem. 2299 * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture 2300 * 0 and 3, then the rest of the EXTINs to the corresponding FX capture 2301 * channel. Multitrack recorders will still see the center/lfe output signal 2301 2302 * on the second and third channels. 2302 2303 */ … … 2311 2312 OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z)); 2312 2313 } 2313 2314 2314 2315 2315 2316 if (gpr > tmp) { -
GPL/trunk/alsa-kernel/pci/emu10k1/io.c
r426 r479 102 102 EXPORT_SYMBOL(snd_emu10k1_ptr_write); 103 103 104 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 105 unsigned int reg, 104 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 105 unsigned int reg, 106 106 unsigned int chn) 107 107 { 108 108 unsigned long flags; 109 109 unsigned int regptr, val; 110 110 111 111 regptr = (reg << 16) | chn; 112 112 … … 118 118 } 119 119 120 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 121 unsigned int reg, 122 unsigned int chn, 120 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, 121 unsigned int reg, 122 unsigned int chn, 123 123 unsigned int data) 124 124 { … … 245 245 err = -EINVAL; 246 246 } 247 247 248 248 spin_unlock(&emu->i2c_lock); 249 249 return err; … … 257 257 return 1; 258 258 reg += 0x40; /* 0x40 upwards are registers. */ 259 if (value < 0 || value> 0x3f) /* 0 to 0x3f are values */259 if (value > 0x3f) /* 0 to 0x3f are values */ 260 260 return 1; 261 261 spin_lock_irqsave(&emu->emu_lock, flags); -
GPL/trunk/alsa-kernel/pci/hda/hda_codec.c
r464 r479 432 432 * process queued unsolicited events 433 433 */ 434 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 434 435 static void process_unsol_events(struct work_struct *work) 435 436 { … … 453 454 } 454 455 } 456 #endif 455 457 456 458 /* … … 615 617 return NULL; /* use the generic parser */ 616 618 619 #ifndef TARGET_OS2 617 620 again: 621 #endif 618 622 mutex_lock(&preset_mutex); 619 623 list_for_each_entry(tbl, &hda_preset_tables, list, struct hda_codec_preset_list) { … … 2501 2505 if (err < 0) { 2502 2506 printk(KERN_ERR "hda_codec: cannot build controls" 2503 "for #%d (error %d)\n", codec->addr, err); 2507 "for #%d (error %d)\n", codec->addr, err); 2504 2508 err = snd_hda_codec_reset(codec); 2505 2509 if (err < 0) { … … 2963 2967 if (err < 0) { 2964 2968 printk(KERN_ERR "hda_codec: cannot build PCMs" 2965 "for #%d (error %d)\n", codec->addr, err); 2969 "for #%d (error %d)\n", codec->addr, err); 2966 2970 err = snd_hda_codec_reset(codec); 2967 2971 if (err < 0) { … … 3400 3404 /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */ 3401 3405 if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) 3402 set_dig_out_convert(codec, nid, 3406 set_dig_out_convert(codec, nid, 3403 3407 codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff, 3404 3408 -1); … … 3660 3664 * output, i.e. to line_out_pins[0]. So, line_outs is always positive 3661 3665 * if any analog output exists. 3662 * 3666 * 3663 3667 * The analog input pins are assigned to input_pins array. 3664 3668 * The digital input/output pins are assigned to dig_in_pin and dig_out_pin,
Note:
See TracChangeset
for help on using the changeset viewer.