Changeset 598 for GPL/trunk/alsa-kernel/include/sound
- Timestamp:
- Apr 3, 2017, 4:51:56 PM (9 years ago)
- Location:
- GPL/trunk
- Files:
-
- 31 added
- 14 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
-
Property svn:mergeinfo
set to
/GPL/branches/uniaud32-2.1.x merged eligible
-
Property svn:mergeinfo
set to
-
GPL/trunk/alsa-kernel/include/sound/ac97_codec.h
r464 r598 478 478 struct snd_ac97 { 479 479 /* -- lowlevel (hardware) driver specific -- */ 480 struct snd_ac97_build_ops *build_ops;480 const struct snd_ac97_build_ops *build_ops; 481 481 void *private_data; 482 482 void (*private_free) (struct snd_ac97 *ac97); … … 594 594 struct ac97_quirk { 595 595 unsigned short subvendor; /* PCI subsystem vendor id */ 596 unsigned short subdevice; /* PCI s ybsystem device id */596 unsigned short subdevice; /* PCI subsystem device id */ 597 597 unsigned short mask; /* device id bit mask, 0 = accept all */ 598 598 unsigned int codec_id; /* codec id (if any), 0 = accept all */ -
GPL/trunk/alsa-kernel/include/sound/ak4114.h
r399 r598 96 96 /* AK4114_REG_IO0 */ 97 97 #define AK4114_TX1E (1<<7) /* TX1 Output Enable (1 = enable) */ 98 #define AK4114_OPS12 (1<< 2) /* Output ThoughData Selector for TX1 pin */99 #define AK4114_OPS11 (1<< 1) /* Output ThoughData Selector for TX1 pin */100 #define AK4114_OPS10 (1<< 0) /* Output ThoughData Selector for TX1 pin */98 #define AK4114_OPS12 (1<<6) /* Output Data Selector for TX1 pin */ 99 #define AK4114_OPS11 (1<<5) /* Output Data Selector for TX1 pin */ 100 #define AK4114_OPS10 (1<<4) /* Output Data Selector for TX1 pin */ 101 101 #define AK4114_TX0E (1<<3) /* TX0 Output Enable (1 = enable) */ 102 #define AK4114_OPS02 (1<<2) /* Output ThoughData Selector for TX0 pin */103 #define AK4114_OPS01 (1<<1) /* Output ThoughData Selector for TX0 pin */104 #define AK4114_OPS00 (1<<0) /* Output ThoughData Selector for TX0 pin */102 #define AK4114_OPS02 (1<<2) /* Output Data Selector for TX0 pin */ 103 #define AK4114_OPS01 (1<<1) /* Output Data Selector for TX0 pin */ 104 #define AK4114_OPS00 (1<<0) /* Output Data Selector for TX0 pin */ 105 105 106 106 /* AK4114_REG_IO1 */ -
GPL/trunk/alsa-kernel/include/sound/ak4xxx-adda.h
r399 r598 69 69 SND_AK4524, SND_AK4528, SND_AK4529, 70 70 SND_AK4355, SND_AK4358, SND_AK4381, 71 SND_AK5365 71 SND_AK5365, SND_AK4620, 72 72 } type; 73 73 … … 77 77 78 78 struct snd_ak4xxx_ops ops; 79 unsigned int num_chips; 80 unsigned int total_regs; 81 const char *name; 79 82 }; 80 83 -
GPL/trunk/alsa-kernel/include/sound/asequencer.h
r587 r598 68 68 #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */ 69 69 #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */ 70 70 71 71 /** timer messages 72 72 * event data type = snd_seq_ev_queue_control … … 222 222 223 223 /* external stored data */ 224 #ifndef TARGET_OS2 224 #ifndef TARGET_OS2 225 225 struct snd_seq_ev_ext { 226 226 unsigned int len; /* length of data */ … … 235 235 #pragma pack() 236 236 #endif 237 238 237 struct snd_seq_result { 239 238 int event; /* processed event type */ … … 274 273 275 274 /* quoted event - inside the kernel only */ 276 #ifndef TARGET_OS2 275 #ifndef TARGET_OS2 277 276 struct snd_seq_ev_quote { 278 277 struct snd_seq_addr origin; /* original sender */ … … 423 422 #define USER_CLIENT ((__force snd_seq_client_type_t) 1) 424 423 #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2) 425 424 426 425 /* event filter flags */ 427 426 #define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ -
GPL/trunk/alsa-kernel/include/sound/asound.h
r587 r598 42 42 #endif /* __KERNEL__ **/ 43 43 44 #ifdef TARGET_OS245 44 #ifndef __force 46 45 #define __force … … 51 50 #endif 52 51 52 #ifdef TARGET_OS2 53 53 #define SNDRV_PCM_VOL_FRONT_LEFT 0 54 54 #define SNDRV_PCM_VOL_FRONT_RIGHT 1 … … 236 236 #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ 237 237 #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ 238 #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE 238 #define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ 239 #define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */ 240 #define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ 241 #define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */ 242 #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B 239 243 240 244 #ifdef SNDRV_LITTLE_ENDIAN … … 279 283 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 280 284 #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 285 #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ 281 286 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ 282 287 … … 323 328 typedef int snd_pcm_hw_param_t; 324 329 #define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */ 325 #ifndef TARGET_OS2 326 #define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */ 327 #define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */ 328 #else 330 #ifdef TARGET_OS2 329 331 #define SNDRV_PCM_HW_PARAM_RATE_MASK 1 /* Format */ 332 #endif 330 333 #define SNDRV_PCM_HW_PARAM_FORMAT 2 /* Format */ 331 334 #define SNDRV_PCM_HW_PARAM_SUBFORMAT 3 /* Subformat */ 332 #endif333 335 #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS 334 336 #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT … … 360 362 361 363 #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 364 #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ 365 #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ 362 366 363 367 struct snd_interval { … … 574 578 */ 575 579 576 #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)580 #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) 577 581 578 582 enum { … … 604 608 605 609 struct snd_timer_id { 606 int dev_class; 610 int dev_class; 607 611 int dev_sclass; 608 612 int card; … … 731 735 #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) 732 736 737 /******************** This section used in uniaud.dll interface *********************/ 733 738 struct snd_ctl_card_info { 734 739 int card; /* card number */ … … 792 797 unsigned int device; /* device/client number */ 793 798 unsigned int subdevice; /* subdevice (substream) number */ 794 799 unsigned char name[44]; /* ASCII name of item */ 795 800 unsigned int index; /* index of item */ 796 801 }; … … 839 844 struct snd_ctl_elem_id id; /* W: element ID */ 840 845 unsigned int indirect: 1; /* W: indirect access - obsoleted */ 841 846 union { 842 847 union { 843 848 long value[128]; … … 857 862 } bytes; 858 863 struct snd_aes_iec958 iec958; 859 } value;/* RO */864 } value; /* RO */ 860 865 struct timespec tstamp; 861 866 unsigned char reserved[128-sizeof(struct timespec)]; 862 867 }; 863 868 864 869 struct snd_ctl_tlv { 865 866 870 unsigned int numid; /* control element numeric identification */ 871 unsigned int length; /* in bytes aligned to 4 */ 867 872 #ifndef TARGET_OS2 868 873 unsigned int tlv[0]; /* first TLV */ 869 874 #else 870 875 unsigned int tlv[1]; /* first TLV */ 871 876 #endif 872 877 }; … … 924 929 struct snd_ctl_elem_id id; 925 930 } elem; 926 927 931 unsigned char data8[60]; 932 } data; 928 933 }; 929 934 -
GPL/trunk/alsa-kernel/include/sound/control.h
r426 r598 57 57 struct snd_kcontrol_volatile { 58 58 struct snd_ctl_file *owner; /* locked */ 59 pid_t owner_pid;60 59 unsigned int access; /* access rights */ 61 60 }; … … 95 94 #define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list) 96 95 96 struct pid; 97 97 98 struct snd_ctl_file { 98 99 struct list_head list; /* list of all control files */ 99 100 struct snd_card *card; 100 pid_tpid;101 struct pid *pid; 101 102 int prefer_pcm_subdevice; 102 103 int prefer_rawmidi_subdevice; … … 167 168 168 169 /* 169 * Frequently used control callbacks 170 * Frequently used control callbacks/helpers 170 171 */ 171 172 int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, … … 173 174 int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, 174 175 struct snd_ctl_elem_info *uinfo); 176 int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels, 177 unsigned int items, const char *const names[]); 175 178 176 179 /* -
GPL/trunk/alsa-kernel/include/sound/core.h
r587 r598 23 23 */ 24 24 #ifdef TARGET_OS2 25 #include < config.h>25 #include <sound\config.h> 26 26 #endif 27 27 … … 97 97 #define snd_device(n) list_entry(n, struct snd_device, list) 98 98 99 /* monitor files for graceful shutdown (hotplug) */100 101 struct snd_monitor_file {102 struct file *file;103 #ifndef TARGET_OS2104 const struct file_operations *disconnected_f_op;105 #else106 struct file_operations *disconnected_f_op;107 #endif108 struct list_head shutdown_list; /* still need to shutdown */109 struct list_head list; /* link of monitor files */110 };111 112 99 /* main structure for soundcard */ 113 100 … … 150 137 wait_queue_head_t shutdown_sleep; 151 138 struct device *dev; /* device assigned to this card */ 152 #ifndef CONFIG_SYSFS_DEPRECATED153 139 struct device *card_dev; /* cardX object for sysfs */ 154 #endif155 140 156 141 #ifdef CONFIG_PM … … 196 181 #define snd_power_unlock(card) do { (void)(card); } while (0) 197 182 static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } 198 #define snd_power_get_state(card) SNDRV_CTL_POWER_D0183 #define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; }) 199 184 #define snd_power_change_state(card, state) do { (void)(card); } while (0) 200 185 … … 205 190 int card; /* card number */ 206 191 int device; /* device number */ 207 #ifndef TARGET_OS2 192 #ifndef TARGET_OS2 208 193 const struct file_operations *f_ops; /* file operations */ 209 194 #else 210 195 struct file_operations *f_ops; /* file operations */ 211 #endif 196 #endif 212 197 void *private_data; /* private data for f_ops->open */ 213 198 struct device *dev; /* device for sysfs */ … … 217 202 static inline struct device *snd_card_get_device_link(struct snd_card *card) 218 203 { 219 #ifdef CONFIG_SYSFS_DEPRECATED220 return card ? card->dev : NULL;221 #else222 204 return card ? card->card_dev : NULL; 223 #endif224 205 } 225 206 … … 234 215 int snd_register_device_for_dev(int type, struct snd_card *card, 235 216 int dev, 236 #ifndef TARGET_OS2 217 #ifndef TARGET_OS2 237 218 const struct file_operations *f_ops, 238 219 #else 239 220 struct file_operations *f_ops, 240 #endif 221 #endif 241 222 void *private_data, 242 223 const char *name, … … 263 244 #ifndef TARGET_OS2 264 245 const struct file_operations *f_ops, 265 #else 246 #else 266 247 struct file_operations *f_ops, 267 #endif 248 #endif 268 249 void *private_data, 269 250 const char *name) … … 285 266 #else 286 267 struct file_operations *f_ops, void *private_data, 287 #endif 268 #endif 288 269 const char *name); 289 270 int snd_unregister_oss_device(int type, struct snd_card *card, int dev); … … 335 316 int snd_card_file_remove(struct snd_card *card, struct file *file); 336 317 337 #ifndef snd_card_set_dev338 318 #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) 339 #endif340 319 341 320 /* device.c */ … … 376 355 #else 377 356 #define __snd_printk printk 378 #endif 357 #endif /* nothing */ 379 358 #endif 380 359 … … 418 397 * When CONFIG_SND_DEBUG is set, this macro evaluates the given condition, 419 398 * and call WARN() and returns the value if it's non-zero. 420 * 399 * 421 400 * When CONFIG_SND_DEBUG is not set, this just returns zero, and the given 422 401 * condition is ignored. … … 427 406 * If you want to evaluate and give a warning, use standard WARN_ON(). 428 407 */ 408 429 409 #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) 430 410 … … 448 428 #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */ 449 429 #endif 430 450 431 451 432 #endif /* CONFIG_SND_DEBUG */ … … 478 459 /* for easier backward-porting */ 479 460 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 480 #ifndef gameport_set_dev_parent481 461 #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) 482 462 #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) 483 463 #define gameport_get_port_data(gp) (gp)->port_data 484 #endif485 464 #endif 486 465 … … 521 500 snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list); 522 501 502 const struct snd_pci_quirk * 503 snd_pci_quirk_lookup_id(u16 vendor, u16 device, 504 const struct snd_pci_quirk *list); 523 505 524 506 #endif /* __SOUND_CORE_H */ -
GPL/trunk/alsa-kernel/include/sound/cs4231-regs.h
r399 r598 71 71 #define CS4235_LEFT_MASTER 0x1b /* left master output control */ 72 72 #define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */ 73 #define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */74 73 #define AD1845_CLOCK 0x1d /* crystal clock select and total power down */ 75 74 #define CS4235_RIGHT_MASTER 0x1d /* right master output control */ -
GPL/trunk/alsa-kernel/include/sound/cs46xx_dsp_spos.h
r305 r598 119 119 struct snd_info_entry *proc_info; 120 120 int ref_count; 121 spinlock_t lock; 122 123 int deleted; 121 122 u16 volume[2]; 123 unsigned int deleted :1; 124 unsigned int updated :1; 125 unsigned int volume_set :1; 124 126 }; 125 127 -
GPL/trunk/alsa-kernel/include/sound/emu10k1.h
r426 r598 439 439 #define CCCA_CURRADDR 0x18000008 440 440 441 /* undefine CCR to avoid conflict with the definition for SH */ 442 #undef CCR 441 443 #define CCR 0x09 /* Cache control register */ 442 444 #define CCR_CACHEINVALIDSIZE 0x07190009 … … 1708 1710 unsigned int ecard_ctrl; /* ecard control bits */ 1709 1711 unsigned long dma_mask; /* PCI DMA mask */ 1712 unsigned int delay_pcm_irq; /* in samples */ 1710 1713 int max_cache_pages; /* max memory size / PAGE_SIZE */ 1711 1714 struct snd_dma_buffer silent_page; /* silent page */ -
GPL/trunk/alsa-kernel/include/sound/es1688.h
r398 r598 45 45 unsigned int dma_size; 46 46 47 struct snd_card *card;48 47 struct snd_pcm *pcm; 49 48 struct snd_pcm_substream *playback_substream; … … 109 108 110 109 int snd_es1688_create(struct snd_card *card, 110 struct snd_es1688 *chip, 111 111 unsigned long port, 112 112 unsigned long mpu_port, … … 114 114 int mpu_irq, 115 115 int dma8, 116 unsigned short hardware, 117 struct snd_es1688 ** rchip); 118 int snd_es1688_pcm(struct snd_es1688 *chip, int device, struct snd_pcm ** rpcm); 119 int snd_es1688_mixer(struct snd_es1688 *chip); 116 unsigned short hardware); 117 int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device, 118 struct snd_pcm **rpcm); 119 int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); 120 int snd_es1688_reset(struct snd_es1688 *chip); 120 121 121 122 #endif /* __SOUND_ES1688_H */ -
GPL/trunk/alsa-kernel/include/sound/hdsp.h
r426 r598 29 29 H9652, 30 30 H9632, 31 RPM, 31 32 Undefined, 32 33 }; -
GPL/trunk/alsa-kernel/include/sound/info.h
r587 r598 52 52 int (*release)(struct snd_info_entry *entry, 53 53 unsigned short mode, void *file_private_data); 54 long(*read)(struct snd_info_entry *entry, void *file_private_data,55 56 unsigned long count, unsigned longpos);57 long(*write)(struct snd_info_entry *entry, void *file_private_data,58 59 unsigned long count, unsigned longpos);60 lo ng long(*llseek)(struct snd_info_entry *entry,61 62 long longoffset, int orig);63 unsigned int (*poll)(struct snd_info_entry *entry,64 void *file_private_data, struct file *file,65 poll_table *wait);54 ssize_t (*read)(struct snd_info_entry *entry, void *file_private_data, 55 struct file *file, char __user *buf, 56 size_t count, loff_t pos); 57 ssize_t (*write)(struct snd_info_entry *entry, void *file_private_data, 58 struct file *file, const char __user *buf, 59 size_t count, loff_t pos); 60 loff_t (*llseek)(struct snd_info_entry *entry, 61 void *file_private_data, struct file *file, 62 loff_t offset, int orig); 63 unsigned int (*poll)(struct snd_info_entry *entry, 64 void *file_private_data, struct file *file, 65 poll_table *wait); 66 66 int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, 67 67 struct file *file, unsigned int cmd, unsigned long arg); … … 111 111 #endif 112 112 113 int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) \ 113 #ifndef TARGET_OS2 114 int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ 114 115 __attribute__ ((format (printf, 2, 3))); 116 #else 117 int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...); 118 #endif 115 119 int snd_info_init(void); 116 120 int snd_info_done(void); 117 121 118 122 int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); 119 c har *snd_info_get_str(char *dest,char *src, int len);123 const char *snd_info_get_str(char *dest, const char *src, int len); 120 124 struct snd_info_entry *snd_info_create_module_entry(struct module *module, 121 125 const char *name, -
GPL/trunk/alsa-kernel/include/sound/initval.h
r587 r598 22 22 */ 23 23 24 #ifdef TARGET_OS225 24 #ifndef MODULE_GENERIC_STRING 26 25 #ifdef MODULE … … 33 32 #endif 34 33 35 #define MODULE_CLASSES(val) 36 #define MODULE_DEVICES(val) 37 #define MODULE_PARM_SYNTAX(id, val) 34 #ifdef TARGET_OS2 35 #define MODULE_CLASSES(val) 36 #define MODULE_DEVICES(val) 37 #define MODULE_PARM_SYNTAX(id, val) 38 38 #define module_param_array(name, type, nump, perm) 39 39 #define module_param(name, type, perm) … … 52 52 #define module_param(name, type, perm) \ 53 53 MODULE_PARM(name, SNDRV_MODULE_TYPE_##type) 54 54 55 #endif 55 56 56 #ifndef TARGET_OS257 #define SNDRV_AUTO_PORT 158 #else59 57 #define SNDRV_AUTO_PORT 0xffff 60 #endif61 58 #define SNDRV_AUTO_IRQ 0xffff 62 59 #define SNDRV_AUTO_DMA 0xffff … … 78 75 #define SNDRV_DEFAULT_ENABLE { 1,1,1,1,1,1,1,1 } 79 76 #define SNDRV_DEFAULT_ENABLE_PNP SNDRV_DEFAULT_ENABLE 80 #ifdef CONFIG_PNP81 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP82 #else83 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE84 #endif85 77 #define SNDRV_DEFAULT_PORT { REPEAT_SNDRV(-1) } 86 78 #define SNDRV_DEFAULT_IRQ { REPEAT_SNDRV(SNDRV_AUTO_IRQ) } … … 91 83 #define SNDDRV_DEFAULT_PCM_SUBSTREAMS {REPEAT_SNDRV(8)}; 92 84 #define SNDDRV_DEFAULT_MIDI_DEVS {REPEAT_SNDRV(4)}; 85 #else 86 #define SNDRV_DEFAULT_IDX { [0 ... (SNDRV_CARDS-1)] = -1 } 87 #define SNDRV_DEFAULT_STR { [0 ... (SNDRV_CARDS-1)] = NULL } 88 #define SNDRV_DEFAULT_ENABLE { 1, [1 ... (SNDRV_CARDS-1)] = 0 } 89 #define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 } 90 #define SNDRV_DEFAULT_PORT { SNDRV_AUTO_PORT, [1 ... (SNDRV_CARDS-1)] = -1 } 91 #define SNDRV_DEFAULT_IRQ { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ } 92 #define SNDRV_DEFAULT_DMA { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA } 93 #define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE } 94 #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR 95 #endif 96 97 #ifdef CONFIG_PNP 98 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP 99 #else 100 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE 101 #endif 93 102 94 103 #define SNDRV_BOOLEAN_TRUE_DESC "allows:{{0,Disabled},{1,Enabled}},default:1,dialog:check" … … 110 119 #define SNDRV_PORT12_DESC SNDRV_ENABLED ",allows:{{0,0x3fff}},base:16" 111 120 #define SNDRV_PORT_DESC SNDRV_ENABLED ",allows:{{0,0xffff}},base:16" 112 #else113 #define SNDRV_DEFAULT_IDX { [0 ... (SNDRV_CARDS-1)] = -1 }114 #define SNDRV_DEFAULT_STR { [0 ... (SNDRV_CARDS-1)] = NULL }115 #define SNDRV_DEFAULT_ENABLE { 1, [1 ... (SNDRV_CARDS-1)] = 0 }116 #define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 }117 #ifdef CONFIG_PNP118 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP119 #else120 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE121 #endif122 #define SNDRV_DEFAULT_PORT { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_PORT }123 #define SNDRV_DEFAULT_IRQ { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ }124 #define SNDRV_DEFAULT_DMA { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA }125 #define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }126 #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR127 #endif128 121 129 122 #ifdef SNDRV_LEGACY_FIND_FREE_IRQ … … 164 157 #endif 165 158 166 #ifdef TARGET_OS2167 159 #if defined(SNDRV_GET_ID) && !defined(MODULE) 168 160 #include <linux/ctype.h> … … 190 182 } 191 183 #endif 192 #endif193 184 194 #endif /* __SOUND_INITVAL_H */ 195 185 #endif /* __INITVAL_H */ -
GPL/trunk/alsa-kernel/include/sound/jack.h
r426 r598 43 43 SND_JACK_VIDEOOUT = 0x0010, 44 44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, 45 46 /* Kept separate from switches to facilitate implementation */ 47 SND_JACK_BTN_0 = 0x4000, 48 SND_JACK_BTN_1 = 0x2000, 49 SND_JACK_BTN_2 = 0x1000, 50 SND_JACK_BTN_3 = 0x0800, 51 SND_JACK_BTN_4 = 0x0400, 52 SND_JACK_BTN_5 = 0x0200, 45 53 }; 46 54 … … 51 59 const char *id; 52 60 char name[100]; 61 unsigned int key[6]; /* Keep in sync with definitions above */ 53 62 void *private_data; 54 63 void (*private_free)(struct snd_jack *); … … 60 69 struct snd_jack **jack); 61 70 void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); 71 int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type, 72 int keytype); 62 73 63 74 void snd_jack_report(struct snd_jack *jack, int status); -
GPL/trunk/alsa-kernel/include/sound/minors.h
r464 r598 32 32 #define SNDRV_MINOR_CONTROL 0 /* 0 */ 33 33 #define SNDRV_MINOR_GLOBAL 1 /* 1 */ 34 #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32)35 #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32)34 #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */ 35 #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ 36 36 37 37 #ifndef CONFIG_SND_DYNAMIC_MINORS -
GPL/trunk/alsa-kernel/include/sound/opl3.h
r587 r598 18 18 * 19 19 * With the above exceptions the both sides can be operated independently. 20 * 20 * 21 21 * A 4 OP voice can be created by setting the corresponding 22 22 * bit at offset 4 of the right side. … … 27 27 * 28 28 * If a voice is set to the 2 OP mode, it works like 2 OP modes 29 * of the original YM3812 (AdLib). In addition the voice can 29 * of the original YM3812 (AdLib). In addition the voice can 30 30 * be connected the left, right or both stereo channels. It can 31 31 * even be left unconnected. This works with 4 OP voices also. … … 189 189 * 190 190 * 191 * 191 * 192 192 * +---+ 193 193 * | | … … 195 195 * |-> 196 196 * >--3----4-+ 197 * 197 * 198 198 * +---+ 199 199 * | | … … 251 251 unsigned char sustain_release; 252 252 unsigned char wave_select; 253 #ifndef TARGET_OS2 253 254 } __attribute__((packed)); 254 #ifdef TARGET_OS2 255 #else 256 }; 255 257 #pragma pack() 256 258 #endif … … 341 343 struct snd_midi_channel_set * oss_chset; 342 344 #endif 343 345 344 346 #define OPL3_PATCH_HASH_SIZE 32 345 347 struct fm_patch *patch_table[OPL3_PATCH_HASH_SIZE]; -
GPL/trunk/alsa-kernel/include/sound/pcm.h
r587 r598 30 30 #include <linux/mm.h> 31 31 #include <linux/bitops.h> 32 #include <linux/pm_qos_params.h> 32 33 33 34 #define snd_pcm_substream_chip(substream) ((substream)->private_data) … … 74 75 snd_pcm_uframes_t pos, 75 76 void __user *buf, snd_pcm_uframes_t count); 76 int (*silence)(struct snd_pcm_substream *substream, int channel, 77 int (*silence)(struct snd_pcm_substream *substream, int channel, 77 78 snd_pcm_uframes_t pos, snd_pcm_uframes_t count); 78 79 struct page *(*page)(struct snd_pcm_substream *substream, … … 174 175 #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 175 176 #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 177 #define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) 178 #define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) 179 #define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) 180 #define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) 176 181 177 182 #ifdef SNDRV_LITTLE_ENDIAN … … 216 221 217 222 struct snd_pcm_hw_constraints { 218 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 223 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 219 224 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; 220 225 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - … … 262 267 unsigned int mask; 263 268 }; 269 270 struct snd_pcm_hwptr_log; 264 271 265 272 struct snd_pcm_runtime { … … 272 279 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 273 280 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 281 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */ 274 282 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 275 283 … … 290 298 unsigned int rate_num; 291 299 unsigned int rate_den; 300 unsigned int no_period_wakeup: 1; 292 301 293 302 /* -- SW params -- */ … … 311 320 312 321 /* -- locking / scheduling -- */ 313 wait_queue_head_t sleep; 322 snd_pcm_uframes_t twake; /* do transfer (!poll) wakeup if non-zero */ 323 wait_queue_head_t sleep; /* poll sleep */ 324 wait_queue_head_t tsleep; /* transfer sleep */ 314 325 struct fasync_struct *fasync; 315 326 … … 330 341 int tstamp_type; /* timestamp type */ 331 342 332 /* -- DMA -- */ 343 /* -- DMA -- */ 333 344 unsigned char *dma_area; /* DMA area */ 334 345 dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */ … … 340 351 /* -- OSS things -- */ 341 352 struct snd_pcm_oss_runtime oss; 353 #endif 354 355 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 356 struct snd_pcm_hwptr_log *hwptr_log; 342 357 #endif 343 358 }; … … 348 363 int count; 349 364 }; 365 366 struct pid; 350 367 351 368 struct snd_pcm_substream { … … 356 373 char name[32]; /* substream name */ 357 374 int stream; /* stream (direction) */ 358 char latency_id[20]; /* latency identifier */ 375 #ifndef TARGET_OS2 376 struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ 377 #else 378 char latency_id[20]; 379 #endif 359 380 size_t buffer_bytes_max; /* limit ring buffer size */ 360 381 struct snd_dma_buffer dma_buffer; … … 380 401 unsigned int f_flags; 381 402 void (*pcm_release)(struct snd_pcm_substream *); 403 struct pid *pid; 382 404 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 383 405 /* -- OSS things -- */ … … 538 560 } while (0) 539 561 540 #ifdef TARGET_OS2541 562 #define snd_pcm_group_for_each_entry(s, substream) \ 542 563 list_for_each_entry(s, &substream->group->substreams, link_list, struct snd_pcm_substream) 543 #else544 #define snd_pcm_group_for_each_entry(s, substream) \545 list_for_each_entry(s, &substream->group->substreams, link_list)546 #endif547 564 548 565 static inline int snd_pcm_running(struct snd_pcm_substream *substream) … … 597 614 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 598 615 #if defined TARGET_OS2 599 if ( runtime->buffer_size > runtime->control->appl_ptr) 600 avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 601 else 602 { 603 604 avail = runtime->control->appl_ptr - runtime->status->hw_ptr; 605 if ( avail > runtime->buffer_size ) 606 avail = 0; 607 else 608 avail = runtime->buffer_size - avail; 609 } 610 #endif /* TARGET_OS2 */ 616 if ( runtime->buffer_size > runtime->control->appl_ptr) 617 avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 618 else 619 { 620 621 avail = runtime->control->appl_ptr - runtime->status->hw_ptr; 622 if ( avail > runtime->buffer_size ) 623 avail = 0; 624 else 625 avail = runtime->buffer_size - avail; 626 } 627 #endif /* TARGET_OS2 */ 611 628 if (avail < 0) 612 629 avail += runtime->boundary; … … 711 728 } 712 729 713 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, 730 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, 714 731 struct snd_pcm_substream *master) 715 732 { … … 768 785 void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 769 786 void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 770 void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, 787 void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, 771 788 unsigned int k, struct snd_interval *c); 772 789 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, … … 793 810 unsigned int min, unsigned int max); 794 811 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var); 795 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 812 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 796 813 unsigned int cond, 797 814 snd_pcm_hw_param_t var, 798 815 struct snd_pcm_hw_constraint_list *l); 799 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 816 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 800 817 unsigned int cond, 801 818 snd_pcm_hw_param_t var, 802 819 struct snd_pcm_hw_constraint_ratnums *r); 803 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 820 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 804 821 unsigned int cond, 805 822 snd_pcm_hw_param_t var, 806 823 struct snd_pcm_hw_constraint_ratdens *r); 807 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 824 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 808 825 unsigned int cond, 809 826 unsigned int width, … … 853 870 int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); 854 871 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 855 unsigned int cmd, void *arg); 872 unsigned int cmd, void *arg); 873 int snd_pcm_update_state(struct snd_pcm_substream *substream, 874 struct snd_pcm_runtime *runtime); 856 875 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); 857 876 int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); … … 925 944 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 926 945 946 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, 947 size_t size, gfp_t gfp_flags); 948 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream); 949 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, 950 unsigned long offset); 951 #if 0 /* for kernel-doc */ 952 /** 953 * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer 954 * @substream: the substream to allocate the buffer to 955 * @size: the requested buffer size, in bytes 956 * 957 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is 958 * contiguous in kernel virtual space, but not in physical memory. Use this 959 * if the buffer is accessed by kernel code but not by device DMA. 960 * 961 * Returns 1 if the buffer was changed, 0 if not changed, or a negative error 962 * code. 963 */ 964 static int snd_pcm_lib_alloc_vmalloc_buffer 965 (struct snd_pcm_substream *substream, size_t size); 966 /** 967 * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer 968 * @substream: the substream to allocate the buffer to 969 * @size: the requested buffer size, in bytes 970 * 971 * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses 972 * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory. 973 */ 974 static int snd_pcm_lib_alloc_vmalloc_32_buffer 975 (struct snd_pcm_substream *substream, size_t size); 976 #endif 977 #define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \ 978 _snd_pcm_lib_alloc_vmalloc_buffer \ 979 (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO) 980 #define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \ 981 _snd_pcm_lib_alloc_vmalloc_buffer \ 982 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO) 983 927 984 #ifdef CONFIG_SND_DMA_SGBUF 928 985 /* … … 995 1052 #endif 996 1053 1054 int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream, 1055 struct vm_area_struct *area); 1056 #define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached 1057 997 1058 static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) 998 1059 { … … 1011 1072 #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) 1012 1073 1074 const char *snd_pcm_format_name(snd_pcm_format_t format); 1075 1013 1076 #endif /* __SOUND_PCM_H */ -
GPL/trunk/alsa-kernel/include/sound/pcm_oss.h
r398 r598 62 62 struct snd_pcm_plugin *plugin_last; 63 63 #endif 64 unsigned int prev_hw_ptr_ interrupt;64 unsigned int prev_hw_ptr_period; 65 65 }; 66 66 -
GPL/trunk/alsa-kernel/include/sound/rawmidi.h
r426 r598 47 47 struct snd_rawmidi_substream; 48 48 struct snd_seq_port_info; 49 struct pid; 49 50 50 51 struct snd_rawmidi_ops { … … 98 99 char name[32]; 99 100 struct snd_rawmidi_runtime *runtime; 101 struct pid *pid; 100 102 /* hardware layer */ 101 103 struct snd_rawmidi_ops *ops; -
GPL/trunk/alsa-kernel/include/sound/sb.h
r426 r598 34 34 SB_HW_201, 35 35 SB_HW_PRO, 36 SB_HW_JAZZ16, /* Media Vision Jazz16 */ 36 37 SB_HW_16, 37 38 SB_HW_16CSP, /* SB16 with CSP chip */ -
GPL/trunk/alsa-kernel/include/sound/seq_kernel.h
r587 r598 76 76 77 77 /* interface for kernel client */ 78 #ifndef TARGET_OS2 78 79 int snd_seq_create_kernel_client(struct snd_card *card, int client_index, 79 80 const char *name_fmt, ...) 80 81 __attribute__ ((format (printf, 3, 4))); 82 #else 83 int snd_seq_create_kernel_client(struct snd_card *card, int client_index, 84 const char *name_fmt, ...); 85 #endif 81 86 int snd_seq_delete_kernel_client(int client); 82 87 int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); -
GPL/trunk/alsa-kernel/include/sound/soc-dapm.h
r464 r598 17 17 #include <linux/types.h> 18 18 #include <sound/control.h> 19 #include <sound/soc.h>20 19 21 20 /* widget has no PM register bit */ … … 73 72 { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 74 73 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 74 #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 75 wcontrols, wncontrols) \ 76 { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 77 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 75 78 #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 76 79 wcontrols, wncontrols)\ … … 91 94 { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 92 95 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} 96 #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ 97 { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 98 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} 93 99 #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 94 100 { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ … … 96 102 .num_kcontrols = 1} 97 103 104 /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 105 #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 106 wcontrols) \ 107 { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 108 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 109 #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 110 wcontrols)\ 111 { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 112 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 113 #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 114 wcontrols)\ 115 { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 116 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 117 .num_kcontrols = ARRAY_SIZE(wcontrols)} 118 98 119 /* path domain with event - event handler must return 0 for success */ 99 120 #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 100 121 wncontrols, wevent, wflags) \ 101 122 { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 123 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 124 .event = wevent, .event_flags = wflags} 125 #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 126 wncontrols, wevent, wflags) \ 127 { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 102 128 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 103 129 .event = wevent, .event_flags = wflags} … … 126 152 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 127 153 .event = wevent, .event_flags = wflags} 154 #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 155 wevent, wflags) \ 156 { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 157 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 158 .event = wevent, .event_flags = wflags} 159 160 /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 161 #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 162 wevent, wflags) \ 163 { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 164 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 165 .event = wevent, .event_flags = wflags} 166 #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 167 wevent, wflags) \ 168 { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 169 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 170 .event = wevent, .event_flags = wflags} 171 #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 172 wcontrols, wevent, wflags) \ 173 { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 174 .invert = winvert, .kcontrols = wcontrols, \ 175 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} 128 176 129 177 /* events that are pre and post DAPM */ … … 141 189 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 142 190 .reg = wreg, .shift = wshift, .invert = winvert } 191 #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ 192 wevent, wflags) \ 193 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 194 .reg = wreg, .shift = wshift, .invert = winvert, \ 195 .event = wevent, .event_flags = wflags } 143 196 #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 144 197 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 145 198 .reg = wreg, .shift = wshift, .invert = winvert } 199 #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ 200 wevent, wflags) \ 201 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 202 .reg = wreg, .shift = wshift, .invert = winvert, \ 203 .event = wevent, .event_flags = wflags } 146 204 #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 147 205 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ … … 178 236 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 179 237 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 180 #define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \181 power) \182 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \183 .info = snd_soc_info_volsw, \184 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \185 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\186 ((max) << 16) | ((invert) << 24) }187 238 #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 188 239 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 192 243 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 193 244 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 194 #define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \195 power, tlv_array) \196 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \197 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\198 .tlv.p = (tlv_array), \199 .info = snd_soc_info_volsw, \200 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \201 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\202 ((max) << 16) | ((invert) << 24) }203 245 #define SOC_DAPM_ENUM(xname, xenum) \ 204 246 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 207 249 .put = snd_soc_dapm_put_enum_double, \ 208 250 .private_value = (unsigned long)&xenum } 251 #define SOC_DAPM_ENUM_VIRT(xname, xenum) \ 252 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 253 .info = snd_soc_info_enum_double, \ 254 .get = snd_soc_dapm_get_enum_virt, \ 255 .put = snd_soc_dapm_put_enum_virt, \ 256 .private_value = (unsigned long)&xenum } 209 257 #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ 210 258 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 236 284 #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 237 285 #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 286 #define SND_SOC_DAPM_PRE_POST_PMD \ 287 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 238 288 239 289 /* convenience event type detection */ … … 248 298 struct snd_soc_dapm_pin; 249 299 struct snd_soc_dapm_route; 300 struct snd_soc_dapm_context; 250 301 251 302 int dapm_reg_event(struct snd_soc_dapm_widget *w, … … 260 311 struct snd_ctl_elem_value *ucontrol); 261 312 int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, 313 struct snd_ctl_elem_value *ucontrol); 314 int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol, 315 struct snd_ctl_elem_value *ucontrol); 316 int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, 262 317 struct snd_ctl_elem_value *ucontrol); 263 318 int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, … … 271 326 int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 272 327 struct snd_ctl_elem_value *uncontrol); 273 int snd_soc_dapm_new_control(struct snd_soc_ codec *codec,328 int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, 274 329 const struct snd_soc_dapm_widget *widget); 275 int snd_soc_dapm_new_controls(struct snd_soc_ codec *codec,330 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, 276 331 const struct snd_soc_dapm_widget *widget, 277 332 int num); 278 333 279 334 /* dapm path setup */ 280 int snd_soc_dapm_new_widgets(struct snd_soc_ codec *codec);281 void snd_soc_dapm_free(struct snd_soc_d evice *socdev);282 int snd_soc_dapm_add_routes(struct snd_soc_ codec *codec,335 int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); 336 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 337 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 283 338 const struct snd_soc_dapm_route *route, int num); 284 339 285 340 /* dapm events */ 286 int snd_soc_dapm_stream_event(struct snd_soc_ codec *codec, char *stream,287 int event);288 void snd_soc_dapm_shutdown(struct snd_soc_ device *socdev);341 int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, 342 const char *stream, int event); 343 void snd_soc_dapm_shutdown(struct snd_soc_card *card); 289 344 290 345 /* dapm sys fs - used by the core */ 291 346 int snd_soc_dapm_sys_add(struct device *dev); 292 void snd_soc_dapm_debugfs_init(struct snd_soc_ codec *codec);347 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); 293 348 294 349 /* dapm audio pin control and status */ 295 int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); 296 int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); 297 int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); 298 int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); 299 int snd_soc_dapm_sync(struct snd_soc_codec *codec); 350 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, 351 const char *pin); 352 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, 353 const char *pin); 354 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); 355 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, 356 const char *pin); 357 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 358 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 359 const char *pin); 360 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 361 const char *pin); 300 362 301 363 /* dapm widget types */ … … 304 366 snd_soc_dapm_output, /* output pin */ 305 367 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 368 snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */ 306 369 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ 307 370 snd_soc_dapm_mixer, /* mixes several analog signals together */ 308 371 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 309 372 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 373 snd_soc_dapm_out_drv, /* output driver */ 310 374 snd_soc_dapm_adc, /* analog to digital converter */ 311 375 snd_soc_dapm_dac, /* digital to analog converter */ … … 334 398 const char *control; 335 399 const char *source; 400 401 /* Note: currently only supported for links where source is a supply */ 402 int (*connected)(struct snd_soc_dapm_widget *source, 403 struct snd_soc_dapm_widget *sink); 336 404 }; 337 405 … … 349 417 u32 connect:1; /* source and sink widgets are connected */ 350 418 u32 walked:1; /* path has been walked */ 419 420 int (*connected)(struct snd_soc_dapm_widget *source, 421 struct snd_soc_dapm_widget *sink); 351 422 352 423 struct list_head list_source; … … 362 433 struct snd_soc_codec *codec; 363 434 struct list_head list; 435 struct snd_soc_dapm_context *dapm; 364 436 365 437 /* dapm control */ … … 377 449 unsigned char new:1; /* cnew complete */ 378 450 unsigned char ext:1; /* has external widgets */ 379 unsigned char muted:1; /* muted for pop reduction */ 380 unsigned char suspend:1; /* was active before suspend */ 381 unsigned char pmdown:1; /* waiting for timeout */ 451 unsigned char force:1; /* force state */ 452 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 382 453 383 454 int (*power_check)(struct snd_soc_dapm_widget *w); … … 399 470 }; 400 471 472 struct snd_soc_dapm_update { 473 struct snd_soc_dapm_widget *widget; 474 struct snd_kcontrol *kcontrol; 475 int reg; 476 int mask; 477 int val; 478 }; 479 480 /* DAPM context */ 481 struct snd_soc_dapm_context { 482 int n_widgets; /* number of widgets in this context */ 483 enum snd_soc_bias_level bias_level; 484 enum snd_soc_bias_level suspend_bias_level; 485 struct delayed_work delayed_work; 486 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 487 488 struct snd_soc_dapm_update *update; 489 490 struct device *dev; /* from parent - for debug */ 491 struct snd_soc_codec *codec; /* parent codec */ 492 struct snd_soc_card *card; /* parent card */ 493 494 /* used during DAPM updates */ 495 int dev_power; 496 struct list_head list; 497 498 #ifdef CONFIG_DEBUG_FS 499 struct dentry *debugfs_dapm; 401 500 #endif 501 }; 502 503 #endif -
GPL/trunk/alsa-kernel/include/sound/soc.h
r464 r598 16 16 #include <linux/platform_device.h> 17 17 #include <linux/types.h> 18 #include <linux/notifier.h> 18 19 #include <linux/workqueue.h> 19 20 #include <linux/interrupt.h> … … 30 31 ((unsigned long)&(struct soc_mixer_control) \ 31 32 {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ 32 . invert = xinvert})33 .platform_max = xmax, .invert = xinvert}) 33 34 #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 34 35 ((unsigned long)&(struct soc_mixer_control) \ 35 {.reg = xreg, .max = xmax, . invert = xinvert})36 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) 36 37 #define SOC_SINGLE(xname, reg, shift, max, invert) \ 37 38 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 53 54 .private_value = (unsigned long)&(struct soc_mixer_control) \ 54 55 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 55 .max = xmax, . invert = xinvert} }56 .max = xmax, .platform_max = xmax, .invert = xinvert} } 56 57 #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ 57 58 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ … … 60 61 .private_value = (unsigned long)&(struct soc_mixer_control) \ 61 62 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 62 .max = xmax, . invert = xinvert} }63 .max = xmax, .platform_max = xmax, .invert = xinvert} } 63 64 #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ 64 65 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ … … 70 71 .private_value = (unsigned long)&(struct soc_mixer_control) \ 71 72 {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ 72 .max = xmax, . invert = xinvert} }73 .max = xmax, .platform_max = xmax, .invert = xinvert} } 73 74 #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 74 75 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ … … 80 81 .private_value = (unsigned long)&(struct soc_mixer_control) \ 81 82 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 82 .max = xmax, . invert = xinvert} }83 .max = xmax, .platform_max = xmax, .invert = xinvert} } 83 84 #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 84 85 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ … … 89 90 .put = snd_soc_put_volsw_s8, \ 90 91 .private_value = (unsigned long)&(struct soc_mixer_control) \ 91 {.reg = xreg, .min = xmin, .max = xmax} } 92 {.reg = xreg, .min = xmin, .max = xmax, \ 93 .platform_max = xmax} } 92 94 #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ 93 95 { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ … … 126 128 .private_value = (unsigned long)&(struct soc_mixer_control) \ 127 129 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 128 .max = xmax, . invert = xinvert} }130 .max = xmax, .platform_max = xmax, .invert = xinvert} } 129 131 #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 130 132 xhandler_get, xhandler_put, tlv_array) \ … … 146 148 .private_value = (unsigned long)&(struct soc_mixer_control) \ 147 149 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 148 .max = xmax, . invert = xinvert} }150 .max = xmax, .platform_max = xmax, .invert = xinvert} } 149 151 #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 150 152 xhandler_get, xhandler_put, tlv_array) \ … … 157 159 .private_value = (unsigned long)&(struct soc_mixer_control) \ 158 160 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 159 .max = xmax, . invert = xinvert} }161 .max = xmax, .platform_max = xmax, .invert = xinvert} } 160 162 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 161 163 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 168 170 .get = xhandler_get, .put = xhandler_put, \ 169 171 .private_value = (unsigned long)&xenum } 172 173 #define SOC_DOUBLE_R_SX_TLV(xname, xreg_left, xreg_right, xshift,\ 174 xmin, xmax, tlv_array) \ 175 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 176 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 177 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 178 .tlv.p = (tlv_array), \ 179 .info = snd_soc_info_volsw_2r_sx, \ 180 .get = snd_soc_get_volsw_2r_sx, \ 181 .put = snd_soc_put_volsw_2r_sx, \ 182 .private_value = (unsigned long)&(struct soc_mixer_control) \ 183 {.reg = xreg_left, \ 184 .rreg = xreg_right, .shift = xshift, \ 185 .min = xmin, .max = xmax} } 186 187 188 /* 189 * Simplified versions of above macros, declaring a struct and calculating 190 * ARRAY_SIZE internally 191 */ 192 #define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \ 193 struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ 194 ARRAY_SIZE(xtexts), xtexts) 195 #define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \ 196 SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) 197 #define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \ 198 struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts) 199 #define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \ 200 struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \ 201 ARRAY_SIZE(xtexts), xtexts, xvalues) 202 #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ 203 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) 170 204 171 205 /* … … 181 215 */ 182 216 enum snd_soc_bias_level { 217 SND_SOC_BIAS_OFF, 218 SND_SOC_BIAS_STANDBY, 219 SND_SOC_BIAS_PREPARE, 183 220 SND_SOC_BIAS_ON, 184 SND_SOC_BIAS_PREPARE,185 SND_SOC_BIAS_STANDBY,186 SND_SOC_BIAS_OFF,187 221 }; 188 222 189 223 struct snd_jack; 190 224 struct snd_soc_card; 191 struct snd_soc_device;192 225 struct snd_soc_pcm_stream; 193 226 struct snd_soc_ops; 194 struct snd_soc_dai_mode;195 227 struct snd_soc_pcm_runtime; 196 228 struct snd_soc_dai; 229 struct snd_soc_dai_driver; 197 230 struct snd_soc_platform; 231 struct snd_soc_dai_link; 232 struct snd_soc_platform_driver; 198 233 struct snd_soc_codec; 234 struct snd_soc_codec_driver; 199 235 struct soc_enum; 200 struct snd_soc_ac97_ops;201 236 struct snd_soc_jack; 202 237 struct snd_soc_jack_pin; 238 struct snd_soc_cache_ops; 239 #include <sound/soc-dapm.h> 240 203 241 #ifdef CONFIG_GPIOLIB 204 242 struct snd_soc_jack_gpio; … … 206 244 207 245 typedef int (*hw_write_t)(void *,const char* ,int); 208 typedef int (*hw_read_t)(void *,char* ,int);209 246 210 247 extern struct snd_ac97_bus_ops soc_ac97_ops; … … 216 253 }; 217 254 218 int snd_soc_register_platform(struct snd_soc_platform *platform); 219 void snd_soc_unregister_platform(struct snd_soc_platform *platform); 220 int snd_soc_register_codec(struct snd_soc_codec *codec); 221 void snd_soc_unregister_codec(struct snd_soc_codec *codec); 255 enum snd_soc_compress_type { 256 SND_SOC_FLAT_COMPRESSION = 1, 257 SND_SOC_LZO_COMPRESSION, 258 SND_SOC_RBTREE_COMPRESSION 259 }; 260 261 int snd_soc_register_card(struct snd_soc_card *card); 262 int snd_soc_unregister_card(struct snd_soc_card *card); 263 int snd_soc_register_platform(struct device *dev, 264 struct snd_soc_platform_driver *platform_drv); 265 void snd_soc_unregister_platform(struct device *dev); 266 int snd_soc_register_codec(struct device *dev, 267 const struct snd_soc_codec_driver *codec_drv, 268 struct snd_soc_dai_driver *dai_drv, int num_dai); 269 void snd_soc_unregister_codec(struct device *dev); 222 270 int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 223 271 int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 224 272 int addr_bits, int data_bits, 225 273 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 231 232 /* pcm <-> DAI connect */ 233 void snd_soc_free_pcms(struct snd_soc_device *socdev); 234 int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); 235 int snd_soc_init_card(struct snd_soc_device *socdev); 274 int snd_soc_cache_sync(struct snd_soc_codec *codec); 275 int snd_soc_cache_init(struct snd_soc_codec *codec); 276 int snd_soc_cache_exit(struct snd_soc_codec *codec); 277 int snd_soc_cache_write(struct snd_soc_codec *codec, 278 unsigned int reg, unsigned int value); 279 int snd_soc_cache_read(struct snd_soc_codec *codec, 280 unsigned int reg, unsigned int *value); 281 int snd_soc_default_volatile_register(struct snd_soc_codec *codec, 282 unsigned int reg); 283 int snd_soc_default_readable_register(struct snd_soc_codec *codec, 284 unsigned int reg); 285 286 /* Utility functions to get clock rates from various things */ 287 int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 288 int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); 289 int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); 290 int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); 236 291 237 292 /* set runtime hw params */ … … 240 295 241 296 /* Jack reporting */ 242 int snd_soc_jack_new(struct snd_soc_c ard *card, const char *id, int type,297 int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, 243 298 struct snd_soc_jack *jack); 244 299 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); 245 300 int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, 246 301 struct snd_soc_jack_pin *pins); 302 void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, 303 struct notifier_block *nb); 304 void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, 305 struct notifier_block *nb); 247 306 #ifdef CONFIG_GPIOLIB 248 307 int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, … … 255 314 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, 256 315 unsigned int mask, unsigned int value); 316 int snd_soc_update_bits_locked(struct snd_soc_codec *codec, 317 unsigned short reg, unsigned int mask, 318 unsigned int value); 257 319 int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, 258 320 unsigned int mask, unsigned int value); … … 302 364 int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, 303 365 struct snd_ctl_elem_value *ucontrol); 366 int snd_soc_limit_volume(struct snd_soc_codec *codec, 367 const char *name, int max); 368 int snd_soc_info_volsw_2r_sx(struct snd_kcontrol *kcontrol, 369 struct snd_ctl_elem_info *uinfo); 370 int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol, 371 struct snd_ctl_elem_value *ucontrol); 372 int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, 373 struct snd_ctl_elem_value *ucontrol); 374 375 /** 376 * struct snd_soc_reg_access - Describes whether a given register is 377 * readable, writable or volatile. 378 * 379 * @reg: the register number 380 * @read: whether this register is readable 381 * @write: whether this register is writable 382 * @vol: whether this register is volatile 383 */ 384 struct snd_soc_reg_access { 385 u16 reg; 386 u16 read; 387 u16 write; 388 u16 vol; 389 }; 304 390 305 391 /** … … 334 420 int debounce_time; 335 421 struct snd_soc_jack *jack; 336 struct work_struct work; 422 struct delayed_work work; 423 424 int (*jack_status_check)(void); 337 425 }; 338 426 #endif … … 340 428 struct snd_soc_jack { 341 429 struct snd_jack *jack; 342 struct snd_soc_c ard *card;430 struct snd_soc_codec *codec; 343 431 struct list_head pins; 344 432 int status; 433 struct blocking_notifier_head notifier; 345 434 }; 346 435 347 436 /* SoC PCM stream information */ 348 437 struct snd_soc_pcm_stream { 349 c har *stream_name;438 const char *stream_name; 350 439 u64 formats; /* SNDRV_PCM_FMTBIT_* */ 351 440 unsigned int rates; /* SNDRV_PCM_RATE_* */ … … 354 443 unsigned int channels_min; /* min channels */ 355 444 unsigned int channels_max; /* max channels */ 356 unsigned int active:1; /* stream is in use */357 445 }; 358 446 … … 367 455 }; 368 456 369 /* SoC Audio Codec */ 457 /* SoC cache ops */ 458 struct snd_soc_cache_ops { 459 const char *name; 460 enum snd_soc_compress_type id; 461 int (*init)(struct snd_soc_codec *codec); 462 int (*exit)(struct snd_soc_codec *codec); 463 int (*read)(struct snd_soc_codec *codec, unsigned int reg, 464 unsigned int *value); 465 int (*write)(struct snd_soc_codec *codec, unsigned int reg, 466 unsigned int value); 467 int (*sync)(struct snd_soc_codec *codec); 468 }; 469 470 /* SoC Audio Codec device */ 370 471 struct snd_soc_codec { 371 char *name; 372 struct module *owner; 472 const char *name; 473 const char *name_prefix; 474 int id; 475 struct device *dev; 476 const struct snd_soc_codec_driver *driver; 477 373 478 struct mutex mutex; 374 struct device *dev; 375 struct snd_soc_device *socdev; 376 479 struct snd_soc_card *card; 377 480 struct list_head list; 378 379 /* callbacks */ 380 int (*set_bias_level)(struct snd_soc_codec *, 381 enum snd_soc_bias_level level); 481 struct list_head card_list; 482 int num_dai; 483 enum snd_soc_compress_type compress_type; 484 size_t reg_size; /* reg_cache_size * reg_word_size */ 485 int (*volatile_register)(struct snd_soc_codec *, unsigned int); 486 int (*readable_register)(struct snd_soc_codec *, unsigned int); 382 487 383 488 /* runtime */ 384 struct snd_card *card;385 489 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 386 490 unsigned int active; 387 unsigned int pcm_devs; 388 void *private_data; 491 unsigned int cache_only:1; /* Suppress writes to hardware */ 492 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ 493 unsigned int suspended:1; /* Codec is in suspend PM state */ 494 unsigned int probed:1; /* Codec has been probed */ 495 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 496 unsigned int ac97_created:1; /* Codec has been created by SoC */ 497 unsigned int sysfs_registered:1; /* codec has been sysfs registered */ 498 unsigned int cache_init:1; /* codec cache has been initialized */ 389 499 390 500 /* codec IO */ 391 501 void *control_data; /* codec control (i2c/3wire) data */ 502 hw_write_t hw_write; 503 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 504 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 505 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 506 void *reg_cache; 507 const void *reg_def_copy; 508 const struct snd_soc_cache_ops *cache_ops; 509 struct mutex cache_rw_mutex; 510 511 /* dapm */ 512 struct snd_soc_dapm_context dapm; 513 514 #ifdef CONFIG_DEBUG_FS 515 struct dentry *debugfs_codec_root; 516 struct dentry *debugfs_reg; 517 struct dentry *debugfs_dapm; 518 #endif 519 }; 520 521 /* codec driver */ 522 struct snd_soc_codec_driver { 523 524 /* driver ops */ 525 int (*probe)(struct snd_soc_codec *); 526 int (*remove)(struct snd_soc_codec *); 527 int (*suspend)(struct snd_soc_codec *, 528 pm_message_t state); 529 int (*resume)(struct snd_soc_codec *); 530 531 /* codec IO */ 392 532 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 393 533 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); 394 534 int (*display_register)(struct snd_soc_codec *, char *, 395 535 size_t, unsigned int); 396 int (*volatile_register)(unsigned int); 397 int (*readable_register)(unsigned int); 398 hw_write_t hw_write; 399 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 400 void *reg_cache; 536 int (*volatile_register)(struct snd_soc_codec *, unsigned int); 537 int (*readable_register)(struct snd_soc_codec *, unsigned int); 401 538 short reg_cache_size; 402 539 short reg_cache_step; 403 404 /* dapm */ 405 u32 pop_time; 406 struct list_head dapm_widgets; 407 struct list_head dapm_paths; 408 enum snd_soc_bias_level bias_level; 409 enum snd_soc_bias_level suspend_bias_level; 410 struct delayed_work delayed_work; 411 412 /* codec DAI's */ 413 struct snd_soc_dai *dai; 414 unsigned int num_dai; 415 416 #ifdef CONFIG_DEBUG_FS 417 struct dentry *debugfs_reg; 418 struct dentry *debugfs_pop_time; 419 struct dentry *debugfs_dapm; 420 #endif 421 }; 422 423 /* codec device */ 424 struct snd_soc_codec_device { 425 int (*probe)(struct platform_device *pdev); 426 int (*remove)(struct platform_device *pdev); 427 int (*suspend)(struct platform_device *pdev, pm_message_t state); 428 int (*resume)(struct platform_device *pdev); 540 short reg_word_size; 541 const void *reg_cache_default; 542 short reg_access_size; 543 const struct snd_soc_reg_access *reg_access_default; 544 enum snd_soc_compress_type compress_type; 545 546 /* codec bias level */ 547 int (*set_bias_level)(struct snd_soc_codec *, 548 enum snd_soc_bias_level level); 429 549 }; 430 550 431 551 /* SoC platform interface */ 432 struct snd_soc_platform { 433 char *name; 434 struct list_head list; 435 436 int (*probe)(struct platform_device *pdev); 437 int (*remove)(struct platform_device *pdev); 552 struct snd_soc_platform_driver { 553 554 int (*probe)(struct snd_soc_platform *); 555 int (*remove)(struct snd_soc_platform *); 438 556 int (*suspend)(struct snd_soc_dai *dai); 439 557 int (*resume)(struct snd_soc_dai *dai); … … 444 562 void (*pcm_free)(struct snd_pcm *); 445 563 564 /* 565 * For platform caused delay reporting. 566 * Optional. 567 */ 568 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, 569 struct snd_soc_dai *); 570 446 571 /* platform stream ops */ 447 struct snd_pcm_ops *pcm_ops; 448 }; 449 450 /* SoC machine DAI configuration, glues a codec and cpu DAI together */ 451 struct snd_soc_dai_link { 452 char *name; /* Codec name */ 453 char *stream_name; /* Stream name */ 454 455 /* DAI */ 456 struct snd_soc_dai *codec_dai; 457 struct snd_soc_dai *cpu_dai; 572 struct snd_pcm_ops *ops; 573 }; 574 575 struct snd_soc_platform { 576 const char *name; 577 int id; 578 struct device *dev; 579 struct snd_soc_platform_driver *driver; 580 581 unsigned int suspended:1; /* platform is suspended */ 582 unsigned int probed:1; 583 584 struct snd_soc_card *card; 585 struct list_head list; 586 struct list_head card_list; 587 }; 588 589 struct snd_soc_dai_link { 590 /* config - must be set by machine driver */ 591 const char *name; /* Codec name */ 592 const char *stream_name; /* Stream name */ 593 const char *codec_name; /* for multi-codec */ 594 const char *platform_name; /* for multi-platform */ 595 const char *cpu_dai_name; 596 const char *codec_dai_name; 597 598 /* Keep DAI active over suspend */ 599 unsigned int ignore_suspend:1; 600 601 /* Symmetry requirements */ 602 unsigned int symmetric_rates:1; 603 604 /* codec/machine specific init - e.g. add machine controls */ 605 int (*init)(struct snd_soc_pcm_runtime *rtd); 458 606 459 607 /* machine stream operations */ 460 608 struct snd_soc_ops *ops; 609 }; 610 611 struct snd_soc_codec_conf { 612 const char *dev_name; 613 614 /* 615 * optional map of kcontrol, widget and path name prefixes that are 616 * associated per device 617 */ 618 const char *name_prefix; 619 620 /* 621 * set this to the desired compression type if you want to 622 * override the one supplied in codec->driver->compress_type 623 */ 624 enum snd_soc_compress_type compress_type; 625 }; 626 627 struct snd_soc_aux_dev { 628 const char *name; /* Codec name */ 629 const char *codec_name; /* for multi-codec */ 461 630 462 631 /* codec/machine specific init - e.g. add machine controls */ 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; 470 471 /* DAI pcm */ 472 struct snd_pcm *pcm; 632 int (*init)(struct snd_soc_dapm_context *dapm); 473 633 }; 474 634 475 635 /* SoC card */ 476 636 struct snd_soc_card { 477 c har *name;637 const char *name; 478 638 struct device *dev; 639 struct snd_card *snd_card; 640 struct module *owner; 479 641 480 642 struct list_head list; 481 482 int instantiated; 643 struct mutex mutex; 644 645 bool instantiated; 483 646 484 647 int (*probe)(struct platform_device *pdev); … … 495 658 int (*set_bias_level)(struct snd_soc_card *, 496 659 enum snd_soc_bias_level level); 660 int (*set_bias_level_post)(struct snd_soc_card *, 661 enum snd_soc_bias_level level); 662 663 long pmdown_time; 497 664 498 665 /* CPU <--> Codec DAI links */ 499 666 struct snd_soc_dai_link *dai_link; 500 667 int num_links; 501 502 struct snd_soc_device *socdev; 503 668 struct snd_soc_pcm_runtime *rtd; 669 int num_rtd; 670 671 /* optional codec specific configuration */ 672 struct snd_soc_codec_conf *codec_conf; 673 int num_configs; 674 675 /* 676 * optional auxiliary devices such as amplifiers or codecs with DAI 677 * link unused 678 */ 679 struct snd_soc_aux_dev *aux_dev; 680 int num_aux_devs; 681 struct snd_soc_pcm_runtime *rtd_aux; 682 int num_aux_rtd; 683 684 struct work_struct deferred_resume_work; 685 686 /* lists of probed devices belonging to this card */ 687 struct list_head codec_dev_list; 688 struct list_head platform_dev_list; 689 struct list_head dai_dev_list; 690 691 struct list_head widgets; 692 struct list_head paths; 693 struct list_head dapm_list; 694 695 #ifdef CONFIG_DEBUG_FS 696 struct dentry *debugfs_card_root; 697 struct dentry *debugfs_pop_time; 698 #endif 699 u32 pop_time; 700 }; 701 702 /* SoC machine DAI configuration, glues a codec and cpu DAI together */ 703 struct snd_soc_pcm_runtime { 704 struct device dev; 705 struct snd_soc_card *card; 706 struct snd_soc_dai_link *dai_link; 707 708 unsigned int complete:1; 709 unsigned int dev_registered:1; 710 711 /* Symmetry data - only valid if symmetry is being enforced */ 712 unsigned int rate; 713 long pmdown_time; 714 715 /* runtime devices */ 716 struct snd_pcm *pcm; 504 717 struct snd_soc_codec *codec; 505 506 718 struct snd_soc_platform *platform; 719 struct snd_soc_dai *codec_dai; 720 struct snd_soc_dai *cpu_dai; 721 507 722 struct delayed_work delayed_work; 508 struct work_struct deferred_resume_work;509 };510 511 /* SoC Device - the audio subsystem */512 struct snd_soc_device {513 struct device *dev;514 struct snd_soc_card *card;515 struct snd_soc_codec_device *codec_dev;516 void *codec_data;517 };518 519 /* runtime channel data */520 struct snd_soc_pcm_runtime {521 struct snd_soc_dai_link *dai;522 struct snd_soc_device *socdev;523 723 }; 524 724 525 725 /* mixer control */ 526 726 struct soc_mixer_control { 527 int min, max ;727 int min, max, platform_max; 528 728 unsigned int reg, rreg, shift, rshift, invert; 529 729 }; … … 543 743 544 744 /* codec IO */ 545 static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 546 unsigned int reg) 745 unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); 746 unsigned int snd_soc_write(struct snd_soc_codec *codec, 747 unsigned int reg, unsigned int val); 748 749 /* device driver data */ 750 751 static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, 752 void *data) 547 753 { 548 return codec->read(codec, reg);754 dev_set_drvdata(codec->dev, data); 549 755 } 550 756 551 static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, 552 unsigned int reg, unsigned int val) 757 static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) 553 758 { 554 return codec->write(codec, reg, val);759 return dev_get_drvdata(codec->dev); 555 760 } 556 761 762 static inline void snd_soc_platform_set_drvdata(struct snd_soc_platform *platform, 763 void *data) 764 { 765 dev_set_drvdata(platform->dev, data); 766 } 767 768 static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platform) 769 { 770 return dev_get_drvdata(platform->dev); 771 } 772 773 static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd, 774 void *data) 775 { 776 dev_set_drvdata(&rtd->dev, data); 777 } 778 779 static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) 780 { 781 return dev_get_drvdata(&rtd->dev); 782 } 783 784 static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) 785 { 786 INIT_LIST_HEAD(&card->dai_dev_list); 787 INIT_LIST_HEAD(&card->codec_dev_list); 788 INIT_LIST_HEAD(&card->platform_dev_list); 789 INIT_LIST_HEAD(&card->widgets); 790 INIT_LIST_HEAD(&card->paths); 791 INIT_LIST_HEAD(&card->dapm_list); 792 } 793 557 794 #include <sound/soc-dai.h> 558 795 796 #ifdef CONFIG_DEBUG_FS 797 extern struct dentry *snd_soc_debugfs_root; 559 798 #endif 799 800 #endif -
GPL/trunk/alsa-kernel/include/sound/tlv.h
r464 r598 39 39 #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ 40 40 41 #define TLV_DB_SCALE_MASK 0xffff 42 #define TLV_DB_SCALE_MUTE 0x10000 41 43 #define TLV_DB_SCALE_ITEM(min, step, mute) \ 42 44 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ 43 (min), ((step) & 0xffff) | ((mute) ? 0x10000: 0)45 (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0) 44 46 #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ 45 47 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } -
GPL/trunk/alsa-kernel/include/sound/version.h
r472 r598 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION "1.0.2 1"2 #define CONFIG_SND_VERSION "1.0.24" 3 3 #define CONFIG_SND_DATE ""
Note:
See TracChangeset
for help on using the changeset viewer.