- Timestamp:
- May 1, 2010, 9:49:10 PM (15 years ago)
- Location:
- GPL/trunk
- Files:
-
- 1 added
- 37 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, -
GPL/trunk/drv32/dispatch.c
r235 r479 96 96 97 97 #ifdef DEBUG 98 printk("StratIOCtl \n");98 printk("StratIOCtl %d\n", rp->Function); 99 99 #endif 100 100 if (rp->Category != CAT_IOCTL_OSS32) -
GPL/trunk/drv32/idc.c
r386 r479 84 84 OSSSTREAMID streamId = 0; 85 85 86 rc = OSS32_WaveOpen(pPacket->open.devicenr, pPacket->open.streamtype, &streamId, pcm_device, pPacket->fileid);86 rc = OSS32_WaveOpen(pPacket->open.devicenr, pPacket->open.streamtype, &streamId, pcm_device, (USHORT)pPacket->fileid); /* DAZ cast added to stop compiler warning */ 87 87 pPacket->streamid = streamId; 88 88 return rc; … … 137 137 } 138 138 139 139 case IDC32_WAVE_GETHWPTR: 140 140 { 141 141 ULONG position = 0; … … 145 145 } 146 146 147 147 case IDC32_WAVE_SETVOLUME: 148 148 return OSS32_WaveSetVolume(pPacket->streamid, pPacket->setwavevol.volume); 149 149 -
GPL/trunk/drv32/parse.c
r32 r479 46 46 extern "C" short int midi_port; 47 47 48 #ifdef DEBUG48 #ifdef COMM_DEBUG 49 49 extern "C" short int MAGIC_COMM_PORT; 50 50 #endif … … 223 223 break; 224 224 #endif 225 #ifdef DEBUG225 #ifdef COMM_DEBUG 226 226 case 'P': 227 227 if(*pszOption == '0') { -
GPL/trunk/include/dbgos2.h
r269 r479 43 43 #define DebugInt3() ; //_asm int 3; 44 44 #define DebInt3() _asm int 3; 45 #else // #if ndef DEBUG45 #else // #ifdef DEBUG 46 46 #define dprintf(a) 47 47 #define dprintf2(a) 48 48 #define dprintf3(a) 49 49 #define DebugInt3() ; 50 #endif // if DEBUG50 #endif // #ifdef DEBUG 51 51 52 52 #endif //__COMMDBG_H__ -
GPL/trunk/include/linux/math64.h
r463 r479 63 63 u32 q1 = 0; 64 64 int c = 32; 65 while (n > 0xffffffffU ) {65 while (n > 0xffffffffUi64) { 66 66 q1 <<= 1; 67 67 if (n >= d) { … … 110 110 u32 low1 = low; 111 111 high /= div; 112 divl(high1, low1, div, &low, rem);112 divl(high1, low1, div, &low, &rem); 113 113 return (u64)high << 32 | low; 114 114 } else { -
GPL/trunk/include/linux/pci.h
r463 r479 73 73 /* 74 74 * Base addresses specify locations in memory or I/O space. 75 * Decoded size can be determined by writing a value of 76 * 0xffffffff to the register, and reading it back. Only 75 * Decoded size can be determined by writing a value of 76 * 0xffffffff to the register, and reading it back. Only 77 77 * 1 bits are decoded. 78 78 */ … … 98 98 #define PCI_CARDBUS_CIS 0x28 99 99 #define PCI_SUBSYSTEM_VENDOR_ID 0x2c 100 #define PCI_SUBSYSTEM_ID 0x2e 100 #define PCI_SUBSYSTEM_ID 0x2e 101 101 #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ 102 102 #define PCI_ROM_ADDRESS_ENABLE 0x01 … … 389 389 #define PCI_BRIDGE_RESOURCES 7 390 390 #define PCI_NUM_RESOURCES 11 391 391 392 392 #define PCI_REGION_FLAG_MASK 0x0f /* These bits of resource flags tell us the PCI region flags */ 393 393 … … 517 517 * simple PCI probing for drivers (drivers/pci/helper.c) 518 518 */ 519 519 520 520 struct pci_simple_probe_entry; 521 521 typedef int (*pci_simple_probe_callback) (struct pci_dev *dev, int match_num, -
GPL/trunk/include/linux/time.h
r442 r479 46 46 value->tv_sec = jiffies / HZ; 47 47 } 48 48 49 49 struct timeval { 50 50 time_t tv_sec; /* seconds */ … … 94 94 static __inline__ unsigned int jiffies_to_msecs(const unsigned long j) 95 95 { 96 96 #if (HZ <= 1000 && !(1000 % HZ)) 97 97 return (1000 / HZ) * j; 98 elseif (HZ > 1000 && !(HZ % 1000))98 #elif (HZ > 1000 && !(HZ % 1000)) 99 99 return (j + (HZ / 1000) - 1)/(HZ / 1000); 100 100 #else 101 101 return (j * 1000) / HZ; 102 #endif 102 103 } 103 104 static __inline__ unsigned long msecs_to_jiffies(const unsigned int m) … … 105 106 if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET)) 106 107 return MAX_JIFFY_OFFSET; 107 108 #if (HZ <= 1000 && !(1000 % HZ)) 108 109 return (m + (1000 / HZ) - 1) / (1000 / HZ); 109 elseif (HZ > 1000 && !(HZ % 1000))110 #elif (HZ > 1000 && !(HZ % 1000)) 110 111 return m * (HZ / 1000); 111 112 #else 112 113 return (m * HZ + 999) / 1000; 114 #endif 113 115 } 114 116 #endif -
GPL/trunk/include/ossdefos2.h
r451 r479 84 84 #define OSS_MIXER_RADIO 23 /* Radio in */ 85 85 #define OSS_MIXER_MONITOR 24 /* Monitor (usually mic) volume */ 86 #define OSS_MIXER_3DDEPTH 25 86 #define OSS_MIXER_3DDEPTH 25 87 87 #define OSS_MIXER_3DCENTER 26 88 88 #define OSS_MIXER_FRONT 27 -
GPL/trunk/lib32/debug.c
r421 r479 34 34 #define SIGNIFICANT_FIELD 0x0007 35 35 36 //#define COMM_DEBUG 37 36 38 BOOL fLineTerminate=TRUE; 37 39 int DebugLevel = 1; … … 123 125 124 126 if (Power==0xF0000000) // 1 billion 125 Power=0xF000000; 127 Power=0xF000000; 126 128 else if (Power==0xF000000) 127 129 Power=0xF00000; … … 144 146 } 145 147 146 #define DEBUG1 147 148 #ifdef DEBUG1 149 char BuildString[1024]; 150 #endif // DEBUG 151 152 //------------------------- PrintfOut - 153 void _cdecl DPD(int level, char *DbgStr, ...) 154 { 155 #ifdef DEBUG1 156 char *BuildPtr=BuildString; 157 char *pStr=(char *) DbgStr; 158 char *SubStr; 159 union { 160 void *VoidPtr; 161 USHORT *WordPtr; 162 ULONG *LongPtr; 163 ULONG *StringPtr; 164 } Parm; 165 USHORT wBuildOption; 166 167 Parm.VoidPtr=(void *) &DbgStr; 168 Parm.StringPtr++; // skip size of string pointer 169 170 while (*pStr) 171 { 172 // don't overflow target 173 if (BuildPtr >= (char *) &BuildString[1024-2]) 174 break; 175 176 switch (*pStr) 177 { 178 case '%': 179 wBuildOption=0; 180 pStr++; 181 if (*pStr=='0') 182 { 183 wBuildOption|=LEADING_ZEROES; 184 pStr++; 185 } 186 if (*pStr=='u') // always unsigned 187 pStr++; 188 if (*pStr=='#') 189 pStr++; 190 191 switch(*pStr) 192 { 193 case 'x': 194 case 'X': 195 case 'p': 196 case 'P': 197 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 198 pStr++; 199 continue; 200 201 case 'd': 202 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 203 pStr++; 204 continue; 205 206 case 's': 207 SubStr=(char *)*Parm.StringPtr; 208 while (*BuildPtr++ = *SubStr++); 209 Parm.StringPtr++; 210 BuildPtr--; // remove the \0 211 pStr++; 212 continue; 213 214 case 'l': 215 pStr++; 216 switch (*pStr) 217 { 218 case 'x': 219 case 'X': 220 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 221 pStr++; 222 continue; 223 224 case 'd': 225 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 226 pStr++; 227 continue; 228 } // end switch 229 continue; // dunno what he wants 230 231 case 0: 232 continue; 233 } // end switch 234 break; 235 236 case '\\': 237 pStr++; 238 switch (*pStr) 239 { 240 case 'n': 241 *BuildPtr++=LF; 242 pStr++; 243 continue; 244 245 case 'r': 246 *BuildPtr++=CR; 247 pStr++; 248 continue; 249 250 case 0: 251 continue; 252 break; 253 } // end switch 254 255 break; 256 } // end switch 257 258 *BuildPtr++=*pStr++; 259 } // end while 260 261 *BuildPtr=0; // cauterize the string 262 StringOut((char *) BuildString); // print to comm port 263 #endif //DEBUG 264 } 265 266 267 void _cdecl DPE(char *DbgStr, ...) 268 { 269 #ifdef DEBUG1 270 char *BuildPtr=BuildString; 271 char *pStr = (char *) DbgStr; 272 char *SubStr; 273 union { 274 void *VoidPtr; 275 USHORT *WordPtr; 276 ULONG *LongPtr; 277 ULONG *StringPtr; 278 } Parm; 279 USHORT wBuildOption; 280 281 Parm.VoidPtr=(void *) &DbgStr; 282 Parm.StringPtr++; // skip size of string pointer 283 284 while (*pStr) 285 { 286 // don't overflow target 287 if (BuildPtr >= (char *) &BuildString[1024-2]) 288 break; 289 290 switch (*pStr) 291 { 292 case '%': 293 wBuildOption=0; 294 pStr++; 295 if (*pStr=='0') 296 { 297 wBuildOption|=LEADING_ZEROES; 298 pStr++; 299 } 300 // if (*pStr=='u') // always unsigned 301 // pStr++; 302 303 switch(*pStr) 304 { 305 case 'x': 306 case 'X': 307 case 'p': 308 case 'P': 309 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 310 pStr++; 311 continue; 312 313 case 'd': 314 case 'u': 315 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 316 pStr++; 317 continue; 318 319 case 's': 320 SubStr=(char *)*Parm.StringPtr; 321 while (*BuildPtr++ = *SubStr++); 322 Parm.StringPtr++; 323 BuildPtr--; // remove the \0 324 pStr++; 325 continue; 326 327 case 'c': 328 *BuildPtr++ = (char)*Parm.LongPtr; 329 Parm.LongPtr++; 330 pStr++; 331 continue; 332 333 case 'l': 334 pStr++; 335 switch (*pStr) 336 { 337 case 'x': 338 case 'X': 339 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 340 pStr++; 341 continue; 342 343 case 'd': 344 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 345 pStr++; 346 continue; 347 } // end switch 348 continue; // dunno what he wants 349 350 case 0: 351 continue; 352 } // end switch 353 break; 354 355 case '\\': 356 pStr++; 357 switch (*pStr) 358 { 359 case 'n': 360 *BuildPtr++=LF; 361 pStr++; 362 continue; 363 364 case 'r': 365 *BuildPtr++=CR; 366 pStr++; 367 continue; 368 369 case 0: 370 continue; 371 break; 372 } // end switch 373 374 break; 375 } // end switch 376 377 *BuildPtr++=*pStr++; 378 } // end while 379 380 *BuildPtr=0; // cauterize the string 381 StringOut((char *) BuildString); // print to comm port 382 #endif //DEBUG 383 } 384 385 struct snd_info_buffer { 386 char *buffer; /* pointer to begin of buffer */ 387 char *curr; /* current position in buffer */ 388 unsigned long size; /* current size */ 389 unsigned long len; /* total length of buffer */ 390 int stop; /* stop flag */ 391 int error; /* error code */ 392 }; 393 394 typedef struct snd_info_buffer snd_info_buffer_t; 395 396 int snd_iprintf(snd_info_buffer_t * buffer, char *fmt,...) 397 { 398 char *BuildPtr=buffer->curr; 399 char *pStr=(char *) fmt; 400 char *SubStr; 401 int res; 402 union { 403 void *VoidPtr; 404 USHORT *WordPtr; 405 ULONG *LongPtr; 406 ULONG *StringPtr; 407 } Parm; 408 USHORT wBuildOption; 409 410 Parm.VoidPtr=(void *) &fmt; 411 Parm.StringPtr++; // skip size of string pointer 412 413 if (buffer->stop || buffer->error) 414 return 0; 415 416 while (*pStr) 417 { 418 // don't overflow target 419 if (BuildPtr >= (char *) &buffer->curr[buffer->len - 4]) 420 break; 421 422 switch (*pStr) 423 { 424 case '%': 425 wBuildOption=0; 426 pStr++; 427 if (*pStr=='0') 428 { 429 wBuildOption|=LEADING_ZEROES; 430 pStr++; 431 } 432 // if (*pStr=='u') // always unsigned 433 // pStr++; 434 if (*pStr=='#') 435 pStr++; 436 437 switch(*pStr) 438 { 439 case 'x': 440 case 'X': 441 case 'p': 442 case 'P': 443 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 444 pStr++; 445 continue; 446 447 case 'd': 448 case 'u': 449 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 450 pStr++; 451 continue; 452 453 case 's': 454 SubStr=(char *)*Parm.StringPtr; 455 while (*BuildPtr++ = *SubStr++); 456 Parm.StringPtr++; 457 BuildPtr--; // remove the \0 458 pStr++; 459 continue; 460 461 case 'c': 462 *BuildPtr++ = (char)*Parm.LongPtr; 463 Parm.LongPtr++; 464 pStr++; 465 continue; 466 467 case 'l': 468 pStr++; 469 switch (*pStr) 470 { 471 case 'x': 472 case 'X': 473 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 474 pStr++; 475 continue; 476 477 case 'd': 478 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 479 pStr++; 480 continue; 481 } // end switch 482 continue; // dunno what he wants 483 484 case 0: 485 continue; 486 } // end switch 487 break; 488 489 case '\\': 490 pStr++; 491 switch (*pStr) 492 { 493 case 'n': 494 *BuildPtr++=LF; 495 pStr++; 496 continue; 497 498 case 'r': 499 *BuildPtr++=CR; 500 pStr++; 501 continue; 502 503 case 0: 504 continue; 505 break; 506 } // end switch 507 508 break; 509 } // end switch 510 511 *BuildPtr++=*pStr++; 512 } // end while 513 514 *BuildPtr=0; // cauterize the string 515 516 res = strlen(buffer->curr); 517 if (buffer->size + res >= buffer->len) { 518 buffer->stop = 1; 519 return 0; 520 } 521 buffer->curr += res; 522 buffer->size += res; 523 return res; 524 } 525 526 #ifdef DEBUG1 148 #ifdef DEBUG 527 149 //------------------------- StringOut --------------------------// 528 150 … … 546 168 return psz - pszC; 547 169 } 548 //PS+++ Changes for right debug output 549 #ifdef DEBUG550 short int MAGIC_COMM_PORT = 0; 170 171 #ifdef COMM_DEBUG 172 short int MAGIC_COMM_PORT = 0; // pulled from word ptr 40:0 551 173 552 174 … … 562 184 563 185 #define DELAY nop 564 #else 565 short int MAGIC_COMM_PORT = 0x0; // pulled from word ptr 40:0 186 187 void CharOut(char c) 188 { 189 if( MAGIC_COMM_PORT ) 190 { 191 192 _asm { 193 194 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port 195 add dx, UART_LINE_STAT 196 197 ReadyCheck: 198 in al, dx // wait for comm port ready signal 199 200 DELAY 201 DELAY 202 DELAY 203 204 test al, 020h 205 jz ReadyCheck 206 207 // Send the character 208 209 add dx, UART_DATA - UART_LINE_STAT 210 mov al,c 211 out dx, al 212 213 DELAY 214 DELAY 215 DELAY 216 } 217 } 218 } 566 219 #endif 567 220 … … 569 222 { 570 223 int len; 571 #ifdef DEBUG224 #ifdef COMM_DEBUG 572 225 int i; 573 226 #endif /* DEBUG */ 574 227 575 228 len= _strnlen( DbgStr, 1024 ); 576 /* 229 /* 577 230 while (*DbgStr) 578 231 CharOut(*DbgStr++); 579 232 */ 580 #ifdef DEBUG233 #ifdef COMM_DEBUG 581 234 if (MAGIC_COMM_PORT) //PS+++ If have comport - out to it 582 235 { … … 631 284 #endif 632 285 633 634 #ifdef DEBUG //--------------------------- CharOut - 635 void CharOut(char c) 636 { 637 if( MAGIC_COMM_PORT ) 638 { 639 640 _asm { 641 642 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port 643 add dx, UART_LINE_STAT 644 645 ReadyCheck: 646 in al, dx // wait for comm port ready signal 647 648 DELAY 649 DELAY 650 DELAY 651 652 test al, 020h 653 jz ReadyCheck 654 655 // Send the character 656 657 add dx, UART_DATA - UART_LINE_STAT 658 mov al,c 659 out dx, al 660 661 DELAY 662 DELAY 663 DELAY 664 } 665 } 666 } 667 #endif 286 #ifdef DEBUG 287 char BuildString[1024]; 288 #endif // DEBUG 289 290 //------------------------- PrintfOut - 291 void _cdecl DPD(int level, char *DbgStr, ...) 292 { 293 #ifdef DEBUG 294 char *BuildPtr=BuildString; 295 char *pStr=(char *) DbgStr; 296 char *SubStr; 297 union { 298 void *VoidPtr; 299 USHORT *WordPtr; 300 ULONG *LongPtr; 301 ULONG *StringPtr; 302 } Parm; 303 USHORT wBuildOption; 304 305 Parm.VoidPtr=(void *) &DbgStr; 306 Parm.StringPtr++; // skip size of string pointer 307 308 while (*pStr) 309 { 310 // don't overflow target 311 if (BuildPtr >= (char *) &BuildString[1024-2]) 312 break; 313 314 switch (*pStr) 315 { 316 case '%': 317 wBuildOption=0; 318 pStr++; 319 if (*pStr=='0') 320 { 321 wBuildOption|=LEADING_ZEROES; 322 pStr++; 323 } 324 if (*pStr=='u') // always unsigned 325 pStr++; 326 if (*pStr=='#') 327 pStr++; 328 329 switch(*pStr) 330 { 331 case 'x': 332 case 'X': 333 case 'p': 334 case 'P': 335 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 336 pStr++; 337 continue; 338 339 case 'd': 340 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 341 pStr++; 342 continue; 343 344 case 's': 345 SubStr=(char *)*Parm.StringPtr; 346 while (*BuildPtr++ = *SubStr++); 347 Parm.StringPtr++; 348 BuildPtr--; // remove the \0 349 pStr++; 350 continue; 351 352 case 'l': 353 pStr++; 354 switch (*pStr) 355 { 356 case 'x': 357 case 'X': 358 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 359 pStr++; 360 continue; 361 362 case 'd': 363 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 364 pStr++; 365 continue; 366 } // end switch 367 continue; // dunno what he wants 368 369 case 0: 370 continue; 371 } // end switch 372 break; 373 374 case '\\': 375 pStr++; 376 switch (*pStr) 377 { 378 case 'n': 379 *BuildPtr++=LF; 380 pStr++; 381 continue; 382 383 case 'r': 384 *BuildPtr++=CR; 385 pStr++; 386 continue; 387 388 case 0: 389 continue; 390 break; 391 } // end switch 392 393 break; 394 } // end switch 395 396 *BuildPtr++=*pStr++; 397 } // end while 398 399 *BuildPtr=0; // cauterize the string 400 StringOut((char *) BuildString); 401 #endif //DEBUG 402 } 403 404 405 void _cdecl DPE(char *DbgStr, ...) 406 { 407 #ifdef DEBUG 408 char *BuildPtr=BuildString; 409 char *pStr = (char *) DbgStr; 410 char *SubStr; 411 union { 412 void *VoidPtr; 413 USHORT *WordPtr; 414 ULONG *LongPtr; 415 ULONG *StringPtr; 416 } Parm; 417 USHORT wBuildOption; 418 419 Parm.VoidPtr=(void *) &DbgStr; 420 Parm.StringPtr++; // skip size of string pointer 421 422 while (*pStr) 423 { 424 // don't overflow target 425 if (BuildPtr >= (char *) &BuildString[1024-2]) 426 break; 427 428 switch (*pStr) 429 { 430 case '%': 431 wBuildOption=0; 432 pStr++; 433 if (*pStr=='0') 434 { 435 wBuildOption|=LEADING_ZEROES; 436 pStr++; 437 } 438 // if (*pStr=='u') // always unsigned 439 // pStr++; 440 441 switch(*pStr) 442 { 443 case 'x': 444 case 'X': 445 case 'p': 446 case 'P': 447 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 448 pStr++; 449 continue; 450 451 case 'd': 452 case 'u': 453 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 454 pStr++; 455 continue; 456 457 case 's': 458 SubStr=(char *)*Parm.StringPtr; 459 while (*BuildPtr++ = *SubStr++); 460 Parm.StringPtr++; 461 BuildPtr--; // remove the \0 462 pStr++; 463 continue; 464 465 case 'c': 466 *BuildPtr++ = (char)*Parm.LongPtr; 467 Parm.LongPtr++; 468 pStr++; 469 continue; 470 471 case 'l': 472 pStr++; 473 switch (*pStr) 474 { 475 case 'x': 476 case 'X': 477 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 478 pStr++; 479 continue; 480 481 case 'd': 482 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 483 pStr++; 484 continue; 485 } // end switch 486 continue; // dunno what he wants 487 488 case 0: 489 continue; 490 } // end switch 491 break; 492 493 case '\\': 494 pStr++; 495 switch (*pStr) 496 { 497 case 'n': 498 *BuildPtr++=LF; 499 pStr++; 500 continue; 501 502 case 'r': 503 *BuildPtr++=CR; 504 pStr++; 505 continue; 506 507 case 0: 508 continue; 509 break; 510 } // end switch 511 512 break; 513 } // end switch 514 515 *BuildPtr++=*pStr++; 516 } // end while 517 518 *BuildPtr=0; // cauterize the string 519 StringOut((char *) BuildString); 520 #endif //DEBUG 521 } 522 523 struct snd_info_buffer { 524 char *buffer; /* pointer to begin of buffer */ 525 char *curr; /* current position in buffer */ 526 unsigned long size; /* current size */ 527 unsigned long len; /* total length of buffer */ 528 int stop; /* stop flag */ 529 int error; /* error code */ 530 }; 531 532 typedef struct snd_info_buffer snd_info_buffer_t; 533 534 int snd_iprintf(snd_info_buffer_t * buffer, char *fmt,...) 535 { 536 char *BuildPtr=buffer->curr; 537 char *pStr=(char *) fmt; 538 char *SubStr; 539 int res; 540 union { 541 void *VoidPtr; 542 USHORT *WordPtr; 543 ULONG *LongPtr; 544 ULONG *StringPtr; 545 } Parm; 546 USHORT wBuildOption; 547 548 Parm.VoidPtr=(void *) &fmt; 549 Parm.StringPtr++; // skip size of string pointer 550 551 if (buffer->stop || buffer->error) 552 return 0; 553 554 while (*pStr) 555 { 556 // don't overflow target 557 if (BuildPtr >= (char *) &buffer->curr[buffer->len - 4]) 558 break; 559 560 switch (*pStr) 561 { 562 case '%': 563 wBuildOption=0; 564 pStr++; 565 if (*pStr=='0') 566 { 567 wBuildOption|=LEADING_ZEROES; 568 pStr++; 569 } 570 // if (*pStr=='u') // always unsigned 571 // pStr++; 572 if (*pStr=='#') 573 pStr++; 574 575 switch(*pStr) 576 { 577 case 'x': 578 case 'X': 579 case 'p': 580 case 'P': 581 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 582 pStr++; 583 continue; 584 585 case 'd': 586 case 'u': 587 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 588 pStr++; 589 continue; 590 591 case 's': 592 SubStr=(char *)*Parm.StringPtr; 593 while (*BuildPtr++ = *SubStr++); 594 Parm.StringPtr++; 595 BuildPtr--; // remove the \0 596 pStr++; 597 continue; 598 599 case 'c': 600 *BuildPtr++ = (char)*Parm.LongPtr; 601 Parm.LongPtr++; 602 pStr++; 603 continue; 604 605 case 'l': 606 pStr++; 607 switch (*pStr) 608 { 609 case 'x': 610 case 'X': 611 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 612 pStr++; 613 continue; 614 615 case 'd': 616 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 617 pStr++; 618 continue; 619 } // end switch 620 continue; // dunno what he wants 621 622 case 0: 623 continue; 624 } // end switch 625 break; 626 627 case '\\': 628 pStr++; 629 switch (*pStr) 630 { 631 case 'n': 632 *BuildPtr++=LF; 633 pStr++; 634 continue; 635 636 case 'r': 637 *BuildPtr++=CR; 638 pStr++; 639 continue; 640 641 case 0: 642 continue; 643 break; 644 } // end switch 645 646 break; 647 } // end switch 648 649 *BuildPtr++=*pStr++; 650 } // end while 651 652 *BuildPtr=0; // cauterize the string 653 654 res = strlen(buffer->curr); 655 if (buffer->size + res >= buffer->len) { 656 buffer->stop = 1; 657 return 0; 658 } 659 buffer->curr += res; 660 buffer->size += res; 661 return res; 662 } 663 -
GPL/trunk/lib32/ioctl.c
r470 r479 38 38 int pcm_instances(int card_id); 39 39 40 intuniaud_set_interrupted_substream(struct snd_pcm_substream *substream)40 void uniaud_set_interrupted_substream(struct snd_pcm_substream *substream) 41 41 { 42 42 int i; … … 257 257 } 258 258 return max_ch; 259 }260 261 void FillCaps(ULONG deviceid)262 {263 int pcms = 0;264 265 pcms = pcm_instances(deviceid);266 267 printk("pcms = %i\n", pcms); //uncommented268 if (!pcmcaps[deviceid])269 {270 pcmcaps[deviceid] = (POSS32_DEVCAPS)kmalloc(sizeof(OSS32_DEVCAPS)*pcms, GFP_KERNEL);271 if (pcmcaps[deviceid])272 {273 memset(pcmcaps[deviceid], 0, sizeof(OSS32_DEVCAPS)*pcms);274 GetUniaudPcmCaps1(deviceid, (void *)pcmcaps[deviceid]);275 }276 }277 return;278 }279 280 int GetUniaudPcmCaps(ULONG deviceid, void *caps)281 {282 int pcms = 0;283 284 pcms = pcm_instances(deviceid);285 286 // printk("pcms = %i\n", pcms);287 if (pcmcaps[deviceid])288 {289 memcpy((unsigned char*)caps,(unsigned char*)pcmcaps[deviceid],sizeof(OSS32_DEVCAPS)*pcms);290 return 0;291 }292 else293 {294 return -1;295 }296 259 } 297 260 … … 316 279 if (!pcaps || !pcms) return -1; 317 280 318 281 319 282 //these structures are too big to put on the stack 320 283 pcminfo = (struct snd_pcm_info *)kmalloc(sizeof(struct snd_pcm_info)+sizeof(struct snd_pcm_hw_params), GFP_KERNEL); … … 434 397 } 435 398 399 void FillCaps(ULONG deviceid) 400 { 401 int pcms = 0; 402 403 pcms = pcm_instances(deviceid); 404 405 printk("pcms = %i\n", pcms); //uncommented 406 if (!pcmcaps[deviceid]) 407 { 408 pcmcaps[deviceid] = (POSS32_DEVCAPS)kmalloc(sizeof(OSS32_DEVCAPS)*pcms, GFP_KERNEL); 409 if (pcmcaps[deviceid]) 410 { 411 memset(pcmcaps[deviceid], 0, sizeof(OSS32_DEVCAPS)*pcms); 412 GetUniaudPcmCaps1(deviceid, (void *)pcmcaps[deviceid]); 413 } 414 } 415 return; 416 } 417 418 int GetUniaudPcmCaps(ULONG deviceid, void *caps) 419 { 420 int pcms = 0; 421 422 pcms = pcm_instances(deviceid); 423 424 // printk("pcms = %i\n", pcms); 425 if (pcmcaps[deviceid]) 426 { 427 memcpy((unsigned char*)caps,(unsigned char*)pcmcaps[deviceid],sizeof(OSS32_DEVCAPS)*pcms); 428 return 0; 429 } 430 else 431 { 432 return -1; 433 } 434 } 435 436 436 /* 437 437 returns power state of given card … … 469 469 } 470 470 //retrieve mixer information 471 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 472 SNDRV_CTL_IOCTL_POWER_STATE, 471 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 472 SNDRV_CTL_IOCTL_POWER_STATE, 473 473 (ULONG)state); 474 474 … … 522 522 } 523 523 //retrieve mixer information 524 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 525 SNDRV_CTL_IOCTL_POWER, 524 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 525 SNDRV_CTL_IOCTL_POWER, 526 526 (ULONG)state); 527 527 … … 576 576 } 577 577 //retrieve mixer information 578 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 579 SNDRV_CTL_IOCTL_CARD_INFO, 578 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 579 SNDRV_CTL_IOCTL_CARD_INFO, 580 580 (ULONG)(struct snd_ctl_card_info *)info); 581 581 if(ret) { … … 630 630 } 631 631 //retrieve mixer information 632 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 633 SNDRV_CTL_IOCTL_CARD_INFO, 632 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 633 SNDRV_CTL_IOCTL_CARD_INFO, 634 634 (ULONG)&pHandle->info); 635 635 if(ret) { … … 640 640 pHandle->list.offset = 0; 641 641 pHandle->list.space = 0; 642 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 643 SNDRV_CTL_IOCTL_ELEM_LIST, 642 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 643 SNDRV_CTL_IOCTL_ELEM_LIST, 644 644 (ULONG)&pHandle->list); 645 645 if(ret) { … … 695 695 } 696 696 //retrieve mixer information 697 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 698 SNDRV_CTL_IOCTL_CARD_INFO, 697 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 698 SNDRV_CTL_IOCTL_CARD_INFO, 699 699 (ULONG)&pHandle->info); 700 700 if(ret) { … … 705 705 pHandle->list.offset = 0; 706 706 pHandle->list.space = 0; 707 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 708 SNDRV_CTL_IOCTL_ELEM_LIST, 707 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 708 SNDRV_CTL_IOCTL_ELEM_LIST, 709 709 (ULONG)&pHandle->list); 710 710 if(ret) { … … 724 724 pHandle->list.space = pHandle->list.count; 725 725 pHandle->list.pids = pHandle->pids; 726 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 727 SNDRV_CTL_IOCTL_ELEM_LIST, 726 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 727 SNDRV_CTL_IOCTL_ELEM_LIST, 728 728 (ULONG)&pHandle->list); 729 729 if(ret) { -
GPL/trunk/lib32/irq.c
r437 r479 206 206 #endif 207 207 208 // HDA Hardware generates controller interrupts and stream interrupts 208 // HDA Hardware generates controller interrupts and stream interrupts 209 209 // the uniaud16 driver only cares about stream interrupts. 210 // azx_interrupt in alsa-kernel/pci/hda/hda_intel.c will return rc 2 if 211 // the interrupt is from the controller. There is no need to call uniaud16 212 // for these interrupts213 if ( rc == 2 ) { 210 // azx_interrupt in alsa-kernel/pci/hda/hda_intel.c will return rc 2 if 211 // the interrupt is from the controller. There is no need to call uniaud16 212 // for these interrupts 213 if ( rc == 2 ) { 214 214 fInInterrupt = FALSE; 215 215 *pulIrq = pSlot->irqNo; -
GPL/trunk/lib32/misc.c
r445 r479 46 46 mem_map_t *mem_map = 0; 47 47 int this_module[64] = {0}; 48 48 49 49 #include <stdarg.h> 50 50 … … 64 64 65 65 char *pszLastALSAError; 66 66 67 67 pszLastALSAError= iLastError ? szLastALSAError2 : szLastALSAError1; 68 68 … … 75 75 DebugInt3(); 76 76 } 77 77 78 78 dprintf( (pszLastALSAError) ); 79 79 if(++iLastError > 1) { … … 240 240 } 241 241 return 0; 242 } 243 //****************************************************************************** 244 //****************************************************************************** 245 static void run_workqueue(struct workqueue_struct *wq) 246 { 247 unsigned long flags; 248 249 spin_lock_irqsave(&wq->lock, flags); 250 while (!list_empty(&wq->worklist)) { 251 struct work_struct *work = list_entry(wq->worklist.next, 252 struct work_struct, entry); 253 void (*f) (void *) = work->func; 254 void *data = work->data; 255 256 list_del_init(wq->worklist.next); 257 spin_unlock_irqrestore(&wq->lock, flags); 258 clear_bit(0, &work->pending); 259 f(data); 260 spin_lock_irqsave(&wq->lock, flags); 261 wake_up(&wq->work_done); 262 } 263 spin_unlock_irqrestore(&wq->lock, flags); 242 264 } 243 265 //****************************************************************************** … … 263 285 spin_unlock_irq(&wq->lock); 264 286 } 265 }266 //******************************************************************************267 //******************************************************************************268 static void run_workqueue(struct workqueue_struct *wq)269 {270 unsigned long flags;271 272 spin_lock_irqsave(&wq->lock, flags);273 while (!list_empty(&wq->worklist)) {274 struct work_struct *work = list_entry(wq->worklist.next,275 struct work_struct, entry);276 void (*f) (void *) = work->func;277 void *data = work->data;278 279 list_del_init(wq->worklist.next);280 spin_unlock_irqrestore(&wq->lock, flags);281 clear_bit(0, &work->pending);282 f(data);283 spin_lock_irqsave(&wq->lock, flags);284 wake_up(&wq->work_done);285 }286 spin_unlock_irqrestore(&wq->lock, flags);287 287 } 288 288 //****************************************************************************** -
GPL/trunk/lib32/ossidc.cpp
r455 r479 270 270 } 271 271 if((ForceCard == CARD_NONE || ForceCard == CARD_AZX) && 272 nrCardsDetected < (OSS32_MAX_AUDIOCARDS-1) && call_module_init(alsa_card_azx_init) == 0) 272 nrCardsDetected < (OSS32_MAX_AUDIOCARDS-1) && call_module_init(alsa_card_azx_init) == 0) 273 273 { 274 274 fnCardExitCall[nrCardsDetected] = name_module_exit(alsa_card_azx_exit); -
GPL/trunk/lib32/sound.c
r475 r479 36 36 #include <stacktoflat.h> 37 37 #include <stdlib.h> 38 #include <proto.h> 38 39 #include "soundoss.h" 39 40 … … 1112 1113 1113 1114 #ifdef DEBUG 1114 printk("OSS32_WaveAddBuffer N:%d hw % d app %d avail %d, orig size: %d, size %d\n",CountWv, samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr), samples_to_bytes(status.avail), size1, size);1115 printk("OSS32_WaveAddBuffer N:%d hw %x app %x avail %x, orig size: %x, size %x\n",CountWv, samples_to_bytes(status.hw_ptr), samples_to_bytes(status.appl_ptr), samples_to_bytes(status.avail), size1, size); 1115 1116 #endif 1116 1117 … … 1325 1326 } 1326 1327 //****************************************************************************** 1327 //****************************************************************************** 1328 1328 -
GPL/trunk/lib32/soundmixer.c
r457 r479 80 80 }; 81 81 82 static unsigned char LinToLog[OSS32_MAX_VOLUME+1] = { 82 static unsigned char LinToLog[OSS32_MAX_VOLUME+1] = { 83 83 0, 0, 0, 0, 1, 2, 2, 5, 5, 10, 84 10, 10, 16, 19, 20, 22, 24, 25, 27, 27, 85 28, 28, 29, 30, 30, 35, 35, 35, 39, 39, 86 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 87 55, 56, 57, 59, 60, 62, 63, 64, 65, 66, 84 10, 10, 16, 19, 20, 22, 24, 25, 27, 27, 85 28, 28, 29, 30, 30, 35, 35, 35, 39, 39, 86 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 87 55, 56, 57, 59, 60, 62, 63, 64, 65, 66, 88 88 67, 68, 69, 70, 71, 72, 73, 74, 74, 75, 89 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 90 85, 86, 87, 88, 89, 90, 91, 92, 92, 93, 91 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 89 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 90 85, 86, 87, 88, 89, 90, 91, 92, 92, 93, 91 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 92 92 98, 99, 99, 99, 99, 100, 100, 100, 100, 100, 93 93 100 … … 148 148 } 149 149 //retrieve mixer information 150 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 151 SNDRV_CTL_IOCTL_CARD_INFO, 150 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 151 SNDRV_CTL_IOCTL_CARD_INFO, 152 152 (ULONG)&pHandle->info); 153 153 if(ret) { … … 157 157 pHandle->list.offset = 0; 158 158 pHandle->list.space = 0; 159 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 160 SNDRV_CTL_IOCTL_ELEM_LIST, 159 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 160 SNDRV_CTL_IOCTL_ELEM_LIST, 161 161 (ULONG)&pHandle->list); 162 162 if(ret) { … … 172 172 pHandle->list.space = pHandle->list.count; 173 173 pHandle->list.pids = pHandle->pids; 174 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 175 SNDRV_CTL_IOCTL_ELEM_LIST, 174 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 175 SNDRV_CTL_IOCTL_ELEM_LIST, 176 176 (ULONG)&pHandle->list); 177 177 if(ret) { … … 188 188 189 189 //Extract standard mixer controls from array with control names 190 for(j=0;j<OSS_MIXER_NRDEVICES;j++) 190 for(j=0;j<OSS_MIXER_NRDEVICES;j++) 191 191 { 192 192 int namelen = strlen(ossid[j].name); … … 197 197 pHandle->controls[j].idxCaptureSwitch = -1; 198 198 199 for(i=0;i<pHandle->list.count;i++) 199 for(i=0;i<pHandle->list.count;i++) 200 200 { 201 201 if (pHandle->pids[i].index == ossid[j].index && … … 209 209 break; 210 210 } 211 else 212 {//first part of the control name is correct; now find out what 211 else 212 {//first part of the control name is correct; now find out what 213 213 //is it exactly 214 214 char *nextword = &pHandle->pids[i].name[namelen]; … … 216 216 217 217 if(strncmp(nextword, MIXER_PLAYBACKVOLUME, sizeof(MIXER_PLAYBACKVOLUME)-1) == 0 || 218 strncmp(nextword, MIXER_VOLUME, sizeof(MIXER_VOLUME)-1) == 0) 218 strncmp(nextword, MIXER_VOLUME, sizeof(MIXER_VOLUME)-1) == 0) 219 219 {//volume control 220 220 pHandle->controls[j].idxVolume = i; … … 222 222 else 223 223 if(strncmp(nextword, MIXER_PLAYBACKSWITCH, sizeof(MIXER_PLAYBACKSWITCH)-1) == 0 || 224 strncmp(nextword, MIXER_SWITCH, sizeof(MIXER_SWITCH)-1) == 0) 224 strncmp(nextword, MIXER_SWITCH, sizeof(MIXER_SWITCH)-1) == 0) 225 225 {//mute control 226 226 pHandle->controls[j].idxMute = i; … … 229 229 } 230 230 else 231 if(strncmp(nextword, MIXER_SOURCE, sizeof(MIXER_SOURCE)-1) == 0) 231 if(strncmp(nextword, MIXER_SOURCE, sizeof(MIXER_SOURCE)-1) == 0) 232 232 {//source control (e.g. recording source) 233 233 pHandle->controls[j].idxCustom = i; … … 235 235 else 236 236 if(strncmp(nextword, MIXER_CAPTUREROUTE, sizeof(MIXER_CAPTUREROUTE)-1) == 0 || 237 strncmp(nextword, MIXER_CAPTURESWITCH, sizeof(MIXER_CAPTURESWITCH)-1) == 0) 237 strncmp(nextword, MIXER_CAPTURESWITCH, sizeof(MIXER_CAPTURESWITCH)-1) == 0) 238 238 {//source control for recording (per input) 239 239 pHandle->controls[j].idxCaptureSwitch = i; … … 241 241 else 242 242 if(i == OSS_MIXER_MIC) { 243 if(strncmp(nextword, MIXER_BOOST, sizeof(MIXER_BOOST)-1) == 0) 243 if(strncmp(nextword, MIXER_BOOST, sizeof(MIXER_BOOST)-1) == 0) 244 244 {//mic boost switch 245 245 pHandle->controls[j].idxCustom = i; … … 257 257 258 258 //request information about available capture sources 259 if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1) 259 if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1) 260 260 { 261 struct snd_ctl_elem_info *pElemInfo = NULL; 261 struct snd_ctl_elem_info *pElemInfo = NULL; 262 262 int idx, j; 263 263 … … 266 266 //set operation to non-blocking 267 267 pHandle->file.f_flags = O_NONBLOCK; 268 268 269 269 pHandle->rectype = RECTYPE_SELECTOR; 270 270 … … 277 277 278 278 pElemInfo->value.enumerated.items = 1; 279 for(i=0;i<pElemInfo->value.enumerated.items;i++) 279 for(i=0;i<pElemInfo->value.enumerated.items;i++) 280 280 { 281 281 pElemInfo->value.enumerated.item = i; … … 307 307 pHandle->idxRecCaps[j] = -1; 308 308 } 309 for(j=0;j<OSS_MIXER_NRDEVICES;j++) 309 for(j=0;j<OSS_MIXER_NRDEVICES;j++) 310 310 { 311 311 if(pHandle->controls[j].idxCaptureSwitch != -1) { … … 364 364 //set operation to non-blocking 365 365 pHandle->file.f_flags = O_NONBLOCK; 366 366 367 367 return OSSERR_NOT_SUPPORTED; 368 368 } … … 373 373 mixerhandle *pHandle = (mixerhandle *)streamid; 374 374 struct snd_ctl_elem_value *pElem = NULL; 375 struct snd_ctl_elem_info *pElemInfo; 375 struct snd_ctl_elem_info *pElemInfo; 376 376 int ret, idx, lVol, rVol = 0, idxMute, cnt; 377 377 378 dprintf(("OSS32_MixSetVolume line=%d\n", line)); 378 379 if(pHandle == NULL || pHandle->magic != MAGIC_MIXER_ALSA32) { 379 380 printk("Invalid handle in OSS32_MixSetVolume\n"); … … 450 451 idxMute = pHandle->controls[OSS_MIXER_PHONEOUT].idxMute; 451 452 break; 452 case OSS32_MIX_VOLUME_HEADPHONE: 453 case OSS32_MIX_VOLUME_HEADPHONE: 453 454 idx = pHandle->controls[OSS_MIXER_HEADPHONE].idxVolume; 454 455 idxMute = pHandle->controls[OSS_MIXER_HEADPHONE].idxMute; … … 557 558 mixerhandle *pHandle = (mixerhandle *)streamid; 558 559 struct snd_ctl_elem_value *pElem = NULL; 559 struct snd_ctl_elem_info *pElemInfo; 560 struct snd_ctl_elem_info *pElemInfo; 560 561 int ret, idx = -1, lVol, rVol = 0, j, i; 561 562 … … 566 567 //set operation to non-blocking 567 568 pHandle->file.f_flags = O_NONBLOCK; 568 569 569 570 //too big to put on the stack 570 571 pElem = (struct snd_ctl_elem_value *)kmalloc(sizeof(struct snd_ctl_elem_value) + sizeof(struct snd_ctl_elem_info), GFP_KERNEL); … … 591 592 else {//capture switch for each input source 592 593 //first turn off all capture switches... 593 for(j=0;j<OSS32_MIX_RECSRC_MAX;j++) 594 for(j=0;j<OSS32_MIX_RECSRC_MAX;j++) 594 595 { 595 596 if(pHandle->idxRecCaps[j] != -1) { … … 641 642 642 643 break; 643 644 644 645 case OSS32_MIX_SWITCH_MICBOOST: 645 646 idx = pHandle->controls[OSS_MIXER_MIC].idxCustom; … … 729 730 //set operation to non-blocking 730 731 pHandle->file.f_flags = O_NONBLOCK; 731 732 732 733 return OSSERR_NOT_SUPPORTED; 733 734 } … … 767 768 case OSS_MIXER_BASS: 768 769 return OSS32_MIX_LEVEL_BASS; 769 case OSS_MIXER_HEADPHONE: 770 case OSS_MIXER_HEADPHONE: 770 771 return OSS32_MIX_VOLUME_HEADPHONE; 771 772 case OSS_MIXER_SPEAKER: … … 792 793 pCaps->fuRecCaps = 0; 793 794 794 for(i=0;i<OSS_MIXER_NRDEVICES;i++) 795 for(i=0;i<OSS_MIXER_NRDEVICES;i++) 795 796 { 796 797 if(pHandle->controls[i].idxVolume != -1) { 797 798 ULONG volidx = OSSToALSAVolume(i); 798 if(volidx != -1) 799 if(volidx != -1) 799 800 pCaps->fuCtrlCaps |= OSS32_MIX_FLAG(volidx); 800 801 } … … 804 805 //then we support intput source selection 805 806 if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1 || 806 pHandle->rectype == RECTYPE_SWITCH) 807 { 807 pHandle->rectype == RECTYPE_SWITCH) 808 { 808 809 pCaps->fuCtrlCaps |= OSS32_MIX_FLAG(OSS32_MIX_INPUTSRC); 809 810 pCaps->fuRecCaps = pHandle->reccaps; … … 843 844 } 844 845 //retrieve mixer information 845 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 846 SNDRV_CTL_IOCTL_CARD_INFO, 846 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 847 SNDRV_CTL_IOCTL_CARD_INFO, 847 848 (ULONG)&pHandle->info); 848 849 if(ret) { … … 904 905 } 905 906 //retrieve mixer information 906 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 907 SNDRV_CTL_IOCTL_CARD_INFO, 907 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 908 SNDRV_CTL_IOCTL_CARD_INFO, 908 909 (ULONG)&pHandle->info); 909 910 if(ret) { -
GPL/trunk/lib32/task.c
r305 r479 46 46 t->next = NULL; 47 47 t->sync = 0; 48 t->func = func;49 t->data = data;48 t->func = (void *)func; /* DAZ cast added to stop compiler warning */ 49 t->data = (void *)data; /* DAZ cast added to stop compiiler warning */ 50 50 } 51 51 -
GPL/trunk/uniaud.inc
r465 r479 7 7 # BUILDVERSION must be 3 parts, and only numbers like 5.44.108 8 8 # It is best that 2'nd number is always 2 digits, eg at least 10 9 BUILDVERSION = 1.9.2 19 BUILDVERSION = 1.9.22 10 10 11 11 # Fixpack version … … 13 13 # ex RC3 GA FIXPACK2 beta_47 14 14 # Comment out to avoid a fixpack line in bldlevel 15 FIXPACK = SVN r4 6515 FIXPACK = SVN r478 16 16 17 17 # ALSA BUILD VERSION
Note:
See TracChangeset
for help on using the changeset viewer.