Merge branch 'topic/misc' into for-next
Generic updates for sound 3.6
This commit is contained in:
commit
f0913cd16e
20 changed files with 360 additions and 538 deletions
|
@ -810,7 +810,7 @@ int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_pa
|
|||
int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
|
||||
unsigned int cond,
|
||||
snd_pcm_hw_param_t var,
|
||||
struct snd_pcm_hw_constraint_list *l);
|
||||
const struct snd_pcm_hw_constraint_list *l);
|
||||
int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
|
||||
unsigned int cond,
|
||||
snd_pcm_hw_param_t var,
|
||||
|
@ -893,6 +893,7 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
|
|||
|
||||
int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
|
||||
unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
|
||||
unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit);
|
||||
|
||||
static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
|
||||
struct snd_dma_buffer *bufp)
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <sound/pcm.h>
|
||||
|
||||
int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm,
|
||||
struct snd_pcm_hw_params *params,
|
||||
snd_pcm_hw_param_t var, int *dir);
|
||||
|
|
|
@ -38,21 +38,31 @@
|
|||
#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
|
||||
#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
|
||||
|
||||
#define TLV_ITEM(type, ...) \
|
||||
(type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__
|
||||
#define TLV_LENGTH(...) \
|
||||
((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
|
||||
|
||||
#define TLV_CONTAINER_ITEM(...) \
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
|
||||
#define DECLARE_TLV_CONTAINER(name, ...) \
|
||||
unsigned int name[] = { TLV_CONTAINER_ITEM(__VA_ARGS__) }
|
||||
|
||||
#define TLV_DB_SCALE_MASK 0xffff
|
||||
#define TLV_DB_SCALE_MUTE 0x10000
|
||||
#define TLV_DB_SCALE_ITEM(min, step, mute) \
|
||||
SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \
|
||||
(min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0)
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
|
||||
(min), \
|
||||
((step) & TLV_DB_SCALE_MASK) | \
|
||||
((mute) ? TLV_DB_SCALE_MUTE : 0))
|
||||
#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
|
||||
unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
|
||||
|
||||
/* dB scale specified with min/max values instead of step */
|
||||
#define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \
|
||||
SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \
|
||||
(min_dB), (max_dB)
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
|
||||
#define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
|
||||
SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \
|
||||
(min_dB), (max_dB)
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
|
||||
#define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \
|
||||
unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) }
|
||||
#define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \
|
||||
|
@ -60,13 +70,16 @@
|
|||
|
||||
/* linear volume between min_dB and max_dB (.01dB unit) */
|
||||
#define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \
|
||||
SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \
|
||||
(min_dB), (max_dB)
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
|
||||
#define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \
|
||||
unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) }
|
||||
|
||||
/* dB range container */
|
||||
/* Each item is: <min> <max> <TLV> */
|
||||
#define TLV_DB_RANGE_ITEM(...) \
|
||||
TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
|
||||
#define DECLARE_TLV_DB_RANGE(name, ...) \
|
||||
unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) }
|
||||
/* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */
|
||||
#define TLV_DB_RANGE_HEAD(num) \
|
||||
SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue