Changeset 772 for GPL/trunk/alsa-kernel/include
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (5 months ago)
- Location:
- GPL/trunk
- Files:
-
- 53 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/ac97/codec.h
r617 r772 64 64 struct device_driver driver; 65 65 int (*probe)(struct ac97_codec_device *); 66 int (*remove)(struct ac97_codec_device *);66 void (*remove)(struct ac97_codec_device *dev); 67 67 void (*shutdown)(struct ac97_codec_device *); 68 68 const struct ac97_id *id_table; -
GPL/trunk/alsa-kernel/include/sound/ac97_codec.h
r679 r772 336 336 void snd_ac97_suspend(struct snd_ac97 *ac97); 337 337 void snd_ac97_resume(struct snd_ac97 *ac97); 338 #else 339 static inline void snd_ac97_suspend(struct snd_ac97 *ac97) {} 340 static inline void snd_ac97_resume(struct snd_ac97 *ac97) {} 338 341 #endif 339 342 int snd_ac97_reset(struct snd_ac97 *ac97, bool try_warm, unsigned int id, -
GPL/trunk/alsa-kernel/include/sound/asequencer.h
r679 r772 66 66 #define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL) 67 67 68 /* check whether the given event is a UMP event */ 69 #ifndef TARGET_OS2 70 #define snd_seq_ev_is_ump(ev) \ 71 (IS_ENABLED(CONFIG_SND_SEQ_UMP) && ((ev)->flags & SNDRV_SEQ_EVENT_UMP)) 72 #else 73 #define snd_seq_ev_is_ump(ev) \ 74 (0 && ((ev)->flags & SNDRV_SEQ_EVENT_UMP)) 75 #endif 68 76 /* queue sync port */ 69 77 #define snd_seq_queue_sync_port(q) ((q) + 16) -
GPL/trunk/alsa-kernel/include/sound/compress_driver.h
r717 r772 149 149 struct snd_compr { 150 150 const char *name; 151 struct device dev;151 struct device *dev; 152 152 struct snd_compr_ops *ops; 153 153 void *private_data; -
GPL/trunk/alsa-kernel/include/sound/config.h
r679 r772 23 23 #define CONFIG_PM 24 24 #define CONFIG_PM_SLEEP 25 #define CONFIG_SND_CTL_INPUT_VALIDATION 0 25 26 #ifdef DEBUG 26 27 #define CONFIG_SND_DEBUG_DETECT … … 31 32 #define CONFIG_SND_HDA_CODEC_CONEXANT 32 33 #define CONFIG_SND_HDA_CODEC_CMEDIA 34 /* #define CONFIG_SND_HDA_CODEC_HDMI not yet supported */ 33 35 #define CONFIG_SND_HDA_CODEC_REALTEK 34 36 #define CONFIG_SND_HDA_CODEC_SIGMATEL 35 37 #define CONFIG_SND_HDA_CODEC_SI3054 36 38 #define CONFIG_SND_HDA_CODEC_VIA 39 #define CONFIG_SND_HDA_COMPONENT 37 40 #define CONFIG_SND_HDA_GENERIC 38 41 #define CONFIG_SND_HDA_HWDEP 42 /* #define CONFIG_SND_HDA_I915 not yet supported */ 39 43 #define CONFIG_SND_HDA_PREALLOC_SIZE 64 40 44 #define CONFIG_SND_OSSEMUL -
GPL/trunk/alsa-kernel/include/sound/control.h
r695 r772 24 24 25 25 /* internal flag for skipping validations */ 26 #ifdef CONFIG_SND_CTL_ VALIDATION26 #ifdef CONFIG_SND_CTL_DEBUG 27 27 #define SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK (1 << 24) 28 28 #define snd_ctl_skip_validation(info) \ … … 110 110 wait_queue_head_t change_sleep; 111 111 spinlock_t read_lock; 112 struct fasync_struct*fasync;112 struct snd_fasync *fasync; 113 113 int subscribed; /* read interface is activated */ 114 114 struct list_head events; /* waiting events for read */ … … 139 139 int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); 140 140 int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); 141 void snd_ctl_rename(struct snd_card *card, struct snd_kcontrol *kctl, const char *name); 141 142 int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, int active); 142 struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); 143 struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id); 143 struct snd_kcontrol *snd_ctl_find_numid_locked(struct snd_card *card, unsigned int numid); 144 struct snd_kcontrol *snd_ctl_find_numid(struct snd_card *card, unsigned int numid); 145 struct snd_kcontrol *snd_ctl_find_id_locked(struct snd_card *card, const struct snd_ctl_elem_id *id); 146 struct snd_kcontrol *snd_ctl_find_id(struct snd_card *card, const struct snd_ctl_elem_id *id); 147 148 /** 149 * snd_ctl_find_id_mixer - find the control instance with the given name string 150 * @card: the card instance 151 * @name: the name string 152 * 153 * Finds the control instance with the given name and 154 * @SNDRV_CTL_ELEM_IFACE_MIXER. Other fields are set to zero. 155 * 156 * This is merely a wrapper to snd_ctl_find_id(). 157 * 158 * Return: The pointer of the instance if found, or %NULL if not. 159 */ 160 static inline struct snd_kcontrol * 161 snd_ctl_find_id_mixer(struct snd_card *card, const char *name) 162 { 163 struct snd_ctl_elem_id id = {0}; 164 165 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 166 strscpy(id.name, name, sizeof(id.name)); 167 return snd_ctl_find_id(card, &id); 168 } 144 169 145 170 int snd_ctl_create(struct snd_card *card); … … 237 262 return _snd_ctl_add_follower(master, follower, 0); 238 263 } 264 265 int snd_ctl_add_followers(struct snd_card *card, struct snd_kcontrol *master, 266 const char * const *list); 239 267 240 268 /** -
GPL/trunk/alsa-kernel/include/sound/core.h
r717 r772 18 18 #include <linux/stringify.h> 19 19 #include <linux/printk.h> 20 #include <linux/xarray.h> 20 21 21 22 /* number of supported soundcards */ … … 99 100 struct list_head devices; /* devices */ 100 101 101 struct device ctl_dev; /* control device */102 struct device *ctl_dev; /* control device */ 102 103 unsigned int last_numid; /* last used numeric ID */ 103 struct rw_semaphore controls_rwsem; /* controls l ist lock*/104 struct rw_semaphore controls_rwsem; /* controls lock (list and values) */ 104 105 rwlock_t ctl_files_rwlock; /* ctl_files list lock */ 105 106 int controls_count; /* count of all controls */ … … 107 108 struct list_head controls; /* all controls for this card */ 108 109 struct list_head ctl_files; /* active control files */ 110 #ifdef CONFIG_SND_CTL_FAST_LOOKUP 111 struct xarray ctl_numids; /* hash table for numids */ 112 struct xarray ctl_hash; /* hash table for ctl id matching */ 113 bool ctl_hash_collision; /* ctl_hash collision seen? */ 114 #endif 109 115 110 116 struct snd_info_entry *proc_root; /* root for soundcard specific files */ … … 230 236 extern int snd_major; 231 237 extern int snd_ecards_limit; 232 extern struct class *sound_class;238 extern const struct class sound_class; 233 239 #ifdef CONFIG_SND_DEBUG 234 240 extern struct dentry *sound_debugfs_root; … … 237 243 void snd_request_card(int card); 238 244 239 void snd_device_initialize(struct device *dev, struct snd_card *card);245 int snd_device_alloc(struct device **dev_p, struct snd_card *card); 240 246 241 247 int snd_register_device(int type, struct snd_card *card, int dev, … … 284 290 struct snd_card **card_ret); 285 291 286 intsnd_card_disconnect(struct snd_card *card);292 void snd_card_disconnect(struct snd_card *card); 287 293 void snd_card_disconnect_sync(struct snd_card *card); 288 intsnd_card_free(struct snd_card *card);289 intsnd_card_free_when_closed(struct snd_card *card);294 void snd_card_free(struct snd_card *card); 295 void snd_card_free_when_closed(struct snd_card *card); 290 296 int snd_card_free_on_error(struct device *dev, int ret); 291 297 void snd_card_set_id(struct snd_card *card, const char *id); … … 543 549 #endif 544 550 551 /* async signal helpers */ 552 struct snd_fasync; 553 554 int snd_fasync_helper(int fd, struct file *file, int on, 555 struct snd_fasync **fasyncp); 556 void snd_kill_fasync(struct snd_fasync *fasync, int signal, int poll); 557 void snd_fasync_free(struct snd_fasync *fasync); 558 545 559 #endif /* __SOUND_CORE_H */ -
GPL/trunk/alsa-kernel/include/sound/da7219-aad.h
r679 r772 45 45 }; 46 46 47 enum da7219_aad_jack_ins_det_pty { 48 DA7219_AAD_JACK_INS_DET_PTY_LOW = 0, 49 DA7219_AAD_JACK_INS_DET_PTY_HIGH, 50 }; 51 47 52 enum da7219_aad_jack_det_rate { 48 53 DA7219_AAD_JACK_DET_RATE_32_64MS = 0, … … 81 86 enum da7219_aad_mic_det_thr mic_det_thr; 82 87 enum da7219_aad_jack_ins_deb jack_ins_deb; 88 enum da7219_aad_jack_ins_det_pty jack_ins_det_pty; 83 89 enum da7219_aad_jack_det_rate jack_det_rate; 84 90 enum da7219_aad_jack_rem_deb jack_rem_deb; -
GPL/trunk/alsa-kernel/include/sound/designware_i2s.h
r679 r772 22 22 }; 23 23 24 struct dw_i2s_dev; 25 24 26 struct i2s_platform_data { 25 27 #define DWC_I2S_PLAY (1 << 0) … … 43 45 bool (*filter)(struct dma_chan *chan, void *slave); 44 46 int (*i2s_clk_cfg)(struct i2s_clk_config_data *config); 47 int (*i2s_pd_init)(struct dw_i2s_dev *dev); 45 48 }; 46 49 -
GPL/trunk/alsa-kernel/include/sound/dmaengine_pcm.h
r695 r772 16 16 * substream 17 17 * @substream: PCM substream 18 * 19 * Return: DMA transfer direction 18 20 */ 19 21 static inline enum dma_transfer_direction … … 35 37 struct dma_chan *chan); 36 38 int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); 39 int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream); 37 40 38 41 int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, … … 61 64 * src_addr_width member, not bytes) that can be send to or received from the 62 65 * DAI in one burst. 63 * @slave_id: Slave requester id for the DMA channel.64 66 * @filter_data: Custom DMA channel filter data, this will usually be used when 65 67 * requesting the DMA channel. … … 75 77 enum dma_slave_buswidth addr_width; 76 78 u32 maxburst; 77 unsigned int slave_id;78 79 void *filter_data; 79 80 const char *chan_name; … … 143 144 int (*process)(struct snd_pcm_substream *substream, 144 145 int channel, unsigned long hwoff, 145 void *buf,unsigned long bytes);146 unsigned long bytes); 146 147 dma_filter_fn compat_filter_fn; 147 148 struct device *dma_dev; -
GPL/trunk/alsa-kernel/include/sound/emu10k1.h
r717 r772 26 26 27 27 #define EMUPAGESIZE 4096 28 #define MAXREQVOICES 829 28 #define MAXPAGES0 4096 /* 32 bit mode */ 30 29 #define MAXPAGES1 8192 /* 31 bit mode */ 31 #define RESERVED 032 #define NUM_MIDI 1633 30 #define NUM_G 64 /* use all channels */ 34 #define NUM_FXSENDS 435 31 #define NUM_EFX_PLAYBACK 16 36 32 … … 40 36 41 37 #define TMEMSIZE 256*1024 42 #define TMEMSIZEREG 443 38 44 39 #define IP_TO_CP(ip) ((ip == 0) ? 0 : (((0x00001000uL | (ip & 0x00000FFFL)) << (((ip >> 12) & 0x000FL) + 4)) & 0xFFFF0000uL)) 40 41 // This is used to define hardware bit-fields (sub-registers) by combining 42 // the bit shift and count with the actual register address. The passed 43 // mask must represent a single run of adjacent bits. 44 // The non-concatenating (_NC) variant should be used directly only for 45 // sub-registers that do not follow the <register>_<field> naming pattern. 46 #define SUB_REG_NC(reg, field, mask) \ 47 enum { \ 48 field ## _MASK = mask, \ 49 field = reg | \ 50 (__builtin_ctz(mask) << 16) | \ 51 (__builtin_popcount(mask) << 24), \ 52 }; 53 #define SUB_REG(reg, field, mask) SUB_REG_NC(reg, reg ## _ ## field, mask) 54 55 // Macros for manipulating values of bit-fields declared using the above macros. 56 // Best used with constant register addresses, as otherwise quite some code is 57 // generated. The actual register read/write functions handle combined addresses 58 // automatically, so use of these macros conveys no advantage when accessing a 59 // single sub-register at a time. 60 #define REG_SHIFT(r) (((r) >> 16) & 0x1f) 61 #define REG_SIZE(r) (((r) >> 24) & 0x1f) 62 #define REG_MASK0(r) ((1U << REG_SIZE(r)) - 1U) 63 #define REG_MASK(r) (REG_MASK0(r) << REG_SHIFT(r)) 64 #define REG_VAL_GET(r, v) ((v & REG_MASK(r)) >> REG_SHIFT(r)) 65 #define REG_VAL_PUT(r, v) ((v) << REG_SHIFT(r)) 66 67 // List terminator for snd_emu10k1_ptr_write_multiple() 68 #define REGLIST_END ~0 45 69 46 70 // Audigy specify registers are prefixed with 'A_' … … 67 91 #define IPR_P16V 0x80000000 /* Bit set when the CA0151 P16V chip wishes 68 92 to interrupt */ 69 #define IPR_ GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure70 which INTE bits enable it)*/93 #define IPR_WATERMARK_REACHED 0x40000000 94 #define IPR_A_GPIO 0x20000000 /* GPIO input pin change */ 71 95 72 96 /* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ … … 96 120 #define IPR_MIDIRECVBUFEMPTY 0x00000080 /* MIDI UART receive buffer empty */ 97 121 #define IPR_CHANNELLOOP 0x00000040 /* Channel (half) loop interrupt(s) pending */ 122 /* The interrupt is triggered shortly after */ 123 /* CCR_READADDRESS has crossed the boundary; */ 124 /* due to the cache, this runs ahead of the */ 125 /* actual playback position. */ 98 126 #define IPR_CHANNELNUMBERMASK 0x0000003f /* When IPR_CHANNELLOOP is set, indicates the */ 99 127 /* highest set channel in CLIPL, CLIPH, HLIPL, */ 100 /* or HLIPH. When IP is written with CL set, */128 /* or HLIPH. When IPR is written with CL set, */ 101 129 /* the bit in H/CLIPL or H/CLIPH corresponding */ 102 /* to the C IN value written will be cleared. */130 /* to the CN value written will be cleared. */ 103 131 104 132 #define INTE 0x0c /* Interrupt enable register */ … … 128 156 /* lockups if enabled. */ 129 157 158 #define INTE_A_GPIOENABLE 0x00040000 /* Enable GPIO input change interrupts */ 159 130 160 /* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ 131 161 #define INTE_A_MIDITXENABLE2 0x00020000 /* Enable MIDI transmit-buffer-empty interrupts */ 132 162 #define INTE_A_MIDIRXENABLE2 0x00010000 /* Enable MIDI receive-buffer-empty interrupts */ 133 163 164 #define INTE_A_SPDIF_BUFFULL_ENABLE 0x00008000 165 #define INTE_A_SPDIF_HALFBUFFULL_ENABLE 0x00004000 134 166 135 167 #define INTE_SAMPLERATETRACKER 0x00002000 /* Enable sample rate tracker interrupts */ … … 150 182 151 183 #define WC 0x10 /* Wall Clock register */ 184 #ifndef TARGET_OS2 185 SUB_REG(WC, SAMPLECOUNTER, 0x03FFFFC0) /* Sample periods elapsed since reset */ 186 SUB_REG(WC, CURRENTCHANNEL, 0x0000003F) /* Channel [0..63] currently being serviced */ 187 /* NOTE: Each channel takes 1/64th of a sample */ 188 /* period to be serviced. */ 189 190 #else 152 191 #define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */ 153 192 #define WC_SAMPLECOUNTER 0x14060010 154 #define WC_CURRENTCHANNEL 0x0 000003F /* Channel [0..63] currently being serviced */193 #define WC_CURRENTCHANNEL 0x0700003F /* Channel [0..63] currently being serviced */ 155 194 /* NOTE: Each channel takes 1/64th of a sample */ 156 195 /* period to be serviced. */ 157 196 #endif 158 197 #define HCFG 0x14 /* Hardware config register */ 159 198 /* NOTE: There is no reason to use the legacy */ … … 181 220 182 221 /* Specific to Alice2, CA0102 */ 222 183 223 #define HCFG_CODECFORMAT_AC97_1 0x00000000 /* AC97 CODEC format -- Ver 1.03 */ 184 224 #define HCFG_CODECFORMAT_AC97_2 0x00010000 /* AC97 CODEC format -- Ver 2.1 */ … … 201 241 /* Rest of HCFG 0x0000000f same as below. LOCKSOUNDCACHE etc. */ 202 242 203 204 205 243 /* Older chips */ 244 206 245 #define HCFG_CODECFORMAT_AC97 0x00000000 /* AC97 CODEC format -- Primary Output */ 207 246 #define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */ … … 226 265 #define HCFG_LOCKSOUNDCACHE 0x00000008 /* 1 = Cancel bustmaster accesses to soundcache */ 227 266 /* NOTE: This should generally never be used. */ 267 #ifndef TARGET_OS2 268 SUB_REG(HCFG, LOCKTANKCACHE, 0x00000004) /* 1 = Cancel bustmaster accesses to tankcache */ 269 /* NOTE: This should generally never be used. */ 270 #else 228 271 #define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ 229 272 /* NOTE: This should generally never be used. */ 230 273 #define HCFG_LOCKTANKCACHE 0x01020014 274 #endif 231 275 #define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */ 232 276 /* NOTE: This is a 'cheap' way to implement a */ … … 239 283 /* completely initialized. */ 240 284 241 // For Audigy, MPU port move to 0x70-0x74 ptr register285 // On Audigy, the MPU port moved to the 0x70-0x74 ptr registers 242 286 243 287 #define MUDATA 0x18 /* MPU401 data register (8 bits) */ … … 252 296 #define MUSTAT_ORDYN 0x40 /* 0 = MUDATA can accept a command or data */ 253 297 254 #define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */ 255 #define A_GPINPUT_MASK 0xff00 298 #define A_GPIO 0x18 /* GPIO on Audigy card (16bits) */ 299 #define A_GPINPUT_MASK 0xff00 /* Alice/2 has 8 input pins */ 300 #define A3_GPINPUT_MASK 0x3f00 /* ... while Tina/2 has only 6 */ 256 301 #define A_GPOUTPUT_MASK 0x00ff 257 302 303 // The GPIO port is used for I/O config on Sound Blasters; 304 // card-specific info can be found in the emu_chip_details table. 305 // On E-MU cards the port is used as the interface to the FPGA. 306 258 307 // Audigy output/GPIO stuff taken from the kX drivers 308 #define A_IOCFG A_GPIO 259 309 #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 260 310 #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ … … 272 322 #define A_IOCFG_PHONES_JACK 0x0100 /* LiveDrive */ 273 323 274 /* outputs:275 * for audigy2 platinum: 0xa00276 * for a2 platinum ex: 0x1c00277 * for a1 platinum: 0x0278 */279 280 324 #define TIMER 0x1a /* Timer terminal count register */ 281 325 /* NOTE: After the rate is changed, a maximum */ 282 326 /* of 1024 sample periods should be allowed */ 283 327 /* before the new rate is guaranteed accurate. */ 284 #define TIMER_RATE_MASK 0x0 00003ff/* Timer interrupt rate in sample periods */328 #define TIMER_RATE_MASK 0x03ff /* Timer interrupt rate in sample periods */ 285 329 /* 0 == 1024 periods, [1..4] are not useful */ 286 #define TIMER_RATE 0x0a00001a287 330 288 331 #define AC97DATA 0x1c /* AC97 register set data register (16 bit) */ … … 318 361 /* 0x00000200 8-channel output. */ 319 362 /* 0x00000004 pauses stream/irq fail. */ 320 /* Rest of bits no nothing to sound output */363 /* Rest of bits do nothing to sound output */ 321 364 /* bit 0: Enable P16V audio. 322 365 * bit 1: Lock P16V record memory cache. … … 332 375 #define IPR3 0x38 /* Cdif interrupt pending register */ 333 376 #define INTE3 0x3c /* Cdif interrupt enable register. */ 377 334 378 /************************************************************************************************/ 335 379 /* PCI function 1 registers, address = <val> + PCIBASE1 */ … … 350 394 #define JOYSTICK_COMPARATOR 0xf0 /* Joystick comparator data */ 351 395 352 353 396 /********************************************************************************************************/ 354 397 /* Emu10k1 pointer-offset register set, accessed through the PTR and DATA registers */ 355 398 /********************************************************************************************************/ 356 399 400 // No official documentation was released for EMU10K1, but some info 401 // about playback can be extrapolated from the EMU8K documents: 402 // "AWE32/EMU8000 Programmerâs Guide" (emu8kpgm.pdf) - registers 403 // "AWE32 Developer's Information Pack" (adip301.pdf) - high-level view 404 405 // The short version: 406 // - The engine has 64 playback channels, also called voices. The channels 407 // operate independently, except when paired for stereo (see below). 408 // - PCM samples are fetched into the cache; see description of CD0 below. 409 // - Samples are consumed at the rate CPF_CURRENTPITCH. 410 // - 8-bit samples are transformed upon use: cooked = (raw ^ 0x80) << 8 411 // - 8 samples are read at CCR_READADDRESS:CPF_FRACADDRESS and interpolated 412 // according to CCCA_INTERPROM_*. With CCCA_INTERPROM_0 selected and a zero 413 // CPF_FRACADDRESS, this results in CCR_READADDRESS[3] being used verbatim. 414 // - The value is multiplied by CVCF_CURRENTVOL. 415 // - The value goes through a filter with cutoff CVCF_CURRENTFILTER; 416 // delay stages Z1 and Z2. 417 // - The value is added by so-called `sends` to 4 (EMU10K1) / 8 (EMU10K2) 418 // of the 16 (EMU10K1) / 64 (EMU10K2) FX bus accumulators via FXRT*, 419 // multiplied by a per-send amount (*_FXSENDAMOUNT_*). 420 // The scaling of the send amounts is exponential-ish. 421 // - The DSP has a go at FXBUS* and outputs the values to EXTOUT* or EMU32OUT*. 422 // - The pitch, volume, and filter cutoff can be modulated by two envelope 423 // engines and two low frequency oscillators. 424 // - To avoid abrupt changes to the parameters (which may cause audible 425 // distortion), the modulation engine sets the target registers, towards 426 // which the current registers "swerve" gradually. 427 428 // For the odd channel in a stereo pair, these registers are meaningless: 429 // CPF_STEREO, CPF_CURRENTPITCH, PTRX_PITCHTARGET, CCR_CACHEINVALIDSIZE, 430 // PSST_LOOPSTARTADDR, DSL_LOOPENDADDR, CCCA_CURRADDR 431 // The somewhat non-obviously still meaningful ones are: 432 // CPF_STOP, CPF_FRACADDRESS, CCR_READADDRESS (!), 433 // CCCA_INTERPROM, CCCA_8BITSELECT (!) 434 // (The envelope engine is ignored here, as stereo matters only for verbatim playback.) 435 357 436 #define CPF 0x00 /* Current pitch and fraction register */ 437 #ifndef TARGET_OS2 438 SUB_REG(CPF, CURRENTPITCH, 0xffff0000) /* Current pitch (linear, 0x4000 == unity pitch shift) */ 439 #else 358 440 #define CPF_CURRENTPITCH_MASK 0xffff0000 /* Current pitch (linear, 0x4000 == unity pitch shift) */ 359 441 #define CPF_CURRENTPITCH 0x10100000 442 #endif 360 443 #define CPF_STEREO_MASK 0x00008000 /* 1 = Even channel interleave, odd channel locked */ 444 #ifndef TARGET_OS2 445 SUB_REG(CPF, STOP, 0x00004000) /* 1 = Current pitch forced to 0 */ 446 /* Can be set only while matching bit in SOLEx is 1 */ 447 #else 448 #define CPF_STOP 0x00004000 /* 1 = Current pitch forced to 0 */ 361 449 #define CPF_STOP_MASK 0x00004000 /* 1 = Current pitch forced to 0 */ 450 #endif 362 451 #define CPF_FRACADDRESS_MASK 0x00003fff /* Linear fractional address of the current channel */ 363 452 364 453 #define PTRX 0x01 /* Pitch target and send A/B amounts register */ 454 #ifndef TARGET_OS2 455 SUB_REG(PTRX, PITCHTARGET, 0xffff0000) /* Pitch target of specified channel */ 456 SUB_REG(PTRX, FXSENDAMOUNT_A, 0x0000ff00) /* Linear level of channel output sent to FX send bus A */ 457 SUB_REG(PTRX, FXSENDAMOUNT_B, 0x000000ff) /* Linear level of channel output sent to FX send bus B */ 458 #else 365 459 #define PTRX_PITCHTARGET_MASK 0xffff0000 /* Pitch target of specified channel */ 366 460 #define PTRX_PITCHTARGET 0x10100001 … … 369 463 #define PTRX_FXSENDAMOUNT_B_MASK 0x000000ff /* Linear level of channel output sent to FX send bus B */ 370 464 #define PTRX_FXSENDAMOUNT_B 0x08000001 371 465 #endif 466 467 // Note: the volumes are raw multpliers, so real 100% is impossible. 372 468 #define CVCF 0x02 /* Current volume and filter cutoff register */ 469 #ifndef TARGET_OS2 470 SUB_REG(CVCF, CURRENTVOL, 0xffff0000) /* Current linear volume of specified channel */ 471 SUB_REG(CVCF, CURRENTFILTER, 0x0000ffff) /* Current filter cutoff frequency of specified channel */ 472 #else 373 473 #define CVCF_CURRENTVOL_MASK 0xffff0000 /* Current linear volume of specified channel */ 374 474 #define CVCF_CURRENTVOL 0x10100002 375 475 #define CVCF_CURRENTFILTER_MASK 0x0000ffff /* Current filter cutoff frequency of specified channel */ 376 476 #define CVCF_CURRENTFILTER 0x10000002 477 #endif 377 478 378 479 #define VTFT 0x03 /* Volume target and filter cutoff target register */ 480 #ifndef TARGET_OS2 481 SUB_REG(VTFT, VOLUMETARGET, 0xffff0000) /* Volume target of specified channel */ 482 SUB_REG(VTFT, FILTERTARGET, 0x0000ffff) /* Filter cutoff target of specified channel */ 483 #else 379 484 #define VTFT_VOLUMETARGET_MASK 0xffff0000 /* Volume target of specified channel */ 380 485 #define VTFT_VOLUMETARGET 0x10100003 381 486 #define VTFT_FILTERTARGET_MASK 0x0000ffff /* Filter cutoff target of specified channel */ 382 487 #define VTFT_FILTERTARGET 0x10000003 488 #endif 383 489 384 490 #define Z1 0x05 /* Filter delay memory 1 register */ … … 387 493 388 494 #define PSST 0x06 /* Send C amount and loop start address register */ 495 #ifndef TARGET_OS2 496 SUB_REG(PSST, FXSENDAMOUNT_C, 0xff000000) /* Linear level of channel output sent to FX send bus C */ 497 SUB_REG(PSST, LOOPSTARTADDR, 0x00ffffff) /* Loop start address of the specified channel */ 498 #else 389 499 #define PSST_FXSENDAMOUNT_C_MASK 0xff000000 /* Linear level of channel output sent to FX send bus C */ 390 500 … … 393 503 #define PSST_LOOPSTARTADDR_MASK 0x00ffffff /* Loop start address of the specified channel */ 394 504 #define PSST_LOOPSTARTADDR 0x18000006 395 396 #define DSL 0x07 /* Send D amount and loop start address register */ 505 #endif 506 507 #define DSL 0x07 /* Send D amount and loop end address register */ 508 #ifndef TARGET_OS2 509 SUB_REG(DSL, FXSENDAMOUNT_D, 0xff000000) /* Linear level of channel output sent to FX send bus D */ 510 SUB_REG(DSL, LOOPENDADDR, 0x00ffffff) /* Loop end address of the specified channel */ 511 #else 397 512 #define DSL_FXSENDAMOUNT_D_MASK 0xff000000 /* Linear level of channel output sent to FX send bus D */ 398 513 … … 401 516 #define DSL_LOOPENDADDR_MASK 0x00ffffff /* Loop end address of the specified channel */ 402 517 #define DSL_LOOPENDADDR 0x18000007 518 #endif 403 519 404 520 #define CCCA 0x08 /* Filter Q, interp. ROM, byte size, cur. addr register */ 521 #ifndef TARGET_OS2 522 SUB_REG(CCCA, RESONANCE, 0xf0000000) /* Lowpass filter resonance (Q) height */ 523 #else 405 524 #define CCCA_RESONANCE 0xf0000000 /* Lowpass filter resonance (Q) height */ 406 #define CCCA_INTERPROMMASK 0x0e000000 /* Selects passband of interpolation ROM */ 525 #endif 526 #define CCCA_INTERPROM_MASK 0x0e000000 /* Selects passband of interpolation ROM */ 407 527 /* 1 == full band, 7 == lowpass */ 408 528 /* ROM 0 is used when pitch shifting downward or less */ … … 419 539 #define CCCA_INTERPROM_7 0x0e000000 /* Select interpolation ROM 7 */ 420 540 #define CCCA_8BITSELECT 0x01000000 /* 1 = Sound memory for this channel uses 8-bit samples */ 541 /* 8-bit samples are unsigned, 16-bit ones signed */ 542 #ifndef TARGET_OS2 543 SUB_REG(CCCA, CURRADDR, 0x00ffffff) /* Current address of the selected channel */ 544 #else 421 545 #define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */ 422 546 #define CCCA_CURRADDR 0x18000008 547 #endif 423 548 424 549 #define CCR 0x09 /* Cache control register */ 550 #ifndef TARGET_OS2 551 SUB_REG(CCR, CACHEINVALIDSIZE, 0xfe000000) /* Number of invalid samples before the read address */ 552 #else 425 553 #define CCR_CACHEINVALIDSIZE 0x07190009 426 554 #define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */ 555 #endif 427 556 #define CCR_CACHELOOPFLAG 0x01000000 /* 1 = Cache has a loop service pending */ 428 557 #define CCR_INTERLEAVEDSAMPLES 0x00800000 /* 1 = A cache service will fetch interleaved samples */ 558 /* Auto-set from CPF_STEREO_MASK */ 429 559 #define CCR_WORDSIZEDSAMPLES 0x00400000 /* 1 = A cache service will fetch word sized samples */ 560 /* Auto-set from CCCA_8BITSELECT */ 561 #ifndef TARGET_OS2 562 SUB_REG(CCR, READADDRESS, 0x003f0000) /* Next cached sample to play */ 563 SUB_REG(CCR, LOOPINVALSIZE, 0x0000fe00) /* Number of invalid samples in cache prior to loop */ 564 #else 430 565 #define CCR_READADDRESS 0x06100009 431 566 #define CCR_READADDRESS_MASK 0x003f0000 /* Location of cache just beyond current cache service */ 432 567 #define CCR_LOOPINVALSIZE 0x0000fe00 /* Number of invalid samples in cache prior to loop */ 433 568 /* NOTE: This is valid only if CACHELOOPFLAG is set */ 569 #endif 570 /* NOTE: This is valid only if CACHELOOPFLAG is set */ 434 571 #define CCR_LOOPFLAG 0x00000100 /* Set for a single sample period when a loop occurs */ 572 #ifndef TARGET_OS2 573 SUB_REG(CCR, CACHELOOPADDRHI, 0x000000ff) /* CLP_LOOPSTARTADDR's hi byte if CACHELOOPFLAG is set */ 574 #else 435 575 #define CCR_CACHELOOPADDRHI 0x000000ff /* DSL_LOOPSTARTADDR's hi byte if CACHELOOPFLAG is set */ 576 #endif 436 577 437 578 #define CLP 0x0a /* Cache loop register (valid if CCR_CACHELOOPFLAG = 1) */ 438 579 /* NOTE: This register is normally not used */ 580 #ifndef TARGET_OS2 581 SUB_REG(CLP, CACHELOOPADDR, 0x0000ffff) /* Cache loop address low word */ 582 #else 439 583 #define CLP_CACHELOOPADDR 0x0000ffff /* Cache loop address (DSL_LOOPSTARTADDR [0..15]) */ 584 #endif 440 585 441 586 #define FXRT 0x0b /* Effects send routing register */ … … 447 592 #define FXRT_CHANNELD 0xf0000000 /* Effects send bus number for channel's effects send D */ 448 593 449 #define A_HR 0x0b /* High Resolution. 24bit playback from host to DSP. */450 594 #define MAPA 0x0c /* Cache map A */ 451 452 595 #define MAPB 0x0d /* Cache map B */ 453 596 … … 458 601 #define MAP_PTI_MASK1 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ 459 602 460 /* 0x0e, 0x0f: Not used*/603 /* 0x0e, 0x0f: Internal state, at least on Audigy */ 461 604 462 605 #define ENVVOL 0x10 /* Volume envelope register */ 463 #define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ 606 #define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ 464 607 /* 0x8000-n == 666*n usec delay */ 465 608 466 609 #define ATKHLDV 0x11 /* Volume envelope hold and attack register */ 467 #define ATKHLDV_PHASE0 610 #define ATKHLDV_PHASE0_MASK 0x00008000 /* 0 = Begin attack phase */ 468 611 #define ATKHLDV_HOLDTIME_MASK 0x00007f00 /* Envelope hold time (127-n == n*88.2msec) */ 469 612 #define ATKHLDV_ATTACKTIME_MASK 0x0000007f /* Envelope attack time, log encoded */ … … 471 614 472 615 #define DCYSUSV 0x12 /* Volume envelope sustain and decay register */ 473 #define DCYSUSV_PHASE1_MASK 0x00008000 /* 0 = Begin attackphase, 1 = begin release phase */616 #define DCYSUSV_PHASE1_MASK 0x00008000 /* 0 = Begin decay phase, 1 = begin release phase */ 474 617 #define DCYSUSV_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */ 475 #define DCYSUSV_CHANNELENABLE_MASK 0x00000080 /* 1= Inhibit envelope engine from writing values in */618 #define DCYSUSV_CHANNELENABLE_MASK 0x00000080 /* 0 = Inhibit envelope engine from writing values in */ 476 619 /* this channel and from writing to pitch, filter and */ 477 620 /* volume targets. */ … … 488 631 489 632 #define ATKHLDM 0x15 /* Modulation envelope hold and attack register */ 490 #define ATKHLDM_PHASE0 633 #define ATKHLDM_PHASE0_MASK 0x00008000 /* 0 = Begin attack phase */ 491 634 #define ATKHLDM_HOLDTIME 0x00007f00 /* Envelope hold time (127-n == n*42msec) */ 492 635 #define ATKHLDM_ATTACKTIME 0x0000007f /* Envelope attack time, log encoded */ … … 494 637 495 638 #define DCYSUSM 0x16 /* Modulation envelope decay and sustain register */ 496 #define DCYSUSM_PHASE1_MASK 0x00008000 /* 0 = Begin attackphase, 1 = begin release phase */639 #define DCYSUSM_PHASE1_MASK 0x00008000 /* 0 = Begin decay phase, 1 = begin release phase */ 497 640 #define DCYSUSM_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */ 498 641 #define DCYSUSM_DECAYTIME_MASK 0x0000007f /* Envelope decay time, log encoded */ … … 509 652 510 653 #define IFATN 0x19 /* Initial filter cutoff and attenuation register */ 654 #ifndef TARGET_OS2 655 SUB_REG(IFATN, FILTERCUTOFF, 0x0000ff00) /* Initial filter cutoff frequency in exponential units */ 656 /* 6 most significant bits are semitones */ 657 /* 2 least significant bits are fractions */ 658 SUB_REG(IFATN, ATTENUATION, 0x000000ff) /* Initial attenuation in 0.375dB steps */ 659 660 #else 511 661 #define IFATN_FILTERCUTOFF_MASK 0x0000ff00 /* Initial filter cutoff frequency in exponential units */ 512 662 /* 6 most significant bits are semitones */ … … 515 665 #define IFATN_ATTENUATION_MASK 0x000000ff /* Initial attenuation in 0.375dB steps */ 516 666 #define IFATN_ATTENUATION 0x08000019 517 518 667 #endif 519 668 #define PEFE 0x1a /* Pitch envelope and filter envelope amount register */ 669 #ifndef TARGET_OS2 670 SUB_REG(PEFE, PITCHAMOUNT, 0x0000ff00) /* Pitch envlope amount */ 671 /* Signed 2's complement, +/- one octave peak extremes */ 672 SUB_REG(PEFE, FILTERAMOUNT, 0x000000ff) /* Filter envlope amount */ 673 /* Signed 2's complement, +/- six octaves peak extremes */ 674 #else 520 675 #define PEFE_PITCHAMOUNT_MASK 0x0000ff00 /* Pitch envlope amount */ 521 676 /* Signed 2's complement, +/- one octave peak extremes */ … … 524 679 /* Signed 2's complement, +/- six octaves peak extremes */ 525 680 #define PEFE_FILTERAMOUNT 0x0800001a 681 #endif 682 683 526 684 #define FMMOD 0x1b /* Vibrato/filter modulation from LFO register */ 527 685 #define FMMOD_MODVIBRATO 0x0000ff00 /* Vibrato LFO modulation depth */ … … 530 688 /* Signed 2's complement, +/- three octave extremes */ 531 689 532 533 690 #define TREMFRQ 0x1c /* Tremolo amount and modulation LFO frequency register */ 534 691 #define TREMFRQ_DEPTH 0x0000ff00 /* Tremolo depth */ 535 692 /* Signed 2's complement, with +/- 12dB extremes */ 536 537 693 #define TREMFRQ_FREQUENCY 0x000000ff /* Tremolo LFO frequency */ 538 694 /* ??Hz steps, maximum of ?? Hz. */ 695 539 696 #define FM2FRQ2 0x1d /* Vibrato amount and vibrato LFO frequency register */ 540 697 #define FM2FRQ2_DEPTH 0x0000ff00 /* Vibrato LFO vibrato depth */ … … 550 707 /* 0x1f: not used */ 551 708 552 #define CD0 0x20 /* Cache data 0 register */ 553 #define CD1 0x21 /* Cache data 1 register */ 554 #define CD2 0x22 /* Cache data 2 register */ 555 #define CD3 0x23 /* Cache data 3 register */ 556 #define CD4 0x24 /* Cache data 4 register */ 557 #define CD5 0x25 /* Cache data 5 register */ 558 #define CD6 0x26 /* Cache data 6 register */ 559 #define CD7 0x27 /* Cache data 7 register */ 560 #define CD8 0x28 /* Cache data 8 register */ 561 #define CD9 0x29 /* Cache data 9 register */ 562 #define CDA 0x2a /* Cache data A register */ 563 #define CDB 0x2b /* Cache data B register */ 564 #define CDC 0x2c /* Cache data C register */ 565 #define CDD 0x2d /* Cache data D register */ 566 #define CDE 0x2e /* Cache data E register */ 567 #define CDF 0x2f /* Cache data F register */ 568 569 /* 0x30-3f seem to be the same as 0x20-2f */ 709 // 32 cache registers (== 128 bytes) per channel follow. 710 // In stereo mode, the two channels' caches are concatenated into one, 711 // and hold the interleaved frames. 712 // The cache holds 64 frames, so the upper half is not used in 8-bit mode. 713 // All registers mentioned below count in frames. 714 // The cache is a ring buffer; CCR_READADDRESS operates modulo 64. 715 // The cache is filled from (CCCA_CURRADDR - CCR_CACHEINVALIDSIZE) 716 // into (CCR_READADDRESS - CCR_CACHEINVALIDSIZE). 717 // The engine has a fetch threshold of 32 bytes, so it tries to keep 718 // CCR_CACHEINVALIDSIZE below 8 (16-bit stereo), 16 (16-bit mono, 719 // 8-bit stereo), or 32 (8-bit mono). The actual transfers are pretty 720 // unpredictable, especially if several voices are running. 721 // Frames are consumed at CCR_READADDRESS, which is incremented afterwards, 722 // along with CCCA_CURRADDR and CCR_CACHEINVALIDSIZE. This implies that the 723 // actual playback position always lags CCCA_CURRADDR by exactly 64 frames. 724 #define CD0 0x20 /* Cache data registers 0 .. 0x1f */ 570 725 571 726 #define PTB 0x40 /* Page table base register */ … … 604 759 /* simultaneously. */ 605 760 606 #define FXWC_DEFAULTROUTE_C (1<<0) /* left emu out? */607 #define FXWC_DEFAULTROUTE_B (1<<1) /* right emu out? */608 #define FXWC_DEFAULTROUTE_A (1<<12)609 #define FXWC_DEFAULTROUTE_D (1<<13)610 #define FXWC_ADCLEFT (1<<18)611 #define FXWC_CDROMSPDIFLEFT (1<<18)612 #define FXWC_ADCRIGHT (1<<19)613 #define FXWC_CDROMSPDIFRIGHT (1<<19)614 #define FXWC_MIC (1<<20)615 #define FXWC_ZOOMLEFT (1<<20)616 #define FXWC_ZOOMRIGHT (1<<21)617 #define FXWC_SPDIFLEFT (1<<22) /* 0x00400000 */618 #define FXWC_SPDIFRIGHT (1<<23) /* 0x00800000 */619 620 761 #define A_TBLSZ 0x43 /* Effects Tank Internal Table Size. Only low byte or register used */ 621 762 … … 640 781 #define FXBA_MASK 0xfffff000 /* 20 bit base address */ 641 782 642 #define A_HWM 0x48 /* High PCI Water Mark - word access, defaults to 3f */783 #define A_HWM 0x48 /* High PCI Water Mark - word access, defaults to 3f */ 643 784 644 785 #define MICBS 0x49 /* Microphone buffer size register */ … … 648 789 #define FXBS 0x4b /* FX buffer size register */ 649 790 650 /* register: 0x4c..4f: ffff-ffff current amounts, per-channel */ 651 652 /* The following mask values define the size of the ADC, MIX and FX buffers in bytes */ 791 /* The following mask values define the size of the ADC, MIC and FX buffers in bytes */ 653 792 #define ADCBS_BUFSIZE_NONE 0x00000000 654 793 #define ADCBS_BUFSIZE_384 0x00000001 … … 684 823 #define ADCBS_BUFSIZE_65536 0x0000001f 685 824 686 /* Current Send B, A Amounts */ 687 #define A_CSBA 0x4c 688 689 /* Current Send D, C Amounts */ 690 #define A_CSDC 0x4d 691 692 /* Current Send F, E Amounts */ 693 #define A_CSFE 0x4e 694 695 /* Current Send H, G Amounts */ 696 #define A_CSHG 0x4f 697 698 699 #define CDCS 0x50 /* CD-ROM digital channel status register */ 700 701 #define GPSCS 0x51 /* General Purpose SPDIF channel status register*/ 702 703 #define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ 704 705 /* S/PDIF Input C Channel Status */ 706 #define A_SPSC 0x52 707 708 #define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ 709 710 #define A_DBG 0x53 711 #define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ 712 #define A_DBG_ZC 0x40000000 /* zero tram counter */ 713 #define A_DBG_STEP_ADDR 0x000003ff 714 #define A_DBG_SATURATION_OCCURED 0x20000000 715 #define A_DBG_SATURATION_ADDR 0x0ffc0000 716 717 // NOTE: 0x54,55,56: 64-bit 825 // On Audigy, the FX send amounts are not applied instantly, but determine 826 // targets towards which the following registers swerve gradually. 827 #define A_CSBA 0x4c /* FX send B & A current amounts */ 828 #define A_CSDC 0x4d /* FX send D & C current amounts */ 829 #define A_CSFE 0x4e /* FX send F & E current amounts */ 830 #define A_CSHG 0x4f /* FX send H & G current amounts */ 831 832 // NOTE: 0x50,51,52: 64-bit (split over voices 0 & 1) 833 #define CDCS 0x50 /* CD-ROM digital channel status register */ 834 835 #define GPSCS 0x51 /* General Purpose SPDIF channel status register */ 836 837 // Corresponding EMU10K1_DBG_* constants are in the public header 838 #define DBG 0x52 839 840 #define A_SPSC 0x52 /* S/PDIF Input C Channel Status */ 841 842 #define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ 843 844 // Corresponding A_DBG_* constants are in the public header 845 #define A_DBG 0x53 846 847 // NOTE: 0x54,55,56: 64-bit (split over voices 0 & 1) 718 848 #define SPCS0 0x54 /* SPDIF output Channel Status 0 register */ 719 849 … … 748 878 /* 0x57: Not used */ 749 879 750 /* The 32-bit CLIx and SOL x registers all have one bit per channel control/status*/880 /* The 32-bit CLIx and SOLEx registers all have one bit per channel control/status */ 751 881 #define CLIEL 0x58 /* Channel loop interrupt enable low register */ 752 753 882 #define CLIEH 0x59 /* Channel loop interrupt enable high register */ 754 883 755 884 #define CLIPL 0x5a /* Channel loop interrupt pending low register */ 756 757 885 #define CLIPH 0x5b /* Channel loop interrupt pending high register */ 758 886 887 // These cause CPF_STOP_MASK to be set shortly after CCCA_CURRADDR passes DSL_LOOPENDADDR. 888 // Subsequent changes to the address registers don't resume; clearing the bit here or in CPF does. 889 // The registers are NOT synchronized; the next serviced channel picks up immediately. 759 890 #define SOLEL 0x5c /* Stop on loop enable low register */ 760 761 891 #define SOLEH 0x5d /* Stop on loop enable high register */ 762 892 … … 768 898 769 899 #define AC97SLOT 0x5f /* additional AC97 slots enable bits */ 770 #define AC97SLOT_REAR_RIGHT 0x01 /* Rear left */ 771 #define AC97SLOT_REAR_LEFT 0x02 /* Rear right */ 772 #define AC97SLOT_CNTR 0x10 /* Center enable */ 773 #define AC97SLOT_LFE 0x20 /* LFE enable */ 774 775 /* PCB Revision */ 776 #define A_PCB 0x5f 900 #define AC97SLOT_REAR_RIGHT 0x01 /* Rear left */ 901 #define AC97SLOT_REAR_LEFT 0x02 /* Rear right */ 902 #define AC97SLOT_CNTR 0x10 /* Center enable */ 903 #define AC97SLOT_LFE 0x20 /* LFE enable */ 904 905 #define A_PCB 0x5f /* PCB Revision */ 777 906 778 907 // NOTE: 0x60,61,62: 64-bit … … 797 926 798 927 #define MICIDX 0x63 /* Microphone recording buffer index register */ 928 #ifndef TARGET_OS2 929 SUB_REG(MICIDX, IDX, 0x0000ffff) 930 #else 799 931 #define MICIDX_MASK 0x0000ffff /* 16-bit value */ 800 932 #define MICIDX_IDX 0x10000063 933 #endif 801 934 802 935 #define ADCIDX 0x64 /* ADC recording buffer index register */ 936 #ifndef TARGET_OS2 937 SUB_REG(ADCIDX, IDX, 0x0000ffff) 938 #else 803 939 #define ADCIDX_MASK 0x0000ffff /* 16 bit index field */ 804 940 #define ADCIDX_IDX 0x10000064 941 #endif 805 942 806 943 #define A_ADCIDX 0x63 944 #ifndef TARGET_OS2 945 SUB_REG(A_ADCIDX, IDX, 0x0000ffff) 946 #else 807 947 #define A_ADCIDX_IDX 0x10000063 948 #endif 808 949 809 950 #define A_MICIDX 0x64 951 #ifndef TARGET_OS2 952 SUB_REG(A_MICIDX, IDX, 0x0000ffff) 953 #else 810 954 #define A_MICIDX_IDX 0x10000064 955 #endif 811 956 812 957 #define FXIDX 0x65 /* FX recording buffer index register */ 958 #ifndef TARGET_OS2 959 SUB_REG(FXIDX, IDX, 0x0000ffff) 960 #else 813 961 #define FXIDX_MASK 0x0000ffff /* 16-bit value */ 814 962 #define FXIDX_IDX 0x10000065 815 816 /* The 32-bit HLIx and HLIPx registers all have one bit per channel control/status */ 963 #endif 964 965 /* The 32-bit HLIEx and HLIPx registers all have one bit per channel control/status */ 817 966 #define HLIEL 0x66 /* Channel half loop interrupt enable low register */ 818 819 967 #define HLIEH 0x67 /* Channel half loop interrupt enable high register */ 820 968 821 969 #define HLIPL 0x68 /* Channel half loop interrupt pending low register */ 822 823 970 #define HLIPH 0x69 /* Channel half loop interrupt pending high register */ 824 971 825 /* S/PDIF Host Record Index (bypasses SRC) */ 826 #define A_SPRI 0x6a 827 /* S/PDIF Host Record Address */ 828 #define A_SPRA 0x6b 829 /* S/PDIF Host Record Control */ 830 #define A_SPRC 0x6c 831 /* Delayed Interrupt Counter & Enable */ 832 #define A_DICE 0x6d 833 /* Tank Table Base */ 834 #define A_TTB 0x6e 835 /* Tank Delay Offset */ 836 #define A_TDOF 0x6f 972 #define A_SPRI 0x6a /* S/PDIF Host Record Index (bypasses SRC) */ 973 #define A_SPRA 0x6b /* S/PDIF Host Record Address */ 974 #define A_SPRC 0x6c /* S/PDIF Host Record Control */ 975 976 #define A_DICE 0x6d /* Delayed Interrupt Counter & Enable */ 977 978 #define A_TTB 0x6e /* Tank Table Base */ 979 #define A_TDOF 0x6f /* Tank Delay Offset */ 837 980 838 981 /* This is the MPU port on the card (via the game port) */ … … 847 990 848 991 /* The next two are the Audigy equivalent of FXWC */ 849 /* the Audigy can record any output (16bit, 48kHz, up to 64 channel simultaneously) */992 /* the Audigy can record any output (16bit, 48kHz, up to 64 channels simultaneously) */ 850 993 /* Each bit selects a channel for recording */ 851 994 #define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */ 852 995 #define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ 853 996 854 /* Extended Hardware Control */ 855 #define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ 856 #define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */ 857 #define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */ 858 #define A_SAMPLE_RATE_UNKNOWN 0xf0030001 /* Bits that can be set, but have unknown use. */ 997 #define A_EHC 0x76 /* Extended Hardware Control */ 998 999 #define A_SPDIF_SAMPLERATE A_EHC /* Set the sample rate of SPDIF output */ 859 1000 #define A_SPDIF_RATE_MASK 0x000000e0 /* Any other values for rates, just use 48000 */ 860 #define A_SPDIF_48000 0x00000000 1001 #define A_SPDIF_48000 0x00000000 /* kX calls this BYPASS */ 861 1002 #define A_SPDIF_192000 0x00000020 862 1003 #define A_SPDIF_96000 0x00000040 863 1004 #define A_SPDIF_44100 0x00000080 864 1005 #define A_SPDIF_MUTED 0x000000c0 1006 1007 #ifndef TARGET_OS2 1008 SUB_REG_NC(A_EHC, A_I2S_CAPTURE_RATE, 0x00000e00) /* This sets the capture PCM rate, but it is */ 1009 /* unclear if this sets the ADC rate as well. */ 1010 #else 1011 #define A_I2S_CAPTURE_RATE 0x00000e00 865 1012 #define A_I2S_CAPTURE_RATE_MASK 0x00000e00 /* This sets the capture PCM rate, but it is */ 866 #define A_I2S_CAPTURE_48000 0x00000000 /* unclear if this sets the ADC rate as well. */ 867 #define A_I2S_CAPTURE_192000 0x00000200 868 #define A_I2S_CAPTURE_96000 0x00000400 869 #define A_I2S_CAPTURE_44100 0x00000800 870 871 #define A_PCM_RATE_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */ 872 #define A_PCM_48000 0x00000000 873 #define A_PCM_192000 0x00002000 874 #define A_PCM_96000 0x00004000 875 #define A_PCM_44100 0x00008000 876 877 /* I2S0 Sample Rate Tracker Status */ 878 #define A_SRT3 0x77 879 880 /* I2S1 Sample Rate Tracker Status */ 881 #define A_SRT4 0x78 882 883 /* I2S2 Sample Rate Tracker Status */ 884 #define A_SRT5 0x79 1013 /* unclear if this sets the ADC rate as well. */ 1014 #endif 1015 #define A_I2S_CAPTURE_48000 0x0 1016 #define A_I2S_CAPTURE_192000 0x1 1017 #define A_I2S_CAPTURE_96000 0x2 1018 #define A_I2S_CAPTURE_44100 0x4 1019 1020 #define A_EHC_SRC48_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */ 1021 #define A_EHC_SRC48_BYPASS 0x00000000 1022 #define A_EHC_SRC48_192 0x00002000 1023 #define A_EHC_SRC48_96 0x00004000 1024 #define A_EHC_SRC48_44 0x00008000 1025 #define A_EHC_SRC48_MUTED 0x0000c000 1026 1027 #define A_EHC_P17V_TVM 0x00000001 /* Tank virtual memory mode */ 1028 #define A_EHC_P17V_SEL0_MASK 0x00030000 /* Aka A_EHC_P16V_PB_RATE; 00: 48, 01: 44.1, 10: 96, 11: 192 */ 1029 #define A_EHC_P17V_SEL1_MASK 0x000c0000 1030 #define A_EHC_P17V_SEL2_MASK 0x00300000 1031 #define A_EHC_P17V_SEL3_MASK 0x00c00000 1032 1033 #define A_EHC_ASYNC_BYPASS 0x80000000 1034 1035 #define A_SRT3 0x77 /* I2S0 Sample Rate Tracker Status */ 1036 #define A_SRT4 0x78 /* I2S1 Sample Rate Tracker Status */ 1037 #define A_SRT5 0x79 /* I2S2 Sample Rate Tracker Status */ 885 1038 /* - default to 0x01080000 on my audigy 2 ZS --rlrevell */ 886 1039 887 /* Tank Table DMA Address */ 888 #define A_TTDA 0x7a 889 /* Tank Table DMA Data */ 890 #define A_TTDD 0x7b 1040 #define A_SRT_ESTSAMPLERATE 0x001fffff 1041 #define A_SRT_RATELOCKED 0x01000000 1042 1043 #define A_TTDA 0x7a /* Tank Table DMA Address */ 1044 #define A_TTDD 0x7b /* Tank Table DMA Data */ 1045 1046 // In A_FXRT1 & A_FXRT2, the 0x80 bit of each byte completely disables the 1047 // filter (CVCF_CURRENTFILTER) for the corresponding channel. There is no 1048 // effect on the volume (CVCF_CURRENTVOLUME) or the interpolator's filter 1049 // (CCCA_INTERPROM_MASK). 891 1050 892 1051 #define A_FXRT2 0x7c … … 901 1060 #define A_FXSENDAMOUNT_G_MASK 0x0000FF00 902 1061 #define A_FXSENDAMOUNT_H_MASK 0x000000FF 903 /* 0x7c, 0x7e "high bit is used for filtering" */ 904 1062 905 1063 /* The send amounts for this one are the same as used with the emu10k1 */ 906 1064 #define A_FXRT1 0x7e … … 911 1069 912 1070 /* 0x7f: Not used */ 913 /* Each FX general purpose register is 32 bits in length, all bits are used */ 914 #define FXGPREGBASE 0x100 /* FX general purpose registers base */ 915 #define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ 916 917 #define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */ 918 #define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */ 919 920 /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ 921 /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ 922 /* locations are for external TRAM. */ 923 #define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */ 924 #define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */ 925 926 /* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */ 927 #define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */ 928 #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ 929 #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ 930 #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ 931 #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ 932 #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ 933 934 #define MICROCODEBASE 0x400 /* Microcode data base address */ 1071 1072 /* The public header defines the GPR and TRAM base addresses that 1073 * are valid for _both_ CPU and DSP addressing. */ 935 1074 936 1075 /* Each DSP microcode instruction is mapped into 2 doublewords */ 937 1076 /* NOTE: When writing, always write the LO doubleword first. Reads can be in either order. */ 938 #define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */ 939 #define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */ 940 #define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */ 941 #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ 942 #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ 943 944 945 /* Audigy Soundcard have a different instruction format */ 1077 #define MICROCODEBASE 0x400 /* Microcode data base address */ 946 1078 #define A_MICROCODEBASE 0x600 947 #define A_LOWORD_OPY_MASK 0x000007ff 948 #define A_LOWORD_OPX_MASK 0x007ff000 949 #define A_HIWORD_OPCODE_MASK 0x0f000000 950 #define A_HIWORD_RESULT_MASK 0x007ff000 951 #define A_HIWORD_OPA_MASK 0x000007ff 1079 952 1080 953 1081 /************************************************************************************************/ 954 /* E MU1010m HANA FPGA registers*/1082 /* E-MU Digital Audio System overview */ 955 1083 /************************************************************************************************/ 1084 1085 // - These cards use a regular PCI-attached Audigy chip (Alice2/Tina/Tina2); 1086 // the PCIe variants simply put the Audigy chip behind a PCI bridge. 1087 // - All physical PCM I/O is routed through an additional FPGA; the regular 1088 // EXTIN/EXTOUT ports are unconnected. 1089 // - The FPGA has a signal routing matrix, to connect each destination (output 1090 // socket or capture channel) to a source (input socket or playback channel). 1091 // - The FPGA is controlled via Audigy's GPIO port, while sample data is 1092 // transmitted via proprietary EMU32 serial links. On first-generation 1093 // E-MU 1010 cards, Audigy's I2S inputs are also used for sample data. 1094 // - The Audio/Micro Dock is attached to Hana via EDI, a "network" link. 1095 // - The Audigy chip operates in slave mode; the clock is supplied by the FPGA. 1096 // Gen1 E-MU 1010 cards have two crystals (for 44.1 kHz and 48 kHz multiples), 1097 // while the later cards use a single crystal and a PLL chip. 1098 // - The whole card is switched to 2x/4x mode to achieve 88.2/96/176.4/192 kHz 1099 // sample rates. Alice2/Tina keeps running at 44.1/48 kHz, but multiple channels 1100 // are bundled. 1101 // - The number of available EMU32/EDI channels is hit in 2x/4x mode, so the total 1102 // number of usable inputs/outputs is limited, esp. with ADAT in use. 1103 // - S/PDIF is unavailable in 4x mode (only over TOSLINK on newer 1010 cards) due 1104 // to being unspecified at 176.4/192 kHz. Therefore, the Dock's S/PDIF channels 1105 // can overlap with the Dock's ADC/DAC's high channels. 1106 // - The code names are mentioned below and in the emu_chip_details table. 1107 1108 /************************************************************************************************/ 1109 /* EMU1010 FPGA registers */ 1110 /************************************************************************************************/ 1111 956 1112 #define EMU_HANA_DESTHI 0x00 /* 0000xxx 3 bits Link Destination */ 957 1113 #define EMU_HANA_DESTLO 0x01 /* 00xxxxx 5 bits */ 1114 958 1115 #define EMU_HANA_SRCHI 0x02 /* 0000xxx 3 bits Link Source */ 959 1116 #define EMU_HANA_SRCLO 0x03 /* 00xxxxx 5 bits */ 1117 960 1118 #define EMU_HANA_DOCK_PWR 0x04 /* 000000x 1 bits Audio Dock power */ 961 1119 #define EMU_HANA_DOCK_PWR_ON 0x01 /* Audio Dock power on */ 1120 962 1121 #define EMU_HANA_WCLOCK 0x05 /* 0000xxx 3 bits Word Clock source select */ 963 1122 /* Must be written after power on to reset DLL */ … … 968 1127 #define EMU_HANA_WCLOCK_HANA_SPDIF_IN 0x02 969 1128 #define EMU_HANA_WCLOCK_HANA_ADAT_IN 0x03 970 #define EMU_HANA_WCLOCK_SYNC_BNC N0x041129 #define EMU_HANA_WCLOCK_SYNC_BNC 0x04 971 1130 #define EMU_HANA_WCLOCK_2ND_HANA 0x05 972 1131 #define EMU_HANA_WCLOCK_SRC_RESERVED 0x06 … … 978 1137 #define EMU_HANA_WCLOCK_MULT_RESERVED 0x18 979 1138 1139 // If the selected external clock source is/becomes invalid or incompatible 1140 // with the clock multiplier, the clock source is reset to this value, and 1141 // a WCLK_CHANGED interrupt is raised. 980 1142 #define EMU_HANA_DEFCLOCK 0x06 /* 000000x 1 bits Default Word Clock */ 981 1143 #define EMU_HANA_DEFCLOCK_48K 0x00 … … 997 1159 998 1160 #define EMU_HANA_SPDIF_MODE 0x0a /* 00xxxxx 5 bits SPDIF MODE */ 999 #define EMU_HANA_SPDIF_MODE_TX_CO MSUMER 0x001161 #define EMU_HANA_SPDIF_MODE_TX_CONSUMER 0x00 1000 1162 #define EMU_HANA_SPDIF_MODE_TX_PRO 0x01 1001 1163 #define EMU_HANA_SPDIF_MODE_TX_NOCOPY 0x02 1002 #define EMU_HANA_SPDIF_MODE_RX_CO MSUMER 0x001164 #define EMU_HANA_SPDIF_MODE_RX_CONSUMER 0x00 1003 1165 #define EMU_HANA_SPDIF_MODE_RX_PRO 0x04 1004 1166 #define EMU_HANA_SPDIF_MODE_RX_NOCOPY 0x08 … … 1012 1174 1013 1175 #define EMU_HANA_MIDI_IN 0x0c /* 000000x 1 bit Control MIDI */ 1014 #define EMU_HANA_MIDI_IN_FROM_HAMOA 0x00 /* HAMOA MIDI in to Alice 2 MIDI B */ 1015 #define EMU_HANA_MIDI_IN_FROM_DOCK 0x01 /* Audio Dock MIDI in to Alice 2 MIDI B */ 1176 #define EMU_HANA_MIDI_INA_FROM_HAMOA 0x01 /* HAMOA MIDI in to Alice 2 MIDI A */ 1177 #define EMU_HANA_MIDI_INA_FROM_DOCK1 0x02 /* Audio Dock-1 MIDI in to Alice 2 MIDI A */ 1178 #define EMU_HANA_MIDI_INA_FROM_DOCK2 0x03 /* Audio Dock-2 MIDI in to Alice 2 MIDI A */ 1179 #define EMU_HANA_MIDI_INB_FROM_HAMOA 0x08 /* HAMOA MIDI in to Alice 2 MIDI B */ 1180 #define EMU_HANA_MIDI_INB_FROM_DOCK1 0x10 /* Audio Dock-1 MIDI in to Alice 2 MIDI B */ 1181 #define EMU_HANA_MIDI_INB_FROM_DOCK2 0x18 /* Audio Dock-2 MIDI in to Alice 2 MIDI B */ 1016 1182 1017 1183 #define EMU_HANA_DOCK_LEDS_1 0x0d /* 000xxxx 4 bit Audio Dock LEDs */ … … 1038 1204 1039 1205 #define EMU_HANA_ADC_PADS 0x10 /* 0000xxx 3 bit Audio Dock ADC 14dB pads */ 1040 #define EMU_HANA_DOCK_ADC_PAD1 0x01 /* 14dB Attenuation on Audio Dock ADC 1 */1041 #define EMU_HANA_DOCK_ADC_PAD2 0x02 /* 14dB Attenuation on Audio Dock ADC 2 */1042 #define EMU_HANA_DOCK_ADC_PAD3 0x04 /* 14dB Attenuation on Audio Dock ADC 3 */1043 #define EMU_HANA_0202_ADC_PAD1 0x08 /* 14dB Attenuation on 0202 ADC 1 */1206 #define EMU_HANA_DOCK_ADC_PAD1 0x01 /* 14dB Attenuation on Audio Dock ADC 1 */ 1207 #define EMU_HANA_DOCK_ADC_PAD2 0x02 /* 14dB Attenuation on Audio Dock ADC 2 */ 1208 #define EMU_HANA_DOCK_ADC_PAD3 0x04 /* 14dB Attenuation on Audio Dock ADC 3 */ 1209 #define EMU_HANA_0202_ADC_PAD1 0x08 /* 14dB Attenuation on 0202 ADC 1 */ 1044 1210 1045 1211 #define EMU_HANA_DOCK_MISC 0x11 /* 0xxxxxx 6 bit Audio Dock misc bits */ 1046 #define EMU_HANA_DOCK_DAC1_MUTE 0x01 /* DAC 1 Mute */1047 #define EMU_HANA_DOCK_DAC2_MUTE 0x02 /* DAC 2 Mute */1048 #define EMU_HANA_DOCK_DAC3_MUTE 0x04 /* DAC 3 Mute */1049 #define EMU_HANA_DOCK_DAC4_MUTE 0x08 /* DAC 4 Mute */1212 #define EMU_HANA_DOCK_DAC1_MUTE 0x01 /* DAC 1 Mute */ 1213 #define EMU_HANA_DOCK_DAC2_MUTE 0x02 /* DAC 2 Mute */ 1214 #define EMU_HANA_DOCK_DAC3_MUTE 0x04 /* DAC 3 Mute */ 1215 #define EMU_HANA_DOCK_DAC4_MUTE 0x08 /* DAC 4 Mute */ 1050 1216 #define EMU_HANA_DOCK_PHONES_192_DAC1 0x00 /* DAC 1 Headphones source at 192kHz */ 1051 1217 #define EMU_HANA_DOCK_PHONES_192_DAC2 0x10 /* DAC 2 Headphones source at 192kHz */ … … 1054 1220 1055 1221 #define EMU_HANA_MIDI_OUT 0x12 /* 00xxxxx 5 bit Source for each MIDI out port */ 1056 #define EMU_HANA_MIDI_OUT_0202 0x01 /* 0202 MIDI from Alice 2. 0 = A, 1 = B */1057 #define EMU_HANA_MIDI_OUT_DOCK1 0x02 /* Audio Dock MIDI1 front, from Alice 2. 0 = A, 1 = B */1058 #define EMU_HANA_MIDI_OUT_DOCK2 0x04 /* Audio Dock MIDI2 rear, from Alice 2. 0 = A, 1 = B */1059 #define EMU_HANA_MIDI_OUT_SYNC2 0x08 /* Sync card. Not the actual MIDI out jack. 0 = A, 1 = B */1060 #define EMU_HANA_MIDI_OUT_LOOP 0x10 /* 0 = bits (3:0) normal. 1 = MIDI loopback enabled. */1222 #define EMU_HANA_MIDI_OUT_0202 0x01 /* 0202 MIDI from Alice 2. 0 = A, 1 = B */ 1223 #define EMU_HANA_MIDI_OUT_DOCK1 0x02 /* Audio Dock MIDI1 front, from Alice 2. 0 = A, 1 = B */ 1224 #define EMU_HANA_MIDI_OUT_DOCK2 0x04 /* Audio Dock MIDI2 rear, from Alice 2. 0 = A, 1 = B */ 1225 #define EMU_HANA_MIDI_OUT_SYNC2 0x08 /* Sync card. Not the actual MIDI out jack. 0 = A, 1 = B */ 1226 #define EMU_HANA_MIDI_OUT_LOOP 0x10 /* 0 = bits (3:0) normal. 1 = MIDI loopback enabled. */ 1061 1227 1062 1228 #define EMU_HANA_DAC_PADS 0x13 /* 00xxxxx 5 bit DAC 14dB attenuation pads */ 1063 #define EMU_HANA_DOCK_DAC_PAD1 0x01 /* 14dB Attenuation on AudioDock DAC 1. Left and Right */1064 #define EMU_HANA_DOCK_DAC_PAD2 0x02 /* 14dB Attenuation on AudioDock DAC 2. Left and Right */1065 #define EMU_HANA_DOCK_DAC_PAD3 0x04 /* 14dB Attenuation on AudioDock DAC 3. Left and Right */1066 #define EMU_HANA_DOCK_DAC_PAD4 0x08 /* 14dB Attenuation on AudioDock DAC 4. Left and Right */1067 #define EMU_HANA_0202_DAC_PAD1 0x10 /* 14dB Attenuation on 0202 DAC 1. Left and Right */1229 #define EMU_HANA_DOCK_DAC_PAD1 0x01 /* 14dB Attenuation on AudioDock DAC 1. Left and Right */ 1230 #define EMU_HANA_DOCK_DAC_PAD2 0x02 /* 14dB Attenuation on AudioDock DAC 2. Left and Right */ 1231 #define EMU_HANA_DOCK_DAC_PAD3 0x04 /* 14dB Attenuation on AudioDock DAC 3. Left and Right */ 1232 #define EMU_HANA_DOCK_DAC_PAD4 0x08 /* 14dB Attenuation on AudioDock DAC 4. Left and Right */ 1233 #define EMU_HANA_0202_DAC_PAD1 0x10 /* 14dB Attenuation on 0202 DAC 1. Left and Right */ 1068 1234 1069 1235 /* 0x14 - 0x1f Unused R/W registers */ 1070 #define EMU_HANA_IRQ_STATUS 0x20 /* 000xxxx 4 bits IRQ Status */ 1071 #if 0 /* Already defined for reg 0x09 IRQ_ENABLE */ 1072 #define EMU_HANA_IRQ_WCLK_CHANGED 0x01 1073 #define EMU_HANA_IRQ_ADAT 0x02 1074 #define EMU_HANA_IRQ_DOCK 0x04 1075 #define EMU_HANA_IRQ_DOCK_LOST 0x08 1076 #endif 1236 1237 #define EMU_HANA_IRQ_STATUS 0x20 /* 00xxxxx 5 bits IRQ Status */ 1238 /* Same bits as for EMU_HANA_IRQ_ENABLE */ 1239 /* Reading the register resets it. */ 1077 1240 1078 1241 #define EMU_HANA_OPTION_CARDS 0x21 /* 000xxxx 4 bits Presence of option cards */ 1079 #define EMU_HANA_OPTION_HAMOA 0x01 /* HAMOA card present */ 1080 #define EMU_HANA_OPTION_SYNC 0x02 /* Sync card present */ 1081 #define EMU_HANA_OPTION_DOCK_ONLINE 0x04 /* Audio Dock online and FPGA configured */ 1082 #define EMU_HANA_OPTION_DOCK_OFFLINE 0x08 /* Audio Dock online and FPGA not configured */ 1083 1084 #define EMU_HANA_ID 0x22 /* 1010101 7 bits ID byte & 0x7f = 0x55 */ 1242 #define EMU_HANA_OPTION_HAMOA 0x01 /* Hamoa (analog I/O) card present */ 1243 #define EMU_HANA_OPTION_SYNC 0x02 /* Sync card present */ 1244 #define EMU_HANA_OPTION_DOCK_ONLINE 0x04 /* Audio/Micro dock present and FPGA configured */ 1245 #define EMU_HANA_OPTION_DOCK_OFFLINE 0x08 /* Audio/Micro dock present and FPGA not configured */ 1246 1247 #define EMU_HANA_ID 0x22 /* 1010101 7 bits ID byte & 0x7f = 0x55 with Alice2 */ 1248 /* 0010101 5 bits ID byte & 0x1f = 0x15 with Tina/2 */ 1085 1249 1086 1250 #define EMU_HANA_MAJOR_REV 0x23 /* 0000xxx 3 bit Hana FPGA Major rev */ … … 1091 1255 1092 1256 #define EMU_DOCK_BOARD_ID 0x27 /* 00000xx 2 bits Audio Dock ID pins */ 1093 #define EMU_DOCK_BOARD_ID0 0x00 /* ID bit 0 */ 1094 #define EMU_DOCK_BOARD_ID1 0x03 /* ID bit 1 */ 1257 #define EMU_DOCK_BOARD_ID0 0x00 /* ID bit 0 */ 1258 #define EMU_DOCK_BOARD_ID1 0x03 /* ID bit 1 */ 1259 1260 // The actual code disagrees about the bit width of the registers - 1261 // the formula used is freq = 0x1770000 / (((X_HI << 5) | X_LO) + 1) 1095 1262 1096 1263 #define EMU_HANA_WC_SPDIF_HI 0x28 /* 0xxxxxx 6 bit SPDIF IN Word clock, upper 6 bits */ … … 1105 1272 #define EMU_HANA2_WC_SPDIF_HI 0x2e /* 0xxxxxx 6 bit HANA2 SPDIF IN Word clock, upper 6 bits */ 1106 1273 #define EMU_HANA2_WC_SPDIF_LO 0x2f /* 0xxxxxx 6 bit HANA2 SPDIF IN Word clock, lower 6 bits */ 1274 1107 1275 /* 0x30 - 0x3f Unused Read only registers */ 1108 1276 1277 // The meaning of this is not clear; kX-project just calls it "lock" in some info-only code. 1278 #define EMU_HANA_LOCK_STS_LO 0x38 /* 0xxxxxx lower 6 bits */ 1279 #define EMU_HANA_LOCK_STS_HI 0x39 /* 0xxxxxx upper 6 bits */ 1280 1109 1281 /************************************************************************************************/ 1110 /* EMU1010 m HANADestinations */1282 /* EMU1010 Audio Destinations */ 1111 1283 /************************************************************************************************/ 1112 /* Hana, original 1010,1212,1820 using Alice2 1113 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz 1284 /* Hana, original 1010,1212m,1820[m] using Alice2 1114 1285 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2 1115 * 0x01, 0x 10-0x1f: 32 Elinkchannels to Audio Dock1116 * 0x01,0x00: Dock DAC 1 Left1117 * 0x01,0x04: Dock DAC 1 Right1118 * 0x01,0x08: Dock DAC 2 Left1119 * 0x01,0x0c: Dock DAC 2 Right1120 * 0x01,0x10: Dock DAC 3 Left1121 * 0x01, 0x12: PHONES Left1122 * 0x01,0x14: Dock DAC 3 Right1123 * 0x01, 0x16: PHONES Right1124 * 0x01,0x18: Dock DAC 4 Left1125 * 0x01,0x1a: S/PDIF Left1126 * 0x01,0x1c: Dock DAC 4 Right1127 * 0x01,0x1e: S/PDIF Right1286 * 0x01, 0x00-0x1f: 32 EDI channels to Audio Dock 1287 * 0x00: Dock DAC 1 Left 1288 * 0x04: Dock DAC 1 Right 1289 * 0x08: Dock DAC 2 Left 1290 * 0x0c: Dock DAC 2 Right 1291 * 0x10: Dock DAC 3 Left 1292 * 0x12: PHONES Left (n/a in 2x/4x mode; output mirrors DAC4 Left) 1293 * 0x14: Dock DAC 3 Right 1294 * 0x16: PHONES Right (n/a in 2x/4x mode; output mirrors DAC4 Right) 1295 * 0x18: Dock DAC 4 Left 1296 * 0x1a: S/PDIF Left 1297 * 0x1c: Dock DAC 4 Right 1298 * 0x1e: S/PDIF Right 1128 1299 * 0x02, 0x00: Hana S/PDIF Left 1129 1300 * 0x02, 0x01: Hana S/PDIF Right 1130 * 0x03, 0x00: Ha noa DAC Left1131 * 0x03, 0x01: Ha noa DAC Right1301 * 0x03, 0x00: Hamoa DAC Left 1302 * 0x03, 0x01: Hamoa DAC Right 1132 1303 * 0x04, 0x00-0x07: Hana ADAT 1133 1304 * 0x05, 0x00: I2S0 Left to Alice2 … … 1141 1312 * Not needed. 1142 1313 * 1143 * Hana3, rev2 1010,1212,1616 using Tina 1144 * Destinations for SRATEX = 1X rates: 44.1 kHz or 48 kHz 1314 * Hana3, rev2 1010,1212m,1616[m] using Tina 1145 1315 * 0x00, 0x00-0x0f: 16 EMU32A channels to Tina 1146 * 0x01, 0x 10-0x1f: 32 EDI channels to Micro Dock1147 * 0x01,0x00: Dock DAC 1 Left1148 * 0x01,0x04: Dock DAC 1 Right1149 * 0x01,0x08: Dock DAC 2 Left1150 * 0x01,0x0c: Dock DAC 2 Right1151 * 0x01,0x10: Dock DAC 3 Left1152 * 0x01,0x12: Dock S/PDIF Left1153 * 0x01,0x14: Dock DAC 3 Right1154 * 0x01,0x16: Dock S/PDIF Right1155 * 0x01,0x18-0x1f: Dock ADAT 0-71316 * 0x01, 0x00-0x1f: 32 EDI channels to Micro Dock 1317 * 0x00: Dock DAC 1 Left 1318 * 0x04: Dock DAC 1 Right 1319 * 0x08: Dock DAC 2 Left 1320 * 0x0c: Dock DAC 2 Right 1321 * 0x10: Dock DAC 3 Left 1322 * 0x12: Dock S/PDIF Left 1323 * 0x14: Dock DAC 3 Right 1324 * 0x16: Dock S/PDIF Right 1325 * 0x18-0x1f: Dock ADAT 0-7 1156 1326 * 0x02, 0x00: Hana3 S/PDIF Left 1157 1327 * 0x02, 0x01: Hana3 S/PDIF Right 1158 * 0x03, 0x00: Ha noa DAC Left1159 * 0x03, 0x01: Ha noa DAC Right1328 * 0x03, 0x00: Hamoa DAC Left 1329 * 0x03, 0x01: Hamoa DAC Right 1160 1330 * 0x04, 0x00-0x07: Hana3 ADAT 0-7 1161 1331 * 0x05, 0x00-0x0f: 16 EMU32B channels to Tina … … 1163 1333 * 1164 1334 * HanaLite, rev1 0404 using Alice2 1165 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz 1166 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2 1167 * 0x01: Not used 1168 * 0x02, 0x00: S/PDIF Left 1169 * 0x02, 0x01: S/PDIF Right 1170 * 0x03, 0x00: DAC Left 1171 * 0x03, 0x01: DAC Right 1172 * 0x04-0x07: Not used 1173 * 1174 * HanaLiteLite, rev2 0404 using Alice2 1175 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz 1176 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2 1335 * HanaLiteLite, rev2 0404 using Tina 1336 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2/Tina 1177 1337 * 0x01: Not used 1178 1338 * 0x02, 0x00: S/PDIF Left … … 1183 1343 * 1184 1344 * Mana, Cardbus 1616 using Tina2 1185 * Destinations for SRATEX = 1X rates: 44.1 kHz or 48 kHz1186 1345 * 0x00, 0x00-0x0f: 16 EMU32A channels to Tina2 1187 * 0x01, 0x10-0x1f: 32 EDI channels to Micro Dock 1188 * 0x01, 0x00: Dock DAC 1 Left 1189 * 0x01, 0x04: Dock DAC 1 Right 1190 * 0x01, 0x08: Dock DAC 2 Left 1191 * 0x01, 0x0c: Dock DAC 2 Right 1192 * 0x01, 0x10: Dock DAC 3 Left 1193 * 0x01, 0x12: Dock S/PDIF Left 1194 * 0x01, 0x14: Dock DAC 3 Right 1195 * 0x01, 0x16: Dock S/PDIF Right 1196 * 0x01, 0x18-0x1f: Dock ADAT 0-7 1346 * 0x01, 0x00-0x1f: 32 EDI channels to Micro Dock 1347 * (same as rev2 1010) 1197 1348 * 0x02: Not used 1198 1349 * 0x03, 0x00: Mana DAC Left … … 1200 1351 * 0x04, 0x00-0x0f: 16 EMU32B channels to Tina2 1201 1352 * 0x05-0x07: Not used 1202 *1203 *1204 1353 */ 1354 1205 1355 /* 32-bit destinations of signal in the Hana FPGA. Destinations are either 1206 * physical outputs of Hana, or outputs going to Alice2 (audigy) for capture 1207 * - 16 x EMU_DST_ALICE2_EMU32_X. 1208 */ 1209 /* EMU32 = 32-bit serial channel between Alice2 (audigy) and Hana (FPGA) */ 1210 /* EMU_DST_ALICE2_EMU32_X - data channels from Hana to Alice2 used for capture. 1211 * Which data is fed into a EMU_DST_ALICE2_EMU32_X channel in Hana depends on 1212 * setup of mixer control for each destination - see emumixer.c - 1213 * snd_emu1010_output_enum_ctls[], snd_emu1010_input_enum_ctls[] 1356 * physical outputs of Hana, or outputs going to Alice2/Tina for capture - 1357 * 16 x EMU_DST_ALICE2_EMU32_X (2x on rev2 boards). Which data is fed into 1358 * a channel depends on the mixer control setting for each destination - see 1359 * the register arrays in emumixer.c. 1214 1360 */ 1215 1361 #define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1362 /* This channel is delayed by one sample. */ 1216 1363 #define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1217 1364 #define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */ … … 1271 1418 #define EMU_DST_HANA_SPDIF_LEFT1 0x0200 /* Hana SPDIF Left, 1st or 48kHz only */ 1272 1419 #define EMU_DST_HANA_SPDIF_LEFT2 0x0202 /* Hana SPDIF Left, 2nd or 96kHz */ 1420 #define EMU_DST_HANA_SPDIF_LEFT3 0x0204 /* Hana SPDIF Left, 3rd or 192kHz */ 1421 #define EMU_DST_HANA_SPDIF_LEFT4 0x0206 /* Hana SPDIF Left, 4th or 192kHz */ 1273 1422 #define EMU_DST_HANA_SPDIF_RIGHT1 0x0201 /* Hana SPDIF Right, 1st or 48kHz only */ 1274 1423 #define EMU_DST_HANA_SPDIF_RIGHT2 0x0203 /* Hana SPDIF Right, 2nd or 96kHz */ 1424 #define EMU_DST_HANA_SPDIF_RIGHT3 0x0205 /* Hana SPDIF Right, 3rd or 192kHz */ 1425 #define EMU_DST_HANA_SPDIF_RIGHT4 0x0207 /* Hana SPDIF Right, 4th or 192kHz */ 1275 1426 #define EMU_DST_HAMOA_DAC_LEFT1 0x0300 /* Hamoa DAC Left, 1st or 48kHz only */ 1276 1427 #define EMU_DST_HAMOA_DAC_LEFT2 0x0302 /* Hamoa DAC Left, 2nd or 96kHz */ … … 1281 1432 #define EMU_DST_HAMOA_DAC_RIGHT3 0x0305 /* Hamoa DAC Right, 3rd or 192kHz */ 1282 1433 #define EMU_DST_HAMOA_DAC_RIGHT4 0x0307 /* Hamoa DAC Right, 4th or 192kHz */ 1434 // In S/MUX mode, the samples of one channel are adjacent. 1283 1435 #define EMU_DST_HANA_ADAT 0x0400 /* Hana ADAT 8 channel out +0 to +7 */ 1284 1436 #define EMU_DST_ALICE_I2S0_LEFT 0x0500 /* Alice2 I2S0 Left */ … … 1290 1442 1291 1443 /* Additional destinations for 1616(M)/Microdock */ 1292 /* Microdock S/PDIF OUT Left, 1st or 48kHz only */ 1293 #define EMU_DST_MDOCK_SPDIF_LEFT1 0x0112 1294 /* Microdock S/PDIF OUT Left, 2nd or 96kHz */ 1295 #define EMU_DST_MDOCK_SPDIF_LEFT2 0x0113 1296 /* Microdock S/PDIF OUT Right, 1st or 48kHz only */ 1297 #define EMU_DST_MDOCK_SPDIF_RIGHT1 0x0116 1298 /* Microdock S/PDIF OUT Right, 2nd or 96kHz */ 1299 #define EMU_DST_MDOCK_SPDIF_RIGHT2 0x0117 1300 /* Microdock S/PDIF ADAT 8 channel out +8 to +f */ 1301 #define EMU_DST_MDOCK_ADAT 0x0118 1302 1303 /* Headphone jack on 1010 cardbus? 44.1/48kHz only? */ 1304 #define EMU_DST_MANA_DAC_LEFT 0x0300 1305 /* Headphone jack on 1010 cardbus? 44.1/48kHz only? */ 1306 #define EMU_DST_MANA_DAC_RIGHT 0x0301 1444 1445 #define EMU_DST_MDOCK_SPDIF_LEFT1 0x0112 /* Microdock S/PDIF OUT Left, 1st or 48kHz only */ 1446 #define EMU_DST_MDOCK_SPDIF_LEFT2 0x0113 /* Microdock S/PDIF OUT Left, 2nd or 96kHz */ 1447 #define EMU_DST_MDOCK_SPDIF_RIGHT1 0x0116 /* Microdock S/PDIF OUT Right, 1st or 48kHz only */ 1448 #define EMU_DST_MDOCK_SPDIF_RIGHT2 0x0117 /* Microdock S/PDIF OUT Right, 2nd or 96kHz */ 1449 #define EMU_DST_MDOCK_ADAT 0x0118 /* Microdock S/PDIF ADAT 8 channel out +8 to +f */ 1450 1451 #define EMU_DST_MANA_DAC_LEFT 0x0300 /* Headphone jack on 1010 cardbus? 44.1/48kHz only? */ 1452 #define EMU_DST_MANA_DAC_RIGHT 0x0301 /* Headphone jack on 1010 cardbus? 44.1/48kHz only? */ 1307 1453 1308 1454 /************************************************************************************************/ 1309 /* EMU1010 m HANASources */1455 /* EMU1010 Audio Sources */ 1310 1456 /************************************************************************************************/ 1311 /* Hana, original 1010,1212,1820 using Alice2 1312 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz 1313 * 0x00,0x00-0x1f: Silence 1314 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock 1315 * 0x01, 0x00: Dock Mic A 1316 * 0x01, 0x04: Dock Mic B 1317 * 0x01, 0x08: Dock ADC 1 Left 1318 * 0x01, 0x0c: Dock ADC 1 Right 1319 * 0x01, 0x10: Dock ADC 2 Left 1320 * 0x01, 0x14: Dock ADC 2 Right 1321 * 0x01, 0x18: Dock ADC 3 Left 1322 * 0x01, 0x1c: Dock ADC 3 Right 1323 * 0x02, 0x00: Hana ADC Left 1324 * 0x02, 0x01: Hana ADC Right 1457 /* Hana, original 1010,1212m,1820[m] using Alice2 1458 * 0x00, 0x00-0x1f: Silence 1459 * 0x01, 0x00-0x1f: 32 EDI channels from Audio Dock 1460 * 0x00: Dock Mic A 1461 * 0x04: Dock Mic B 1462 * 0x08: Dock ADC 1 Left 1463 * 0x0c: Dock ADC 1 Right 1464 * 0x10: Dock ADC 2 Left 1465 * 0x14: Dock ADC 2 Right 1466 * 0x18: Dock ADC 3 Left 1467 * 0x1c: Dock ADC 3 Right 1468 * 0x02, 0x00: Hamoa ADC Left 1469 * 0x02, 0x01: Hamoa ADC Right 1325 1470 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output 1326 1471 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output … … 1333 1478 * Not needed. 1334 1479 * 1335 * Hana3, rev2 1010,1212,1616 using Tina 1336 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz 1337 * 0x00,0x00-0x1f: Silence 1338 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock 1339 * 0x01, 0x00: Dock Mic A 1340 * 0x01, 0x04: Dock Mic B 1341 * 0x01, 0x08: Dock ADC 1 Left 1342 * 0x01, 0x0c: Dock ADC 1 Right 1343 * 0x01, 0x10: Dock ADC 2 Left 1344 * 0x01, 0x12: Dock S/PDIF Left 1345 * 0x01, 0x14: Dock ADC 2 Right 1346 * 0x01, 0x16: Dock S/PDIF Right 1347 * 0x01, 0x18-0x1f: Dock ADAT 0-7 1348 * 0x01, 0x18: Dock ADC 3 Left 1349 * 0x01, 0x1c: Dock ADC 3 Right 1350 * 0x02, 0x00: Hanoa ADC Left 1351 * 0x02, 0x01: Hanoa ADC Right 1480 * Hana3, rev2 1010,1212m,1616[m] using Tina 1481 * 0x00, 0x00-0x1f: Silence 1482 * 0x01, 0x00-0x1f: 32 EDI channels from Micro Dock 1483 * 0x00: Dock Mic A 1484 * 0x04: Dock Mic B 1485 * 0x08: Dock ADC 1 Left 1486 * 0x0c: Dock ADC 1 Right 1487 * 0x10: Dock ADC 2 Left 1488 * 0x12: Dock S/PDIF Left 1489 * 0x14: Dock ADC 2 Right 1490 * 0x16: Dock S/PDIF Right 1491 * 0x18-0x1f: Dock ADAT 0-7 1492 * 0x02, 0x00: Hamoa ADC Left 1493 * 0x02, 0x01: Hamoa ADC Right 1352 1494 * 0x03, 0x00-0x0f: 16 inputs from Tina Emu32A output 1353 1495 * 0x03, 0x10-0x1f: 16 inputs from Tina Emu32B output … … 1358 1500 * 1359 1501 * HanaLite, rev1 0404 using Alice2 1360 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz1361 * 0x00, 0x00-0x1f: Silence1502 * HanaLiteLite, rev2 0404 using Tina 1503 * 0x00, 0x00-0x1f: Silence 1362 1504 * 0x01: Not used 1363 1505 * 0x02, 0x00: ADC Left 1364 1506 * 0x02, 0x01: ADC Right 1365 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output 1366 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output 1367 * 0x04: Not used 1368 * 0x05, 0x00: S/PDIF Left 1369 * 0x05, 0x01: S/PDIF Right 1370 * 0x06-0x07: Not used 1371 * 1372 * HanaLiteLite, rev2 0404 using Alice2 1373 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz 1374 * 0x00,0x00-0x1f: Silence 1375 * 0x01: Not used 1376 * 0x02, 0x00: ADC Left 1377 * 0x02, 0x01: ADC Right 1378 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output 1379 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output 1507 * 0x03, 0x00-0x0f: 16 inputs from Alice2/Tina Emu32A output 1508 * 0x03, 0x10-0x1f: 16 inputs from Alice2/Tina Emu32B output 1380 1509 * 0x04: Not used 1381 1510 * 0x05, 0x00: S/PDIF Left … … 1384 1513 * 1385 1514 * Mana, Cardbus 1616 using Tina2 1386 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz 1387 * 0x00,0x00-0x1f: Silence 1388 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock 1389 * 0x01, 0x00: Dock Mic A 1390 * 0x01, 0x04: Dock Mic B 1391 * 0x01, 0x08: Dock ADC 1 Left 1392 * 0x01, 0x0c: Dock ADC 1 Right 1393 * 0x01, 0x10: Dock ADC 2 Left 1394 * 0x01, 0x12: Dock S/PDIF Left 1395 * 0x01, 0x14: Dock ADC 2 Right 1396 * 0x01, 0x16: Dock S/PDIF Right 1397 * 0x01, 0x18-0x1f: Dock ADAT 0-7 1398 * 0x01, 0x18: Dock ADC 3 Left 1399 * 0x01, 0x1c: Dock ADC 3 Right 1515 * 0x00, 0x00-0x1f: Silence 1516 * 0x01, 0x00-0x1f: 32 EDI channels from Micro Dock 1517 * (same as rev2 1010) 1400 1518 * 0x02: Not used 1401 * 0x03, 0x00-0x0f: 16 inputs from Tina Emu32A output1402 * 0x03, 0x10-0x1f: 16 inputs from Tina Emu32B output1519 * 0x03, 0x00-0x0f: 16 inputs from Tina2 Emu32A output 1520 * 0x03, 0x10-0x1f: 16 inputs from Tina2 Emu32B output 1403 1521 * 0x04-0x07: Not used 1404 *1405 1522 */ 1406 1523 1407 1524 /* 32-bit sources of signal in the Hana FPGA. The sources are routed to 1408 * destinations using mixer control for each destination - see emumixer.c 1409 * Sources are either physical inputs of FPGA, 1410 * or outputs from Alice (audigy) - 16 x EMU_SRC_ALICE_EMU32A + 1411 * 16 x EMU_SRC_ALICE_EMU32B 1525 * destinations using a mixer control for each destination - see emumixer.c. 1526 * Sources are either physical inputs of Hana, or inputs from Alice2/Tina - 1527 * 16 x EMU_SRC_ALICE_EMU32A + 16 x EMU_SRC_ALICE_EMU32B. 1412 1528 */ 1413 1529 #define EMU_SRC_SILENCE 0x0000 /* Silence */ … … 1454 1570 #define EMU_SRC_ALICE_EMU32A 0x0300 /* Alice2 EMU32a 16 outputs. +0 to +0xf */ 1455 1571 #define EMU_SRC_ALICE_EMU32B 0x0310 /* Alice2 EMU32b 16 outputs. +0 to +0xf */ 1572 // In S/MUX mode, the samples of one channel are adjacent. 1456 1573 #define EMU_SRC_HANA_ADAT 0x0400 /* Hana ADAT 8 channel in +0 to +7 */ 1457 1574 #define EMU_SRC_HANA_SPDIF_LEFT1 0x0500 /* Hana SPDIF Left, 1st or 48kHz only */ 1458 1575 #define EMU_SRC_HANA_SPDIF_LEFT2 0x0502 /* Hana SPDIF Left, 2nd or 96kHz */ 1576 #define EMU_SRC_HANA_SPDIF_LEFT3 0x0504 /* Hana SPDIF Left, 3rd or 192kHz */ 1577 #define EMU_SRC_HANA_SPDIF_LEFT4 0x0506 /* Hana SPDIF Left, 4th or 192kHz */ 1459 1578 #define EMU_SRC_HANA_SPDIF_RIGHT1 0x0501 /* Hana SPDIF Right, 1st or 48kHz only */ 1460 1579 #define EMU_SRC_HANA_SPDIF_RIGHT2 0x0503 /* Hana SPDIF Right, 2nd or 96kHz */ 1580 #define EMU_SRC_HANA_SPDIF_RIGHT3 0x0505 /* Hana SPDIF Right, 3rd or 192kHz */ 1581 #define EMU_SRC_HANA_SPDIF_RIGHT4 0x0507 /* Hana SPDIF Right, 4th or 192kHz */ 1461 1582 1462 1583 /* Additional inputs for 1616(M)/Microdock */ 1463 /* Microdock S/PDIF Left, 1st or 48kHz only */ 1464 #define EMU_SRC_MDOCK_SPDIF_LEFT1 0x0112 1465 /* Microdock S/PDIF Left, 2nd or 96kHz */ 1466 #define EMU_SRC_MDOCK_SPDIF_LEFT2 0x0113 1467 /* Microdock S/PDIF Right, 1st or 48kHz only */ 1468 #define EMU_SRC_MDOCK_SPDIF_RIGHT1 0x0116 1469 /* Microdock S/PDIF Right, 2nd or 96kHz */ 1470 #define EMU_SRC_MDOCK_SPDIF_RIGHT2 0x0117 1471 /* Microdock ADAT 8 channel in +8 to +f */ 1472 #define EMU_SRC_MDOCK_ADAT 0x0118 1584 1585 #define EMU_SRC_MDOCK_SPDIF_LEFT1 0x0112 /* Microdock S/PDIF Left, 1st or 48kHz only */ 1586 #define EMU_SRC_MDOCK_SPDIF_LEFT2 0x0113 /* Microdock S/PDIF Left, 2nd or 96kHz */ 1587 #define EMU_SRC_MDOCK_SPDIF_RIGHT1 0x0116 /* Microdock S/PDIF Right, 1st or 48kHz only */ 1588 #define EMU_SRC_MDOCK_SPDIF_RIGHT2 0x0117 /* Microdock S/PDIF Right, 2nd or 96kHz */ 1589 #define EMU_SRC_MDOCK_ADAT 0x0118 /* Microdock ADAT 8 channel in +8 to +f */ 1473 1590 1474 1591 /* 0x600 and 0x700 no used */ 1475 1592 1593 1594 /* ------------------- CONSTANTS -------------------- */ 1595 1596 extern const char * const snd_emu10k1_fxbus[32]; 1597 extern const char * const snd_emu10k1_sblive_ins[16]; 1598 extern const char * const snd_emu10k1_audigy_ins[16]; 1599 extern const char * const snd_emu10k1_sblive_outs[32]; 1600 extern const char * const snd_emu10k1_audigy_outs[32]; 1601 extern const s8 snd_emu10k1_sblive51_fxbus2_map[16]; 1602 1476 1603 /* ------------------- STRUCTURES -------------------- */ 1477 1604 1478 1605 enum { 1606 EMU10K1_UNUSED, // This must be zero 1479 1607 EMU10K1_EFX, 1608 EMU10K1_EFX_IRQ, 1480 1609 EMU10K1_PCM, 1610 EMU10K1_PCM_IRQ, 1481 1611 EMU10K1_SYNTH, 1482 EMU10K1_ MIDI1612 EMU10K1_NUM_TYPES 1483 1613 }; 1484 1614 … … 1486 1616 1487 1617 struct snd_emu10k1_voice { 1488 struct snd_emu10k1 *emu; 1489 int number; 1490 unsigned int use: 1, 1491 pcm: 1, 1492 efx: 1, 1493 synth: 1, 1494 midi: 1; 1618 unsigned char number; 1619 unsigned char use; 1620 unsigned char dirty; 1621 unsigned char last; 1495 1622 void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice); 1496 1623 … … 1514 1641 unsigned short running; 1515 1642 unsigned short first_ptr; 1643 snd_pcm_uframes_t resume_pos; 1516 1644 struct snd_util_memblk *memblk; 1645 unsigned int pitch_target; 1517 1646 unsigned int start_addr; 1518 1647 unsigned int ccca_start_addr; … … 1532 1661 unsigned char send_routing[3][8]; 1533 1662 unsigned char send_volume[3][8]; 1663 // 0x8000 is neutral. The mixer code rescales it to 0xffff to maintain 1664 // backwards compatibility with user space. 1534 1665 unsigned short attn[3]; 1535 1666 struct snd_emu10k1_pcm *epcm; … … 1540 1671 1541 1672 #define snd_emu10k1_compose_audigy_fxrt1(route) \ 1542 ((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24) )1673 ((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24) | 0x80808080) 1543 1674 1544 1675 #define snd_emu10k1_compose_audigy_fxrt2(route) \ 1545 ((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24)) 1676 ((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24) | 0x80808080) 1677 1678 #define snd_emu10k1_compose_audigy_sendamounts(vol) \ 1679 (((unsigned int)vol[4] << 24) | ((unsigned int)vol[5] << 16) | ((unsigned int)vol[6] << 8) | (unsigned int)vol[7]) 1546 1680 1547 1681 struct snd_emu10k1_memblk { … … 1563 1697 unsigned int count; /* count of GPR (1..16) */ 1564 1698 unsigned short gpr[32]; /* GPR number(s) */ 1565 unsignedint value[32];1566 unsigned int min;/* minimum range */1567 unsigned int max;/* maximum range */1699 int value[32]; 1700 int min; /* minimum range */ 1701 int max; /* maximum range */ 1568 1702 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 1569 1703 struct snd_kcontrol *kcontrol; … … 1600 1734 1601 1735 struct snd_emu10k1_fx8010 { 1602 unsigned short fxbus_mask; /* used FX buses (bitmask) */ 1603 unsigned short extin_mask; /* used external inputs (bitmask) */ 1604 unsigned short extout_mask; /* used external outputs (bitmask) */ 1605 unsigned short pad1; 1736 unsigned short extin_mask; /* used external inputs (bitmask); not used for Audigy */ 1737 unsigned short extout_mask; /* used external outputs (bitmask); not used for Audigy */ 1606 1738 unsigned int itram_size; /* internal TRAM size in samples */ 1607 1739 struct snd_dma_buffer etram_pages; /* external TRAM pages and size */ … … 1640 1772 }; 1641 1773 1774 // Chip-o-logy: 1775 // - All SB Live! cards use EMU10K1 chips 1776 // - All SB Audigy cards use CA* chips, termed "emu10k2" by the driver 1777 // - Original Audigy uses CA0100 "Alice" 1778 // - Audigy 2 uses CA0102/CA10200 "Alice2" 1779 // - Has an interface for CA0151 (P16V) "Alice3" 1780 // - Audigy 2 Value uses CA0108/CA10300 "Tina" 1781 // - Approximately a CA0102 with an on-chip CA0151 (P17V) 1782 // - Audigy 2 ZS NB uses CA0109 "Tina2" 1783 // - Cardbus version of CA0108 1642 1784 struct snd_emu_chip_details { 1643 1785 u32 vendor; … … 1645 1787 u32 subsystem; 1646 1788 unsigned char revision; 1647 unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ 1648 unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ 1649 unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ 1650 unsigned char ca0108_chip; /* Audigy 2 Value */ 1651 unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook */ 1652 unsigned char ca0151_chip; /* P16V */ 1653 unsigned char spk71; /* Has 7.1 speakers */ 1654 unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ 1655 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1656 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1657 unsigned char ecard; /* APS EEPROM */ 1658 unsigned char emu_model; /* EMU model type */ 1659 unsigned char spi_dac; /* SPI interface for DAC */ 1660 unsigned char i2c_adc; /* I2C interface for ADC */ 1661 unsigned char adc_1361t; /* Use Philips 1361T ADC */ 1662 unsigned char invert_shared_spdif; /* analog/digital switch inverted */ 1789 unsigned char emu_model; /* EMU model type */ 1790 #ifndef TARGET_OS2 1791 unsigned int emu10k1_chip:1; /* Original SB Live. Not SB Live 24bit. */ 1792 /* Redundant with emu10k2_chip being unset. */ 1793 unsigned int emu10k2_chip:1; /* Audigy 1 or Audigy 2. */ 1794 unsigned int ca0102_chip:1; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ 1795 /* Redundant with ca0108_chip being unset. */ 1796 unsigned int ca0108_chip:1; /* Audigy 2 Value */ 1797 unsigned int ca_cardbus_chip:1; /* Audigy 2 ZS Notebook */ 1798 unsigned int ca0151_chip:1; /* P16V */ 1799 unsigned int spk20:1; /* Stereo only */ 1800 unsigned int spk71:1; /* Has 7.1 speakers */ 1801 unsigned int no_adat:1; /* Has no ADAT, only SPDIF */ 1802 unsigned int sblive51:1; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ 1803 unsigned int spdif_bug:1; /* Has Spdif phasing bug */ 1804 unsigned int ac97_chip:2; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1805 unsigned int ecard:1; /* APS EEPROM */ 1806 unsigned int spi_dac:1; /* SPI interface for DAC; requires ca0108_chip */ 1807 unsigned int i2c_adc:1; /* I2C interface for ADC; requires ca0108_chip */ 1808 unsigned int adc_1361t:1; /* Use Philips 1361T ADC */ 1809 unsigned int invert_shared_spdif:1; /* analog/digital switch inverted */ 1810 #else 1811 unsigned int emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ 1812 /* Redundant with emu10k2_chip being unset. */ 1813 unsigned int emu10k2_chip; /* Audigy 1 or Audigy 2. */ 1814 unsigned int ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ 1815 /* Redundant with ca0108_chip being unset. */ 1816 unsigned int ca0108_chip; /* Audigy 2 Value */ 1817 unsigned int ca_cardbus_chip; /* Audigy 2 ZS Notebook */ 1818 unsigned int ca0151_chip; /* P16V */ 1819 unsigned int spk20; /* Stereo only */ 1820 unsigned int spk71; /* Has 7.1 speakers */ 1821 unsigned int no_adat; /* Has no ADAT, only SPDIF */ 1822 unsigned int sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ 1823 unsigned int spdif_bug; /* Has Spdif phasing bug */ 1824 unsigned int ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1825 unsigned int ecard; /* APS EEPROM */ 1826 unsigned int spi_dac; /* SPI interface for DAC; requires ca0108_chip */ 1827 unsigned int i2c_adc; /* I2C interface for ADC; requires ca0108_chip */ 1828 unsigned int adc_1361t; /* Use Philips 1361T ADC */ 1829 unsigned int invert_shared_spdif; /* analog/digital switch inverted */ 1830 #endif 1663 1831 const char *driver; 1664 1832 const char *name; … … 1666 1834 }; 1667 1835 1836 #define NUM_OUTPUT_DESTS 28 1837 #define NUM_INPUT_DESTS 22 1838 1668 1839 struct snd_emu1010 { 1669 unsigned int output_source[64];1670 unsigned int input_source[64];1840 unsigned char output_source[NUM_OUTPUT_DESTS]; 1841 unsigned char input_source[NUM_INPUT_DESTS]; 1671 1842 unsigned int adc_pads; /* bit mask */ 1672 1843 unsigned int dac_pads; /* bit mask */ 1673 unsigned int internal_clock; /* 44100 or 48000 */ 1844 unsigned int wclock; /* Cached register value */ 1845 unsigned int word_clock; /* Cached effective value */ 1846 unsigned int clock_source; 1847 unsigned int clock_fallback; 1674 1848 unsigned int optical_in; /* 0:SPDIF, 1:ADAT */ 1675 1849 unsigned int optical_out; /* 0:SPDIF, 1:ADAT */ 1676 struct delayed_work firmware_work; 1677 u32 last_reg; 1850 struct work_struct work; 1678 1851 }; 1679 1852 … … 1692 1865 unsigned int serial; /* serial number */ 1693 1866 unsigned short model; /* subsystem id */ 1694 unsigned int card_type; /* EMU10K1_CARD_* */1695 1867 unsigned int ecard_ctrl; /* ecard control bits */ 1696 1868 unsigned int address_mode; /* address mode */ 1697 1869 unsigned long dma_mask; /* PCI DMA mask */ 1698 1870 bool iommu_workaround; /* IOMMU workaround needed */ 1699 unsigned int delay_pcm_irq; /* in samples */1700 1871 int max_cache_pages; /* max memory size / PAGE_SIZE */ 1701 1872 struct snd_dma_buffer silent_page; /* silent page */ … … 1733 1904 int (*get_synth_voice)(struct snd_emu10k1 *emu); 1734 1905 1735 spinlock_t reg_lock; 1736 spinlock_t emu_lock; 1737 spinlock_t voice_lock; 1906 spinlock_t reg_lock; // high-level driver lock 1907 spinlock_t emu_lock; // low-level i/o lock 1908 spinlock_t voice_lock; // voice allocator lock 1738 1909 spinlock_t spi_lock; /* serialises access to spi port */ 1739 1910 spinlock_t i2c_lock; /* serialises access to i2c port */ 1740 1911 1741 1912 struct snd_emu10k1_voice voices[NUM_G]; 1742 struct snd_emu10k1_voice p16v_voices[4];1743 struct snd_emu10k1_voice p16v_capture_voice;1744 1913 int p16v_device_offset; 1745 1914 u32 p16v_capture_source; … … 1754 1923 struct snd_kcontrol *ctl_efx_send_volume; 1755 1924 struct snd_kcontrol *ctl_efx_attn; 1925 struct snd_kcontrol *ctl_clock_source; 1756 1926 1757 1927 void (*hwvol_interrupt)(struct snd_emu10k1 *emu, unsigned int status); … … 1761 1931 void (*spdif_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1762 1932 void (*dsp_interrupt)(struct snd_emu10k1 *emu); 1933 void (*gpio_interrupt)(struct snd_emu10k1 *emu); 1934 void (*p16v_interrupt)(struct snd_emu10k1 *emu); 1763 1935 1764 1936 struct snd_pcm_substream *pcm_capture_substream; 1765 1937 struct snd_pcm_substream *pcm_capture_mic_substream; 1766 1938 struct snd_pcm_substream *pcm_capture_efx_substream; 1767 struct snd_pcm_substream *pcm_playback_efx_substream;1768 1939 1769 1940 struct snd_timer *timer; … … 1821 1992 unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn); 1822 1993 void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1994 void snd_emu10k1_ptr_write_multiple(struct snd_emu10k1 *emu, unsigned int chn, ...); 1823 1995 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn); 1824 1996 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1825 1997 int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data); 1826 1998 int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value); 1827 int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value); 1828 int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value); 1829 int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src); 1999 void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value); 2000 void snd_emu1010_fpga_read(struct snd_emu10k1 *emu, u32 reg, u32 *value); 2001 void snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 *emu, u32 dst, u32 src); 2002 u32 snd_emu1010_fpga_link_dst_src_read(struct snd_emu10k1 *emu, u32 dst); 2003 int snd_emu1010_get_raw_rate(struct snd_emu10k1 *emu, u8 src); 2004 void snd_emu1010_update_clock(struct snd_emu10k1 *emu); 1830 2005 unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc); 1831 2006 void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb); … … 1837 2012 void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum); 1838 2013 void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum); 2014 #if 0 1839 2015 void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum); 1840 2016 void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum); 2017 #endif 2018 void snd_emu10k1_voice_set_loop_stop_multiple(struct snd_emu10k1 *emu, u64 voices); 2019 void snd_emu10k1_voice_clear_loop_stop_multiple(struct snd_emu10k1 *emu, u64 voices); 2020 int snd_emu10k1_voice_clear_loop_stop_multiple_atomic(struct snd_emu10k1 *emu, u64 voices); 1841 2021 void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait); 1842 2022 static inline unsigned int snd_emu10k1_wc(struct snd_emu10k1 *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; } 1843 2023 unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg); 1844 2024 void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data); 1845 unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);1846 2025 1847 2026 #ifdef CONFIG_PM_SLEEP … … 1871 2050 1872 2051 /* voice allocation */ 1873 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int pair, struct snd_emu10k1_voice **rvoice); 2052 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int count, int channels, 2053 struct snd_emu10k1_pcm *epcm, struct snd_emu10k1_voice **rvoice); 1874 2054 int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice); 1875 2055 -
GPL/trunk/alsa-kernel/include/sound/emux_synth.h
r679 r772 55 55 int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2); 56 56 #endif 57 int (*get_pitch_shift)(struct snd_emux *emu); 57 58 }; 58 59 … … 83 84 int mem_size; /* memory size (in byte) */ 84 85 int num_ports; /* number of ports to be created */ 85 int pitch_shift; /* pitch shift value (for Emu10k1) */86 86 struct snd_emux_operators ops; /* operators */ 87 87 void *hw; /* hardware */ -
GPL/trunk/alsa-kernel/include/sound/hda_codec.h
r717 r772 19 19 #include <sound/hda_regmap.h> 20 20 21 #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)22 #define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)23 24 21 /* 25 22 * Structures … … 60 57 unsigned int bus_probing :1; /* during probing process */ 61 58 unsigned int keep_power:1; /* keep power up for notification */ 59 unsigned int jackpoll_in_suspend:1; /* keep jack polling during 60 * runtime suspend 61 */ 62 62 63 63 int primary_dig_out_type; /* primary digital out PCM type */ … … 229 229 unsigned int configured:1; /* codec was configured */ 230 230 unsigned int in_freeing:1; /* being released */ 231 unsigned int registered:1; /* codec was registered */232 231 unsigned int display_power_control:1; /* needs display power */ 233 232 unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each … … 257 256 unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ 258 257 unsigned int forced_resume:1; /* forced resume for jack */ 259 unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */ 258 unsigned int no_stream_clean_at_suspend:1; /* do not clean streams at suspend */ 259 unsigned int ctl_dev_id:1; /* old control element id build behaviour */ 260 260 261 261 #ifdef CONFIG_PM … … 292 292 #define hda_codec_dev(_dev) (&(_dev)->core.dev) 293 293 294 #define hdac_to_hda_priv(_hdac) \295 container_of(_hdac, struct hdac_hda_priv, codec.core)296 294 #define hdac_to_hda_codec(_hdac) container_of(_hdac, struct hda_codec, core) 297 295 … … 307 305 * constructors 308 306 */ 307 #ifndef TARGET_OS2 308 __printf(3, 4) 309 #endif 310 struct hda_codec * 311 snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr, 312 const char *fmt, ...); 309 313 int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card, 310 314 unsigned int codec_addr, struct hda_codec **codecp); 311 315 int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, 312 unsigned int codec_addr, struct hda_codec *codec); 316 unsigned int codec_addr, struct hda_codec *codec, 317 bool snddev_managed); 313 318 int snd_hda_codec_configure(struct hda_codec *codec); 314 319 int snd_hda_codec_update_widgets(struct hda_codec *codec); 320 void snd_hda_codec_register(struct hda_codec *codec); 321 void snd_hda_codec_unregister(struct hda_codec *codec); 322 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec); 315 323 316 324 /* … … 493 501 #define snd_hda_power_down_pm(codec) snd_hdac_power_down_pm(&(codec)->core) 494 502 #ifdef CONFIG_PM 503 void snd_hda_codec_set_power_save(struct hda_codec *codec, int delay); 495 504 void snd_hda_set_power_save(struct hda_bus *bus, int delay); 496 505 void snd_hda_update_power_acct(struct hda_codec *codec); 497 506 #else 507 static inline void snd_hda_codec_set_power_save(struct hda_codec *codec, int delay) {} 498 508 static inline void snd_hda_set_power_save(struct hda_bus *bus, int delay) {} 499 509 #endif -
GPL/trunk/alsa-kernel/include/sound/hda_register.h
r695 r772 259 259 #define AZX_ML_INTERVAL 0x40 260 260 261 /* HDaudio registers valid for HDaudio and HDaudio extended links */ 261 262 #define AZX_REG_ML_LCAP 0x00 263 264 #define AZX_ML_HDA_LCAP_ALT BIT(28) 265 #define AZX_ML_HDA_LCAP_ALT_HDA 0x0 266 #define AZX_ML_HDA_LCAP_ALT_HDA_EXT 0x1 267 268 #define AZX_ML_HDA_LCAP_INTC BIT(27) /* only used if ALT == 1 */ 269 #define AZX_ML_HDA_LCAP_OFLS BIT(26) /* only used if ALT == 1 */ 270 #define AZX_ML_HDA_LCAP_LSS BIT(23) /* only used if ALT == 1 */ 271 #define AZX_ML_HDA_LCAP_SLCOUNT GENMASK(22, 20) /* only used if ALT == 1 */ 272 262 273 #define AZX_REG_ML_LCTL 0x04 274 #define AZX_ML_LCTL_INTSTS BIT(31) /* only used if ALT == 1 */ 275 #define AZX_ML_LCTL_CPA BIT(23) 276 #define AZX_ML_LCTL_CPA_SHIFT 23 277 #define AZX_ML_LCTL_SPA BIT(16) 278 #define AZX_ML_LCTL_SPA_SHIFT 16 279 #define AZX_ML_LCTL_INTEN BIT(5) /* only used if ALT == 1 */ 280 #define AZX_ML_LCTL_OFLEN BIT(4) /* only used if ALT == 1 */ 281 #define AZX_ML_LCTL_SCF GENMASK(3, 0) /* only used if ALT == 0 */ 282 263 283 #define AZX_REG_ML_LOSIDV 0x08 284 285 /* bit0 is reserved, with BIT(1) mapping to stream1 */ 286 #define AZX_ML_LOSIDV_STREAM_MASK 0xFFFE 287 264 288 #define AZX_REG_ML_LSDIID 0x0C 289 #define AZX_REG_ML_LSDIID_OFFSET(x) (0x0C + (x) * 0x02) /* only used if ALT == 1 */ 290 291 /* HDaudio registers only valid if LCAP.ALT == 0 */ 265 292 #define AZX_REG_ML_LPSOO 0x10 266 293 #define AZX_REG_ML_LPSIO 0x12 … … 269 296 #define AZX_REG_ML_LINPAY 0x30 270 297 271 /* bit0 is reserved, with BIT(1) mapping to stream1 */ 272 #define ML_LOSIDV_STREAM_MASK 0xFFFE 273 274 #define ML_LCTL_SCF_MASK 0xF 275 #define AZX_MLCTL_SPA (0x1 << 16) 276 #define AZX_MLCTL_CPA (0x1 << 23) 277 #define AZX_MLCTL_SPA_SHIFT 16 278 #define AZX_MLCTL_CPA_SHIFT 23 298 /* HDaudio Extended link registers only valid if LCAP.ALT == 1 */ 299 #define AZX_REG_ML_LSYNC 0x1C 300 301 #define AZX_REG_ML_LSYNC_CMDSYNC BIT(24) 302 #define AZX_REG_ML_LSYNC_CMDSYNC_SHIFT 24 303 #define AZX_REG_ML_LSYNC_SYNCGO BIT(23) 304 #define AZX_REG_ML_LSYNC_SYNCPU BIT(20) 305 #define AZX_REG_ML_LSYNC_SYNCPRD GENMASK(19, 0) 306 307 #define AZX_REG_ML_LEPTR 0x20 308 309 #define AZX_REG_ML_LEPTR_ID GENMASK(31, 24) 310 #define AZX_REG_ML_LEPTR_ID_SHIFT 24 311 #define AZX_REG_ML_LEPTR_ID_SDW 0x00 312 #define AZX_REG_ML_LEPTR_ID_INTEL_SSP 0xC0 313 #define AZX_REG_ML_LEPTR_ID_INTEL_DMIC 0xC1 314 #define AZX_REG_ML_LEPTR_ID_INTEL_UAOL 0xC2 315 #define AZX_REG_ML_LEPTR_VER GENMASK(23, 20) 316 #define AZX_REG_ML_LEPTR_PTR GENMASK(19, 0) 279 317 280 318 /* registers for DMA Resume Capability Structure */ -
GPL/trunk/alsa-kernel/include/sound/hda_verbs.h
r679 r772 462 462 #define AC_DE_IA (1<<2) 463 463 464 /* device devicetypes (0x0-0xf) */464 /* device types (0x0-0xf) */ 465 465 enum { 466 466 AC_JACK_LINE_OUT, -
GPL/trunk/alsa-kernel/include/sound/hdaudio.h
r695 r772 10 10 #include <linux/interrupt.h> 11 11 #include <linux/io.h> 12 #include <linux/io-64-nonatomic-lo-hi.h> 13 #include <linux/iopoll.h> 14 #include <linux/pci.h> 12 15 #include <linux/pm_runtime.h> 13 16 #include <linux/timecounter.h> … … 93 96 bool caps_overwriting:1; /* caps overwrite being in process */ 94 97 bool cache_coef:1; /* cache COEF read/write too */ 98 unsigned int registered:1; /* codec was registered */ 95 99 }; 96 100 … … 121 125 void snd_hdac_device_unregister(struct hdac_device *codec); 122 126 int snd_hdac_device_set_chip_name(struct hdac_device *codec, const char *name); 123 int snd_hdac_codec_modalias( struct hdac_device *hdac, char *buf, size_t size);127 int snd_hdac_codec_modalias(const struct hdac_device *hdac, char *buf, size_t size); 124 128 125 129 int snd_hdac_refresh_widgets(struct hdac_device *codec); … … 356 360 bool polling_mode:1; 357 361 bool needs_damn_long_delay:1; 362 bool not_use_interrupts:1; /* prohibiting the RIRB IRQ */ 363 bool access_sdnctl_in_dword:1; /* accessing the sdnctl register by dword */ 358 364 359 365 int poll_count; … … 460 466 #define snd_hdac_reg_writel(bus, addr, val) writel(val, addr) 461 467 #define snd_hdac_reg_readl(bus, addr) readl(addr) 468 #define snd_hdac_reg_writeq(bus, addr, val) writeq(val, addr) 469 #define snd_hdac_reg_readq(bus, addr) readq(addr) 462 470 463 471 /* … … 502 510 (snd_hdac_chip_readb(chip, reg) & ~(mask)) | (val)) 503 511 512 /* update register macro */ 513 #define snd_hdac_updatel(addr, reg, mask, val) \ 514 writel(((readl(addr + reg) & ~(mask)) | (val)), addr + reg) 515 516 #define snd_hdac_updatew(addr, reg, mask, val) \ 517 writew(((readw(addr + reg) & ~(mask)) | (val)), addr + reg) 518 504 519 /* 505 520 * HD-audio stream … … 521 536 522 537 void __iomem *sd_addr; /* stream descriptor pointer */ 538 539 void __iomem *spib_addr; /* software position in buffers stream pointer */ 540 void __iomem *fifo_addr; /* software position Max fifos stream pointer */ 541 542 void __iomem *dpibr_addr; /* DMA position in buffer resume pointer */ 543 u32 dpib; /* DMA position in buffer */ 544 u32 lpib; /* Linear position in buffer */ 523 545 524 546 u32 sd_int_sta_mask; /* stream int status mask */ … … 561 583 struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus, 562 584 struct snd_pcm_substream *substream); 585 void snd_hdac_stream_release_locked(struct hdac_stream *azx_dev); 563 586 void snd_hdac_stream_release(struct hdac_stream *azx_dev); 564 587 struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus, … … 570 593 int snd_hdac_stream_set_params(struct hdac_stream *azx_dev, 571 594 unsigned int format_val); 572 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start); 573 void snd_hdac_stream_clear(struct hdac_stream *azx_dev); 595 void snd_hdac_stream_start(struct hdac_stream *azx_dev); 574 596 void snd_hdac_stream_stop(struct hdac_stream *azx_dev); 597 void snd_hdac_stop_streams(struct hdac_bus *bus); 598 void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus); 575 599 void snd_hdac_stream_reset(struct hdac_stream *azx_dev); 576 600 void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set, … … 582 606 int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus, 583 607 struct snd_pcm_substream *substream); 608 609 void snd_hdac_stream_spbcap_enable(struct hdac_bus *chip, 610 bool enable, int index); 611 int snd_hdac_stream_set_spib(struct hdac_bus *bus, 612 struct hdac_stream *azx_dev, u32 value); 613 int snd_hdac_stream_get_spbmaxfifo(struct hdac_bus *bus, 614 struct hdac_stream *azx_dev); 615 void snd_hdac_stream_drsm_enable(struct hdac_bus *bus, 616 bool enable, int index); 617 int snd_hdac_stream_wait_drsm(struct hdac_stream *azx_dev); 618 int snd_hdac_stream_set_dpibr(struct hdac_bus *bus, 619 struct hdac_stream *azx_dev, u32 value); 620 int snd_hdac_stream_set_lpib(struct hdac_stream *azx_dev, u32 value); 584 621 585 622 /* … … 599 636 #define snd_hdac_stream_readb(dev, reg) \ 600 637 snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 638 #define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \ 639 read_poll_timeout_atomic(snd_hdac_reg_readb, val, cond, delay_us, timeout_us, \ 640 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 641 #define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \ 642 read_poll_timeout_atomic(snd_hdac_reg_readl, val, cond, delay_us, timeout_us, \ 643 false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) 601 644 602 645 /* update a register, pass without AZX_REG_ prefix */ … … 677 720 (ptr) = snd_array_elem(array, ++(idx))) 678 721 722 /* 723 * Device matching 724 */ 725 726 #ifndef TARGET_OS2 727 #define HDA_CONTROLLER_IS_HSW(pci) (pci_match_id((struct pci_device_id []){ \ 728 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_0) }, \ 729 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_2) }, \ 730 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_3) }, \ 731 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_BDW) }, \ 732 { } \ 733 }, pci)) 734 735 #define HDA_CONTROLLER_IS_APL(pci) (pci_match_id((struct pci_device_id []){ \ 736 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_APL) }, \ 737 { } \ 738 }, pci)) 739 740 #define HDA_CONTROLLER_IN_GPU(pci) (pci_match_id((struct pci_device_id []){ \ 741 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG1) }, \ 742 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_0) }, \ 743 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_1) }, \ 744 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_2) }, \ 745 { } \ 746 }, pci) || HDA_CONTROLLER_IS_HSW(pci)) 747 #else 748 #define HDA_CONTROLLER_IS_HSW(pci) 0 749 #define HDA_CONTROLLER_IS_APL(pci) 0 750 #define HDA_CONTROLLER_IN_GPU(pci) 0 751 #endif 679 752 #endif /* __SOUND_HDAUDIO_H */ -
GPL/trunk/alsa-kernel/include/sound/hdaudio_ext.h
r717 r772 3 3 #define __SOUND_HDAUDIO_EXT_H 4 4 5 #include <linux/io-64-nonatomic-lo-hi.h> 6 #include <linux/iopoll.h> 5 7 #include <sound/hdaudio.h> 6 8 … … 10 12 11 13 void snd_hdac_ext_bus_exit(struct hdac_bus *bus); 12 int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,13 struct hdac_device *hdev, int type);14 void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);15 14 void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus); 16 15 … … 25 24 void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *chip, bool enable); 26 25 27 void snd_hdac_ext_stream_spbcap_enable(struct hdac_bus *chip,28 bool enable, int index);29 30 26 int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus); 31 struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus, 32 const char *codec_name); 27 struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr); 28 struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_name(struct hdac_bus *bus, 29 const char *codec_name); 33 30 34 31 enum hdac_ext_stream_type { … … 44 41 * @pphc_addr: processing pipe host stream pointer 45 42 * @pplc_addr: processing pipe link stream pointer 46 * @spib_addr: software position in buffers stream pointer47 * @fifo_addr: software position Max fifos stream pointer48 * @dpibr_addr: DMA position in buffer resume pointer49 * @dpib: DMA position in buffer50 * @lpib: Linear position in buffer51 43 * @decoupled: stream host and link is decoupled 52 44 * @link_locked: link is locked … … 60 52 void __iomem *pplc_addr; 61 53 62 void __iomem *spib_addr; 63 void __iomem *fifo_addr; 54 u32 pphcllpl; 55 u32 pphcllpu; 56 u32 pphcldpl; 57 u32 pphcldpu; 64 58 65 void __iomem *dpibr_addr;66 67 u32 dpib;68 u32 lpib;69 59 bool decoupled:1; 70 60 bool link_locked:1; … … 78 68 container_of(s, struct hdac_ext_stream, hstream) 79 69 80 void snd_hdac_ext_stream_init(struct hdac_bus *bus,81 struct hdac_ext_stream *stream, int idx,82 int direction, int tag);83 70 int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx, 84 int num_stream, int dir);85 void snd_hdac_ stream_free_all(struct hdac_bus *bus);86 void snd_hdac_ link_free_all(struct hdac_bus *bus);71 int num_stream, int dir); 72 void snd_hdac_ext_stream_free_all(struct hdac_bus *bus); 73 void snd_hdac_ext_link_free_all(struct hdac_bus *bus); 87 74 struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_bus *bus, 88 75 struct snd_pcm_substream *substream, 89 76 int type); 90 void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type); 77 void snd_hdac_ext_stream_release(struct hdac_ext_stream *hext_stream, int type); 78 struct hdac_ext_stream *snd_hdac_ext_cstream_assign(struct hdac_bus *bus, 79 struct snd_compr_stream *cstream); 91 80 void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus, 92 struct hdac_ext_stream *azx_dev, bool decouple);81 struct hdac_ext_stream *hext_stream, bool decouple); 93 82 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, 94 83 struct hdac_ext_stream *azx_dev, bool decouple); 95 void snd_hdac_ext_stop_streams(struct hdac_bus *bus);96 84 97 int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus, 98 struct hdac_ext_stream *stream, u32 value); 99 int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus, 100 struct hdac_ext_stream *stream); 101 void snd_hdac_ext_stream_drsm_enable(struct hdac_bus *bus, 102 bool enable, int index); 103 int snd_hdac_ext_stream_set_dpibr(struct hdac_bus *bus, 104 struct hdac_ext_stream *stream, u32 value); 105 int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value); 106 107 void snd_hdac_ext_link_stream_start(struct hdac_ext_stream *hstream); 108 void snd_hdac_ext_link_stream_clear(struct hdac_ext_stream *hstream); 109 void snd_hdac_ext_link_stream_reset(struct hdac_ext_stream *hstream); 110 int snd_hdac_ext_link_stream_setup(struct hdac_ext_stream *stream, int fmt); 85 void snd_hdac_ext_stream_start(struct hdac_ext_stream *hext_stream); 86 void snd_hdac_ext_stream_clear(struct hdac_ext_stream *hext_stream); 87 void snd_hdac_ext_stream_reset(struct hdac_ext_stream *hext_stream); 88 int snd_hdac_ext_stream_setup(struct hdac_ext_stream *hext_stream, int fmt); 111 89 112 90 struct hdac_ext_link { … … 122 100 }; 123 101 124 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link * link);125 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link * link);102 int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink); 103 int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink); 126 104 int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus); 127 105 int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus); 128 void snd_hdac_ext_ link_set_stream_id(struct hdac_ext_link *link,129 int stream);130 void snd_hdac_ext_ link_clear_stream_id(struct hdac_ext_link *link,131 int stream);106 void snd_hdac_ext_bus_link_set_stream_id(struct hdac_ext_link *hlink, 107 int stream); 108 void snd_hdac_ext_bus_link_clear_stream_id(struct hdac_ext_link *hlink, 109 int stream); 132 110 133 int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link * link);134 int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link * link);111 int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link *hlink); 112 int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *hlink); 135 113 136 114 void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable); 137 115 138 /* update register macro */ 139 #define snd_hdac_updatel(addr, reg, mask, val) \ 140 writel(((readl(addr + reg) & ~(mask)) | (val)), \ 141 addr + reg) 116 #define snd_hdac_adsp_writeb(chip, reg, value) \ 117 snd_hdac_reg_writeb(chip, (chip)->dsp_ba + (reg), value) 118 #define snd_hdac_adsp_readb(chip, reg) \ 119 snd_hdac_reg_readb(chip, (chip)->dsp_ba + (reg)) 120 #define snd_hdac_adsp_writew(chip, reg, value) \ 121 snd_hdac_reg_writew(chip, (chip)->dsp_ba + (reg), value) 122 #define snd_hdac_adsp_readw(chip, reg) \ 123 snd_hdac_reg_readw(chip, (chip)->dsp_ba + (reg)) 124 #define snd_hdac_adsp_writel(chip, reg, value) \ 125 snd_hdac_reg_writel(chip, (chip)->dsp_ba + (reg), value) 126 #define snd_hdac_adsp_readl(chip, reg) \ 127 snd_hdac_reg_readl(chip, (chip)->dsp_ba + (reg)) 128 #define snd_hdac_adsp_writeq(chip, reg, value) \ 129 snd_hdac_reg_writeq(chip, (chip)->dsp_ba + (reg), value) 130 #define snd_hdac_adsp_readq(chip, reg) \ 131 snd_hdac_reg_readq(chip, (chip)->dsp_ba + (reg)) 142 132 143 #define snd_hdac_updatew(addr, reg, mask, val) \ 144 writew(((readw(addr + reg) & ~(mask)) | (val)), \ 145 addr + reg) 133 #define snd_hdac_adsp_updateb(chip, reg, mask, val) \ 134 snd_hdac_adsp_writeb(chip, reg, \ 135 (snd_hdac_adsp_readb(chip, reg) & ~(mask)) | (val)) 136 #define snd_hdac_adsp_updatew(chip, reg, mask, val) \ 137 snd_hdac_adsp_writew(chip, reg, \ 138 (snd_hdac_adsp_readw(chip, reg) & ~(mask)) | (val)) 139 #define snd_hdac_adsp_updatel(chip, reg, mask, val) \ 140 snd_hdac_adsp_writel(chip, reg, \ 141 (snd_hdac_adsp_readl(chip, reg) & ~(mask)) | (val)) 142 #define snd_hdac_adsp_updateq(chip, reg, mask, val) \ 143 snd_hdac_adsp_writeq(chip, reg, \ 144 (snd_hdac_adsp_readq(chip, reg) & ~(mask)) | (val)) 146 145 146 #define snd_hdac_adsp_readb_poll(chip, reg, val, cond, delay_us, timeout_us) \ 147 readb_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ 148 delay_us, timeout_us) 149 #define snd_hdac_adsp_readw_poll(chip, reg, val, cond, delay_us, timeout_us) \ 150 readw_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ 151 delay_us, timeout_us) 152 #define snd_hdac_adsp_readl_poll(chip, reg, val, cond, delay_us, timeout_us) \ 153 readl_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ 154 delay_us, timeout_us) 155 #define snd_hdac_adsp_readq_poll(chip, reg, val, cond, delay_us, timeout_us) \ 156 readq_poll_timeout((chip)->dsp_ba + (reg), val, cond, \ 157 delay_us, timeout_us) 147 158 148 159 struct hdac_ext_device; -
GPL/trunk/alsa-kernel/include/sound/hdmi-codec.h
r703 r772 33 33 unsigned int bit_clk_inv:1; 34 34 unsigned int frame_clk_inv:1; 35 unsigned int bit_clk_ master:1;36 unsigned int frame_clk_ master:1;35 unsigned int bit_clk_provider:1; 36 unsigned int frame_clk_provider:1; 37 37 /* bit_fmt could be standard PCM format or 38 38 * IEC958 encoded format. ALSA IEC958 plugin will pass … … 125 125 const struct hdmi_codec_ops *ops; 126 126 uint i2s:1; 127 uint no_i2s_playback:1; 128 uint no_i2s_capture:1; 127 129 uint spdif:1; 130 uint no_spdif_playback:1; 131 uint no_spdif_capture:1; 128 132 int max_i2s_channels; 129 133 void *data; -
GPL/trunk/alsa-kernel/include/sound/hwdep.h
r679 r772 54 54 void *private_data; 55 55 void (*private_free) (struct snd_hwdep *hwdep); 56 struct device dev;56 struct device *dev; 57 57 58 58 struct mutex open_mutex; -
GPL/trunk/alsa-kernel/include/sound/info.h
r679 r772 123 123 struct snd_info_entry *parent); 124 124 void snd_info_free_entry(struct snd_info_entry *entry); 125 int snd_info_store_text(struct snd_info_entry *entry);126 int snd_info_restore_text(struct snd_info_entry *entry);127 125 128 126 int snd_info_card_create(struct snd_card *card); -
GPL/trunk/alsa-kernel/include/sound/intel-dsp-config.h
r695 r772 16 16 SND_INTEL_DSP_DRIVER_SST, 17 17 SND_INTEL_DSP_DRIVER_SOF, 18 SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF 18 SND_INTEL_DSP_DRIVER_AVS, 19 SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_AVS 19 20 }; 20 21 -
GPL/trunk/alsa-kernel/include/sound/intel-nhlt.h
r689 r772 11 11 #include <linux/acpi.h> 12 12 13 #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT) 13 enum nhlt_link_type { 14 NHLT_LINK_HDA = 0, 15 NHLT_LINK_DSP = 1, 16 NHLT_LINK_DMIC = 2, 17 NHLT_LINK_SSP = 3, 18 NHLT_LINK_INVALID 19 }; 20 21 enum nhlt_device_type { 22 NHLT_DEVICE_BT = 0, 23 NHLT_DEVICE_DMIC = 1, 24 NHLT_DEVICE_I2S = 4, 25 NHLT_DEVICE_INVALID 26 }; 14 27 15 28 struct wav_fmt { … … 33 46 u8 sub_fmt[16]; 34 47 } __packed; 35 36 enum nhlt_link_type {37 NHLT_LINK_HDA = 0,38 NHLT_LINK_DSP = 1,39 NHLT_LINK_DMIC = 2,40 NHLT_LINK_SSP = 3,41 NHLT_LINK_INVALID42 };43 44 enum nhlt_device_type {45 NHLT_DEVICE_BT = 0,46 NHLT_DEVICE_DMIC = 1,47 NHLT_DEVICE_I2S = 4,48 NHLT_DEVICE_INVALID49 };50 48 51 49 struct nhlt_specific_cfg { … … 127 125 }; 128 126 127 #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT) 128 129 129 struct nhlt_acpi_table *intel_nhlt_init(struct device *dev); 130 130 … … 133 133 int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt); 134 134 135 bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt, u8 link_type); 136 137 int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type); 138 139 int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num); 140 141 struct nhlt_specific_cfg * 142 intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, 143 u32 bus_id, u8 link_type, u8 vbps, u8 bps, 144 u8 num_ch, u32 rate, u8 dir, u8 dev_type); 145 135 146 #else 136 137 struct nhlt_acpi_table;138 147 139 148 static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev) … … 151 160 return 0; 152 161 } 162 163 static inline bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt, 164 u8 link_type) 165 { 166 return false; 167 } 168 169 static inline int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type) 170 { 171 return 0; 172 } 173 174 static inline int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num) 175 { 176 return 0; 177 } 178 179 static inline struct nhlt_specific_cfg * 180 intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, 181 u32 bus_id, u8 link_type, u8 vbps, u8 bps, 182 u8 num_ch, u32 rate, u8 dir, u8 dev_type) 183 { 184 return NULL; 185 } 186 153 187 #endif 154 188 -
GPL/trunk/alsa-kernel/include/sound/madera-pdata.h
r679 r772 10 10 #define MADERA_CODEC_PDATA_H 11 11 12 #include <linux/ kernel.h>12 #include <linux/types.h> 13 13 14 14 #define MADERA_MAX_INPUT 6 -
GPL/trunk/alsa-kernel/include/sound/memalloc.h
r717 r772 10 10 #define __SOUND_MEMALLOC_H 11 11 12 #include <linux/dma-direction.h> 12 13 #include <asm/page.h> 13 14 14 15 struct device; 15 16 struct vm_area_struct; 17 struct sg_table; 16 18 17 19 /* … … 20 22 struct snd_dma_device { 21 23 int type; /* SNDRV_DMA_TYPE_XXX */ 24 enum dma_data_direction dir; /* DMA direction */ 25 bool need_sync; /* explicit sync needed? */ 22 26 struct device *dev; /* generic device */ 23 27 }; 24 25 #define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x))26 27 28 28 29 /* … … 33 34 #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ 34 35 #define SNDRV_DMA_TYPE_DEV_WC 5 /* continuous write-combined */ 35 #ifdef CONFIG_SND_DMA_SGBUF36 #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */37 #define SNDRV_DMA_TYPE_DEV_WC_SG 6 /* SG write-combined */38 #else39 #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */40 #define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC41 #endif42 36 #ifdef CONFIG_GENERIC_ALLOCATOR 43 37 #define SNDRV_DMA_TYPE_DEV_IRAM 4 /* generic device iram-buffer */ … … 46 40 #endif 47 41 #define SNDRV_DMA_TYPE_VMALLOC 7 /* vmalloc'ed buffer */ 42 #define SNDRV_DMA_TYPE_NONCONTIG 8 /* non-coherent SG buffer */ 43 #define SNDRV_DMA_TYPE_NONCOHERENT 9 /* non-coherent buffer */ 44 #ifdef CONFIG_SND_DMA_SGBUF 45 #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_NONCONTIG 46 #define SNDRV_DMA_TYPE_DEV_WC_SG 6 /* SG write-combined */ 47 #else 48 #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ 49 #define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC 50 #endif 51 /* fallback types, don't use those directly */ 52 #ifdef CONFIG_SND_DMA_SGBUF 53 #define SNDRV_DMA_TYPE_DEV_SG_FALLBACK 10 54 #define SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK 11 55 #endif 48 56 49 57 /* … … 67 75 68 76 /* allocate/release a buffer */ 69 int snd_dma_alloc_pages(int type, struct device *dev, size_t size, 70 struct snd_dma_buffer *dmab); 77 int snd_dma_alloc_dir_pages(int type, struct device *dev, 78 enum dma_data_direction dir, size_t size, 79 struct snd_dma_buffer *dmab); 80 81 static inline int snd_dma_alloc_pages(int type, struct device *dev, 82 size_t size, struct snd_dma_buffer *dmab) 83 { 84 return snd_dma_alloc_dir_pages(type, dev, DMA_BIDIRECTIONAL, size, dmab); 85 } 86 71 87 int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size, 72 88 struct snd_dma_buffer *dmab); … … 74 90 int snd_dma_buffer_mmap(struct snd_dma_buffer *dmab, 75 91 struct vm_area_struct *area); 92 93 enum snd_dma_sync_mode { SNDRV_DMA_SYNC_CPU, SNDRV_DMA_SYNC_DEVICE }; 94 #ifdef CONFIG_HAS_DMA 95 void snd_dma_buffer_sync(struct snd_dma_buffer *dmab, 96 enum snd_dma_sync_mode mode); 97 #else 98 static inline void snd_dma_buffer_sync(struct snd_dma_buffer *dmab, 99 enum snd_dma_sync_mode mode) {} 100 #endif 76 101 77 102 dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, size_t offset); … … 81 106 82 107 /* device-managed memory allocator */ 83 struct snd_dma_buffer *snd_devm_alloc_pages(struct device *dev, int type, 84 size_t size); 108 struct snd_dma_buffer *snd_devm_alloc_dir_pages(struct device *dev, int type, 109 enum dma_data_direction dir, 110 size_t size); 111 112 static inline struct snd_dma_buffer * 113 snd_devm_alloc_pages(struct device *dev, int type, size_t size) 114 { 115 return snd_devm_alloc_dir_pages(dev, type, DMA_BIDIRECTIONAL, size); 116 } 117 118 static inline struct sg_table * 119 snd_dma_noncontig_sg_table(struct snd_dma_buffer *dmab) 120 { 121 return dmab->private_data; 122 } 123 85 124 #ifdef TARGET_OS2 86 125 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab); -
GPL/trunk/alsa-kernel/include/sound/pcm-indirect.h
r679 r772 45 45 diff += runtime->boundary; 46 46 if (diff < 0) 47 return -E INVAL;47 return -EPIPE; 48 48 rec->sw_ready += (int)frames_to_bytes(runtime, diff); 49 49 rec->appl_ptr = appl_ptr; … … 84 84 { 85 85 int bytes = ptr - rec->hw_io; 86 int err; 87 86 88 if (bytes < 0) 87 89 bytes += rec->hw_buffer_size; … … 91 93 if (rec->sw_io >= rec->sw_buffer_size) 92 94 rec->sw_io -= rec->sw_buffer_size; 93 if (substream->ops->ack) 94 substream->ops->ack(substream); 95 if (substream->ops->ack) { 96 err = substream->ops->ack(substream); 97 if (err == -EPIPE) 98 return SNDRV_PCM_POS_XRUN; 99 } 95 100 return bytes_to_frames(substream->runtime, rec->sw_io); 96 101 } … … 113 118 diff += runtime->boundary; 114 119 if (diff < 0) 115 return -E INVAL;120 return -EPIPE; 116 121 rec->sw_ready -= frames_to_bytes(runtime, diff); 117 122 rec->appl_ptr = appl_ptr; … … 153 158 int qsize; 154 159 int bytes = ptr - rec->hw_io; 160 int err; 161 155 162 if (bytes < 0) 156 163 bytes += rec->hw_buffer_size; … … 163 170 if (rec->sw_io >= rec->sw_buffer_size) 164 171 rec->sw_io -= rec->sw_buffer_size; 165 if (substream->ops->ack) 166 substream->ops->ack(substream); 172 if (substream->ops->ack) { 173 err = substream->ops->ack(substream); 174 if (err == -EPIPE) 175 return SNDRV_PCM_POS_XRUN; 176 } 167 177 return bytes_to_frames(substream->runtime, rec->sw_io); 168 178 } -
GPL/trunk/alsa-kernel/include/sound/pcm.h
r717 r772 17 17 #include <linux/pm_qos.h> 18 18 #include <linux/refcount.h> 19 #include <linux/uio.h> 19 20 20 21 #define snd_pcm_substream_chip(substream) ((substream)->private_data) … … 47 48 struct snd_pcm_status64; 48 49 struct snd_pcm_substream; 49 50 50 struct snd_pcm_audio_tstamp_config; /* definitions further down */ 51 51 struct snd_pcm_audio_tstamp_report; … … 69 69 int (*fill_silence)(struct snd_pcm_substream *substream, int channel, 70 70 unsigned long pos, unsigned long bytes); 71 int (*copy_user)(struct snd_pcm_substream *substream, int channel, 72 unsigned long pos, void __user *buf, 73 unsigned long bytes); 74 int (*copy_kernel)(struct snd_pcm_substream *substream, int channel, 75 unsigned long pos, void *buf, unsigned long bytes); 71 #ifndef TARGET_OS2 72 int (*copy)(struct snd_pcm_substream *substream, int channel, 73 unsigned long pos, struct iov_iter *iter, unsigned long bytes); 74 #else 75 int (*copy)(struct snd_pcm_substream *substream, int channel, 76 unsigned long pos, void *iter, unsigned long bytes); 77 #endif 76 78 struct page *(*page)(struct snd_pcm_substream *substream, 77 79 unsigned long offset); … … 107 109 108 110 /* If you change this don't forget to change rates[] table in pcm_native.c */ 109 #define SNDRV_PCM_RATE_5512 (1 <<0) /* 5512Hz */110 #define SNDRV_PCM_RATE_8000 (1 <<1) /* 8000Hz */111 #define SNDRV_PCM_RATE_11025 (1 <<2) /* 11025Hz */112 #define SNDRV_PCM_RATE_16000 (1 <<3) /* 16000Hz */113 #define SNDRV_PCM_RATE_22050 (1 <<4) /* 22050Hz */114 #define SNDRV_PCM_RATE_32000 (1 <<5) /* 32000Hz */115 #define SNDRV_PCM_RATE_44100 (1 <<6) /* 44100Hz */116 #define SNDRV_PCM_RATE_48000 (1 <<7) /* 48000Hz */117 #define SNDRV_PCM_RATE_64000 (1 <<8) /* 64000Hz */118 #define SNDRV_PCM_RATE_88200 (1 <<9) /* 88200Hz */119 #define SNDRV_PCM_RATE_96000 (1 <<10)/* 96000Hz */120 #define SNDRV_PCM_RATE_176400 (1 <<11)/* 176400Hz */121 #define SNDRV_PCM_RATE_192000 (1 <<12)/* 192000Hz */122 #define SNDRV_PCM_RATE_352800 (1 <<13)/* 352800Hz */123 #define SNDRV_PCM_RATE_384000 (1 <<14)/* 384000Hz */124 125 #define SNDRV_PCM_RATE_CONTINUOUS (1 <<30)/* continuous range */126 #define SNDRV_PCM_RATE_KNOT (1 <<31)/* supports more non-continuos rates */111 #define SNDRV_PCM_RATE_5512 (1U<<0) /* 5512Hz */ 112 #define SNDRV_PCM_RATE_8000 (1U<<1) /* 8000Hz */ 113 #define SNDRV_PCM_RATE_11025 (1U<<2) /* 11025Hz */ 114 #define SNDRV_PCM_RATE_16000 (1U<<3) /* 16000Hz */ 115 #define SNDRV_PCM_RATE_22050 (1U<<4) /* 22050Hz */ 116 #define SNDRV_PCM_RATE_32000 (1U<<5) /* 32000Hz */ 117 #define SNDRV_PCM_RATE_44100 (1U<<6) /* 44100Hz */ 118 #define SNDRV_PCM_RATE_48000 (1U<<7) /* 48000Hz */ 119 #define SNDRV_PCM_RATE_64000 (1U<<8) /* 64000Hz */ 120 #define SNDRV_PCM_RATE_88200 (1U<<9) /* 88200Hz */ 121 #define SNDRV_PCM_RATE_96000 (1U<<10) /* 96000Hz */ 122 #define SNDRV_PCM_RATE_176400 (1U<<11) /* 176400Hz */ 123 #define SNDRV_PCM_RATE_192000 (1U<<12) /* 192000Hz */ 124 #define SNDRV_PCM_RATE_352800 (1U<<13) /* 352800Hz */ 125 #define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */ 126 127 #define SNDRV_PCM_RATE_CONTINUOUS (1U<<30) /* continuous range */ 128 #define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuos rates */ 127 129 128 130 #define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\ … … 148 150 #define SNDRV_PCM_FMTBIT_U24_LE _SNDRV_PCM_FMTBIT(U24_LE) 149 151 #define SNDRV_PCM_FMTBIT_U24_BE _SNDRV_PCM_FMTBIT(U24_BE) 152 // For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the 153 // available bit count in most significant bit. It's for the case of so-called 'left-justified' or 154 // `right-padding` sample which has less width than 32 bit. 150 155 #define SNDRV_PCM_FMTBIT_S32_LE _SNDRV_PCM_FMTBIT(S32_LE) 151 156 #define SNDRV_PCM_FMTBIT_S32_BE _SNDRV_PCM_FMTBIT(S32_BE) … … 344 349 struct snd_pcm_runtime { 345 350 /* -- Status -- */ 351 snd_pcm_state_t state; /* stream state */ 352 snd_pcm_state_t suspended_state; /* suspended stream state */ 346 353 struct snd_pcm_substream *trigger_master; 347 354 struct timespec64 trigger_tstamp; /* trigger timestamp */ … … 374 381 unsigned int no_period_wakeup: 1; 375 382 376 /* -- SW params -- */377 int tstamp_mode; /* mmap timestamp is updated */383 /* -- SW params; see struct snd_pcm_sw_params for comments -- */ 384 int tstamp_mode; 378 385 unsigned int period_step; 379 386 snd_pcm_uframes_t start_threshold; 380 387 snd_pcm_uframes_t stop_threshold; 381 snd_pcm_uframes_t silence_threshold; /* Silence filling happens when382 noise is nearest than this */383 snd_pcm_uframes_t silence_size; /* Silence filling size */384 snd_pcm_uframes_t boundary; /* pointers wrap point */ 385 388 snd_pcm_uframes_t silence_threshold; 389 snd_pcm_uframes_t silence_size; 390 snd_pcm_uframes_t boundary; 391 392 /* internal data of auto-silencer */ 386 393 snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ 387 snd_pcm_uframes_t silence_filled; /* size filled with silence*/394 snd_pcm_uframes_t silence_filled; /* already filled part of silence area */ 388 395 389 396 union snd_pcm_sync_id sync; /* hardware synchronization ID */ … … 397 404 wait_queue_head_t sleep; /* poll sleep */ 398 405 wait_queue_head_t tsleep; /* transfer sleep */ 399 struct fasync_struct*fasync;406 struct snd_fasync *fasync; 400 407 bool stop_operating; /* sync_stop will be called */ 401 408 struct mutex buffer_mutex; /* protect for buffer changes */ … … 506 513 #endif 507 514 struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */ 508 struct device dev;515 struct device *dev; 509 516 }; 510 517 … … 605 612 * @substream: substream to check 606 613 * 607 * Return s true if the given substream is being linked with others.614 * Return: true if the given substream is being linked with others 608 615 */ 609 616 static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream) … … 617 624 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream); 618 625 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream); 626 unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream); 619 627 620 628 /** … … 643 651 644 652 /** 653 * snd_pcm_stream_lock_irqsave_nested - Single-nested PCM stream locking 654 * @substream: PCM substream 655 * @flags: irq flags 656 * 657 * This locks the PCM stream like snd_pcm_stream_lock_irqsave() but with 658 * the single-depth lockdep subclass. 659 */ 660 #define snd_pcm_stream_lock_irqsave_nested(substream, flags) \ 661 do { \ 662 typecheck(unsigned long, flags); \ 663 flags = _snd_pcm_stream_lock_irqsave_nested(substream); \ 664 } while (0) 665 666 /** 645 667 * snd_pcm_group_for_each_entry - iterate over the linked substreams 646 668 * @s: the iterator … … 663 685 * @substream: substream to check 664 686 * 665 * Return strue if the given substream is in the state RUNNING, or in the687 * Return: true if the given substream is in the state RUNNING, or in the 666 688 * state DRAINING for playback. 667 689 */ 668 690 static inline int snd_pcm_running(struct snd_pcm_substream *substream) 669 691 { 670 return (substream->runtime->stat us->state == SNDRV_PCM_STATE_RUNNING ||671 (substream->runtime->stat us->state == SNDRV_PCM_STATE_DRAINING &&692 return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING || 693 (substream->runtime->state == SNDRV_PCM_STATE_DRAINING && 672 694 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); 695 } 696 697 /** 698 * __snd_pcm_set_state - Change the current PCM state 699 * @runtime: PCM runtime to set 700 * @state: the current state to set 701 * 702 * Call within the stream lock 703 */ 704 static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime, 705 snd_pcm_state_t state) 706 { 707 runtime->state = state; 708 runtime->status->state = state; /* copy for mmap */ 673 709 } 674 710 … … 677 713 * @runtime: PCM runtime instance 678 714 * @size: size in bytes 715 * 716 * Return: the size in samples 679 717 */ 680 718 static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size) … … 687 725 * @runtime: PCM runtime instance 688 726 * @size: size in bytes 727 * 728 * Return: the size in frames 689 729 */ 690 730 static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size) … … 697 737 * @runtime: PCM runtime instance 698 738 * @size: size in samples 739 * 740 * Return: the byte size 699 741 */ 700 742 static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size) … … 707 749 * @runtime: PCM runtime instance 708 750 * @size: size in frames 751 * 752 * Return: the byte size 709 753 */ 710 754 static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size) … … 717 761 * @runtime: PCM runtime instance 718 762 * @bytes: size in bytes 763 * 764 * Return: true if aligned, or false if not 719 765 */ 720 766 static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes) … … 726 772 * snd_pcm_lib_buffer_bytes - Get the buffer size of the current PCM in bytes 727 773 * @substream: PCM substream 774 * 775 * Return: buffer byte size 728 776 */ 729 777 static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream) … … 736 784 * snd_pcm_lib_period_bytes - Get the period size of the current PCM in bytes 737 785 * @substream: PCM substream 786 * 787 * Return: period byte size 738 788 */ 739 789 static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream) … … 748 798 * 749 799 * Result is between 0 ... (boundary - 1) 800 * 801 * Return: available frame size 750 802 */ 751 803 static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime) … … 777 829 * 778 830 * Result is between 0 ... (boundary - 1) 831 * 832 * Return: available frame size 779 833 */ 780 834 static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime) … … 789 843 * snd_pcm_playback_hw_avail - Get the queued space for playback 790 844 * @runtime: PCM runtime instance 845 * 846 * Return: available frame size 791 847 */ 792 848 static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime) … … 798 854 * snd_pcm_capture_hw_avail - Get the free space for capture 799 855 * @runtime: PCM runtime instance 856 * 857 * Return: available frame size 800 858 */ 801 859 static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime) … … 937 995 * params_channels - Get the number of channels from the hw params 938 996 * @p: hw params 997 * 998 * Return: the number of channels 939 999 */ 940 1000 static inline unsigned int params_channels(const struct snd_pcm_hw_params *p) … … 946 1006 * params_rate - Get the sample rate from the hw params 947 1007 * @p: hw params 1008 * 1009 * Return: the sample rate 948 1010 */ 949 1011 static inline unsigned int params_rate(const struct snd_pcm_hw_params *p) … … 955 1017 * params_period_size - Get the period size (in frames) from the hw params 956 1018 * @p: hw params 1019 * 1020 * Return: the period size in frames 957 1021 */ 958 1022 static inline unsigned int params_period_size(const struct snd_pcm_hw_params *p) … … 964 1028 * params_periods - Get the number of periods from the hw params 965 1029 * @p: hw params 1030 * 1031 * Return: the number of periods 966 1032 */ 967 1033 static inline unsigned int params_periods(const struct snd_pcm_hw_params *p) … … 973 1039 * params_buffer_size - Get the buffer size (in frames) from the hw params 974 1040 * @p: hw params 1041 * 1042 * Return: the buffer size in frames 975 1043 */ 976 1044 static inline unsigned int params_buffer_size(const struct snd_pcm_hw_params *p) … … 982 1050 * params_buffer_bytes - Get the buffer size (in bytes) from the hw params 983 1051 * @p: hw params 1052 * 1053 * Return: the buffer size in bytes 984 1054 */ 985 1055 static inline unsigned int params_buffer_bytes(const struct snd_pcm_hw_params *p) … … 1244 1314 * allocation of a larger buffer unlike the standard one. 1245 1315 * The function may return -ENOMEM error, hence the caller must check it. 1316 * 1317 * Return: zero if successful, or a negative error code 1246 1318 */ 1247 1319 static inline int __must_check … … 1262 1334 * all substream. If any of allocation fails, it returns -ENOMEM, hence the 1263 1335 * caller must check the return value. 1336 * 1337 * Return: zero if successful, or a negative error code 1264 1338 */ 1265 1339 static inline int __must_check … … 1318 1392 * @substream: PCM substream 1319 1393 * @ofs: byte offset 1394 * 1395 * Return: DMA address 1320 1396 */ 1321 1397 static inline dma_addr_t … … 1331 1407 * @ofs: byte offset 1332 1408 * @size: byte size to examine 1409 * 1410 * Return: chunk size 1333 1411 */ 1334 1412 static inline unsigned int … … 1396 1474 1397 1475 /** 1398 * snd_pcm_ stream_str- Get a string naming the direction of a stream1399 * @ substream: the pcm substream instance1400 * 1401 * Return : Astring naming the direction of the stream.1402 */ 1403 static inline const char *snd_pcm_ stream_str(struct snd_pcm_substream *substream)1404 { 1405 if ( substream->stream== SNDRV_PCM_STREAM_PLAYBACK)1476 * snd_pcm_direction_name - Get a string naming the direction of a stream 1477 * @direction: Stream's direction, one of SNDRV_PCM_STREAM_XXX 1478 * 1479 * Returns a string naming the direction of the stream. 1480 */ 1481 static inline const char *snd_pcm_direction_name(int direction) 1482 { 1483 if (direction == SNDRV_PCM_STREAM_PLAYBACK) 1406 1484 return "Playback"; 1407 1485 else 1408 1486 return "Capture"; 1487 } 1488 1489 /** 1490 * snd_pcm_stream_str - Get a string naming the direction of a stream 1491 * @substream: the pcm substream instance 1492 * 1493 * Return: A string naming the direction of the stream. 1494 */ 1495 static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) 1496 { 1497 return snd_pcm_direction_name(substream->stream); 1409 1498 } 1410 1499 … … 1433 1522 * @info: chmap information 1434 1523 * @idx: the substream number index 1524 * 1525 * Return: the matched PCM substream, or NULL if not found 1435 1526 */ 1436 1527 static inline struct snd_pcm_substream * … … 1463 1554 * pcm_format_to_bits - Strong-typed conversion of pcm_format to bitwise 1464 1555 * @pcm_format: PCM format 1556 * 1557 * Return: 64bit mask corresponding to the given PCM format 1465 1558 */ 1466 1559 static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format) … … 1491 1584 int pcm_dbg(struct snd_pcm *dev, const char *fmt, ...); 1492 1585 #endif 1586 1587 /* helpers for copying between iov_iter and iomem */ 1588 int copy_to_iter_fromio(struct iov_iter *itert, const void __iomem *src, 1589 size_t count); 1590 int copy_from_iter_toio(void __iomem *dst, struct iov_iter *iter, size_t count); 1493 1591 1494 1592 struct snd_pcm_status64 { -
GPL/trunk/alsa-kernel/include/sound/pxa2xx-lib.h
r717 r772 53 53 extern void pxa2xx_ac97_hw_remove(struct platform_device *dev); 54 54 55 /* modem registers, used by touchscreen driver */ 56 u32 pxa2xx_ac97_read_modr(void); 57 u32 pxa2xx_ac97_read_misr(void); 58 55 59 #endif -
GPL/trunk/alsa-kernel/include/sound/rawmidi.h
r717 r772 19 19 #include <sound/seq_device.h> 20 20 #endif 21 #include <sound/info.h> 21 22 22 23 /* … … 48 49 void (*get_port_info)(struct snd_rawmidi *rmidi, int number, 49 50 struct snd_seq_port_info *info); 51 long (*ioctl)(struct snd_rawmidi *rmidi, unsigned int cmd, 52 void __user *argp); 53 void (*proc_read)(struct snd_info_entry *entry, 54 struct snd_info_buffer *buf); 50 55 }; 51 56 … … 62 67 size_t avail; /* max used buffer for wakeup */ 63 68 size_t xruns; /* over/underruns counter */ 69 size_t align; /* alignment (0 = byte stream, 3 = UMP) */ 64 70 int buffer_ref; /* buffer reference count */ 65 71 /* misc */ 66 spinlock_t lock;67 72 wait_queue_head_t sleep; 68 73 /* event handler (new bytes, input only) */ … … 86 91 int use_count; /* use counter (for output) */ 87 92 size_t bytes; 93 spinlock_t lock; 88 94 struct snd_rawmidi *rmidi; 89 95 struct snd_rawmidi_str *pstr; … … 130 136 wait_queue_head_t open_wait; 131 137 132 struct device dev;138 struct device *dev; 133 139 134 140 struct snd_info_entry *proc_entry; … … 147 153 const struct snd_rawmidi_ops *ops); 148 154 155 /* internal */ 156 int snd_rawmidi_init(struct snd_rawmidi *rmidi, 157 struct snd_card *card, char *id, int device, 158 int output_count, int input_count, 159 unsigned int info_flags); 160 int snd_rawmidi_free(struct snd_rawmidi *rmidi); 161 149 162 /* callbacks */ 150 163 … … 157 170 int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, 158 171 unsigned char *buffer, int count); 159 int __snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,160 unsigned char *buffer, int count);161 int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream,162 int count);163 172 int snd_rawmidi_proceed(struct snd_rawmidi_substream *substream); 164 173 … … 166 175 167 176 int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info); 168 int snd_rawmidi_kernel_open(struct snd_ card *card, int device, int subdevice,177 int snd_rawmidi_kernel_open(struct snd_rawmidi *rmidi, int subdevice, 169 178 int mode, struct snd_rawmidi_file *rfile); 170 179 int snd_rawmidi_kernel_release(struct snd_rawmidi_file *rfile); -
GPL/trunk/alsa-kernel/include/sound/rt5665.h
r679 r772 32 32 bool in4_diff; 33 33 34 int ldo1_en; /* GPIO for LDO1_EN */35 36 34 enum rt5665_dmic1_data_pin dmic1_data_pin; 37 35 enum rt5665_dmic2_data_pin dmic2_data_pin; -
GPL/trunk/alsa-kernel/include/sound/rt5668.h
r679 r772 26 26 27 27 struct rt5668_platform_data { 28 29 int ldo1_en; /* GPIO for LDO1_EN */30 31 28 enum rt5668_dmic1_data_pin dmic1_data_pin; 32 29 enum rt5668_dmic1_clk_pin dmic1_clk_pin; -
GPL/trunk/alsa-kernel/include/sound/rt5682.h
r695 r772 32 32 33 33 struct rt5682_platform_data { 34 35 int ldo1_en; /* GPIO for LDO1_EN */36 37 34 enum rt5682_dmic1_data_pin dmic1_data_pin; 38 35 enum rt5682_dmic1_clk_pin dmic1_clk_pin; -
GPL/trunk/alsa-kernel/include/sound/seq_device.h
r679 r772 79 79 #define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi" 80 80 #define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth" 81 #define SNDRV_SEQ_DEV_ID_UMP "seq-ump-client" 81 82 82 83 #endif /* __SOUND_SEQ_DEVICE_H */ -
GPL/trunk/alsa-kernel/include/sound/seq_kernel.h
r679 r772 73 73 int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf, 74 74 int in_kernel, int size_aligned); 75 int snd_seq_expand_var_event_at(const struct snd_seq_event *event, int count, 76 char *buf, int offset); 75 77 int snd_seq_dump_var_event(const struct snd_seq_event *event, 76 78 snd_seq_dump_func_t func, void *private_data); 79 80 /* size of the event packet; it can be greater than snd_seq_event size */ 81 static inline size_t snd_seq_event_packet_size(struct snd_seq_event *ev) 82 { 83 if (snd_seq_ev_is_ump(ev)) 84 return sizeof(struct snd_seq_ump_event); 85 return sizeof(struct snd_seq_event); 86 } 77 87 78 88 /* interface for OSS emulation */ -
GPL/trunk/alsa-kernel/include/sound/simple_card_utils.h
r695 r772 16 16 #define asoc_simple_init_mic(card, sjack, prefix) \ 17 17 asoc_simple_init_jack(card, sjack, 0, prefix, NULL) 18 19 struct asoc_simple_tdm_width_map { 20 u8 sample_bits; 21 u8 slot_count; 22 u16 slot_width; 23 }; 18 24 19 25 struct asoc_simple_dai { … … 26 32 unsigned int rx_slot_mask; 27 33 struct clk *clk; 34 bool clk_fixed; 35 struct asoc_simple_tdm_width_map *tdm_width_map; 36 int n_tdm_widths; 28 37 }; 29 38 … … 31 40 u32 convert_rate; 32 41 u32 convert_channels; 42 const char *convert_sample_format; 33 43 }; 34 44 … … 50 60 struct asoc_simple_dai *cpu_dai; 51 61 struct asoc_simple_dai *codec_dai; 52 struct snd_soc_dai_link_component *cpus;53 struct snd_soc_dai_link_component *codecs;54 struct snd_soc_dai_link_component *platforms;55 62 struct asoc_simple_data adata; 56 63 struct snd_soc_codec_conf *codec_conf; … … 60 67 struct asoc_simple_jack hp_jack; 61 68 struct asoc_simple_jack mic_jack; 69 struct snd_soc_jack *aux_jacks; 62 70 struct snd_soc_dai_link *dai_link; 63 71 struct asoc_simple_dai *dais; 64 72 struct snd_soc_dai_link_component *dlcs; 65 struct snd_soc_dai_link_component dummy;66 73 struct snd_soc_codec_conf *codec_conf; 67 74 struct gpio_desc *pa_gpio; … … 116 123 (i)++) 117 124 118 #define SNDRV_MAX_LINKS 128125 #define SNDRV_MAX_LINKS 512 119 126 120 127 struct link_info { … … 129 136 char *prefix, 130 137 unsigned int *retfmt); 138 int asoc_simple_parse_tdm_width_map(struct device *dev, struct device_node *np, 139 struct asoc_simple_dai *dai); 140 131 141 __printf(3, 4) 132 142 int asoc_simple_set_dailink_name(struct device *dev, … … 159 169 int is_single_links); 160 170 161 int asoc_simple_clean_reference(struct snd_soc_card *card); 162 163 void asoc_simple_convert_fixup(struct asoc_simple_data *data, 164 struct snd_pcm_hw_params *params); 171 void asoc_simple_clean_reference(struct snd_soc_card *card); 172 165 173 void asoc_simple_parse_convert(struct device_node *np, char *prefix, 166 174 struct asoc_simple_data *data); 175 bool asoc_simple_is_convert_required(const struct asoc_simple_data *data); 167 176 168 177 int asoc_simple_parse_routing(struct snd_soc_card *card, … … 176 185 struct asoc_simple_jack *sjack, 177 186 int is_hp, char *prefix, char *pin); 187 int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv, 188 char *prefix); 178 189 int asoc_simple_init_priv(struct asoc_simple_priv *priv, 179 190 struct link_info *li); … … 181 192 182 193 int asoc_graph_card_probe(struct snd_soc_card *card); 194 int asoc_graph_is_ports0(struct device_node *port); 195 int asoc_graph_parse_dai(struct device *dev, struct device_node *ep, 196 struct snd_soc_dai_link_component *dlc, int *is_single_link); 183 197 184 198 #ifdef DEBUG -
GPL/trunk/alsa-kernel/include/sound/soc-acpi-intel-match.h
r695 r772 15 15 * pdata or machine ops 16 16 */ 17 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[];18 17 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[]; 19 18 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[]; … … 31 30 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[]; 32 31 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[]; 32 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[]; 33 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[]; 34 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_machines[]; 35 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[]; 33 36 34 37 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_sdw_machines[]; … … 38 41 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[]; 39 42 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[]; 43 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[]; 44 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[]; 45 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[]; 46 extern struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[]; 40 47 41 48 /* -
GPL/trunk/alsa-kernel/include/sound/soc-acpi.h
r695 r772 10 10 #include <linux/acpi.h> 11 11 #include <linux/mod_devicetable.h> 12 #include <linux/soundwire/sdw.h> 12 13 13 14 struct snd_soc_acpi_package_context { … … 61 62 * @platform: string used for HDAudio codec support 62 63 * @codec_mask: used for HDAudio support 64 * @dmic_num: number of SoC- or chipset-attached PDM digital microphones 63 65 * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver 64 * @link_mask: links enabled on the board 65 * @links: array of link _ADR descriptors, null terminated 66 * @link_mask: SoundWire links enabled on the board 67 * @links: array of SoundWire link _ADR descriptors, null terminated 68 * @i2s_link_mask: I2S/TDM links enabled on the board 66 69 * @num_dai_drivers: number of elements in @dai_drivers 67 70 * @dai_drivers: pointer to dai_drivers, used e.g. in nocodec mode 71 * @subsystem_vendor: optional PCI SSID vendor value 72 * @subsystem_device: optional PCI SSID device value 73 * @subsystem_id_set: true if a value has been written to 74 * subsystem_vendor and subsystem_device. 68 75 */ 69 76 struct snd_soc_acpi_mach_params { … … 75 82 u32 link_mask; 76 83 const struct snd_soc_acpi_link_adr *links; 84 u32 i2s_link_mask; 77 85 u32 num_dai_drivers; 78 86 struct snd_soc_dai_driver *dai_drivers; 87 unsigned short subsystem_vendor; 88 unsigned short subsystem_device; 89 bool subsystem_id_set; 79 90 }; 80 91 … … 123 134 }; 124 135 136 /* 137 * when set the topology uses the -ssp<N> suffix, where N is determined based on 138 * BIOS or DMI information 139 */ 140 #define SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER BIT(0) 141 142 /* 143 * when more than one SSP is reported in the link mask, use the most significant. 144 * This choice was found to be valid on platforms with ES8336 codecs. 145 */ 146 #define SND_SOC_ACPI_TPLG_INTEL_SSP_MSB BIT(1) 147 148 /* 149 * when set the topology uses the -dmic<N>ch suffix, where N is determined based on 150 * BIOS or DMI information 151 */ 152 #define SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER BIT(2) 153 125 154 /** 126 155 * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are … … 130 159 * 131 160 * @id: ACPI ID (usually the codec's) used to find a matching machine driver. 161 * @uid: ACPI Unique ID, can be used to disambiguate matches. 162 * @comp_ids: list of compatible audio codecs using the same machine driver, 163 * firmware and topology 132 164 * @link_mask: describes required board layout, e.g. for SoundWire. 133 165 * @links: array of link _ADR descriptors, null terminated. 134 166 * @drv_name: machine driver name 135 167 * @fw_filename: firmware file name. Used when SOF is not enabled. 168 * @tplg_filename: topology file name. Used when SOF is not enabled. 136 169 * @board: board name 137 170 * @machine_quirk: pointer to quirk, usually based on DMI information when … … 141 174 * @pdata: intended for platform data or machine specific-ops. This structure 142 175 * is not constant since this field may be updated at run-time 143 * @sof_fw_filename: Sound Open Firmware file name, if enabled144 176 * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled 177 * @tplg_quirk_mask: quirks to select different topology files dynamically 145 178 */ 146 179 /* Descriptor for SST ASoC machine driver */ 147 180 struct snd_soc_acpi_mach { 148 const u8 id[ACPI_ID_LEN]; 181 u8 id[ACPI_ID_LEN]; 182 const char *uid; 183 const struct snd_soc_acpi_codecs *comp_ids; 149 184 const u32 link_mask; 150 185 const struct snd_soc_acpi_link_adr *links; 151 186 const char *drv_name; 152 187 const char *fw_filename; 188 const char *tplg_filename; 153 189 const char *board; 154 190 struct snd_soc_acpi_mach * (*machine_quirk)(void *arg); … … 156 192 void *pdata; 157 193 struct snd_soc_acpi_mach_params mach_params; 158 const char *sof_fw_filename;159 194 const char *sof_tplg_filename; 195 const u32 tplg_quirk_mask; 160 196 }; 161 197 … … 182 218 } 183 219 220 bool snd_soc_acpi_sdw_link_slaves_found(struct device *dev, 221 const struct snd_soc_acpi_link_adr *link, 222 struct sdw_extended_slave_id *ids, 223 int num_slaves); 224 184 225 #endif -
GPL/trunk/alsa-kernel/include/sound/soc-component.h
r695 r772 99 99 int (*set_jack)(struct snd_soc_component *component, 100 100 struct snd_soc_jack *jack, void *data); 101 int (*get_jack_type)(struct snd_soc_component *component); 101 102 102 103 /* DT */ … … 137 138 struct snd_pcm_audio_tstamp_config *audio_tstamp_config, 138 139 struct snd_pcm_audio_tstamp_report *audio_tstamp_report); 139 int (*copy _user)(struct snd_soc_component *component,140 141 unsigned long pos, void __user *buf,142 140 int (*copy)(struct snd_soc_component *component, 141 struct snd_pcm_substream *substream, int channel, 142 unsigned long pos, struct iov_iter *iter, 143 unsigned long bytes); 143 144 struct page *(*page)(struct snd_soc_component *component, 144 145 struct snd_pcm_substream *substream, … … 149 150 int (*ack)(struct snd_soc_component *component, 150 151 struct snd_pcm_substream *substream); 152 snd_pcm_sframes_t (*delay)(struct snd_soc_component *component, 153 struct snd_pcm_substream *substream); 151 154 152 155 const struct snd_compress_ops *compress_ops; … … 155 158 int probe_order; 156 159 int remove_order; 160 161 /* 162 * soc_pcm_trigger() start/stop sequence. 163 * see also 164 * snd_soc_dai_link 165 * soc_pcm_trigger() 166 */ 167 enum snd_soc_trigger_order trigger_start; 168 enum snd_soc_trigger_order trigger_stop; 157 169 158 170 /* … … 168 180 unsigned int suspend_bias_off:1; 169 181 unsigned int use_pmdown_time:1; /* care pmdown_time at stop */ 182 /* 183 * Indicates that the component does not care about the endianness of 184 * PCM audio data and the core will ensure that both LE and BE variants 185 * of each used format are present. Typically this is because the 186 * component sits behind a bus that abstracts away the endian of the 187 * original data, ie. one for which the transmission endian is defined 188 * (I2S/SLIMbus/SoundWire), or the concept of endian doesn't exist (PDM, 189 * analogue). 190 */ 170 191 unsigned int endianness:1; 171 unsigned int non_legacy_dai_naming:1;192 unsigned int legacy_dai_naming:1; 172 193 173 194 /* this component uses topology and ignore machine driver FEs */ … … 178 199 bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */ 179 200 int be_pcm_base; /* base device ID for all BE PCMs */ 201 202 #ifdef CONFIG_DEBUG_FS 203 const char *debugfs_prefix; 204 #endif 180 205 }; 181 206 … … 221 246 222 247 /* function mark */ 223 struct snd_pcm_substream*mark_module;248 void *mark_module; 224 249 struct snd_pcm_substream *mark_open; 225 250 struct snd_pcm_substream *mark_hw_params; … … 228 253 void *mark_pm; 229 254 230 #ifdef CONFIG_DEBUG_FS231 255 struct dentry *debugfs_root; 232 256 const char *debugfs_prefix; 233 #endif234 257 }; 235 258 … … 372 395 int snd_soc_component_set_jack(struct snd_soc_component *component, 373 396 struct snd_soc_jack *jack, void *data); 397 int snd_soc_component_get_jack_type(struct snd_soc_component *component); 374 398 375 399 void snd_soc_component_seq_notifier(struct snd_soc_component *component, … … 392 416 snd_soc_component_module_get(component, substream, 1) 393 417 int snd_soc_component_module_get(struct snd_soc_component *component, 394 struct snd_pcm_substream *substream, 395 int upon_open); 418 void *mark, int upon_open); 396 419 #define snd_soc_component_module_put_when_remove(component) \ 397 420 snd_soc_component_module_put(component, NULL, 0, 0) … … 399 422 snd_soc_component_module_put(component, substream, 1, rollback) 400 423 void snd_soc_component_module_put(struct snd_soc_component *component, 401 struct snd_pcm_substream *substream, 402 int upon_open, int rollback); 424 void *mark, int upon_open, int rollback); 403 425 404 426 static inline void snd_soc_component_set_drvdata(struct snd_soc_component *c, … … 440 462 const char *pin); 441 463 464 /* component controls */ 465 int snd_soc_component_notify_control(struct snd_soc_component *component, 466 const char * const ctl); 467 442 468 /* component driver ops */ 443 469 int snd_soc_component_open(struct snd_soc_component *component, … … 456 482 const struct of_phandle_args *args, 457 483 const char **dai_name); 458 int snd_soc_component_compr_open(struct snd_compr_stream *cstream); 459 void snd_soc_component_compr_free(struct snd_compr_stream *cstream, 484 int snd_soc_component_compr_open(struct snd_soc_component *component, 485 struct snd_compr_stream *cstream); 486 void snd_soc_component_compr_free(struct snd_soc_component *component, 487 struct snd_compr_stream *cstream, 460 488 int rollback); 461 489 int snd_soc_component_compr_trigger(struct snd_compr_stream *cstream, int cmd); … … 482 510 unsigned int cmd, void *arg); 483 511 int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream); 484 int snd_soc_pcm_component_copy _user(struct snd_pcm_substream *substream,485 486 void __user *buf, unsigned long bytes);512 int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream, 513 int channel, unsigned long pos, 514 struct iov_iter *iter, unsigned long bytes); 487 515 struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream, 488 516 unsigned long offset); … … 503 531 void *stream, int rollback); 504 532 int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream); 533 void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream, 534 snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay); 505 535 506 536 #endif /* __SOC_COMPONENT_H */ -
GPL/trunk/alsa-kernel/include/sound/soc-dai.h
r703 r772 124 124 #define SND_SOC_DAIFMT_CBM_CFS SND_SOC_DAIFMT_CBP_CFC 125 125 #define SND_SOC_DAIFMT_CBS_CFS SND_SOC_DAIFMT_CBC_CFC 126 127 /* when passed to set_fmt directly indicate if the device is provider or consumer */ 128 #define SND_SOC_DAIFMT_BP_FP SND_SOC_DAIFMT_CBP_CFP 129 #define SND_SOC_DAIFMT_BC_FP SND_SOC_DAIFMT_CBC_CFP 130 #define SND_SOC_DAIFMT_BP_FC SND_SOC_DAIFMT_CBP_CFC 131 #define SND_SOC_DAIFMT_BC_FC SND_SOC_DAIFMT_CBC_CFC 126 132 127 133 /* Describes the possible PCM format */ … … 209 215 void snd_soc_dai_shutdown(struct snd_soc_dai *dai, 210 216 struct snd_pcm_substream *substream, int rollback); 211 snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,212 struct snd_pcm_substream *substream);213 217 void snd_soc_dai_suspend(struct snd_soc_dai *dai); 214 218 void snd_soc_dai_resume(struct snd_soc_dai *dai); … … 239 243 int snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream, 240 244 int cmd); 245 void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream, 246 snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay); 241 247 242 248 int snd_soc_dai_compr_startup(struct snd_soc_dai *dai, … … 266 272 struct snd_compr_metadata *metadata); 267 273 274 const char *snd_soc_dai_name_get(struct snd_soc_dai *dai); 275 268 276 struct snd_soc_dai_ops { 277 /* DAI driver callbacks */ 278 int (*probe)(struct snd_soc_dai *dai); 279 int (*remove)(struct snd_soc_dai *dai); 280 /* compress dai */ 281 int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num); 282 /* Optional Callback used at pcm creation*/ 283 int (*pcm_new)(struct snd_soc_pcm_runtime *rtd, 284 struct snd_soc_dai *dai); 285 269 286 /* 270 287 * DAI clocking configuration, all optional. … … 296 313 int (*set_tristate)(struct snd_soc_dai *dai, int tristate); 297 314 298 int (*set_s dw_stream)(struct snd_soc_dai *dai,299 void *stream, int direction);300 void *(*get_s dw_stream)(struct snd_soc_dai *dai, int direction);315 int (*set_stream)(struct snd_soc_dai *dai, 316 void *stream, int direction); 317 void *(*get_stream)(struct snd_soc_dai *dai, int direction); 301 318 302 319 /* … … 348 365 int num_auto_selectable_formats; 349 366 367 /* probe ordering - for components with runtime dependencies */ 368 int probe_order; 369 int remove_order; 370 350 371 /* bit field */ 351 372 unsigned int no_capture_mute:1; 373 unsigned int mute_unmute_on_trigger:1; 352 374 }; 353 375 … … 392 414 unsigned int base; 393 415 struct snd_soc_dobj dobj; 394 395 /* DAI driver callbacks */ 396 int (*probe)(struct snd_soc_dai *dai); 397 int (*remove)(struct snd_soc_dai *dai); 398 /* compress dai */ 399 int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num); 400 /* Optional Callback used at pcm creation*/ 401 int (*pcm_new)(struct snd_soc_pcm_runtime *rtd, 402 struct snd_soc_dai *dai); 416 struct of_phandle_args *dai_args; 403 417 404 418 /* ops */ … … 412 426 unsigned int symmetric_channels:1; 413 427 unsigned int symmetric_sample_bits:1; 414 415 /* probe ordering - for components with runtime dependencies */ 416 int probe_order; 417 int remove_order; 428 }; 429 430 /* for Playback/Capture */ 431 struct snd_soc_dai_stream { 432 struct snd_soc_dapm_widget *widget; 433 434 unsigned int active; /* usage count */ 435 unsigned int tdm_mask; /* CODEC TDM slot masks and params (for fixup) */ 436 437 void *dma_data; /* DAI DMA data */ 418 438 }; 419 439 … … 432 452 433 453 /* DAI runtime info */ 434 unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1]; /* usage count */ 435 436 struct snd_soc_dapm_widget *playback_widget; 437 struct snd_soc_dapm_widget *capture_widget; 438 439 /* DAI DMA data */ 440 void *playback_dma_data; 441 void *capture_dma_data; 454 struct snd_soc_dai_stream stream[SNDRV_PCM_STREAM_LAST + 1]; 442 455 443 456 /* Symmetry data - only valid if symmetry is being enforced */ … … 448 461 /* parent platform/codec */ 449 462 struct snd_soc_component *component; 450 451 /* CODEC TDM slot masks and params (for fixup) */452 unsigned int tx_mask;453 unsigned int rx_mask;454 463 455 464 struct list_head list; … … 472 481 } 473 482 483 #define snd_soc_dai_get_widget_playback(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_PLAYBACK) 484 #define snd_soc_dai_get_widget_capture(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_CAPTURE) 474 485 static inline 475 struct snd_soc_dapm_widget *snd_soc_dai_get_widget( 476 struct snd_soc_dai *dai, int stream) 477 { 478 return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? 479 dai->playback_widget : dai->capture_widget; 480 } 481 482 static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, 483 const struct snd_pcm_substream *ss) 484 { 485 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 486 dai->playback_dma_data : dai->capture_dma_data; 487 } 488 489 static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, 490 const struct snd_pcm_substream *ss, 491 void *data) 492 { 493 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) 494 dai->playback_dma_data = data; 495 else 496 dai->capture_dma_data = data; 497 } 498 499 static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, 500 void *playback, void *capture) 501 { 502 dai->playback_dma_data = playback; 503 dai->capture_dma_data = capture; 486 struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream) 487 { 488 return dai->stream[stream].widget; 489 } 490 491 #define snd_soc_dai_set_widget_playback(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_PLAYBACK, widget) 492 #define snd_soc_dai_set_widget_capture(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_CAPTURE, widget) 493 static inline 494 void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget) 495 { 496 dai->stream[stream].widget = widget; 497 } 498 499 #define snd_soc_dai_dma_data_get_playback(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_PLAYBACK) 500 #define snd_soc_dai_dma_data_get_capture(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_CAPTURE) 501 #define snd_soc_dai_get_dma_data(dai, ss) snd_soc_dai_dma_data_get(dai, ss->stream) 502 static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int stream) 503 { 504 return dai->stream[stream].dma_data; 505 } 506 507 #define snd_soc_dai_dma_data_set_playback(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_PLAYBACK, data) 508 #define snd_soc_dai_dma_data_set_capture(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_CAPTURE, data) 509 #define snd_soc_dai_set_dma_data(dai, ss, data) snd_soc_dai_dma_data_set(dai, ss->stream, data) 510 static inline void snd_soc_dai_dma_data_set(struct snd_soc_dai *dai, int stream, void *data) 511 { 512 dai->stream[stream].dma_data = data; 513 } 514 515 static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *playback, void *capture) 516 { 517 snd_soc_dai_dma_data_set_playback(dai, playback); 518 snd_soc_dai_dma_data_set_capture(dai, capture); 519 } 520 521 static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream) 522 { 523 return dai->stream[stream].tdm_mask; 524 } 525 526 static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream, 527 unsigned int tdm_mask) 528 { 529 dai->stream[stream].tdm_mask = tdm_mask; 530 } 531 532 static inline unsigned int snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream) 533 { 534 /* see snd_soc_dai_action() for setup */ 535 return dai->stream[stream].active; 504 536 } 505 537 … … 516 548 517 549 /** 518 * snd_soc_dai_set_s dw_stream() - Configures a DAI for SDWstream operation550 * snd_soc_dai_set_stream() - Configures a DAI for stream operation 519 551 * @dai: DAI 520 * @stream: STREAM 552 * @stream: STREAM (opaque structure depending on DAI type) 521 553 * @direction: Stream direction(Playback/Capture) 522 * So undWire subsystem doesn't have a notion of direction and we reuse554 * Some subsystems, such as SoundWire, don't have a notion of direction and we reuse 523 555 * the ASoC stream direction to configure sink/source ports. 524 556 * Playback maps to source ports and Capture for sink ports. … … 527 559 * Returns 0 on success, a negative error code otherwise. 528 560 */ 529 static inline int snd_soc_dai_set_s dw_stream(struct snd_soc_dai *dai,530 void *stream, int direction)531 { 532 if (dai->driver->ops->set_s dw_stream)533 return dai->driver->ops->set_s dw_stream(dai, stream, direction);561 static inline int snd_soc_dai_set_stream(struct snd_soc_dai *dai, 562 void *stream, int direction) 563 { 564 if (dai->driver->ops->set_stream) 565 return dai->driver->ops->set_stream(dai, stream, direction); 534 566 else 535 567 return -ENOTSUPP; … … 537 569 538 570 /** 539 * snd_soc_dai_get_s dw_stream() - Retrieves SDWstream from DAI571 * snd_soc_dai_get_stream() - Retrieves stream from DAI 540 572 * @dai: DAI 541 573 * @direction: Stream direction(Playback/Capture) 542 574 * 543 575 * This routine only retrieves that was previously configured 544 * with snd_soc_dai_get_s dw_stream()576 * with snd_soc_dai_get_stream() 545 577 * 546 578 * Returns pointer to stream or an ERR_PTR value, e.g. 547 579 * ERR_PTR(-ENOTSUPP) if callback is not supported; 548 580 */ 549 static inline void *snd_soc_dai_get_s dw_stream(struct snd_soc_dai *dai,550 551 { 552 if (dai->driver->ops->get_s dw_stream)553 return dai->driver->ops->get_s dw_stream(dai, direction);581 static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai, 582 int direction) 583 { 584 if (dai->driver->ops->get_stream) 585 return dai->driver->ops->get_stream(dai, direction); 554 586 else 555 587 return ERR_PTR(-ENOTSUPP); 556 588 } 557 589 558 static inline unsigned int559 snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream)560 {561 return dai->stream_active[stream];562 }563 564 590 #endif -
GPL/trunk/alsa-kernel/include/sound/soc-dapm.h
r679 r772 17 17 18 18 struct device; 19 struct snd_pcm_substream; 19 20 struct snd_soc_pcm_runtime; 20 21 struct soc_enum; … … 42 43 /* codec domain */ 43 44 #define SND_SOC_DAPM_VMID(wname) \ 44 { .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ 45 (struct snd_soc_dapm_widget) { \ 46 .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ 45 47 .num_kcontrols = 0} 46 48 47 49 /* platform domain */ 48 50 #define SND_SOC_DAPM_SIGGEN(wname) \ 49 { .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ 51 (struct snd_soc_dapm_widget) { \ 52 .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ 50 53 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 51 54 #define SND_SOC_DAPM_SINK(wname) \ 52 { .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ 55 (struct snd_soc_dapm_widget) { \ 56 .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ 53 57 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 54 58 #define SND_SOC_DAPM_INPUT(wname) \ 55 { .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 59 (struct snd_soc_dapm_widget) { \ 60 .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 56 61 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 57 62 #define SND_SOC_DAPM_OUTPUT(wname) \ 58 { .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ 63 (struct snd_soc_dapm_widget) { \ 64 .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ 59 65 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 60 66 #define SND_SOC_DAPM_MIC(wname, wevent) \ 61 { .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ 67 (struct snd_soc_dapm_widget) { \ 68 .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ 62 69 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 63 70 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 64 71 #define SND_SOC_DAPM_HP(wname, wevent) \ 65 { .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ 72 (struct snd_soc_dapm_widget) { \ 73 .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ 66 74 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 67 75 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 68 76 #define SND_SOC_DAPM_SPK(wname, wevent) \ 69 { .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ 77 (struct snd_soc_dapm_widget) { \ 78 .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ 70 79 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 71 80 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 72 81 #define SND_SOC_DAPM_LINE(wname, wevent) \ 73 { .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ 82 (struct snd_soc_dapm_widget) { \ 83 .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ 74 84 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 75 85 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} … … 82 92 #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 83 93 wcontrols, wncontrols) \ 84 { .id = snd_soc_dapm_pga, .name = wname, \ 94 (struct snd_soc_dapm_widget) { \ 95 .id = snd_soc_dapm_pga, .name = wname, \ 85 96 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 86 97 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 87 98 #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 88 99 wcontrols, wncontrols) \ 89 { .id = snd_soc_dapm_out_drv, .name = wname, \ 100 (struct snd_soc_dapm_widget) { \ 101 .id = snd_soc_dapm_out_drv, .name = wname, \ 90 102 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 91 103 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 92 104 #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 93 105 wcontrols, wncontrols)\ 94 { .id = snd_soc_dapm_mixer, .name = wname, \ 106 (struct snd_soc_dapm_widget) { \ 107 .id = snd_soc_dapm_mixer, .name = wname, \ 95 108 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 96 109 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 97 110 #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 98 111 wcontrols, wncontrols)\ 99 { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 112 (struct snd_soc_dapm_widget) { \ 113 .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 100 114 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 101 115 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 102 116 /* DEPRECATED: use SND_SOC_DAPM_SUPPLY */ 103 117 #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 104 { .id = snd_soc_dapm_micbias, .name = wname, \ 118 (struct snd_soc_dapm_widget) { \ 119 .id = snd_soc_dapm_micbias, .name = wname, \ 105 120 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 106 121 .kcontrol_news = NULL, .num_kcontrols = 0} 107 122 #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 108 { .id = snd_soc_dapm_switch, .name = wname, \ 123 (struct snd_soc_dapm_widget) { \ 124 .id = snd_soc_dapm_switch, .name = wname, \ 109 125 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 110 126 .kcontrol_news = wcontrols, .num_kcontrols = 1} 111 127 #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 112 { .id = snd_soc_dapm_mux, .name = wname, \ 128 (struct snd_soc_dapm_widget) { \ 129 .id = snd_soc_dapm_mux, .name = wname, \ 113 130 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 114 131 .kcontrol_news = wcontrols, .num_kcontrols = 1} 115 132 #define SND_SOC_DAPM_DEMUX(wname, wreg, wshift, winvert, wcontrols) \ 116 { .id = snd_soc_dapm_demux, .name = wname, \ 133 (struct snd_soc_dapm_widget) { \ 134 .id = snd_soc_dapm_demux, .name = wname, \ 117 135 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 118 136 .kcontrol_news = wcontrols, .num_kcontrols = 1} … … 121 139 #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 122 140 wcontrols) \ 123 { .id = snd_soc_dapm_pga, .name = wname, \ 141 (struct snd_soc_dapm_widget) { \ 142 .id = snd_soc_dapm_pga, .name = wname, \ 124 143 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 125 144 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 126 145 #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 127 146 wcontrols)\ 128 { .id = snd_soc_dapm_mixer, .name = wname, \ 147 (struct snd_soc_dapm_widget) { \ 148 .id = snd_soc_dapm_mixer, .name = wname, \ 129 149 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 130 150 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 131 151 #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 132 152 wcontrols)\ 133 { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 153 (struct snd_soc_dapm_widget) { \ 154 .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 134 155 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 135 156 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} … … 138 159 #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 139 160 wncontrols, wevent, wflags) \ 140 { .id = snd_soc_dapm_pga, .name = wname, \ 161 (struct snd_soc_dapm_widget) { \ 162 .id = snd_soc_dapm_pga, .name = wname, \ 141 163 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 142 164 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 144 166 #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 145 167 wncontrols, wevent, wflags) \ 146 { .id = snd_soc_dapm_out_drv, .name = wname, \ 168 (struct snd_soc_dapm_widget) { \ 169 .id = snd_soc_dapm_out_drv, .name = wname, \ 147 170 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 148 171 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 150 173 #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 151 174 wncontrols, wevent, wflags) \ 152 { .id = snd_soc_dapm_mixer, .name = wname, \ 175 (struct snd_soc_dapm_widget) { \ 176 .id = snd_soc_dapm_mixer, .name = wname, \ 153 177 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 154 178 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 156 180 #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 157 181 wcontrols, wncontrols, wevent, wflags) \ 158 { .id = snd_soc_dapm_mixer, .name = wname, \ 182 (struct snd_soc_dapm_widget) { \ 183 .id = snd_soc_dapm_mixer, .name = wname, \ 159 184 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 160 185 .kcontrol_news = wcontrols, \ … … 162 187 #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 163 188 wevent, wflags) \ 164 { .id = snd_soc_dapm_switch, .name = wname, \ 189 (struct snd_soc_dapm_widget) { \ 190 .id = snd_soc_dapm_switch, .name = wname, \ 165 191 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 166 192 .kcontrol_news = wcontrols, .num_kcontrols = 1, \ … … 168 194 #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 169 195 wevent, wflags) \ 170 { .id = snd_soc_dapm_mux, .name = wname, \ 196 (struct snd_soc_dapm_widget) { \ 197 .id = snd_soc_dapm_mux, .name = wname, \ 171 198 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 172 199 .kcontrol_news = wcontrols, .num_kcontrols = 1, \ … … 176 203 #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 177 204 wevent, wflags) \ 178 { .id = snd_soc_dapm_pga, .name = wname, \ 205 (struct snd_soc_dapm_widget) { \ 206 .id = snd_soc_dapm_pga, .name = wname, \ 179 207 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 180 208 .event = wevent, .event_flags = wflags, \ … … 182 210 #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 183 211 wflags) \ 184 { .id = snd_soc_dapm_supply, .name = wname, \ 212 (struct snd_soc_dapm_widget) { \ 213 .id = snd_soc_dapm_supply, .name = wname, \ 185 214 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 186 215 .event = wevent, .event_flags = wflags, .subseq = wsubseq} … … 189 218 #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 190 219 wevent, wflags) \ 191 { .id = snd_soc_dapm_pga, .name = wname, \ 220 (struct snd_soc_dapm_widget) { \ 221 .id = snd_soc_dapm_pga, .name = wname, \ 192 222 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 193 223 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 195 225 #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 196 226 wevent, wflags) \ 197 { .id = snd_soc_dapm_mixer, .name = wname, \ 227 (struct snd_soc_dapm_widget) { \ 228 .id = snd_soc_dapm_mixer, .name = wname, \ 198 229 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 199 230 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 201 232 #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 202 233 wcontrols, wevent, wflags) \ 203 { .id = snd_soc_dapm_mixer, .name = wname, \ 234 (struct snd_soc_dapm_widget) { \ 235 .id = snd_soc_dapm_mixer, .name = wname, \ 204 236 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 205 237 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 208 240 /* events that are pre and post DAPM */ 209 241 #define SND_SOC_DAPM_PRE(wname, wevent) \ 210 { .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ 242 (struct snd_soc_dapm_widget) { \ 243 .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ 211 244 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 212 245 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} 213 246 #define SND_SOC_DAPM_POST(wname, wevent) \ 214 { .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ 247 (struct snd_soc_dapm_widget) { \ 248 .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ 215 249 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 216 250 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} … … 218 252 /* stream domain */ 219 253 #define SND_SOC_DAPM_AIF_IN(wname, stname, wchan, wreg, wshift, winvert) \ 220 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 254 (struct snd_soc_dapm_widget) { \ 255 .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 221 256 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 222 257 #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wchan, wreg, wshift, winvert, \ 223 258 wevent, wflags) \ 224 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 259 (struct snd_soc_dapm_widget) { \ 260 .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 225 261 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 226 262 .event = wevent, .event_flags = wflags } 227 263 #define SND_SOC_DAPM_AIF_OUT(wname, stname, wchan, wreg, wshift, winvert) \ 228 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 264 (struct snd_soc_dapm_widget) { \ 265 .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 229 266 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 230 267 #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wchan, wreg, wshift, winvert, \ 231 268 wevent, wflags) \ 232 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 269 (struct snd_soc_dapm_widget) { \ 270 .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 233 271 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 234 272 .event = wevent, .event_flags = wflags } 235 273 #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 236 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 274 (struct snd_soc_dapm_widget) { \ 275 .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 237 276 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) } 238 277 #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 239 278 wevent, wflags) \ 240 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 279 (struct snd_soc_dapm_widget) { \ 280 .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 241 281 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 242 282 .event = wevent, .event_flags = wflags} 243 283 244 284 #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 245 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 285 (struct snd_soc_dapm_widget) { \ 286 .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 246 287 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 247 288 #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 248 289 wevent, wflags) \ 249 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 290 (struct snd_soc_dapm_widget) { \ 291 .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 250 292 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 251 293 .event = wevent, .event_flags = wflags} 252 294 #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 253 { .id = snd_soc_dapm_clock_supply, .name = wname, \ 295 (struct snd_soc_dapm_widget) { \ 296 .id = snd_soc_dapm_clock_supply, .name = wname, \ 254 297 .reg = SND_SOC_NOPM, .event = dapm_clock_event, \ 255 298 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } … … 257 300 /* generic widgets */ 258 301 #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 259 { .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ 302 (struct snd_soc_dapm_widget) { \ 303 .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ 260 304 .reg = wreg, .shift = wshift, .mask = wmask, \ 261 305 .on_val = won_val, .off_val = woff_val, } 262 306 #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 263 { .id = snd_soc_dapm_supply, .name = wname, \ 307 (struct snd_soc_dapm_widget) { \ 308 .id = snd_soc_dapm_supply, .name = wname, \ 264 309 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 265 310 .event = wevent, .event_flags = wflags} 266 311 #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 267 { .id = snd_soc_dapm_regulator_supply, .name = wname, \ 312 (struct snd_soc_dapm_widget) { \ 313 .id = snd_soc_dapm_regulator_supply, .name = wname, \ 268 314 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 269 315 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 270 316 .on_val = wflags} 271 317 #define SND_SOC_DAPM_PINCTRL(wname, active, sleep) \ 272 { .id = snd_soc_dapm_pinctrl, .name = wname, \ 318 (struct snd_soc_dapm_widget) { \ 319 .id = snd_soc_dapm_pinctrl, .name = wname, \ 273 320 .priv = (&(struct snd_soc_dapm_pinctrl_priv) \ 274 321 { .active_state = active, .sleep_state = sleep,}), \ … … 342 389 #define SND_SOC_DAPM_STREAM_SUSPEND 0x4 343 390 #define SND_SOC_DAPM_STREAM_RESUME 0x8 344 #define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10391 #define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10 345 392 #define SND_SOC_DAPM_STREAM_PAUSE_RELEASE 0x20 346 393 347 394 /* dapm event types */ 348 #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ 349 #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ 350 #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ 351 #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 352 #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 353 #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 354 #define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ 355 #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ 356 #define SND_SOC_DAPM_PRE_POST_PMD \ 357 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 358 #define SND_SOC_DAPM_PRE_POST_PMU \ 359 (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) 395 #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ 396 #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ 397 #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ 398 #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 399 #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 400 #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 401 #define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ 402 #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ 403 #define SND_SOC_DAPM_PRE_POST_PMD (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 404 #define SND_SOC_DAPM_PRE_POST_PMU (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) 360 405 361 406 /* convenience event type detection */ 362 #define SND_SOC_DAPM_EVENT_ON(e) \ 363 (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)) 364 #define SND_SOC_DAPM_EVENT_OFF(e) \ 365 (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 407 #define SND_SOC_DAPM_EVENT_ON(e) (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)) 408 #define SND_SOC_DAPM_EVENT_OFF(e) (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 366 409 367 410 /* regulator widget flags */ 368 #define SND_SOC_DAPM_REGULATOR_BYPASS 0x1/* bypass when disabled */411 #define SND_SOC_DAPM_REGULATOR_BYPASS 0x1 /* bypass when disabled */ 369 412 370 413 struct snd_soc_dapm_widget; … … 397 440 }; 398 441 399 int dapm_regulator_event(struct snd_soc_dapm_widget *w, 400 struct snd_kcontrol *kcontrol, int event); 401 int dapm_clock_event(struct snd_soc_dapm_widget *w, 402 struct snd_kcontrol *kcontrol, int event); 403 int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, 404 struct snd_kcontrol *kcontrol, int event); 442 int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 443 int dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 444 int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 405 445 406 446 /* dapm controls */ 407 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, 408 struct snd_ctl_elem_value *ucontrol); 409 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, 410 struct snd_ctl_elem_value *ucontrol); 447 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 448 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 411 449 int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, 412 450 struct snd_ctl_elem_value *ucontrol); … … 420 458 struct snd_ctl_elem_value *uncontrol); 421 459 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, 422 const struct snd_soc_dapm_widget *widget, 423 int num); 424 struct snd_soc_dapm_widget *snd_soc_dapm_new_control( 425 struct snd_soc_dapm_context *dapm, 460 const struct snd_soc_dapm_widget *widget, int num); 461 struct snd_soc_dapm_widget *snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, 426 462 const struct snd_soc_dapm_widget *widget); 427 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked( 428 struct snd_soc_dapm_context *dapm, 463 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, 429 464 const struct snd_soc_dapm_widget *widget); 430 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, 431 struct snd_soc_dai *dai);465 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, struct snd_soc_dai *dai); 466 void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 432 467 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 433 468 void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); 434 469 435 470 int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream, 436 struct snd_pcm_hw_params *params, 437 struct snd_soc_dai *dai);471 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); 472 int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s); 438 473 439 474 /* dapm path setup */ … … 441 476 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 442 477 void snd_soc_dapm_init(struct snd_soc_dapm_context *dapm, 443 struct snd_soc_card *card, 444 struct snd_soc_component *component); 478 struct snd_soc_card *card, struct snd_soc_component *component); 445 479 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 446 480 const struct snd_soc_dapm_route *route, int num); … … 450 484 const struct snd_soc_dapm_route *route, int num); 451 485 void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 452 void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm);453 486 454 487 /* dapm events */ 455 void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, 456 int event); 488 void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event); 457 489 void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream); 458 490 void snd_soc_dapm_shutdown(struct snd_soc_card *card); … … 460 492 /* external DAPM widget events */ 461 493 int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, 462 struct snd_kcontrol *kcontrol, int connect, 463 struct snd_soc_dapm_update *update); 494 struct snd_kcontrol *kcontrol, int connect, struct snd_soc_dapm_update *update); 464 495 int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, 465 496 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e, … … 468 499 /* dapm sys fs - used by the core */ 469 500 extern struct attribute *soc_dapm_dev_attrs[]; 470 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, 471 struct dentry *parent); 501 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, struct dentry *parent); 472 502 473 503 /* dapm audio pin control and status */ 474 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, 475 const char *pin); 476 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 477 const char *pin); 478 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, 479 const char *pin); 480 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, 481 const char *pin); 504 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 505 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 506 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 507 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 482 508 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); 483 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, 484 const char *pin); 485 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, 486 const char *pin); 509 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 510 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin); 487 511 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 488 512 int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm); 489 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 490 const char *pin); 491 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 492 const char *pin); 493 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 494 const char *pin); 513 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 514 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 515 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin); 495 516 unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); 496 517 … … 501 522 int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 502 523 struct snd_soc_dapm_widget_list **list, 503 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, 504 enum snd_soc_dapm_direction)); 524 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, enum snd_soc_dapm_direction)); 505 525 void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list); 506 526 507 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( 508 struct snd_kcontrol *kcontrol); 509 510 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget( 511 struct snd_kcontrol *kcontrol); 512 513 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, 514 enum snd_soc_bias_level level); 527 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(struct snd_kcontrol *kcontrol); 528 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(struct snd_kcontrol *kcontrol); 529 530 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 515 531 516 532 /* dapm widget types */ … … 518 534 snd_soc_dapm_input = 0, /* input pin */ 519 535 snd_soc_dapm_output, /* output pin */ 520 snd_soc_dapm_mux, 521 snd_soc_dapm_demux, 522 snd_soc_dapm_mixer, 523 snd_soc_dapm_mixer_named_ctl, 524 snd_soc_dapm_pga, 525 snd_soc_dapm_out_drv, 526 snd_soc_dapm_adc, 527 snd_soc_dapm_dac, 536 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 537 snd_soc_dapm_demux, /* connects the input to one of multiple outputs */ 538 snd_soc_dapm_mixer, /* mixes several analog signals together */ 539 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 540 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 541 snd_soc_dapm_out_drv, /* output driver */ 542 snd_soc_dapm_adc, /* analog to digital converter */ 543 snd_soc_dapm_dac, /* digital to analog converter */ 528 544 snd_soc_dapm_micbias, /* microphone bias (power) - DEPRECATED: use snd_soc_dapm_supply */ 529 snd_soc_dapm_mic, 530 snd_soc_dapm_hp, 531 snd_soc_dapm_spk, 532 snd_soc_dapm_line, 545 snd_soc_dapm_mic, /* microphone */ 546 snd_soc_dapm_hp, /* headphones */ 547 snd_soc_dapm_spk, /* speaker */ 548 snd_soc_dapm_line, /* line input/output */ 533 549 snd_soc_dapm_switch, /* analog switch */ 534 snd_soc_dapm_vmid, 535 snd_soc_dapm_pre, 536 snd_soc_dapm_post, 550 snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ 551 snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 552 snd_soc_dapm_post, /* machine specific post widget - exec last */ 537 553 snd_soc_dapm_supply, /* power/clock supply */ 538 554 snd_soc_dapm_pinctrl, /* pinctrl */ … … 559 575 }; 560 576 561 enum snd_soc_dapm_subclass {562 SND_SOC_DAPM_CLASS_INIT = 0,563 SND_SOC_DAPM_CLASS_RUNTIME = 1,564 };565 566 577 /* 567 578 * DAPM audio route definition. … … 600 611 601 612 /* status */ 602 u32 connect:1; /* source and sink widgets are connected */603 u32 walking:1; 604 u32 weak:1; /* path ignored for power management */613 u32 connect:1; /* source and sink widgets are connected */ 614 u32 walking:1; /* path is in the process of being walked */ 615 u32 weak:1; /* path ignored for power management */ 605 616 u32 is_supply:1; /* At least one of the connected widgets is a supply */ 606 617 … … 616 627 struct snd_soc_dapm_widget { 617 628 enum snd_soc_dapm_type id; 618 const char *name; /* widget name */619 const char *sname; /* stream name */629 const char *name; /* widget name */ 630 const char *sname; /* stream name */ 620 631 struct list_head list; 621 632 struct snd_soc_dapm_context *dapm; … … 636 647 unsigned char new:1; /* cnew complete */ 637 648 unsigned char force:1; /* force state */ 638 unsigned char ignore_suspend:1; 649 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 639 650 unsigned char new_power:1; /* power from this run */ 640 651 unsigned char power_checked:1; /* power checked this run */ 641 652 unsigned char is_supply:1; /* Widget is a supply type widget */ 642 653 unsigned char is_ep:2; /* Widget is a endpoint type widget */ 654 unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */ 643 655 int subseq; /* sort within widget type */ 644 656 … … 680 692 }; 681 693 682 struct snd_soc_dapm_wcache {683 struct snd_soc_dapm_widget *widget;684 };685 686 694 /* DAPM context */ 687 695 struct snd_soc_dapm_context { 688 696 enum snd_soc_bias_level bias_level; 689 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 690 /* Go to BIAS_OFF in suspend if the DAPM context is idle */ 691 unsigned int suspend_bias_off:1; 692 693 struct device *dev; /* from parent - for debug */ 694 struct snd_soc_component *component; /* parent component */ 695 struct snd_soc_card *card; /* parent card */ 697 698 /* bit field */ 699 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 700 unsigned int suspend_bias_off:1; /* Use BIAS_OFF in suspend if the DAPM is idle */ 701 702 struct device *dev; /* from parent - for debug */ 703 struct snd_soc_component *component; /* parent component */ 704 struct snd_soc_card *card; /* parent card */ 696 705 697 706 /* used during DAPM updates */ … … 699 708 struct list_head list; 700 709 701 struct snd_soc_dapm_w cache path_sink_cache;702 struct snd_soc_dapm_w cache path_source_cache;710 struct snd_soc_dapm_widget *wcache_sink; 711 struct snd_soc_dapm_widget *wcache_source; 703 712 704 713 #ifdef CONFIG_DEBUG_FS … … 767 776 #define SND_SOC_DAPM_DIR_TO_EP(x) BIT(x) 768 777 769 #define SND_SOC_DAPM_EP_SOURCE 770 #define SND_SOC_DAPM_EP_SINK 778 #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN) 779 #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT) 771 780 772 781 /** 773 * snd_soc_dapm_widget_for_each_ sink_path - Iterates over all paths in the782 * snd_soc_dapm_widget_for_each_path - Iterates over all paths in the 774 783 * specified direction of a widget 775 784 * @w: The widget … … 782 791 783 792 /** 784 * snd_soc_dapm_widget_for_each_ sink_path_safe - Iterates over all paths in the793 * snd_soc_dapm_widget_for_each_path_safe - Iterates over all paths in the 785 794 * specified direction of a widget 786 795 * @w: The widget … … 790 799 * @next_p: Temporary storage for the next path 791 800 * 792 * This function works like snd_soc_dapm_widget_for_each_ sink_path, expect that801 * This function works like snd_soc_dapm_widget_for_each_path, expect that 793 802 * it is safe to remove the current path from the list while iterating 794 803 */ -
GPL/trunk/alsa-kernel/include/sound/soc-dpcm.h
r695 r772 79 79 struct list_head list_fe; 80 80 81 /* hw params for this link - may be different for each link */82 struct snd_pcm_hw_params hw_params;83 81 #ifdef CONFIG_DEBUG_FS 84 82 struct dentry *debugfs_state; … … 94 92 95 93 int users; 96 struct snd_pcm_runtime *runtime;97 94 struct snd_pcm_hw_params hw_params; 98 95 … … 102 99 103 100 int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */ 101 102 int be_start; /* refcount protected by BE stream pcm lock */ 103 int be_pause; /* refcount protected by BE stream pcm lock */ 104 bool fe_pause; /* used to track STOP after PAUSE */ 104 105 }; 105 106 … … 121 122 int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, 122 123 struct snd_soc_pcm_runtime *be, int stream); 124 125 /* can this BE perform prepare */ 126 int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, 127 struct snd_soc_pcm_runtime *be, int stream); 123 128 124 129 /* is the current PCM operation for this FE ? */ … … 160 165 int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, 161 166 int event); 167 bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget *widget, enum snd_soc_dapm_direction dir); 168 int widget_in_list(struct snd_soc_dapm_widget_list *list, 169 struct snd_soc_dapm_widget *widget); 162 170 163 171 #define dpcm_be_dai_startup_rollback(fe, stream, last) \ -
GPL/trunk/alsa-kernel/include/sound/soc-topology.h
r717 r772 63 63 unsigned int index; /* objects can belong in different groups */ 64 64 struct list_head list; 65 struct snd_soc_tplg_ops *ops;65 int (*unload)(struct snd_soc_component *comp, struct snd_soc_dobj *dobj); 66 66 union { 67 67 struct snd_soc_dobj_control control; … … 152 152 153 153 /* completion - called at completion of firmware loading */ 154 void (*complete)(struct snd_soc_component *);154 int (*complete)(struct snd_soc_component *comp); 155 155 156 156 /* manifest - optional to inform component of manifest */ -
GPL/trunk/alsa-kernel/include/sound/soc.h
r703 r772 32 32 ((unsigned long)&(struct soc_mixer_control) \ 33 33 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 34 .rshift = shift_right, .max = xmax, .platform_max = xmax,\34 .rshift = shift_right, .max = xmax, \ 35 35 .invert = xinvert, .autodisable = xautodisable}) 36 36 #define SOC_DOUBLE_S_VALUE(xreg, shift_left, shift_right, xmin, xmax, xsign_bit, xinvert, xautodisable) \ 37 37 ((unsigned long)&(struct soc_mixer_control) \ 38 38 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 39 .rshift = shift_right, .min = xmin, .max = xmax, .platform_max = xmax,\39 .rshift = shift_right, .min = xmin, .max = xmax, \ 40 40 .sign_bit = xsign_bit, .invert = xinvert, .autodisable = xautodisable}) 41 41 #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ … … 43 43 #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 44 44 ((unsigned long)&(struct soc_mixer_control) \ 45 {.reg = xreg, .max = xmax, . platform_max = xmax, .invert = xinvert})45 {.reg = xreg, .max = xmax, .invert = xinvert}) 46 46 #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ 47 47 ((unsigned long)&(struct soc_mixer_control) \ 48 48 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 49 .max = xmax, . platform_max = xmax, .invert = xinvert})49 .max = xmax, .invert = xinvert}) 50 50 #define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \ 51 51 ((unsigned long)&(struct soc_mixer_control) \ 52 52 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 53 .max = xmax, .min = xmin, . platform_max = xmax, .sign_bit = xsign_bit, \53 .max = xmax, .min = xmin, .sign_bit = xsign_bit, \ 54 54 .invert = xinvert}) 55 55 #define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 56 56 ((unsigned long)&(struct soc_mixer_control) \ 57 57 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 58 .min = xmin, .max = xmax, . platform_max = xmax, .invert = xinvert})58 .min = xmin, .max = xmax, .invert = xinvert}) 59 59 #define SOC_SINGLE(xname, reg, shift, max, invert) \ 60 60 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 69 69 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 70 70 .rshift = xshift, .min = xmin, .max = xmax, \ 71 . platform_max = xmax, .invert = xinvert} }71 .invert = xinvert} } 72 72 #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 73 73 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 100 100 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 101 101 .rshift = xshift, .min = xmin, .max = xmax, \ 102 . platform_max = xmax, .invert = xinvert} }102 .invert = xinvert} } 103 103 #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ 104 104 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ … … 137 137 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 138 138 max, invert, 0) } 139 #define SOC_DOUBLE_SX_TLV(xname, xreg, shift_left, shift_right, xmin, xmax, 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_sx, \ 145 .get = snd_soc_get_volsw_sx, \ 146 .put = snd_soc_put_volsw_sx, \ 147 .private_value = (unsigned long)&(struct soc_mixer_control) \ 148 {.reg = xreg, .rreg = xreg, \ 149 .shift = shift_left, .rshift = shift_right, \ 150 .max = xmax, .min = xmin} } 139 151 #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 140 152 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ … … 177 189 .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \ 178 190 xmin, xmax, xsign_bit, xinvert) } 191 #define SOC_SINGLE_S_TLV(xname, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \ 192 SOC_DOUBLE_R_S_TLV(xname, xreg, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) 179 193 #define SOC_SINGLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 180 194 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ … … 186 200 .private_value = (unsigned long)&(struct soc_mixer_control) \ 187 201 {.reg = xreg, .rreg = xreg, \ 188 .min = xmin, .max = xmax, .platform_max = xmax,\202 .min = xmin, .max = xmax, \ 189 203 .sign_bit = 7,} } 190 204 #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ … … 260 274 {.reg = xreg, .rreg = xreg, .shift = xshift, \ 261 275 .rshift = xshift, .min = xmin, .max = xmax, \ 262 . platform_max = xmax, .invert = xinvert} }276 .invert = xinvert} } 263 277 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 264 278 xhandler_get, xhandler_put, tlv_array) \ … … 281 295 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 282 296 xmax, xinvert) } 297 #define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \ 298 xsign_bit, xinvert, xhandler_get, xhandler_put, \ 299 tlv_array) \ 300 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 301 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 302 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 303 .tlv.p = (tlv_array), \ 304 .info = snd_soc_info_volsw, \ 305 .get = xhandler_get, .put = xhandler_put, \ 306 .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \ 307 xmin, xmax, xsign_bit, xinvert) } 308 #define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \ 309 xsign_bit, xinvert, xhandler_get, xhandler_put, \ 310 tlv_array) \ 311 SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \ 312 xsign_bit, xinvert, xhandler_get, xhandler_put, \ 313 tlv_array) 283 314 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 284 315 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 390 421 struct snd_soc_jack_gpio; 391 422 392 typedef int (*hw_write_t)(void *,const char* ,int);393 394 423 enum snd_soc_pcm_subclass { 395 424 SND_SOC_PCM_CLASS_PCM = 0, … … 398 427 399 428 int snd_soc_register_card(struct snd_soc_card *card); 400 intsnd_soc_unregister_card(struct snd_soc_card *card);429 void snd_soc_unregister_card(struct snd_soc_card *card); 401 430 int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card); 402 431 #ifdef CONFIG_PM_SLEEP … … 486 515 int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); 487 516 int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); 517 int snd_soc_tdm_params_to_bclk(struct snd_pcm_hw_params *params, 518 int tdm_width, int tdm_slots, int slot_multiple); 488 519 489 520 /* set runtime hw params */ … … 577 608 struct snd_ctl_elem_value *ucontrol); 578 609 610 enum snd_soc_trigger_order { 611 /* start stop */ 612 SND_SOC_TRIGGER_ORDER_DEFAULT = 0, /* Link->Component->DAI DAI->Component->Link */ 613 SND_SOC_TRIGGER_ORDER_LDC, /* Link->DAI->Component Component->DAI->Link */ 614 615 SND_SOC_TRIGGER_ORDER_MAX, 616 }; 617 579 618 /* SoC PCM stream information */ 580 619 struct snd_soc_pcm_stream { … … 603 642 void (*shutdown)(struct snd_compr_stream *); 604 643 int (*set_params)(struct snd_compr_stream *); 605 int (*trigger)(struct snd_compr_stream *);606 644 }; 607 645 … … 614 652 struct device_node *of_node; 615 653 const char *dai_name; 654 struct of_phandle_args *dai_args; 655 }; 656 657 struct snd_soc_dai_link_codec_ch_map { 658 unsigned int connected_cpu_id; 659 unsigned int ch_mask; 616 660 }; 617 661 … … 644 688 unsigned int num_codecs; 645 689 690 struct snd_soc_dai_link_codec_ch_map *codec_ch_maps; 646 691 /* 647 692 * You MAY specify the link's platform/PCM/DMA driver, either by … … 654 699 int id; /* optional ID for machine driver link identification */ 655 700 656 const struct snd_soc_pcm_stream *params; 657 unsigned int num_params; 701 /* 702 * for Codec2Codec 703 */ 704 const struct snd_soc_pcm_stream *c2c_params; 705 unsigned int num_c2c_params; 658 706 659 707 unsigned int dai_fmt; /* format to set on init */ … … 674 722 const struct snd_soc_ops *ops; 675 723 const struct snd_soc_compr_ops *compr_ops; 724 725 /* 726 * soc_pcm_trigger() start/stop sequence. 727 * see also 728 * snd_soc_component_driver 729 * soc_pcm_trigger() 730 */ 731 enum snd_soc_trigger_order trigger_start; 732 enum snd_soc_trigger_order trigger_stop; 676 733 677 734 /* Mark this pcm with non atomic ops */ … … 713 770 unsigned int ignore:1; 714 771 715 /* This flag will reorder stop sequence. By enabling this flag716 * DMA controller stop sequence will be invoked first followed by717 * CPU DAI driver stop sequence718 */719 unsigned int stop_dma_first:1;720 721 772 #ifdef CONFIG_SND_SOC_TOPOLOGY 722 773 struct snd_soc_dobj dobj; /* For topology */ … … 724 775 }; 725 776 777 /* REMOVE ME */ 778 #define asoc_link_to_cpu snd_soc_link_to_cpu 779 #define asoc_link_to_codec snd_soc_link_to_codec 780 #define asoc_link_to_platform snd_soc_link_to_platform 781 726 782 static inline struct snd_soc_dai_link_component* 727 asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) {783 snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) { 728 784 return &(link)->cpus[n]; 729 785 } 730 786 731 787 static inline struct snd_soc_dai_link_component* 732 asoc_link_to_codec(struct snd_soc_dai_link *link, int n) {788 snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) { 733 789 return &(link)->codecs[n]; 734 790 } 735 791 736 792 static inline struct snd_soc_dai_link_component* 737 asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {793 snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) { 738 794 return &(link)->platforms[n]; 739 795 } … … 742 798 for ((i) = 0; \ 743 799 ((i) < link->num_codecs) && \ 744 ((codec) = asoc_link_to_codec(link, i)); \800 ((codec) = snd_soc_link_to_codec(link, i)); \ 745 801 (i)++) 746 802 … … 748 804 for ((i) = 0; \ 749 805 ((i) < link->num_platforms) && \ 750 ((platform) = asoc_link_to_platform(link, i)); \806 ((platform) = snd_soc_link_to_platform(link, i)); \ 751 807 (i)++) 752 808 … … 754 810 for ((i) = 0; \ 755 811 ((i) < link->num_cpus) && \ 756 ((cpu) = asoc_link_to_cpu(link, i)); \812 ((cpu) = snd_soc_link_to_cpu(link, i)); \ 757 813 (i)++) 758 814 … … 844 900 #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", } 845 901 902 /* REMOVE ME */ 903 #define asoc_dummy_dlc snd_soc_dummy_dlc 904 846 905 extern struct snd_soc_dai_link_component null_dailink_component[0]; 906 extern struct snd_soc_dai_link_component snd_soc_dummy_dlc; 847 907 848 908 … … 881 941 char dmi_longname[80]; 882 942 #endif /* CONFIG_DMI */ 943 944 #ifdef CONFIG_PCI 945 /* 946 * PCI does not define 0 as invalid, so pci_subsystem_set indicates 947 * whether a value has been written to these fields. 948 */ 949 unsigned short pci_subsystem_vendor; 950 unsigned short pci_subsystem_device; 951 bool pci_subsystem_set; 952 #endif /* CONFIG_PCI */ 953 883 954 char topology_shortname[32]; 884 955 … … 894 965 enum snd_soc_pcm_subclass pcm_subclass; 895 966 896 spinlock_t dpcm_lock;897 898 967 int (*probe)(struct snd_soc_card *card); 899 968 int (*late_probe)(struct snd_soc_card *card); 969 void (*fixup_controls)(struct snd_soc_card *card); 900 970 int (*remove)(struct snd_soc_card *card); 901 971 … … 1023 1093 list_for_each_entry_safe(w, _w, &card->widgets, list) 1024 1094 1095 1096 static inline int snd_soc_card_is_instantiated(struct snd_soc_card *card) 1097 { 1098 return card && card->instantiated; 1099 } 1100 1025 1101 /* SoC machine DAI configuration, glues a codec and cpu DAI together */ 1026 1102 struct snd_soc_pcm_runtime { … … 1030 1106 struct snd_pcm_ops ops; 1031 1107 1032 unsigned int params_select; /* currently selectedparam for dai link */1108 unsigned int c2c_params_select; /* currently selected c2c_param for dai link */ 1033 1109 1034 1110 /* Dynamic PCM BE runtime data */ 1035 struct snd_soc_dpcm_runtime dpcm[2]; 1111 struct snd_soc_dpcm_runtime dpcm[SNDRV_PCM_STREAM_LAST + 1]; 1112 struct snd_soc_dapm_widget *c2c_widget[SNDRV_PCM_STREAM_LAST + 1]; 1036 1113 1037 1114 long pmdown_time; … … 1045 1122 * see 1046 1123 * soc_new_pcm_runtime() 1047 * asoc_rtd_to_cpu()1048 * asoc_rtd_to_codec()1124 * snd_soc_rtd_to_cpu() 1125 * snd_soc_rtd_to_codec() 1049 1126 */ 1050 1127 struct snd_soc_dai **dais; 1051 unsigned int num_codecs;1052 unsigned int num_cpus;1053 1054 struct snd_soc_dapm_widget *playback_widget;1055 struct snd_soc_dapm_widget *capture_widget;1056 1128 1057 1129 struct delayed_work delayed_work; … … 1074 1146 unsigned int fe_compr:1; /* for Dynamic PCM */ 1075 1147 1148 bool initialized; 1149 1076 1150 int num_components; 1077 1151 struct snd_soc_component *components[]; /* CPU/Codec/Platform */ 1078 1152 }; 1153 1154 /* REMOVE ME */ 1155 #define asoc_rtd_to_cpu snd_soc_rtd_to_cpu 1156 #define asoc_rtd_to_codec snd_soc_rtd_to_codec 1157 #define asoc_substream_to_rtd snd_soc_substream_to_rtd 1158 1079 1159 /* see soc_new_pcm_runtime() */ 1080 #define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n]1081 #define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->num_cpus]1082 #define asoc_substream_to_rtd(substream) \1160 #define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n] 1161 #define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus] 1162 #define snd_soc_substream_to_rtd(substream) \ 1083 1163 (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream) 1084 1164 … … 1089 1169 #define for_each_rtd_cpu_dais(rtd, i, dai) \ 1090 1170 for ((i) = 0; \ 1091 ((i) < rtd-> num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \1171 ((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \ 1092 1172 (i)++) 1093 1173 #define for_each_rtd_codec_dais(rtd, i, dai) \ 1094 1174 for ((i) = 0; \ 1095 ((i) < rtd-> num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \1175 ((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \ 1096 1176 (i)++) 1097 1177 #define for_each_rtd_dais(rtd, i, dai) \ 1098 1178 for ((i) = 0; \ 1099 ((i) < (rtd)-> num_cpus + (rtd)->num_codecs) &&\1179 ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \ 1100 1180 ((dai) = (rtd)->dais[i]); \ 1101 1181 (i)++) … … 1105 1185 /* mixer control */ 1106 1186 struct soc_mixer_control { 1107 int min, max, platform_max; 1187 /* Minimum and maximum specified as written to the hardware */ 1188 int min, max; 1189 /* Limited maximum value specified as presented through the control */ 1190 int platform_max; 1108 1191 int reg, rreg; 1109 1192 unsigned int shift, rshift; … … 1214 1297 int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, 1215 1298 const char *propname); 1299 int snd_soc_of_parse_pin_switches(struct snd_soc_card *card, const char *prop); 1216 1300 int snd_soc_of_get_slot_mask(struct device_node *np, 1217 1301 const char *prop_name, … … 1240 1324 int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname); 1241 1325 1242 unsigned int snd_soc_daifmt_clock_provider_flip ed(unsigned int dai_fmt);1326 unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int dai_fmt); 1243 1327 unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame); 1244 1328 … … 1256 1340 snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix)) 1257 1341 1342 int snd_soc_get_stream_cpu(struct snd_soc_dai_link *dai_link, int stream); 1343 int snd_soc_get_dlc(const struct of_phandle_args *args, 1344 struct snd_soc_dai_link_component *dlc); 1345 int snd_soc_of_get_dlc(struct device_node *of_node, 1346 struct of_phandle_args *args, 1347 struct snd_soc_dai_link_component *dlc, 1348 int index); 1258 1349 int snd_soc_get_dai_id(struct device_node *ep); 1259 1350 int snd_soc_get_dai_name(const struct of_phandle_args *args, 1260 1351 const char **dai_name); 1261 1352 int snd_soc_of_get_dai_name(struct device_node *of_node, 1262 const char **dai_name );1353 const char **dai_name, int index); 1263 1354 int snd_soc_of_get_dai_link_codecs(struct device *dev, 1264 1355 struct device_node *of_node, 1265 1356 struct snd_soc_dai_link *dai_link); 1266 1357 void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link); 1267 1268 int snd_soc_add_pcm_runtime(struct snd_soc_card *card, 1269 struct snd_soc_dai_link *dai_link); 1358 int snd_soc_of_get_dai_link_cpus(struct device *dev, 1359 struct device_node *of_node, 1360 struct snd_soc_dai_link *dai_link); 1361 void snd_soc_of_put_dai_link_cpus(struct snd_soc_dai_link *dai_link); 1362 1363 int snd_soc_add_pcm_runtimes(struct snd_soc_card *card, 1364 struct snd_soc_dai_link *dai_link, 1365 int num_dai_link); 1270 1366 void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, 1271 1367 struct snd_soc_pcm_runtime *rtd); 1272 1368 1369 void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms, 1370 struct snd_soc_dai_link_component *cpus); 1371 struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, 1372 struct of_phandle_args *args); 1373 struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args); 1273 1374 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, 1274 1375 struct snd_soc_dai_driver *dai_drv, … … 1324 1425 extern const struct dev_pm_ops snd_soc_pm_ops; 1325 1426 1326 /* Helper functions */ 1327 static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm) 1328 { 1329 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 1330 } 1331 1332 static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm) 1333 { 1334 mutex_unlock(&dapm->card->dapm_mutex); 1335 } 1427 /* 1428 * DAPM helper functions 1429 */ 1430 enum snd_soc_dapm_subclass { 1431 SND_SOC_DAPM_CLASS_ROOT = 0, 1432 SND_SOC_DAPM_CLASS_RUNTIME = 1, 1433 }; 1434 1435 static inline void _snd_soc_dapm_mutex_lock_root_c(struct snd_soc_card *card) 1436 { 1437 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_ROOT); 1438 } 1439 1440 static inline void _snd_soc_dapm_mutex_lock_c(struct snd_soc_card *card) 1441 { 1442 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 1443 } 1444 1445 static inline void _snd_soc_dapm_mutex_unlock_c(struct snd_soc_card *card) 1446 { 1447 mutex_unlock(&card->dapm_mutex); 1448 } 1449 1450 static inline void _snd_soc_dapm_mutex_assert_held_c(struct snd_soc_card *card) 1451 { 1452 lockdep_assert_held(&card->dapm_mutex); 1453 } 1454 1455 static inline void _snd_soc_dapm_mutex_lock_root_d(struct snd_soc_dapm_context *dapm) 1456 { 1457 _snd_soc_dapm_mutex_lock_root_c(dapm->card); 1458 } 1459 1460 static inline void _snd_soc_dapm_mutex_lock_d(struct snd_soc_dapm_context *dapm) 1461 { 1462 _snd_soc_dapm_mutex_lock_c(dapm->card); 1463 } 1464 1465 static inline void _snd_soc_dapm_mutex_unlock_d(struct snd_soc_dapm_context *dapm) 1466 { 1467 _snd_soc_dapm_mutex_unlock_c(dapm->card); 1468 } 1469 1470 static inline void _snd_soc_dapm_mutex_assert_held_d(struct snd_soc_dapm_context *dapm) 1471 { 1472 _snd_soc_dapm_mutex_assert_held_c(dapm->card); 1473 } 1474 1475 #define snd_soc_dapm_mutex_lock_root(x) _Generic((x), \ 1476 struct snd_soc_card * : _snd_soc_dapm_mutex_lock_root_c, \ 1477 struct snd_soc_dapm_context * : _snd_soc_dapm_mutex_lock_root_d)(x) 1478 #define snd_soc_dapm_mutex_lock(x) _Generic((x), \ 1479 struct snd_soc_card * : _snd_soc_dapm_mutex_lock_c, \ 1480 struct snd_soc_dapm_context * : _snd_soc_dapm_mutex_lock_d)(x) 1481 #define snd_soc_dapm_mutex_unlock(x) _Generic((x), \ 1482 struct snd_soc_card * : _snd_soc_dapm_mutex_unlock_c, \ 1483 struct snd_soc_dapm_context * : _snd_soc_dapm_mutex_unlock_d)(x) 1484 #define snd_soc_dapm_mutex_assert_held(x) _Generic((x), \ 1485 struct snd_soc_card * : _snd_soc_dapm_mutex_assert_held_c, \ 1486 struct snd_soc_dapm_context * : _snd_soc_dapm_mutex_assert_held_d)(x) 1487 1488 /* 1489 * PCM helper functions 1490 */ 1491 static inline void _snd_soc_dpcm_mutex_lock_c(struct snd_soc_card *card) 1492 { 1493 mutex_lock_nested(&card->pcm_mutex, card->pcm_subclass); 1494 } 1495 1496 static inline void _snd_soc_dpcm_mutex_unlock_c(struct snd_soc_card *card) 1497 { 1498 mutex_unlock(&card->pcm_mutex); 1499 } 1500 1501 static inline void _snd_soc_dpcm_mutex_assert_held_c(struct snd_soc_card *card) 1502 { 1503 lockdep_assert_held(&card->pcm_mutex); 1504 } 1505 1506 static inline void _snd_soc_dpcm_mutex_lock_r(struct snd_soc_pcm_runtime *rtd) 1507 { 1508 _snd_soc_dpcm_mutex_lock_c(rtd->card); 1509 } 1510 1511 static inline void _snd_soc_dpcm_mutex_unlock_r(struct snd_soc_pcm_runtime *rtd) 1512 { 1513 _snd_soc_dpcm_mutex_unlock_c(rtd->card); 1514 } 1515 1516 static inline void _snd_soc_dpcm_mutex_assert_held_r(struct snd_soc_pcm_runtime *rtd) 1517 { 1518 _snd_soc_dpcm_mutex_assert_held_c(rtd->card); 1519 } 1520 1521 #define snd_soc_dpcm_mutex_lock(x) _Generic((x), \ 1522 struct snd_soc_card * : _snd_soc_dpcm_mutex_lock_c, \ 1523 struct snd_soc_pcm_runtime * : _snd_soc_dpcm_mutex_lock_r)(x) 1524 1525 #define snd_soc_dpcm_mutex_unlock(x) _Generic((x), \ 1526 struct snd_soc_card * : _snd_soc_dpcm_mutex_unlock_c, \ 1527 struct snd_soc_pcm_runtime * : _snd_soc_dpcm_mutex_unlock_r)(x) 1528 1529 #define snd_soc_dpcm_mutex_assert_held(x) _Generic((x), \ 1530 struct snd_soc_card * : _snd_soc_dpcm_mutex_assert_held_c, \ 1531 struct snd_soc_pcm_runtime * : _snd_soc_dpcm_mutex_assert_held_r)(x) 1336 1532 1337 1533 #include <sound/soc-component.h> -
GPL/trunk/alsa-kernel/include/sound/sof.h
r717 r772 17 17 18 18 struct snd_sof_dsp_ops; 19 struct snd_sof_dev; 20 21 /** 22 * enum sof_fw_state - DSP firmware state definitions 23 * @SOF_FW_BOOT_NOT_STARTED: firmware boot is not yet started 24 * @SOF_DSPLESS_MODE: DSP is not used 25 * @SOF_FW_BOOT_PREPARE: preparing for boot (firmware loading for exaqmple) 26 * @SOF_FW_BOOT_IN_PROGRESS: firmware boot is in progress 27 * @SOF_FW_BOOT_FAILED: firmware boot failed 28 * @SOF_FW_BOOT_READY_FAILED: firmware booted but fw_ready op failed 29 * @SOF_FW_BOOT_READY_OK: firmware booted and fw_ready op passed 30 * @SOF_FW_BOOT_COMPLETE: firmware is booted up and functional 31 * @SOF_FW_CRASHED: firmware crashed after successful boot 32 */ 33 enum sof_fw_state { 34 SOF_FW_BOOT_NOT_STARTED = 0, 35 SOF_DSPLESS_MODE, 36 SOF_FW_BOOT_PREPARE, 37 SOF_FW_BOOT_IN_PROGRESS, 38 SOF_FW_BOOT_FAILED, 39 SOF_FW_BOOT_READY_FAILED, 40 SOF_FW_BOOT_READY_OK, 41 SOF_FW_BOOT_COMPLETE, 42 SOF_FW_CRASHED, 43 }; 44 45 /* DSP power states */ 46 enum sof_dsp_power_states { 47 SOF_DSP_PM_D0, 48 SOF_DSP_PM_D1, 49 SOF_DSP_PM_D2, 50 SOF_DSP_PM_D3, 51 }; 52 53 /* Definitions for multiple IPCs */ 54 enum sof_ipc_type { 55 SOF_IPC_TYPE_3, 56 SOF_IPC_TYPE_4, 57 SOF_IPC_TYPE_COUNT 58 }; 59 60 #define SOF_IPC SOF_IPC_TYPE_3 61 #define SOF_INTEL_IPC4 SOF_IPC_TYPE_4 19 62 20 63 /* … … 22 65 */ 23 66 struct snd_sof_pdata { 24 const struct firmware *fw;25 67 const char *name; 26 68 const char *platform; 27 69 70 /* 71 * PCI SSID. As PCI does not define 0 as invalid, the subsystem_id_set 72 * flag indicates that a value has been written to these members. 73 */ 74 unsigned short subsystem_vendor; 75 unsigned short subsystem_device; 76 bool subsystem_id_set; 77 28 78 struct device *dev; 29 30 /* indicate how many first bytes shouldn't be loaded into DSP memory. */31 size_t fw_offset;32 79 33 80 /* … … 49 96 const char *tplg_filename; 50 97 98 /* loadable external libraries available under this directory */ 99 const char *fw_lib_prefix; 100 51 101 /* machine */ 52 102 struct platform_device *pdev_mach; 53 103 const struct snd_soc_acpi_mach *machine; 104 const struct snd_sof_of_mach *of_machine; 54 105 55 106 void *hw_pdata; 107 108 enum sof_ipc_type ipc_type; 56 109 }; 57 110 … … 63 116 /* list of machines using this configuration */ 64 117 struct snd_soc_acpi_mach *machines; 118 struct snd_sof_of_mach *of_machines; 65 119 66 120 /* alternate list of machines using this configuration */ … … 75 129 int resindex_imr_base; 76 130 int irqindex_host_ipc; 77 int resindex_dma_base;78 79 /* DMA only valid when resindex_dma_base != -1*/80 int dma_engine;81 int dma_size;82 131 83 132 /* IPC timeouts in ms */ … … 91 140 const char *nocodec_tplg_filename; 92 141 93 /* defaults paths for firmware and topology files */ 94 const char *default_fw_path; 95 const char *default_tplg_path; 142 /* information on supported IPCs */ 143 unsigned int ipc_supported_mask; 144 enum sof_ipc_type ipc_default; 145 146 /* The platform supports DSPless mode */ 147 bool dspless_mode_supported; 148 149 /* defaults paths for firmware, library and topology files */ 150 const char *default_fw_path[SOF_IPC_TYPE_COUNT]; 151 const char *default_lib_path[SOF_IPC_TYPE_COUNT]; 152 const char *default_tplg_path[SOF_IPC_TYPE_COUNT]; 96 153 97 154 /* default firmware name */ 98 const char *default_fw_filename ;155 const char *default_fw_filename[SOF_IPC_TYPE_COUNT]; 99 156 100 const struct snd_sof_dsp_ops *ops; 157 struct snd_sof_dsp_ops *ops; 158 int (*ops_init)(struct snd_sof_dev *sdev); 159 void (*ops_free)(struct snd_sof_dev *sdev); 101 160 }; 102 161 -
GPL/trunk/alsa-kernel/include/sound/version.h
r717 r772 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION " 5.15.59"2 #define CONFIG_SND_VERSION "6.6.85" 3 3 #define CONFIG_SND_DATE "" -
GPL/trunk/alsa-kernel/include/uapi/sound/asequencer.h
r615 r772 4 4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> 5 5 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz> 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 #ifndef _UAPI__SOUND_ASEQUENCER_H … … 27 11 28 12 /** version of the sequencer */ 29 #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)13 #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3) 30 14 31 15 /** … … 191 175 #define SNDRV_SEQ_PRIORITY_MASK (1<<4) 192 176 177 #define SNDRV_SEQ_EVENT_UMP (1<<5) /* event holds a UMP packet */ 193 178 194 179 /* note event */ … … 288 273 #endif 289 274 275 union snd_seq_event_data { /* event data... */ 276 struct snd_seq_ev_note note; 277 struct snd_seq_ev_ctrl control; 278 struct snd_seq_ev_raw8 raw8; 279 struct snd_seq_ev_raw32 raw32; 280 struct snd_seq_ev_ext ext; 281 struct snd_seq_ev_queue_control queue; 282 union snd_seq_timestamp time; 283 struct snd_seq_addr addr; 284 struct snd_seq_connect connect; 285 struct snd_seq_result result; 286 struct snd_seq_ev_quote quote; 287 }; 290 288 291 289 /* sequencer event */ … … 298 296 union snd_seq_timestamp time; /* schedule time */ 299 297 300 301 298 struct snd_seq_addr source; /* source address */ 302 299 struct snd_seq_addr dest; /* destination address */ 303 300 304 union { /* event data... */ 305 struct snd_seq_ev_note note; 306 struct snd_seq_ev_ctrl control; 307 struct snd_seq_ev_raw8 raw8; 308 struct snd_seq_ev_raw32 raw32; 309 struct snd_seq_ev_ext ext; 310 struct snd_seq_ev_queue_control queue; 311 union snd_seq_timestamp time; 312 struct snd_seq_addr addr; 313 struct snd_seq_connect connect; 314 struct snd_seq_result result; 315 struct snd_seq_ev_quote quote; 316 } data; 317 }; 318 301 union snd_seq_event_data data; 302 }; 303 304 /* (compatible) event for UMP-capable clients */ 305 struct snd_seq_ump_event { 306 snd_seq_event_type_t type; /* event type */ 307 unsigned char flags; /* event flags */ 308 char tag; 309 unsigned char queue; /* schedule queue */ 310 union snd_seq_timestamp time; /* schedule time */ 311 struct snd_seq_addr source; /* source address */ 312 struct snd_seq_addr dest; /* destination address */ 313 314 union { 315 union snd_seq_event_data data; 316 unsigned int ump[4]; 317 }; 318 }; 319 319 320 320 /* … … 364 364 365 365 /* event filter flags */ 366 #define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ 367 #define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */ 368 #define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */ 369 #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */ 366 #define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */ 367 #define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */ 368 #define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */ 369 #define SNDRV_SEQ_FILTER_NO_CONVERT (1U<<30) /* don't convert UMP events */ 370 #define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */ 370 371 371 372 struct snd_seq_client_info { … … 380 381 int card; /* RO: card number[kernel] */ 381 382 int pid; /* RO: pid[user] */ 382 char reserved[56]; /* for future use */ 383 }; 384 383 unsigned int midi_version; /* MIDI version */ 384 unsigned int group_filter; /* UMP group filter bitmap 385 * (bit 0 = groupless messages, 386 * bit 1-16 = messages for groups 1-16) 387 */ 388 char reserved[48]; /* for future use */ 389 }; 390 391 /* MIDI version numbers in client info */ 392 #define SNDRV_SEQ_CLIENT_LEGACY_MIDI 0 /* Legacy client */ 393 #define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0 1 /* UMP MIDI 1.0 */ 394 #define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0 2 /* UMP MIDI 2.0 */ 385 395 386 396 /* client pool size */ … … 442 452 #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */ 443 453 #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */ 454 #define SNDRV_SEQ_PORT_CAP_INACTIVE (1<<8) /* inactive port */ 455 #define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT (1<<9) /* MIDI 2.0 UMP Endpoint port */ 444 456 445 457 /* port type */ … … 451 463 #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */ 452 464 #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */ 465 #define SNDRV_SEQ_PORT_TYPE_MIDI_UMP (1<<7) /* UMP */ 453 466 454 467 /* other standards...*/ … … 468 481 #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) 469 482 483 /* port direction */ 484 #define SNDRV_SEQ_PORT_DIR_UNKNOWN 0 485 #define SNDRV_SEQ_PORT_DIR_INPUT 1 486 #define SNDRV_SEQ_PORT_DIR_OUTPUT 2 487 #define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3 488 470 489 struct snd_seq_port_info { 471 490 struct snd_seq_addr addr; /* client/port numbers */ … … 484 503 unsigned int flags; /* misc. conditioning */ 485 504 unsigned char time_queue; /* queue # for timestamping */ 486 char reserved[59]; /* for future use */ 505 unsigned char direction; /* port usage direction (r/w/bidir) */ 506 unsigned char ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */ 507 char reserved[57]; /* for future use */ 487 508 }; 488 509 … … 588 609 }; 589 610 611 /* 612 * UMP-specific information 613 */ 614 /* type of UMP info query */ 615 #define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0 616 #define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1 617 618 struct snd_seq_client_ump_info { 619 int client; /* client number to inquire/set */ 620 int type; /* type to inquire/set */ 621 unsigned char info[512]; /* info (either UMP ep or block info) */ 622 } __packed; 590 623 591 624 /* … … 597 630 #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info) 598 631 #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info) 632 #define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int) 599 633 600 634 #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info) 601 635 #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info) 636 #define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO _IOWR('S', 0x12, struct snd_seq_client_ump_info) 637 #define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO _IOWR('S', 0x13, struct snd_seq_client_ump_info) 602 638 603 639 #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info) -
GPL/trunk/alsa-kernel/include/uapi/sound/asoc.h
r695 r772 5 5 * Copyright (C) 2012 Texas Instruments Inc. 6 6 * Copyright (C) 2015 Intel Corporation. 7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License version 2 as10 * published by the Free Software Foundation.11 7 * 12 8 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs, … … 227 223 __le32 num_elems; /* number of elements in array */ 228 224 union { 229 struct snd_soc_tplg_vendor_uuid_elem uuid[0];230 struct snd_soc_tplg_vendor_value_elem value[0];231 struct snd_soc_tplg_vendor_string_elem string[0];225 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_uuid_elem, uuid); 226 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_value_elem, value); 227 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_string_elem, string); 232 228 }; 233 229 } __attribute__((packed)); … … 241 237 __le32 size; /* in bytes of private data */ 242 238 union { 243 char data[0];244 struct snd_soc_tplg_vendor_array array[0];239 __DECLARE_FLEX_ARRAY(char, data); 240 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_array, array); 245 241 }; 246 242 } __attribute__((packed)); -
GPL/trunk/alsa-kernel/include/uapi/sound/asound.h
r717 r772 4 4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>, 5 5 * Abramo Bagnara <abramo@alsa-project.org> 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 … … 44 28 #ifndef __bitwise 45 29 #define __bitwise 30 #endif 31 32 #ifndef __packed 33 #define __packed 46 34 #endif 47 35 … … 229 217 #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */ 230 218 #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */ 219 /* 220 * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the 221 * available bit count in most significant bit. It's for the case of so-called 'left-justified' or 222 * `right-padding` sample which has less width than 32 bit. 223 */ 231 224 #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10) 232 225 #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11) … … 310 303 #define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */ 311 304 #define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020 /* need the explicit sync of appl_ptr update */ 305 #define SNDRV_PCM_INFO_PERFECT_DRAIN 0x00000040 /* silencing at the end of stream is not required */ 312 306 #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */ 313 307 #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */ … … 327 321 #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */ 328 322 #define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */ 329 323 #define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */ 330 324 #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ 331 325 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ … … 422 416 #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ 423 417 #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ 418 #define SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE (1<<3) /* suppress drain with the filling 419 * of the silence samples 420 */ 424 421 425 422 struct snd_interval { … … 468 465 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */ 469 466 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ 470 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ 471 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ 472 snd_pcm_uframes_t silence_size; /* silence block size */ 467 /* 468 * The following two thresholds alleviate playback buffer underruns; when 469 * hw_avail drops below the threshold, the respective action is triggered: 470 */ 471 snd_pcm_uframes_t stop_threshold; /* - stop playback */ 472 snd_pcm_uframes_t silence_threshold; /* - pre-fill buffer with silence */ 473 snd_pcm_uframes_t silence_size; /* max size of silence pre-fill; when >= boundary, 474 * fill played area with silence immediately */ 473 475 snd_pcm_uframes_t boundary; /* pointers wrap point */ 474 476 unsigned int proto; /* protocol version */ … … 619 621 __pad_before_uframe __pad1; 620 622 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ 621 __pad_before_uframe __pad2; 623 __pad_before_uframe __pad2; // This should be __pad_after_uframe, but binary 624 // backwards compatibility constraints prevent a fix. 622 625 623 626 __pad_before_uframe __pad3; … … 751 754 */ 752 755 753 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)756 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) 754 757 755 758 enum { … … 762 765 #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 763 766 #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 767 #define SNDRV_RAWMIDI_INFO_UMP 0x00000008 764 768 765 769 struct snd_rawmidi_info { … … 826 830 #endif 827 831 832 /* UMP EP info flags */ 833 #define SNDRV_UMP_EP_INFO_STATIC_BLOCKS 0x01 834 835 /* UMP EP Protocol / JRTS capability bits */ 836 #define SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK 0x0300 837 #define SNDRV_UMP_EP_INFO_PROTO_MIDI1 0x0100 /* MIDI 1.0 */ 838 #define SNDRV_UMP_EP_INFO_PROTO_MIDI2 0x0200 /* MIDI 2.0 */ 839 #define SNDRV_UMP_EP_INFO_PROTO_JRTS_MASK 0x0003 840 #define SNDRV_UMP_EP_INFO_PROTO_JRTS_TX 0x0001 /* JRTS Transmit */ 841 #define SNDRV_UMP_EP_INFO_PROTO_JRTS_RX 0x0002 /* JRTS Receive */ 842 843 /* UMP Endpoint information */ 844 struct snd_ump_endpoint_info { 845 int card; /* card number */ 846 int device; /* device number */ 847 unsigned int flags; /* additional info */ 848 unsigned int protocol_caps; /* protocol capabilities */ 849 unsigned int protocol; /* current protocol */ 850 unsigned int num_blocks; /* # of function blocks */ 851 unsigned short version; /* UMP major/minor version */ 852 unsigned short family_id; /* MIDI device family ID */ 853 unsigned short model_id; /* MIDI family model ID */ 854 unsigned int manufacturer_id; /* MIDI manufacturer ID */ 855 unsigned char sw_revision[4]; /* software revision */ 856 unsigned short padding; 857 unsigned char name[128]; /* endpoint name string */ 858 unsigned char product_id[128]; /* unique product id string */ 859 unsigned char reserved[32]; 860 } __packed; 861 862 /* UMP direction */ 863 #define SNDRV_UMP_DIR_INPUT 0x01 864 #define SNDRV_UMP_DIR_OUTPUT 0x02 865 #define SNDRV_UMP_DIR_BIDIRECTION 0x03 866 867 /* UMP block info flags */ 868 #define SNDRV_UMP_BLOCK_IS_MIDI1 (1U << 0) /* MIDI 1.0 port w/o restrict */ 869 #define SNDRV_UMP_BLOCK_IS_LOWSPEED (1U << 1) /* 31.25Kbps B/W MIDI1 port */ 870 871 /* UMP block user-interface hint */ 872 #define SNDRV_UMP_BLOCK_UI_HINT_UNKNOWN 0x00 873 #define SNDRV_UMP_BLOCK_UI_HINT_RECEIVER 0x01 874 #define SNDRV_UMP_BLOCK_UI_HINT_SENDER 0x02 875 #define SNDRV_UMP_BLOCK_UI_HINT_BOTH 0x03 876 877 /* UMP groups and blocks */ 878 #define SNDRV_UMP_MAX_GROUPS 16 879 #define SNDRV_UMP_MAX_BLOCKS 32 880 881 /* UMP Block information */ 882 struct snd_ump_block_info { 883 int card; /* card number */ 884 int device; /* device number */ 885 unsigned char block_id; /* block ID (R/W) */ 886 unsigned char direction; /* UMP direction */ 887 unsigned char active; /* Activeness */ 888 unsigned char first_group; /* first group ID */ 889 unsigned char num_groups; /* number of groups */ 890 unsigned char midi_ci_version; /* MIDI-CI support version */ 891 unsigned char sysex8_streams; /* max number of sysex8 streams */ 892 unsigned char ui_hint; /* user interface hint */ 893 unsigned int flags; /* various info flags */ 894 unsigned char name[128]; /* block name string */ 895 unsigned char reserved[32]; 896 } __packed; 897 828 898 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) 829 899 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) … … 833 903 #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int) 834 904 #define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int) 905 /* Additional ioctls for UMP rawmidi devices */ 906 #define SNDRV_UMP_IOCTL_ENDPOINT_INFO _IOR('W', 0x40, struct snd_ump_endpoint_info) 907 #define SNDRV_UMP_IOCTL_BLOCK_INFO _IOR('W', 0x41, struct snd_ump_block_info) 835 908 836 909 /* … … 1008 1081 ****************************************************************************/ 1009 1082 1010 #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)1083 #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9) 1011 1084 1012 1085 /******************** This section used in uniaud.dll interface *********************/ … … 1047 1120 #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE) 1048 1121 #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */ 1049 / / (1 << 3) is unused.1122 /* (1 << 3) is unused. */ 1050 1123 #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */ 1051 1124 #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */ … … 1145 1218 unsigned int length; /* in bytes aligned to 4 */ 1146 1219 #ifndef TARGET_OS2 1147 unsigned int tlv[ 0]; /* first TLV */1220 unsigned int tlv[]; /* first TLV */ 1148 1221 #else 1149 1222 unsigned int tlv[1]; /* first TLV */ … … 1174 1247 #define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info) 1175 1248 #define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int) 1249 #define SNDRV_CTL_IOCTL_UMP_NEXT_DEVICE _IOWR('U', 0x43, int) 1250 #define SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO _IOWR('U', 0x44, struct snd_ump_endpoint_info) 1251 #define SNDRV_CTL_IOCTL_UMP_BLOCK_INFO _IOWR('U', 0x45, struct snd_ump_block_info) 1176 1252 #define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int) 1177 1253 #define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int) -
GPL/trunk/alsa-kernel/include/uapi/sound/asound_fm.h
r615 r772 11 11 * 12 12 * Direct FM control 13 *14 * This program is free software; you can redistribute it and/or modify15 * it under the terms of the GNU General Public License as published by16 * the Free Software Foundation; either version 2 of the License, or17 * (at your option) any later version.18 *19 * This program is distributed in the hope that it will be useful,20 * but WITHOUT ANY WARRANTY; without even the implied warranty of21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 * GNU General Public License for more details.23 *24 * You should have received a copy of the GNU General Public License25 * along with this program; if not, write to the Free Software26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA27 *28 13 */ 29 14 -
GPL/trunk/alsa-kernel/include/uapi/sound/compress_offload.h
r629 r772 6 6 * Authors: Vinod Koul <vinod.koul@linux.intel.com> 7 7 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> 8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~9 *10 * This program is free software; you can redistribute it and/or modify11 * it under the terms of the GNU General Public License as published by12 * the Free Software Foundation; version 2 of the License.13 *14 * This program is distributed in the hope that it will be useful, but15 * WITHOUT ANY WARRANTY; without even the implied warranty of16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU17 * General Public License for more details.18 *19 * You should have received a copy of the GNU General Public License along20 * with this program; if not, write to the Free Software Foundation, Inc.,21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.22 *23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~24 *25 8 */ 26 9 #ifndef __COMPRESS_OFFLOAD_H … … 124 107 125 108 /** 126 * enum sndrv_compress_encoder 109 * enum sndrv_compress_encoder - encoder metadata key 127 110 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the 128 111 * end of the track -
GPL/trunk/alsa-kernel/include/uapi/sound/compress_params.h
r629 r772 8 8 * Vinod Koul <vinod.koul@linux.intel.com> 9 9 * 10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11 *12 * This program is free software; you can redistribute it and/or modify13 * it under the terms of the GNU General Public License as published by14 * the Free Software Foundation; version 2 of the License.15 *16 * This program is distributed in the hope that it will be useful, but17 * WITHOUT ANY WARRANTY; without even the implied warranty of18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU19 * General Public License for more details.20 *21 * You should have received a copy of the GNU General Public License along22 * with this program; if not, write to the Free Software Foundation, Inc.,23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.24 *25 10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 11 * 27 12 * The definitions in this file are derived from the OpenMAX AL version 1.1 28 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below. 13 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below 14 * and are licensed under the MIT license. 29 15 * 30 16 * Copyright (c) 2007-2010 The Khronos Group Inc. 31 *32 * Permission is hereby granted, free of charge, to any person obtaining33 * a copy of this software and/or associated documentation files (the34 * "Materials "), to deal in the Materials without restriction, including35 * without limitation the rights to use, copy, modify, merge, publish,36 * distribute, sublicense, and/or sell copies of the Materials, and to37 * permit persons to whom the Materials are furnished to do so, subject to38 * the following conditions:39 *40 * The above copyright notice and this permission notice shall be included41 * in all copies or substantial portions of the Materials.42 *43 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS44 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF45 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.46 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY47 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,48 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE49 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.50 *51 17 */ 52 18 #ifndef __SND_COMPRESS_PARAMS_H … … 251 217 252 218 /** 253 * struct snd_enc_vorbis 219 * struct snd_enc_vorbis - Vorbis encoder parameters 254 220 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high). 255 221 * In the default mode of operation, the quality level is 3. … … 280 246 281 247 /** 282 * struct snd_enc_real 248 * struct snd_enc_real - RealAudio encoder parameters 283 249 * @quant_bits: number of coupling quantization bits in the stream 284 250 * @start_region: coupling start region in the stream … … 295 261 296 262 /** 297 * struct snd_enc_flac 263 * struct snd_enc_flac - FLAC encoder parameters 298 264 * @num: serial number, valid only for OGG formats 299 265 * needs to be set by application -
GPL/trunk/alsa-kernel/include/uapi/sound/emu10k1.h
r629 r772 4 4 * Creative Labs, Inc. 5 5 * Definitions for EMU10K1 (SB Live!) chips 6 *7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License as published by10 * the Free Software Foundation; either version 2 of the License, or11 * (at your option) any later version.12 *13 * This program is distributed in the hope that it will be useful,14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public License for more details.17 *18 * You should have received a copy of the GNU General Public License19 * along with this program; if not, write to the Free Software20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21 *22 6 */ 23 7 #ifndef _UAPI__SOUND_EMU10K1_H … … 31 15 * ---- FX8010 ---- 32 16 */ 33 34 #define EMU10K1_CARD_CREATIVE 0x0000000035 #define EMU10K1_CARD_EMUAPS 0x0000000136 17 37 18 #define EMU10K1_FX8010_PCM_COUNT 8 … … 63 44 #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ 64 45 46 #define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */ 47 #define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */ 48 #define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */ 49 #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ 50 #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ 51 52 /* Audigy Soundcards have a different instruction format */ 53 #define A_LOWORD_OPX_MASK 0x007ff000 54 #define A_LOWORD_OPY_MASK 0x000007ff 55 #define A_HIWORD_OPCODE_MASK 0x0f000000 56 #define A_HIWORD_RESULT_MASK 0x007ff000 57 #define A_HIWORD_OPA_MASK 0x000007ff 58 65 59 /* GPRs */ 66 60 #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ … … 69 63 #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ 70 64 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ 65 66 #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ 67 #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ 68 #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ 69 #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ 70 #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ 71 #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" */ 72 #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_01 - _0F" */ 73 #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x1f "EMU32_IN_00 - _1F" - Only when .device = 0x0008 */ 74 #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x1f "EMU32_OUT_00 - _1F" - Only when .device = 0x0008 */ 71 75 72 76 #define C_00000000 0x40 … … 98 102 #define GPR_IRQ 0x5a /* IRQ register */ 99 103 #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ 100 #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */101 #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */102 #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */103 #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */104 #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */105 106 #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */107 #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */108 #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */109 #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */110 #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */111 #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */112 113 #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */114 #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */115 #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */116 #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */117 #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */118 #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */119 #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */120 #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */121 #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */122 #define A_GPR(x) (A_FXGPREGBASE + (x))123 124 /* cc_reg constants */125 #define CC_REG_NORMALIZED C_00000001126 #define CC_REG_BORROW C_00000002127 #define CC_REG_MINUS C_00000004128 #define CC_REG_ZERO C_00000008129 #define CC_REG_SATURATE C_00000010130 #define CC_REG_NONZERO C_00000100131 132 /* FX buses */133 #define FXBUS_PCM_LEFT 0x00134 #define FXBUS_PCM_RIGHT 0x01135 #define FXBUS_PCM_LEFT_REAR 0x02136 #define FXBUS_PCM_RIGHT_REAR 0x03137 #define FXBUS_MIDI_LEFT 0x04138 #define FXBUS_MIDI_RIGHT 0x05139 #define FXBUS_PCM_CENTER 0x06140 #define FXBUS_PCM_LFE 0x07141 #define FXBUS_PCM_LEFT_FRONT 0x08142 #define FXBUS_PCM_RIGHT_FRONT 0x09143 #define FXBUS_MIDI_REVERB 0x0c144 #define FXBUS_MIDI_CHORUS 0x0d145 #define FXBUS_PCM_LEFT_SIDE 0x0e146 #define FXBUS_PCM_RIGHT_SIDE 0x0f147 #define FXBUS_PT_LEFT 0x14148 #define FXBUS_PT_RIGHT 0x15149 150 /* Inputs */151 #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */152 #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */153 #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */154 #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */155 #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */156 #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */157 #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */158 #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */159 #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */160 #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */161 #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */162 #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */163 #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */164 #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */165 166 /* Outputs */167 #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */168 #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */169 #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */170 #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */171 #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */172 #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */173 #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */174 #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */175 #define EXTOUT_REAR_L 0x08 /* Rear channel - left */176 #define EXTOUT_REAR_R 0x09 /* Rear channel - right */177 #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */178 #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */179 #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */180 #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */181 #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */182 #define EXTOUT_ACENTER 0x11 /* Analog Center */183 #define EXTOUT_ALFE 0x12 /* Analog LFE */184 185 /* Audigy Inputs */186 #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */187 #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */188 #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */189 #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */190 #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */191 #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */192 #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */193 #define A_EXTIN_LINE2_R 0x09 /* right */194 #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */195 #define A_EXTIN_ADC_R 0x0b /* right */196 #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */197 #define A_EXTIN_AUX2_R 0x0d /* - right */198 199 /* Audigiy Outputs */200 #define A_EXTOUT_FRONT_L 0x00 /* digital front left */201 #define A_EXTOUT_FRONT_R 0x01 /* right */202 #define A_EXTOUT_CENTER 0x02 /* digital front center */203 #define A_EXTOUT_LFE 0x03 /* digital front lfe */204 #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */205 #define A_EXTOUT_HEADPHONE_R 0x05 /* right */206 #define A_EXTOUT_REAR_L 0x06 /* digital rear left */207 #define A_EXTOUT_REAR_R 0x07 /* right */208 #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */209 #define A_EXTOUT_AFRONT_R 0x09 /* right */210 #define A_EXTOUT_ACENTER 0x0a /* analog center */211 #define A_EXTOUT_ALFE 0x0b /* analog LFE */212 #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */213 #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */214 #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */215 #define A_EXTOUT_AREAR_R 0x0f /* right */216 #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */217 #define A_EXTOUT_AC97_R 0x11 /* right */218 #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */219 #define A_EXTOUT_ADC_CAP_R 0x17 /* right */220 #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */221 104 222 105 /* Audigy constants */ … … 251 134 #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ 252 135 253 /* definitions for debug register */ 136 /* Each FX general purpose register is 32 bits in length, all bits are used */ 137 #define FXGPREGBASE 0x100 /* FX general purpose registers base */ 138 #define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ 139 140 #define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */ 141 #define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */ 142 143 /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ 144 /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ 145 /* locations are for external TRAM. */ 146 #define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */ 147 #define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */ 148 149 /* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */ 150 #define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */ 151 #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ 152 #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ 153 #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ 154 #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ 155 #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ 156 157 #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ 158 #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 159 #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 160 #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 161 #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 162 163 #define A_GPR(x) (A_FXGPREGBASE + (x)) 164 #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 165 #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 166 #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 167 #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 168 #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 169 #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 170 171 /* cc_reg constants */ 172 #define CC_REG_NORMALIZED C_00000001 173 #define CC_REG_BORROW C_00000002 174 #define CC_REG_MINUS C_00000004 175 #define CC_REG_ZERO C_00000008 176 #define CC_REG_SATURATE C_00000010 177 #define CC_REG_NONZERO C_00000100 178 179 #define A_CC_REG_NORMALIZED A_C_00000001 180 #define A_CC_REG_BORROW A_C_00000002 181 #define A_CC_REG_MINUS A_C_00000004 182 #define A_CC_REG_ZERO A_C_00000008 183 #define A_CC_REG_SATURATE A_C_00000010 184 #define A_CC_REG_NONZERO A_C_00000100 185 186 /* FX buses */ 187 // These are arbitrary mappings; our DSP code simply expects 188 // the config files to route the channels this way. 189 // The numbers are documented in {audigy,sb-live}-mixer.rst. 190 #define FXBUS_PCM_LEFT 0x00 191 #define FXBUS_PCM_RIGHT 0x01 192 #define FXBUS_PCM_LEFT_REAR 0x02 193 #define FXBUS_PCM_RIGHT_REAR 0x03 194 #define FXBUS_MIDI_LEFT 0x04 195 #define FXBUS_MIDI_RIGHT 0x05 196 #define FXBUS_PCM_CENTER 0x06 197 #define FXBUS_PCM_LFE 0x07 198 #define FXBUS_PCM_LEFT_FRONT 0x08 199 #define FXBUS_PCM_RIGHT_FRONT 0x09 200 #define FXBUS_MIDI_REVERB 0x0c 201 #define FXBUS_MIDI_CHORUS 0x0d 202 #define FXBUS_PCM_LEFT_SIDE 0x0e 203 #define FXBUS_PCM_RIGHT_SIDE 0x0f 204 #define FXBUS_PT_LEFT 0x14 205 #define FXBUS_PT_RIGHT 0x15 206 207 /* Inputs */ 208 #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 209 #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 210 #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ 211 #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ 212 #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ 213 #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ 214 #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ 215 #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ 216 #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ 217 #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ 218 #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ 219 #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ 220 #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ 221 #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ 222 223 /* Outputs */ 224 #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ 225 #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ 226 #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ 227 #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ 228 #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ 229 #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ 230 #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ 231 #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ 232 #define EXTOUT_REAR_L 0x08 /* Rear channel - left */ 233 #define EXTOUT_REAR_R 0x09 /* Rear channel - right */ 234 #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ 235 #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ 236 #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ 237 #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ 238 #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ 239 #define EXTOUT_ACENTER 0x11 /* Analog Center */ 240 #define EXTOUT_ALFE 0x12 /* Analog LFE */ 241 242 /* Audigy Inputs */ 243 #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 244 #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 245 #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ 246 #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ 247 #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ 248 #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ 249 #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ 250 #define A_EXTIN_LINE2_R 0x09 /* right */ 251 #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */ 252 #define A_EXTIN_ADC_R 0x0b /* right */ 253 #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ 254 #define A_EXTIN_AUX2_R 0x0d /* - right */ 255 256 /* Audigiy Outputs */ 257 #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ 258 #define A_EXTOUT_FRONT_R 0x01 /* right */ 259 #define A_EXTOUT_CENTER 0x02 /* digital front center */ 260 #define A_EXTOUT_LFE 0x03 /* digital front lfe */ 261 #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ 262 #define A_EXTOUT_HEADPHONE_R 0x05 /* right */ 263 #define A_EXTOUT_REAR_L 0x06 /* digital rear left */ 264 #define A_EXTOUT_REAR_R 0x07 /* right */ 265 #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ 266 #define A_EXTOUT_AFRONT_R 0x09 /* right */ 267 #define A_EXTOUT_ACENTER 0x0a /* analog center */ 268 #define A_EXTOUT_ALFE 0x0b /* analog LFE */ 269 #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ 270 #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ 271 #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ 272 #define A_EXTOUT_AREAR_R 0x0f /* right */ 273 #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ 274 #define A_EXTOUT_AC97_R 0x11 /* right */ 275 #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ 276 #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ 277 #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ 278 279 /* Definitions for debug register. Note that these are for emu10k1 ONLY. */ 254 280 #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ 255 281 #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ … … 260 286 #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ 261 287 262 /* tank memory address line*/263 # ifndef __KERNEL__264 #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */265 #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */266 #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access*/267 #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */268 #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */269 # endif288 /* Definitions for emu10k2 debug register. */ 289 #define A_DBG_ZC 0x40000000 /* zero tram counter */ 290 #define A_DBG_SATURATION_OCCURED 0x20000000 291 #define A_DBG_SATURATION_ADDR 0x0ffc0000 292 #define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ 293 #define A_DBG_STEP 0x00010000 294 #define A_DBG_CONDITION_CODE 0x0000f800 295 #define A_DBG_STEP_ADDR 0x000003ff 270 296 271 297 struct snd_emu10k1_fx8010_info { … … 283 309 #define EMU10K1_GPR_TRANSLATION_TREBLE 3 284 310 #define EMU10K1_GPR_TRANSLATION_ONOFF 4 311 #define EMU10K1_GPR_TRANSLATION_NEGATE 5 312 #define EMU10K1_GPR_TRANSLATION_NEG_TABLE100 6 285 313 286 314 enum emu10k1_ctl_elem_iface { … … 303 331 unsigned int count; /* count of GPR (1..16) */ 304 332 unsigned short gpr[32]; /* GPR number(s) */ 305 unsigned int value[32];/* initial values */306 unsigned int min;/* minimum range */307 unsigned int max;/* maximum range */333 int value[32]; /* initial values */ 334 int min; /* minimum range */ 335 int max; /* maximum range */ 308 336 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 309 337 const unsigned int *tlv; -
GPL/trunk/alsa-kernel/include/uapi/sound/tlv.h
r615 r772 1 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 /*3 * This program is free software; you can redistribute it and/or modify4 * it under the terms of the GNU General Public License as published by5 * the Free Software Foundation; either version 2 of the License, or6 * (at your option) any later version.7 *8 * This program is distributed in the hope that it will be useful,9 * but WITHOUT ANY WARRANTY; without even the implied warranty of10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11 * GNU General Public License for more details.12 */13 2 14 3 #ifndef __UAPI_SOUND_TLV_H
Note:
See TracChangeset
for help on using the changeset viewer.