diff options
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/Kbuild | 10 | ||||
| -rw-r--r-- | include/sound/ac97_codec.h | 33 | ||||
| -rw-r--r-- | include/sound/ad1848.h | 22 | ||||
| -rw-r--r-- | include/sound/ak4xxx-adda.h | 50 | ||||
| -rw-r--r-- | include/sound/asound.h | 19 | ||||
| -rw-r--r-- | include/sound/control.h | 13 | ||||
| -rw-r--r-- | include/sound/core.h | 12 | ||||
| -rw-r--r-- | include/sound/cs46xx.h | 1 | ||||
| -rw-r--r-- | include/sound/emu10k1.h | 4 | ||||
| -rw-r--r-- | include/sound/info.h | 7 | ||||
| -rw-r--r-- | include/sound/initval.h | 3 | ||||
| -rw-r--r-- | include/sound/pcm.h | 4 | ||||
| -rw-r--r-- | include/sound/tea575x-tuner.h | 3 | ||||
| -rw-r--r-- | include/sound/timer.h | 1 | ||||
| -rw-r--r-- | include/sound/tlv.h | 60 | ||||
| -rw-r--r-- | include/sound/vx_core.h | 1 |
16 files changed, 207 insertions, 36 deletions
diff --git a/include/sound/Kbuild b/include/sound/Kbuild new file mode 100644 index 000000000000..fd054a344324 --- /dev/null +++ b/include/sound/Kbuild | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | header-y += asound_fm.h | ||
| 2 | header-y += hdsp.h | ||
| 3 | header-y += hdspm.h | ||
| 4 | header-y += sfnt_info.h | ||
| 5 | header-y += sscape_ioctl.h | ||
| 6 | |||
| 7 | unifdef-y += asequencer.h | ||
| 8 | unifdef-y += asound.h | ||
| 9 | unifdef-y += emu10k1.h | ||
| 10 | unifdef-y += sb16_csp.h | ||
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 446afc3ea27f..4c43521cc493 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
| 29 | #include <linux/device.h> | 29 | #include <linux/device.h> |
| 30 | #include <linux/workqueue.h> | ||
| 30 | #include "pcm.h" | 31 | #include "pcm.h" |
| 31 | #include "control.h" | 32 | #include "control.h" |
| 32 | #include "info.h" | 33 | #include "info.h" |
| @@ -140,6 +141,20 @@ | |||
| 140 | #define AC97_GP_DRSS_1011 0x0000 /* LR(C) 10+11(+12) */ | 141 | #define AC97_GP_DRSS_1011 0x0000 /* LR(C) 10+11(+12) */ |
| 141 | #define AC97_GP_DRSS_78 0x0400 /* LR 7+8 */ | 142 | #define AC97_GP_DRSS_78 0x0400 /* LR 7+8 */ |
| 142 | 143 | ||
| 144 | /* powerdown bits */ | ||
| 145 | #define AC97_PD_ADC_STATUS 0x0001 /* ADC status (RO) */ | ||
| 146 | #define AC97_PD_DAC_STATUS 0x0002 /* DAC status (RO) */ | ||
| 147 | #define AC97_PD_MIXER_STATUS 0x0004 /* Analog mixer status (RO) */ | ||
| 148 | #define AC97_PD_VREF_STATUS 0x0008 /* Vref status (RO) */ | ||
| 149 | #define AC97_PD_PR0 0x0100 /* Power down PCM ADCs and input MUX */ | ||
| 150 | #define AC97_PD_PR1 0x0200 /* Power down PCM front DAC */ | ||
| 151 | #define AC97_PD_PR2 0x0400 /* Power down Mixer (Vref still on) */ | ||
| 152 | #define AC97_PD_PR3 0x0800 /* Power down Mixer (Vref off) */ | ||
| 153 | #define AC97_PD_PR4 0x1000 /* Power down AC-Link */ | ||
| 154 | #define AC97_PD_PR5 0x2000 /* Disable internal clock usage */ | ||
| 155 | #define AC97_PD_PR6 0x4000 /* Headphone amplifier */ | ||
| 156 | #define AC97_PD_EAPD 0x8000 /* External Amplifer Power Down (EAPD) */ | ||
| 157 | |||
| 143 | /* extended audio ID bit defines */ | 158 | /* extended audio ID bit defines */ |
| 144 | #define AC97_EI_VRA 0x0001 /* Variable bit rate supported */ | 159 | #define AC97_EI_VRA 0x0001 /* Variable bit rate supported */ |
| 145 | #define AC97_EI_DRA 0x0002 /* Double rate supported */ | 160 | #define AC97_EI_DRA 0x0002 /* Double rate supported */ |
| @@ -265,6 +280,7 @@ | |||
| 265 | 280 | ||
| 266 | /* specific - Analog Devices */ | 281 | /* specific - Analog Devices */ |
| 267 | #define AC97_AD_TEST 0x5a /* test register */ | 282 | #define AC97_AD_TEST 0x5a /* test register */ |
| 283 | #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */ | ||
| 268 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ | 284 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ |
| 269 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ | 285 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ |
| 270 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ | 286 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ |
| @@ -358,6 +374,7 @@ | |||
| 358 | #define AC97_SCAP_INV_EAPD (1<<7) /* inverted EAPD */ | 374 | #define AC97_SCAP_INV_EAPD (1<<7) /* inverted EAPD */ |
| 359 | #define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */ | 375 | #define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */ |
| 360 | #define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */ | 376 | #define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */ |
| 377 | #define AC97_SCAP_EAPD_LED (1<<10) /* EAPD as mute LED */ | ||
| 361 | 378 | ||
| 362 | /* ac97->flags */ | 379 | /* ac97->flags */ |
| 363 | #define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */ | 380 | #define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */ |
| @@ -490,6 +507,12 @@ struct snd_ac97 { | |||
| 490 | /* jack-sharing info */ | 507 | /* jack-sharing info */ |
| 491 | unsigned char indep_surround; | 508 | unsigned char indep_surround; |
| 492 | unsigned char channel_mode; | 509 | unsigned char channel_mode; |
| 510 | |||
| 511 | #ifdef CONFIG_SND_AC97_POWER_SAVE | ||
| 512 | unsigned int power_up; /* power states */ | ||
| 513 | struct workqueue_struct *power_workq; | ||
| 514 | struct work_struct power_work; | ||
| 515 | #endif | ||
| 493 | struct device dev; | 516 | struct device dev; |
| 494 | }; | 517 | }; |
| 495 | 518 | ||
| @@ -531,6 +554,15 @@ unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg); | |||
| 531 | void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value); | 554 | void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value); |
| 532 | int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value); | 555 | int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value); |
| 533 | int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value); | 556 | int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value); |
| 557 | #ifdef CONFIG_SND_AC97_POWER_SAVE | ||
| 558 | int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup); | ||
| 559 | #else | ||
| 560 | static inline int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, | ||
| 561 | int powerup) | ||
| 562 | { | ||
| 563 | return 0; | ||
| 564 | } | ||
| 565 | #endif | ||
| 534 | #ifdef CONFIG_PM | 566 | #ifdef CONFIG_PM |
| 535 | void snd_ac97_suspend(struct snd_ac97 *ac97); | 567 | void snd_ac97_suspend(struct snd_ac97 *ac97); |
| 536 | void snd_ac97_resume(struct snd_ac97 *ac97); | 568 | void snd_ac97_resume(struct snd_ac97 *ac97); |
| @@ -582,6 +614,7 @@ struct ac97_pcm { | |||
| 582 | copy_flag: 1, /* lowlevel driver must fill all entries */ | 614 | copy_flag: 1, /* lowlevel driver must fill all entries */ |
| 583 | spdif: 1; /* spdif pcm */ | 615 | spdif: 1; /* spdif pcm */ |
| 584 | unsigned short aslots; /* active slots */ | 616 | unsigned short aslots; /* active slots */ |
| 617 | unsigned short cur_dbl; /* current double-rate state */ | ||
| 585 | unsigned int rates; /* available rates */ | 618 | unsigned int rates; /* available rates */ |
| 586 | struct { | 619 | struct { |
| 587 | unsigned short slots; /* driver input: requested AC97 slot numbers */ | 620 | unsigned short slots; /* driver input: requested AC97 slot numbers */ |
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h index 57af1fe7b309..c8de6f83338f 100644 --- a/include/sound/ad1848.h +++ b/include/sound/ad1848.h | |||
| @@ -179,14 +179,13 @@ enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE }; | |||
| 179 | #define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ | 179 | #define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ |
| 180 | ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) | 180 | ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) |
| 181 | 181 | ||
| 182 | int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int type, unsigned long value); | ||
| 183 | |||
| 184 | /* for ease of use */ | 182 | /* for ease of use */ |
| 185 | struct ad1848_mix_elem { | 183 | struct ad1848_mix_elem { |
| 186 | const char *name; | 184 | const char *name; |
| 187 | int index; | 185 | int index; |
| 188 | int type; | 186 | int type; |
| 189 | unsigned long private_value; | 187 | unsigned long private_value; |
| 188 | unsigned int *tlv; | ||
| 190 | }; | 189 | }; |
| 191 | 190 | ||
| 192 | #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ | 191 | #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ |
| @@ -195,15 +194,26 @@ struct ad1848_mix_elem { | |||
| 195 | .type = AD1848_MIX_SINGLE, \ | 194 | .type = AD1848_MIX_SINGLE, \ |
| 196 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) } | 195 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) } |
| 197 | 196 | ||
| 197 | #define AD1848_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \ | ||
| 198 | { .name = xname, \ | ||
| 199 | .index = xindex, \ | ||
| 200 | .type = AD1848_MIX_SINGLE, \ | ||
| 201 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert), \ | ||
| 202 | .tlv = xtlv } | ||
| 203 | |||
| 198 | #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ | 204 | #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ |
| 199 | { .name = xname, \ | 205 | { .name = xname, \ |
| 200 | .index = xindex, \ | 206 | .index = xindex, \ |
| 201 | .type = AD1848_MIX_DOUBLE, \ | 207 | .type = AD1848_MIX_DOUBLE, \ |
| 202 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } | 208 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } |
| 203 | 209 | ||
| 204 | static inline int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c) | 210 | #define AD1848_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv) \ |
| 205 | { | 211 | { .name = xname, \ |
| 206 | return snd_ad1848_add_ctl(chip, c->name, c->index, c->type, c->private_value); | 212 | .index = xindex, \ |
| 207 | } | 213 | .type = AD1848_MIX_DOUBLE, \ |
| 214 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert), \ | ||
| 215 | .tlv = xtlv } | ||
| 216 | |||
| 217 | int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c); | ||
| 208 | 218 | ||
| 209 | #endif /* __SOUND_AD1848_H */ | 219 | #endif /* __SOUND_AD1848_H */ |
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h index 3bf5911fe827..d0deca669b92 100644 --- a/include/sound/ak4xxx-adda.h +++ b/include/sound/ak4xxx-adda.h | |||
| @@ -32,38 +32,62 @@ struct snd_akm4xxx; | |||
| 32 | struct snd_ak4xxx_ops { | 32 | struct snd_ak4xxx_ops { |
| 33 | void (*lock)(struct snd_akm4xxx *ak, int chip); | 33 | void (*lock)(struct snd_akm4xxx *ak, int chip); |
| 34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); | 34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); |
| 35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
| 36 | // unsigned char (*read)(struct snd_akm4xxx *ak, int chip, unsigned char reg); | 36 | unsigned char val); |
| 37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); | 37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | #define AK4XXX_IMAGE_SIZE (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */ | 40 | #define AK4XXX_IMAGE_SIZE (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */ |
| 41 | 41 | ||
| 42 | /* DAC label and channels */ | ||
| 43 | struct snd_akm4xxx_dac_channel { | ||
| 44 | char *name; /* mixer volume name */ | ||
| 45 | unsigned int num_channels; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* ADC labels and channels */ | ||
| 49 | struct snd_akm4xxx_adc_channel { | ||
| 50 | char *name; /* capture gain volume label */ | ||
| 51 | char *switch_name; /* capture switch */ | ||
| 52 | unsigned int num_channels; | ||
| 53 | }; | ||
| 54 | |||
| 42 | struct snd_akm4xxx { | 55 | struct snd_akm4xxx { |
| 43 | struct snd_card *card; | 56 | struct snd_card *card; |
| 44 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ | 57 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ |
| 45 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ | 58 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ |
| 46 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ | 59 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ |
| 47 | unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image for IPGA (AK4528) */ | 60 | unsigned char volumes[AK4XXX_IMAGE_SIZE]; /* saved volume values */ |
| 48 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 61 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
| 49 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 62 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
| 50 | /* template should fill the following fields */ | 63 | /* template should fill the following fields */ |
| 51 | unsigned int idx_offset; /* control index offset */ | 64 | unsigned int idx_offset; /* control index offset */ |
| 52 | enum { | 65 | enum { |
| 53 | SND_AK4524, SND_AK4528, SND_AK4529, | 66 | SND_AK4524, SND_AK4528, SND_AK4529, |
| 54 | SND_AK4355, SND_AK4358, SND_AK4381 | 67 | SND_AK4355, SND_AK4358, SND_AK4381, |
| 68 | SND_AK5365 | ||
| 55 | } type; | 69 | } type; |
| 70 | |||
| 71 | /* (array) information of combined codecs */ | ||
| 72 | struct snd_akm4xxx_dac_channel *dac_info; | ||
| 73 | struct snd_akm4xxx_adc_channel *adc_info; | ||
| 74 | |||
| 56 | struct snd_ak4xxx_ops ops; | 75 | struct snd_ak4xxx_ops ops; |
| 57 | }; | 76 | }; |
| 58 | 77 | ||
| 59 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 78 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
| 79 | unsigned char val); | ||
| 60 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); | 80 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); |
| 61 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); | 81 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); |
| 62 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); | 82 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); |
| 63 | 83 | ||
| 64 | #define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)] | 84 | #define snd_akm4xxx_get(ak,chip,reg) \ |
| 65 | #define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val)) | 85 | (ak)->images[(chip) * 16 + (reg)] |
| 66 | #define snd_akm4xxx_get_ipga(ak,chip,reg) (ak)->ipga_gain[chip][(reg)-4] | 86 | #define snd_akm4xxx_set(ak,chip,reg,val) \ |
| 67 | #define snd_akm4xxx_set_ipga(ak,chip,reg,val) ((ak)->ipga_gain[chip][(reg)-4] = (val)) | 87 | ((ak)->images[(chip) * 16 + (reg)] = (val)) |
| 88 | #define snd_akm4xxx_get_vol(ak,chip,reg) \ | ||
| 89 | (ak)->volumes[(chip) * 16 + (reg)] | ||
| 90 | #define snd_akm4xxx_set_vol(ak,chip,reg,val) \ | ||
| 91 | ((ak)->volumes[(chip) * 16 + (reg)] = (val)) | ||
| 68 | 92 | ||
| 69 | #endif /* __SOUND_AK4XXX_ADDA_H */ | 93 | #endif /* __SOUND_AK4XXX_ADDA_H */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 41885f48ad91..c1621c650a9a 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -688,7 +688,7 @@ struct snd_timer_tread { | |||
| 688 | * * | 688 | * * |
| 689 | ****************************************************************************/ | 689 | ****************************************************************************/ |
| 690 | 690 | ||
| 691 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) | 691 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) |
| 692 | 692 | ||
| 693 | struct snd_ctl_card_info { | 693 | struct snd_ctl_card_info { |
| 694 | int card; /* card number */ | 694 | int card; /* card number */ |
| @@ -727,10 +727,15 @@ typedef int __bitwise snd_ctl_elem_iface_t; | |||
| 727 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) | 727 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) |
| 728 | #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE) | 728 | #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE) |
| 729 | #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */ | 729 | #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */ |
| 730 | #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<2) /* when was control changed */ | 730 | #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */ |
| 731 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */ | ||
| 732 | #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */ | ||
| 733 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) | ||
| 734 | #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */ | ||
| 731 | #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */ | 735 | #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */ |
| 732 | #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */ | 736 | #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */ |
| 733 | #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ | 737 | #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ |
| 738 | #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */ | ||
| 734 | #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ | 739 | #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ |
| 735 | #define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */ | 740 | #define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */ |
| 736 | #define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */ | 741 | #define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */ |
| @@ -818,6 +823,12 @@ struct snd_ctl_elem_value { | |||
| 818 | unsigned char reserved[128-sizeof(struct timespec)]; | 823 | unsigned char reserved[128-sizeof(struct timespec)]; |
| 819 | }; | 824 | }; |
| 820 | 825 | ||
| 826 | struct snd_ctl_tlv { | ||
| 827 | unsigned int numid; /* control element numeric identification */ | ||
| 828 | unsigned int length; /* in bytes aligned to 4 */ | ||
| 829 | unsigned int tlv[0]; /* first TLV */ | ||
| 830 | }; | ||
| 831 | |||
| 821 | enum { | 832 | enum { |
| 822 | SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), | 833 | SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), |
| 823 | SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct snd_ctl_card_info), | 834 | SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct snd_ctl_card_info), |
| @@ -831,6 +842,9 @@ enum { | |||
| 831 | SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct snd_ctl_elem_info), | 842 | SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct snd_ctl_elem_info), |
| 832 | SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info), | 843 | SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info), |
| 833 | SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id), | 844 | SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id), |
| 845 | SNDRV_CTL_IOCTL_TLV_READ = _IOWR('U', 0x1a, struct snd_ctl_tlv), | ||
| 846 | SNDRV_CTL_IOCTL_TLV_WRITE = _IOWR('U', 0x1b, struct snd_ctl_tlv), | ||
| 847 | SNDRV_CTL_IOCTL_TLV_COMMAND = _IOWR('U', 0x1c, struct snd_ctl_tlv), | ||
| 834 | SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), | 848 | SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), |
| 835 | SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info), | 849 | SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info), |
| 836 | SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), | 850 | SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), |
| @@ -855,6 +869,7 @@ enum sndrv_ctl_event_type { | |||
| 855 | #define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */ | 869 | #define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */ |
| 856 | #define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */ | 870 | #define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */ |
| 857 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ | 871 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ |
| 872 | #define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */ | ||
| 858 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ | 873 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ |
| 859 | 874 | ||
| 860 | struct snd_ctl_event { | 875 | struct snd_ctl_event { |
diff --git a/include/sound/control.h b/include/sound/control.h index 2489b1eb0110..1de148b0fd94 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
| @@ -30,6 +30,11 @@ struct snd_kcontrol; | |||
| 30 | typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_info * uinfo); | 30 | typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_info * uinfo); |
| 31 | typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); | 31 | typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); |
| 32 | typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); | 32 | typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); |
| 33 | typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, | ||
| 34 | int op_flag, /* 0=read,1=write,-1=command */ | ||
| 35 | unsigned int size, | ||
| 36 | unsigned int __user *tlv); | ||
| 37 | |||
| 33 | 38 | ||
| 34 | struct snd_kcontrol_new { | 39 | struct snd_kcontrol_new { |
| 35 | snd_ctl_elem_iface_t iface; /* interface identifier */ | 40 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
| @@ -42,6 +47,10 @@ struct snd_kcontrol_new { | |||
| 42 | snd_kcontrol_info_t *info; | 47 | snd_kcontrol_info_t *info; |
| 43 | snd_kcontrol_get_t *get; | 48 | snd_kcontrol_get_t *get; |
| 44 | snd_kcontrol_put_t *put; | 49 | snd_kcontrol_put_t *put; |
| 50 | union { | ||
| 51 | snd_kcontrol_tlv_rw_t *c; | ||
| 52 | unsigned int *p; | ||
| 53 | } tlv; | ||
| 45 | unsigned long private_value; | 54 | unsigned long private_value; |
| 46 | }; | 55 | }; |
| 47 | 56 | ||
| @@ -58,6 +67,10 @@ struct snd_kcontrol { | |||
| 58 | snd_kcontrol_info_t *info; | 67 | snd_kcontrol_info_t *info; |
| 59 | snd_kcontrol_get_t *get; | 68 | snd_kcontrol_get_t *get; |
| 60 | snd_kcontrol_put_t *put; | 69 | snd_kcontrol_put_t *put; |
| 70 | union { | ||
| 71 | snd_kcontrol_tlv_rw_t *c; | ||
| 72 | unsigned int *p; | ||
| 73 | } tlv; | ||
| 61 | unsigned long private_value; | 74 | unsigned long private_value; |
| 62 | void *private_data; | 75 | void *private_data; |
| 63 | void (*private_free)(struct snd_kcontrol *kcontrol); | 76 | void (*private_free)(struct snd_kcontrol *kcontrol); |
diff --git a/include/sound/core.h b/include/sound/core.h index 5d184be0ff72..b056ea925ecf 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -25,8 +25,8 @@ | |||
| 25 | #include <linux/sched.h> /* wake_up() */ | 25 | #include <linux/sched.h> /* wake_up() */ |
| 26 | #include <linux/mutex.h> /* struct mutex */ | 26 | #include <linux/mutex.h> /* struct mutex */ |
| 27 | #include <linux/rwsem.h> /* struct rw_semaphore */ | 27 | #include <linux/rwsem.h> /* struct rw_semaphore */ |
| 28 | #include <linux/workqueue.h> /* struct workqueue_struct */ | ||
| 29 | #include <linux/pm.h> /* pm_message_t */ | 28 | #include <linux/pm.h> /* pm_message_t */ |
| 29 | #include <linux/device.h> | ||
| 30 | 30 | ||
| 31 | /* forward declarations */ | 31 | /* forward declarations */ |
| 32 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
| @@ -71,7 +71,6 @@ struct snd_device_ops { | |||
| 71 | int (*dev_free)(struct snd_device *dev); | 71 | int (*dev_free)(struct snd_device *dev); |
| 72 | int (*dev_register)(struct snd_device *dev); | 72 | int (*dev_register)(struct snd_device *dev); |
| 73 | int (*dev_disconnect)(struct snd_device *dev); | 73 | int (*dev_disconnect)(struct snd_device *dev); |
| 74 | int (*dev_unregister)(struct snd_device *dev); | ||
| 75 | }; | 74 | }; |
| 76 | 75 | ||
| 77 | struct snd_device { | 76 | struct snd_device { |
| @@ -131,8 +130,8 @@ struct snd_card { | |||
| 131 | state */ | 130 | state */ |
| 132 | spinlock_t files_lock; /* lock the files for this card */ | 131 | spinlock_t files_lock; /* lock the files for this card */ |
| 133 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
| 133 | int free_on_last_close; /* free in context of file_release */ | ||
| 134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
| 135 | struct work_struct free_workq; /* for free in workqueue */ | ||
| 136 | struct device *dev; | 135 | struct device *dev; |
| 137 | 136 | ||
| 138 | #ifdef CONFIG_PM | 137 | #ifdef CONFIG_PM |
| @@ -188,8 +187,7 @@ struct snd_minor { | |||
| 188 | int device; /* device number */ | 187 | int device; /* device number */ |
| 189 | const struct file_operations *f_ops; /* file operations */ | 188 | const struct file_operations *f_ops; /* file operations */ |
| 190 | void *private_data; /* private data for f_ops->open */ | 189 | void *private_data; /* private data for f_ops->open */ |
| 191 | char name[0]; /* device name (keep at the end of | 190 | struct class_device *class_dev; /* class device for sysfs */ |
| 192 | structure) */ | ||
| 193 | }; | 191 | }; |
| 194 | 192 | ||
| 195 | /* sound.c */ | 193 | /* sound.c */ |
| @@ -204,6 +202,8 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
| 204 | const char *name); | 202 | const char *name); |
| 205 | int snd_unregister_device(int type, struct snd_card *card, int dev); | 203 | int snd_unregister_device(int type, struct snd_card *card, int dev); |
| 206 | void *snd_lookup_minor_data(unsigned int minor, int type); | 204 | void *snd_lookup_minor_data(unsigned int minor, int type); |
| 205 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | ||
| 206 | const struct class_device_attribute *attr); | ||
| 207 | 207 | ||
| 208 | #ifdef CONFIG_SND_OSSEMUL | 208 | #ifdef CONFIG_SND_OSSEMUL |
| 209 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 209 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
| @@ -246,7 +246,7 @@ struct snd_card *snd_card_new(int idx, const char *id, | |||
| 246 | struct module *module, int extra_size); | 246 | struct module *module, int extra_size); |
| 247 | int snd_card_disconnect(struct snd_card *card); | 247 | int snd_card_disconnect(struct snd_card *card); |
| 248 | int snd_card_free(struct snd_card *card); | 248 | int snd_card_free(struct snd_card *card); |
| 249 | int snd_card_free_in_thread(struct snd_card *card); | 249 | int snd_card_free_when_closed(struct snd_card *card); |
| 250 | int snd_card_register(struct snd_card *card); | 250 | int snd_card_register(struct snd_card *card); |
| 251 | int snd_card_info_init(void); | 251 | int snd_card_info_init(void); |
| 252 | int snd_card_info_done(void); | 252 | int snd_card_info_done(void); |
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index 80b2979c0cba..685928e6f65a 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h | |||
| @@ -1704,6 +1704,7 @@ struct snd_cs46xx { | |||
| 1704 | int acpi_port; | 1704 | int acpi_port; |
| 1705 | struct snd_kcontrol *eapd_switch; /* for amplifier hack */ | 1705 | struct snd_kcontrol *eapd_switch; /* for amplifier hack */ |
| 1706 | int accept_valid; /* accept mmap valid (for OSS) */ | 1706 | int accept_valid; /* accept mmap valid (for OSS) */ |
| 1707 | int in_suspend; | ||
| 1707 | 1708 | ||
| 1708 | struct gameport *gameport; | 1709 | struct gameport *gameport; |
| 1709 | 1710 | ||
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 884bbf54cd36..892e310c504d 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
| @@ -1524,6 +1524,10 @@ struct snd_emu10k1_fx8010_control_gpr { | |||
| 1524 | unsigned int value[32]; /* initial values */ | 1524 | unsigned int value[32]; /* initial values */ |
| 1525 | unsigned int min; /* minimum range */ | 1525 | unsigned int min; /* minimum range */ |
| 1526 | unsigned int max; /* maximum range */ | 1526 | unsigned int max; /* maximum range */ |
| 1527 | union { | ||
| 1528 | snd_kcontrol_tlv_rw_t *c; | ||
| 1529 | unsigned int *p; | ||
| 1530 | } tlv; | ||
| 1527 | unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ | 1531 | unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ |
| 1528 | }; | 1532 | }; |
| 1529 | 1533 | ||
diff --git a/include/sound/info.h b/include/sound/info.h index 74f6996769c7..97ffc4fb9969 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -71,7 +71,6 @@ struct snd_info_entry { | |||
| 71 | mode_t mode; | 71 | mode_t mode; |
| 72 | long size; | 72 | long size; |
| 73 | unsigned short content; | 73 | unsigned short content; |
| 74 | unsigned short disconnected: 1; | ||
| 75 | union { | 74 | union { |
| 76 | struct snd_info_entry_text text; | 75 | struct snd_info_entry_text text; |
| 77 | struct snd_info_entry_ops *ops; | 76 | struct snd_info_entry_ops *ops; |
| @@ -83,6 +82,8 @@ struct snd_info_entry { | |||
| 83 | void (*private_free)(struct snd_info_entry *entry); | 82 | void (*private_free)(struct snd_info_entry *entry); |
| 84 | struct proc_dir_entry *p; | 83 | struct proc_dir_entry *p; |
| 85 | struct mutex access; | 84 | struct mutex access; |
| 85 | struct list_head children; | ||
| 86 | struct list_head list; | ||
| 86 | }; | 87 | }; |
| 87 | 88 | ||
| 88 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) | 89 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) |
| @@ -122,8 +123,8 @@ int snd_info_restore_text(struct snd_info_entry * entry); | |||
| 122 | int snd_info_card_create(struct snd_card * card); | 123 | int snd_info_card_create(struct snd_card * card); |
| 123 | int snd_info_card_register(struct snd_card * card); | 124 | int snd_info_card_register(struct snd_card * card); |
| 124 | int snd_info_card_free(struct snd_card * card); | 125 | int snd_info_card_free(struct snd_card * card); |
| 126 | void snd_info_card_disconnect(struct snd_card * card); | ||
| 125 | int snd_info_register(struct snd_info_entry * entry); | 127 | int snd_info_register(struct snd_info_entry * entry); |
| 126 | int snd_info_unregister(struct snd_info_entry * entry); | ||
| 127 | 128 | ||
| 128 | /* for card drivers */ | 129 | /* for card drivers */ |
| 129 | int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_entry **entryp); | 130 | int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_entry **entryp); |
| @@ -156,8 +157,8 @@ static inline void snd_info_free_entry(struct snd_info_entry * entry) { ; } | |||
| 156 | static inline int snd_info_card_create(struct snd_card * card) { return 0; } | 157 | static inline int snd_info_card_create(struct snd_card * card) { return 0; } |
| 157 | static inline int snd_info_card_register(struct snd_card * card) { return 0; } | 158 | static inline int snd_info_card_register(struct snd_card * card) { return 0; } |
| 158 | static inline int snd_info_card_free(struct snd_card * card) { return 0; } | 159 | static inline int snd_info_card_free(struct snd_card * card) { return 0; } |
| 160 | static inline void snd_info_card_disconnect(struct snd_card * card) { } | ||
| 159 | static inline int snd_info_register(struct snd_info_entry * entry) { return 0; } | 161 | static inline int snd_info_register(struct snd_info_entry * entry) { return 0; } |
| 160 | static inline int snd_info_unregister(struct snd_info_entry * entry) { return 0; } | ||
| 161 | 162 | ||
| 162 | static inline int snd_card_proc_new(struct snd_card *card, const char *name, | 163 | static inline int snd_card_proc_new(struct snd_card *card, const char *name, |
| 163 | struct snd_info_entry **entryp) { return -EINVAL; } | 164 | struct snd_info_entry **entryp) { return -EINVAL; } |
diff --git a/include/sound/initval.h b/include/sound/initval.h index d29e3d31d149..2ae76efc696f 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h | |||
| @@ -62,7 +62,8 @@ static int snd_legacy_find_free_irq(int *irq_table) | |||
| 62 | { | 62 | { |
| 63 | while (*irq_table != -1) { | 63 | while (*irq_table != -1) { |
| 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, | 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, |
| 65 | SA_INTERRUPT, "ALSA Test IRQ", (void *) irq_table)) { | 65 | IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", |
| 66 | (void *) irq_table)) { | ||
| 66 | free_irq(*irq_table, (void *) irq_table); | 67 | free_irq(*irq_table, (void *) irq_table); |
| 67 | return *irq_table; | 68 | return *irq_table; |
| 68 | } | 69 | } |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index f84d84993a31..60d40b34efc0 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -190,7 +190,7 @@ struct snd_pcm_ops { | |||
| 190 | 190 | ||
| 191 | struct snd_pcm_file { | 191 | struct snd_pcm_file { |
| 192 | struct snd_pcm_substream *substream; | 192 | struct snd_pcm_substream *substream; |
| 193 | struct snd_pcm_file *next; | 193 | int no_compat_mmap; |
| 194 | }; | 194 | }; |
| 195 | 195 | ||
| 196 | struct snd_pcm_hw_rule; | 196 | struct snd_pcm_hw_rule; |
| @@ -384,7 +384,6 @@ struct snd_pcm_substream { | |||
| 384 | struct snd_info_entry *proc_prealloc_entry; | 384 | struct snd_info_entry *proc_prealloc_entry; |
| 385 | #endif | 385 | #endif |
| 386 | /* misc flags */ | 386 | /* misc flags */ |
| 387 | unsigned int no_mmap_ctrl: 1; | ||
| 388 | unsigned int hw_opened: 1; | 387 | unsigned int hw_opened: 1; |
| 389 | }; | 388 | }; |
| 390 | 389 | ||
| @@ -402,7 +401,6 @@ struct snd_pcm_str { | |||
| 402 | /* -- OSS things -- */ | 401 | /* -- OSS things -- */ |
| 403 | struct snd_pcm_oss_stream oss; | 402 | struct snd_pcm_oss_stream oss; |
| 404 | #endif | 403 | #endif |
| 405 | struct snd_pcm_file *files; | ||
| 406 | #ifdef CONFIG_SND_VERBOSE_PROCFS | 404 | #ifdef CONFIG_SND_VERBOSE_PROCFS |
| 407 | struct snd_info_entry *proc_root; | 405 | struct snd_info_entry *proc_root; |
| 408 | struct snd_info_entry *proc_info_entry; | 406 | struct snd_info_entry *proc_info_entry; |
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index a4f554520197..b5067d3c2387 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
| @@ -20,9 +20,10 @@ | |||
| 20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/videodev.h> | 25 | #include <linux/videodev.h> |
| 26 | #include <media/v4l2-dev.h> | ||
| 26 | 27 | ||
| 27 | struct snd_tea575x; | 28 | struct snd_tea575x; |
| 28 | 29 | ||
diff --git a/include/sound/timer.h b/include/sound/timer.h index 5ece2bf541dc..d42c083db1da 100644 --- a/include/sound/timer.h +++ b/include/sound/timer.h | |||
| @@ -129,7 +129,6 @@ void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstam | |||
| 129 | int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer); | 129 | int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer); |
| 130 | int snd_timer_global_free(struct snd_timer *timer); | 130 | int snd_timer_global_free(struct snd_timer *timer); |
| 131 | int snd_timer_global_register(struct snd_timer *timer); | 131 | int snd_timer_global_register(struct snd_timer *timer); |
| 132 | int snd_timer_global_unregister(struct snd_timer *timer); | ||
| 133 | 132 | ||
| 134 | int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id); | 133 | int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id); |
| 135 | int snd_timer_close(struct snd_timer_instance *timeri); | 134 | int snd_timer_close(struct snd_timer_instance *timeri); |
diff --git a/include/sound/tlv.h b/include/sound/tlv.h new file mode 100644 index 000000000000..d93a96b91875 --- /dev/null +++ b/include/sound/tlv.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #ifndef __SOUND_TLV_H | ||
| 2 | #define __SOUND_TLV_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Advanced Linux Sound Architecture - ALSA - Driver | ||
| 6 | * Copyright (c) 2006 by Jaroslav Kysela <perex@suse.cz> | ||
| 7 | * | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | /* | ||
| 26 | * TLV structure is right behind the struct snd_ctl_tlv: | ||
| 27 | * unsigned int type - see SNDRV_CTL_TLVT_* | ||
| 28 | * unsigned int length | ||
| 29 | * .... data aligned to sizeof(unsigned int), use | ||
| 30 | * block_length = (length + (sizeof(unsigned int) - 1)) & | ||
| 31 | * ~(sizeof(unsigned int) - 1)) .... | ||
| 32 | */ | ||
| 33 | |||
| 34 | #define SNDRV_CTL_TLVT_CONTAINER 0 /* one level down - group of TLVs */ | ||
| 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ | ||
| 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ | ||
| 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ | ||
| 38 | |||
| 39 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ | ||
| 40 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ | ||
| 41 | (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) | ||
| 42 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ | ||
| 43 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } | ||
| 44 | |||
| 45 | /* linear volume between min_dB and max_dB (.01dB unit) */ | ||
| 46 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ | ||
| 47 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ | ||
| 48 | (min_dB), (max_dB) | ||
| 49 | #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ | ||
| 50 | unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } | ||
| 51 | |||
| 52 | /* dB range container */ | ||
| 53 | /* Each item is: <min> <max> <TLV> */ | ||
| 54 | /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ | ||
| 55 | #define TLV_DB_RANGE_HEAD(num) \ | ||
| 56 | SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) | ||
| 57 | |||
| 58 | #define TLV_DB_GAIN_MUTE -9999999 | ||
| 59 | |||
| 60 | #endif /* __SOUND_TLV_H */ | ||
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 9821a6194caa..dbca14170615 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h | |||
| @@ -128,6 +128,7 @@ struct snd_vx_hardware { | |||
| 128 | unsigned int num_ins; | 128 | unsigned int num_ins; |
| 129 | unsigned int num_outs; | 129 | unsigned int num_outs; |
| 130 | unsigned int output_level_max; | 130 | unsigned int output_level_max; |
| 131 | unsigned int *output_level_db_scale; | ||
| 131 | }; | 132 | }; |
| 132 | 133 | ||
| 133 | /* hwdep id string */ | 134 | /* hwdep id string */ |
