Changeset 464 for GPL/trunk/alsa-kernel/include
- Timestamp:
- Oct 8, 2009, 10:35:00 AM (16 years ago)
- Location:
- GPL/trunk/alsa-kernel/include/sound
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/ac97_codec.h
r402 r464 32 32 #include "control.h" 33 33 #include "info.h" 34 35 /* maximum number of devices on the AC97 bus */ 36 #define AC97_BUS_MAX_DEVICES 4 34 37 35 38 /* … … 650 653 extern struct bus_type ac97_bus_type; 651 654 655 /* AC97 platform_data adding function */ 656 static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data) 657 { 658 ac97->dev.platform_data = data; 659 } 660 652 661 #endif /* __SOUND_AC97_CODEC_H */ -
GPL/trunk/alsa-kernel/include/sound/asound.h
r426 r464 162 162 *****************************************************************************/ 163 163 164 #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)164 #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) 165 165 166 166 typedef unsigned long snd_pcm_uframes_t; … … 279 279 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 280 280 #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 281 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ 281 282 282 283 typedef int __bitwise snd_pcm_state_t; -
GPL/trunk/alsa-kernel/include/sound/config.h
r455 r464 85 85 #define CONFIG_SND_DEBUG_DETECT 86 86 #define CONFIG_SND_DEBUG_VERBOSE 87 #define CONFIG_SND_DMA_SGBUF 87 88 #define CONFIG_SND_HDA_CODEC_ANALOG 88 89 #define CONFIG_SND_HDA_CODEC_ATIHDMI -
GPL/trunk/alsa-kernel/include/sound/core.h
r426 r464 324 324 struct snd_card **card_ret); 325 325 326 static inline __deprecated327 struct snd_card *snd_card_new(int idx, const char *id,328 struct module *module, int extra_size)329 {330 struct snd_card *card;331 if (snd_card_create(idx, id, module, extra_size, &card) < 0)332 return NULL;333 return card;334 }335 336 326 int snd_card_disconnect(struct snd_card *card); 337 327 int snd_card_free(struct snd_card *card); 338 328 int snd_card_free_when_closed(struct snd_card *card); 329 void snd_card_set_id(struct snd_card *card, const char *id); 339 330 int snd_card_register(struct snd_card *card); 340 331 int snd_card_info_init(void); … … 373 364 void release_and_free_resource(struct resource *res); 374 365 375 #ifdef CONFIG_SND_VERBOSE_PRINTK376 void snd_verbose_printk(const char *file, int line, const char *format, ...)377 __attribute__ ((format (printf, 3, 4)));378 #endif379 #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK)380 void snd_verbose_printd(const char *file, int line, const char *format, ...)381 __attribute__ ((format (printf, 3, 4)));382 #endif383 384 366 /* --- */ 385 367 386 #ifdef CONFIG_SND_VERBOSE_PRINTK 368 #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) 369 void __snd_printk(unsigned int level, const char *file, int line, 370 const char *format, ...) 371 __attribute__ ((format (printf, 4, 5))); 372 #else 373 #ifndef TARGET_OS2 374 #define __snd_printk(level, file, line, format, args...) \ 375 printk(format, ##args) 376 #else 377 #define __snd_printk printk 378 #endif /* nothing */ 379 #endif 380 387 381 /** 388 382 * snd_printk - printk wrapper … … 392 386 * when configured with CONFIG_SND_VERBOSE_PRINTK. 393 387 */ 388 #ifndef TARGET_OS2 394 389 #define snd_printk(fmt, args...) \ 395 snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) 396 #else 397 #ifndef TARGET_OS2 398 #define snd_printk(fmt, args...) \ 399 printk(fmt ,##args) 390 __snd_printk(0, __FILE__, __LINE__, fmt, ##args) 400 391 #else 401 392 #define snd_printk printk 402 393 #endif 403 #endif404 394 405 395 #ifdef CONFIG_SND_DEBUG 406 407 #ifdef CONFIG_SND_VERBOSE_PRINTK408 396 /** 409 397 * snd_printd - debug printk … … 414 402 */ 415 403 #define snd_printd(fmt, args...) \ 416 snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) 417 #else 418 #define snd_printd(fmt, args...) \ 419 printk(fmt ,##args) 420 #endif 404 __snd_printk(1, __FILE__, __LINE__, fmt, ##args) 421 405 422 406 /** … … 478 462 */ 479 463 #ifndef TARGET_OS2 480 #define snd_printdd(format, args...) snd_printk(format, ##args) 464 #define snd_printdd(format, args...) \ 465 __snd_printk(2, __FILE__, __LINE__, format, ##args) 481 466 #else 482 467 #define snd_printdd snd_printk … … 484 469 #else 485 470 #ifndef TARGET_OS2 486 #define snd_printdd(format, args...) /* nothing */471 #define snd_printdd(format, args...) do { } while (0) 487 472 #else 488 473 #define snd_printdd 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL) -
GPL/trunk/alsa-kernel/include/sound/memalloc.h
r410 r464 48 48 #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ 49 49 #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ 50 #ifdef CONFIG_SND_DMA_SGBUF 50 51 #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ 52 #else 53 #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ 54 #endif 51 55 52 56 /* … … 61 65 }; 62 66 67 #ifdef CONFIG_SND_DMA_SGBUF 63 68 /* 64 69 * Scatter-Gather generic device pages … … 108 113 return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; 109 114 } 115 #endif /* CONFIG_SND_DMA_SGBUF */ 110 116 111 117 /* allocate/release a buffer */ -
GPL/trunk/alsa-kernel/include/sound/pcm.h
r426 r464 99 99 #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 100 100 #define SNDRV_PCM_IOCTL1_GSTATE 3 101 #define SNDRV_PCM_IOCTL1_FIFO_SIZE 4 101 102 102 103 #define SNDRV_PCM_TRIGGER_STOP 0 … … 271 272 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 272 273 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 274 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 273 275 274 276 /* -- HW params -- */ … … 490 492 void snd_pcm_vma_notify_data(void *client, void *data); 491 493 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 492 493 #if BITS_PER_LONG >= 64494 495 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)496 {497 *rem = *n % div;498 *n /= div;499 }500 501 #elif defined(i386)502 503 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)504 {505 u_int32_t low, high;506 low = *n & 0xffffffff;507 high = *n >> 32;508 if (high) {509 u_int32_t high1 = high % div;510 high /= div;511 asm("divl %2":"=a" (low), "=d" (*rem):"rm" (div), "a" (low), "d" (high1));512 *n = (u_int64_t)high << 32 | low;513 } else {514 *n = low / div;515 *rem = low % div;516 }517 }518 #else519 520 static inline void divl(u_int32_t high, u_int32_t low,521 u_int32_t div,522 u_int32_t *q, u_int32_t *r)523 {524 u_int64_t n = (u_int64_t)high << 32 | low;525 u_int64_t d = (u_int64_t)div << 31;526 u_int32_t q1 = 0;527 int c = 32;528 while (n > 0xffffffffU) {529 q1 <<= 1;530 if (n >= d) {531 n -= d;532 q1 |= 1;533 }534 d >>= 1;535 c--;536 }537 q1 <<= c;538 if (n) {539 low = n;540 *q = q1 | (low / div);541 *r = low % div;542 } else {543 *r = 0;544 *q = q1;545 }546 return;547 }548 549 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)550 {551 u_int32_t low, high;552 low = *n & 0xffffffff;553 high = *n >> 32;554 if (high) {555 u_int32_t high1 = high % div;556 u_int32_t low1 = low;557 high /= div;558 divl(high1, low1, div, &low, rem);559 *n = (u_int64_t)high << 32 | low;560 } else {561 *n = low / div;562 *rem = low % div;563 }564 }565 #endif566 494 567 495 /* … … 992 920 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 993 921 922 #ifdef CONFIG_SND_DMA_SGBUF 994 923 /* 995 924 * SG-buffer handling … … 1016 945 unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, 1017 946 unsigned int ofs, unsigned int size); 947 948 #else /* !SND_DMA_SGBUF */ 949 /* 950 * fake using a continuous buffer 951 */ 952 static inline dma_addr_t 953 snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) 954 { 955 return substream->runtime->dma_addr + ofs; 956 } 957 958 static inline void * 959 snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) 960 { 961 return substream->runtime->dma_area + ofs; 962 } 963 964 #define snd_pcm_sgbuf_ops_page NULL 965 966 #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) 967 968 #endif /* SND_DMA_SGBUF */ 1018 969 1019 970 /* handle mmap counter - PCM mmap callback should handle this counter properly */ -
GPL/trunk/alsa-kernel/include/sound/soc-dapm.h
r426 r464 138 138 139 139 /* stream domain */ 140 #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 141 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 142 .reg = wreg, .shift = wshift, .invert = winvert } 143 #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 144 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 145 .reg = wreg, .shift = wshift, .invert = winvert } 140 146 #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 141 147 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 142 148 .shift = wshift, .invert = winvert} 149 #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 150 wevent, wflags) \ 151 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 152 .shift = wshift, .invert = winvert, \ 153 .event = wevent, .event_flags = wflags} 143 154 #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 144 155 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 145 156 .shift = wshift, .invert = winvert} 146 147 /* generic register modifier widget */ 157 #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 158 wevent, wflags) \ 159 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 160 .shift = wshift, .invert = winvert, \ 161 .event = wevent, .event_flags = wflags} 162 163 /* generic widgets */ 148 164 #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 149 165 { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ … … 151 167 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 152 168 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 169 #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 170 { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 171 .shift = wshift, .invert = winvert, .event = wevent, \ 172 .event_flags = wflags} 153 173 154 174 /* dapm kcontrol types */ … … 266 286 int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 267 287 int event); 268 int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev, 269 enum snd_soc_bias_level level); 288 void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); 270 289 271 290 /* dapm sys fs - used by the core */ 272 291 int snd_soc_dapm_sys_add(struct device *dev); 292 void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); 273 293 274 294 /* dapm audio pin control and status */ … … 299 319 snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 300 320 snd_soc_dapm_post, /* machine specific post widget - exec last */ 321 snd_soc_dapm_supply, /* power/clock supply */ 322 snd_soc_dapm_aif_in, /* audio interface input */ 323 snd_soc_dapm_aif_out, /* audio interface output */ 301 324 }; 302 325 … … 358 381 unsigned char pmdown:1; /* waiting for timeout */ 359 382 383 int (*power_check)(struct snd_soc_dapm_widget *w); 384 360 385 /* external events */ 361 386 unsigned short event_flags; /* flags to specify event types */ … … 369 394 struct list_head sources; 370 395 struct list_head sinks; 396 397 /* used during DAPM updates */ 398 struct list_head power_list; 371 399 }; 372 400 -
GPL/trunk/alsa-kernel/include/sound/soc.h
r426 r464 119 119 .get = xhandler_get, .put = xhandler_put, \ 120 120 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 121 #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 122 xhandler_get, xhandler_put) \ 123 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 124 .info = snd_soc_info_volsw, \ 125 .get = xhandler_get, .put = xhandler_put, \ 126 .private_value = (unsigned long)&(struct soc_mixer_control) \ 127 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 128 .max = xmax, .invert = xinvert} } 121 129 #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 122 130 xhandler_get, xhandler_put, tlv_array) \ … … 128 136 .get = xhandler_get, .put = xhandler_put, \ 129 137 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 138 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 139 xhandler_get, xhandler_put, tlv_array) \ 140 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 141 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 142 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 143 .tlv.p = (tlv_array), \ 144 .info = snd_soc_info_volsw, \ 145 .get = xhandler_get, .put = xhandler_put, \ 146 .private_value = (unsigned long)&(struct soc_mixer_control) \ 147 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 148 .max = xmax, .invert = xinvert} } 149 #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 150 xhandler_get, xhandler_put, tlv_array) \ 151 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 152 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 153 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 154 .tlv.p = (tlv_array), \ 155 .info = snd_soc_info_volsw_2r, \ 156 .get = xhandler_get, .put = xhandler_put, \ 157 .private_value = (unsigned long)&(struct soc_mixer_control) \ 158 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 159 .max = xmax, .invert = xinvert} } 130 160 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 131 161 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 180 210 extern struct snd_ac97_bus_ops soc_ac97_ops; 181 211 212 enum snd_soc_control_type { 213 SND_SOC_CUSTOM, 214 SND_SOC_I2C, 215 SND_SOC_SPI, 216 }; 217 182 218 int snd_soc_register_platform(struct snd_soc_platform *platform); 183 219 void snd_soc_unregister_platform(struct snd_soc_platform *platform); 184 220 int snd_soc_register_codec(struct snd_soc_codec *codec); 185 221 void snd_soc_unregister_codec(struct snd_soc_codec *codec); 222 int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 223 int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 224 int addr_bits, int data_bits, 225 enum snd_soc_control_type control); 226 227 #ifdef CONFIG_PM 228 int snd_soc_suspend_device(struct device *dev); 229 int snd_soc_resume_device(struct device *dev); 230 #endif 186 231 187 232 /* pcm <-> DAI connect */ … … 207 252 #endif 208 253 209 /* codec IO */210 #define snd_soc_read(codec, reg) codec->read(codec, reg)211 #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value)212 213 254 /* codec register bit access */ 214 255 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, 215 unsigned short mask, unsigned short value);256 unsigned int mask, unsigned int value); 216 257 int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, 217 unsigned short mask, unsigned short value);258 unsigned int mask, unsigned int value); 218 259 219 260 int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, … … 332 373 struct mutex mutex; 333 374 struct device *dev; 375 struct snd_soc_device *socdev; 334 376 335 377 struct list_head list; … … 352 394 int (*display_register)(struct snd_soc_codec *, char *, 353 395 size_t, unsigned int); 396 int (*volatile_register)(unsigned int); 397 int (*readable_register)(unsigned int); 354 398 hw_write_t hw_write; 355 hw_read_t hw_read;399 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 356 400 void *reg_cache; 357 401 short reg_cache_size; … … 373 417 struct dentry *debugfs_reg; 374 418 struct dentry *debugfs_pop_time; 419 struct dentry *debugfs_dapm; 375 420 #endif 376 421 }; … … 417 462 /* codec/machine specific init - e.g. add machine controls */ 418 463 int (*init)(struct snd_soc_codec *codec); 464 465 /* Symmetry requirements */ 466 unsigned int symmetric_rates:1; 467 468 /* Symmetry data - only valid if symmetry is being enforced */ 469 unsigned int rate; 419 470 420 471 /* DAI pcm */ … … 491 542 }; 492 543 544 /* codec IO */ 545 static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 546 unsigned int reg) 547 { 548 return codec->read(codec, reg); 549 } 550 551 static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, 552 unsigned int reg, unsigned int val) 553 { 554 return codec->write(codec, reg, val); 555 } 556 493 557 #include <sound/soc-dai.h> 494 558 -
GPL/trunk/alsa-kernel/include/sound/tlv.h
r305 r464 36 36 #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ 37 37 #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ 38 #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ 39 #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ 38 40 39 41 #define TLV_DB_SCALE_ITEM(min, step, mute) \ … … 42 44 #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ 43 45 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } 46 47 /* dB scale specified with min/max values instead of step */ 48 #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ 49 SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ 50 (min_dB), (max_dB) 51 #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ 52 SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ 53 (min_dB), (max_dB) 54 #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ 55 unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } 56 #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ 57 unsigned int name[] = { TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) } 44 58 45 59 /* linear volume between min_dB and max_dB (.01dB unit) */ -
GPL/trunk/alsa-kernel/include/sound/ymfpci.h
r305 r464 332 332 struct snd_rawmidi *rawmidi; 333 333 struct snd_timer *timer; 334 unsigned int timer_ticks; 334 335 335 336 struct pci_dev *pci;
Note:
See TracChangeset
for help on using the changeset viewer.