From d031166fecac97fc6b5c35636deace8a3c9ec5f6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 7 Nov 2005 14:38:44 +0100 Subject: [ALSA] hda-codec - Allocate amp hash array dynamically Modules: HDA Codec driver Allocate amp hash array dynamically instead of static array. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 1179d6cfa82a..b0123adc569c 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -545,7 +545,8 @@ struct hda_codec { /* hash for amp access */ u16 amp_hash[32]; int num_amp_entries; - struct hda_amp_info amp_info[128]; /* big enough? */ + int amp_info_size; + struct hda_amp_info *amp_info; struct semaphore spdif_mutex; unsigned int spdif_status; /* IEC958 status bits */ -- cgit v1.2.3 From a2a20939b1cc82222eb67a4631009338791f1acd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 11:08:23 +0100 Subject: [ALSA] hda-codec - Fix a typo Modules: HDA Codec driver Fix a typo in hda_codec.h. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index b0123adc569c..58b9949aca46 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -98,7 +98,7 @@ enum { #define AC_VERB_SET_UNSOLICITED_ENABLE 0x708 #define AC_VERB_SET_PIN_SENSE 0x709 #define AC_VERB_SET_BEEP_CONTROL 0x70a -#define AC_VERB_SET_EAPD_BTLENALBE 0x70c +#define AC_VERB_SET_EAPD_BTLENABLE 0x70c #define AC_VERB_SET_DIGI_CONVERT_1 0x70d #define AC_VERB_SET_DIGI_CONVERT_2 0x70e #define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f -- cgit v1.2.3 From c8b6bf9b5ef1f595a65a3414a5ca2588e8d993b2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 14:57:47 +0100 Subject: [ALSA] Remove xxx_t typedefs: HD-Audio codec Modules: HDA Codec driver,HDA generic driver Remove xxx_t typedefs from the HD-Audio codec support codes. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 90 +++++++++++++++++++++--------------------- sound/pci/hda/hda_codec.h | 14 +++---- sound/pci/hda/hda_generic.c | 20 +++++----- sound/pci/hda/hda_local.h | 36 ++++++++--------- sound/pci/hda/hda_proc.c | 12 +++--- sound/pci/hda/patch_analog.c | 42 ++++++++++---------- sound/pci/hda/patch_cmedia.c | 30 +++++++------- sound/pci/hda/patch_realtek.c | 88 ++++++++++++++++++++--------------------- sound/pci/hda/patch_si3054.c | 20 +++++----- sound/pci/hda/patch_sigmatel.c | 44 ++++++++++----------- 10 files changed, 198 insertions(+), 198 deletions(-) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 2e9f5877386e..7f4e19951bae 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -332,7 +332,7 @@ static int snd_hda_bus_free(struct hda_bus *bus) return 0; } -static int snd_hda_bus_dev_free(snd_device_t *device) +static int snd_hda_bus_dev_free(struct snd_device *device) { struct hda_bus *bus = device->device_data; return snd_hda_bus_free(bus); @@ -346,12 +346,12 @@ static int snd_hda_bus_dev_free(snd_device_t *device) * * Returns 0 if successful, or a negative error code. */ -int snd_hda_bus_new(snd_card_t *card, const struct hda_bus_template *temp, +int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp, struct hda_bus **busp) { struct hda_bus *bus; int err; - static snd_device_ops_t dev_ops = { + static struct snd_device_ops dev_ops = { .dev_free = snd_hda_bus_dev_free, }; @@ -732,7 +732,7 @@ static int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int #define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf) /* volume */ -int snd_hda_mixer_amp_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); u16 nid = get_amp_nid(kcontrol); @@ -753,7 +753,7 @@ int snd_hda_mixer_amp_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -int snd_hda_mixer_amp_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = get_amp_nid(kcontrol); @@ -769,7 +769,7 @@ int snd_hda_mixer_amp_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -int snd_hda_mixer_amp_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = get_amp_nid(kcontrol); @@ -791,7 +791,7 @@ int snd_hda_mixer_amp_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t } /* switch */ -int snd_hda_mixer_amp_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { int chs = get_amp_channels(kcontrol); @@ -802,7 +802,7 @@ int snd_hda_mixer_amp_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -int snd_hda_mixer_amp_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = get_amp_nid(kcontrol); @@ -818,7 +818,7 @@ int snd_hda_mixer_amp_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -int snd_hda_mixer_amp_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = get_amp_nid(kcontrol); @@ -849,7 +849,7 @@ int snd_hda_mixer_amp_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t #define AMP_VAL_IDX_SHIFT 19 #define AMP_VAL_IDX_MASK (0x0f<<19) -int snd_hda_mixer_bind_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); unsigned long pval; @@ -864,7 +864,7 @@ int snd_hda_mixer_bind_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return err; } -int snd_hda_mixer_bind_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); unsigned long pval; @@ -889,14 +889,14 @@ int snd_hda_mixer_bind_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * SPDIF out controls */ -static int snd_hda_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int snd_hda_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; return 0; } -static int snd_hda_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | IEC958_AES0_NONAUDIO | @@ -907,7 +907,7 @@ static int snd_hda_spdif_cmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_ return 0; } -static int snd_hda_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL | IEC958_AES0_NONAUDIO | @@ -915,7 +915,7 @@ static int snd_hda_spdif_pmask_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_ return 0; } -static int snd_hda_spdif_default_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_default_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); @@ -978,7 +978,7 @@ static unsigned int convert_to_spdif_status(unsigned short val) return sbits; } -static int snd_hda_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value; @@ -1004,7 +1004,7 @@ static int snd_hda_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu return change; } -static int snd_hda_spdif_out_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int snd_hda_spdif_out_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -1013,7 +1013,7 @@ static int snd_hda_spdif_out_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_ return 0; } -static int snd_hda_spdif_out_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_out_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); @@ -1021,7 +1021,7 @@ static int snd_hda_spdif_out_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_v return 0; } -static int snd_hda_spdif_out_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value; @@ -1044,7 +1044,7 @@ static int snd_hda_spdif_out_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_v return change; } -static snd_kcontrol_new_t dig_mixes[] = { +static struct snd_kcontrol_new dig_mixes[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ, .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -1089,8 +1089,8 @@ static snd_kcontrol_new_t dig_mixes[] = { int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) { int err; - snd_kcontrol_t *kctl; - snd_kcontrol_new_t *dig_mix; + struct snd_kcontrol *kctl; + struct snd_kcontrol_new *dig_mix; for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { kctl = snd_ctl_new1(dig_mix, codec); @@ -1109,7 +1109,7 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) #define snd_hda_spdif_in_switch_info snd_hda_spdif_out_switch_info -static int snd_hda_spdif_in_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_in_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); @@ -1117,7 +1117,7 @@ static int snd_hda_spdif_in_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va return 0; } -static int snd_hda_spdif_in_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_in_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value; @@ -1134,7 +1134,7 @@ static int snd_hda_spdif_in_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_va return change; } -static int snd_hda_spdif_in_status_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value; @@ -1150,7 +1150,7 @@ static int snd_hda_spdif_in_status_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_va return 0; } -static snd_kcontrol_new_t dig_in_ctls[] = { +static struct snd_kcontrol_new dig_in_ctls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), @@ -1181,8 +1181,8 @@ static snd_kcontrol_new_t dig_in_ctls[] = { int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) { int err; - snd_kcontrol_t *kctl; - snd_kcontrol_new_t *dig_mix; + struct snd_kcontrol *kctl; + struct snd_kcontrol_new *dig_mix; for (dig_mix = dig_in_ctls; dig_mix->name; dig_mix++) { kctl = snd_ctl_new1(dig_mix, codec); @@ -1498,7 +1498,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, */ static int hda_pcm_default_open_close(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { return 0; } @@ -1507,7 +1507,7 @@ static int hda_pcm_default_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format); return 0; @@ -1515,7 +1515,7 @@ static int hda_pcm_default_prepare(struct hda_pcm_stream *hinfo, static int hda_pcm_default_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { snd_hda_codec_setup_stream(codec, hinfo->nid, 0, 0, 0); return 0; @@ -1646,14 +1646,14 @@ int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_c /** * snd_hda_add_new_ctls - create controls from the array * @codec: the HDA codec - * @knew: the array of snd_kcontrol_new_t + * @knew: the array of struct snd_kcontrol_new * * This helper function creates and add new controls in the given array. * The array must be terminated with an empty entry as terminator. * * Returns 0 if successful, or a negative error code. */ -int snd_hda_add_new_ctls(struct hda_codec *codec, snd_kcontrol_new_t *knew) +int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) { int err; @@ -1666,10 +1666,10 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, snd_kcontrol_new_t *knew) } - /* +/* * Channel mode helper */ -int snd_hda_ch_mode_info(struct hda_codec *codec, snd_ctl_elem_info_t *uinfo, +int snd_hda_ch_mode_info(struct hda_codec *codec, struct snd_ctl_elem_info *uinfo, const struct hda_channel_mode *chmode, int num_chmodes) { uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; @@ -1682,7 +1682,7 @@ int snd_hda_ch_mode_info(struct hda_codec *codec, snd_ctl_elem_info_t *uinfo, return 0; } -int snd_hda_ch_mode_get(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, +int snd_hda_ch_mode_get(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int max_channels) { @@ -1697,7 +1697,7 @@ int snd_hda_ch_mode_get(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, return 0; } -int snd_hda_ch_mode_put(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, +int snd_hda_ch_mode_put(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int *max_channelsp) { @@ -1717,7 +1717,7 @@ int snd_hda_ch_mode_put(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, /* * input MUX helper */ -int snd_hda_input_mux_info(const struct hda_input_mux *imux, snd_ctl_elem_info_t *uinfo) +int snd_hda_input_mux_info(const struct hda_input_mux *imux, struct snd_ctl_elem_info *uinfo) { unsigned int index; @@ -1732,7 +1732,7 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux, snd_ctl_elem_info_t } int snd_hda_input_mux_put(struct hda_codec *codec, const struct hda_input_mux *imux, - snd_ctl_elem_value_t *ucontrol, hda_nid_t nid, + struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, unsigned int *cur_val) { unsigned int idx; @@ -1783,7 +1783,7 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec, struct hda_multi_out *m * set up more restrictions for analog out */ int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out *mout, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { substream->runtime->hw.channels_max = mout->max_channels; return snd_pcm_hw_constraint_step(substream->runtime, 0, @@ -1797,7 +1797,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { hda_nid_t *nids = mout->dac_nids; int chs = substream->runtime->channels; @@ -2019,15 +2019,15 @@ int snd_hda_resume(struct hda_bus *bus) /** * snd_hda_resume_ctls - resume controls in the new control list * @codec: the HDA codec - * @knew: the array of snd_kcontrol_new_t + * @knew: the array of struct snd_kcontrol_new * - * This function resumes the mixer controls in the snd_kcontrol_new_t array, + * This function resumes the mixer controls in the struct snd_kcontrol_new array, * originally for snd_hda_add_new_ctls(). * The array must be terminated with an empty entry as terminator. */ -int snd_hda_resume_ctls(struct hda_codec *codec, snd_kcontrol_new_t *knew) +int snd_hda_resume_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) { - snd_ctl_elem_value_t *val; + struct snd_ctl_elem_value *val; val = kmalloc(sizeof(*val), GFP_KERNEL); if (! val) diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 58b9949aca46..0b5c36788898 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -420,7 +420,7 @@ struct hda_bus_template { * A hda_bus contains several codecs in the list codec_list. */ struct hda_bus { - snd_card_t *card; + struct snd_card *card; /* copied from template */ void *private_data; @@ -437,7 +437,7 @@ struct hda_bus { /* unsolicited event queue */ struct hda_bus_unsolicited *unsol; - snd_info_entry_t *proc; + struct snd_info_entry *proc; }; /* @@ -481,14 +481,14 @@ struct hda_amp_info { /* PCM callbacks */ struct hda_pcm_ops { int (*open)(struct hda_pcm_stream *info, struct hda_codec *codec, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); int (*close)(struct hda_pcm_stream *info, struct hda_codec *codec, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); int (*prepare)(struct hda_pcm_stream *info, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); }; /* PCM information for each substream */ @@ -563,7 +563,7 @@ enum { /* * constructors */ -int snd_hda_bus_new(snd_card_t *card, const struct hda_bus_template *temp, +int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp, struct hda_bus **busp); int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, struct hda_codec **codecp); diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index d0eb9f2250aa..863e8c6d29a8 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -389,14 +389,14 @@ static int parse_output(struct hda_codec *codec) */ /* control callbacks */ -static int capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int capture_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gspec *spec = codec->spec; return snd_hda_input_mux_info(&spec->input_mux, uinfo); } -static int capture_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int capture_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gspec *spec = codec->spec; @@ -405,7 +405,7 @@ static int capture_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc return 0; } -static int capture_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int capture_source_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_gspec *spec = codec->spec; @@ -617,7 +617,7 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, char name[32]; int err; int created = 0; - snd_kcontrol_new_t knew; + struct snd_kcontrol_new knew; if (type) sprintf(name, "%s %s Switch", type, dir_sfx); @@ -625,14 +625,14 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, sprintf(name, "%s Switch", dir_sfx); if ((node->wid_caps & AC_WCAP_IN_AMP) && (node->amp_in_caps & AC_AMPCAP_MUTE)) { - knew = (snd_kcontrol_new_t)HDA_CODEC_MUTE(name, node->nid, index, HDA_INPUT); + knew = (struct snd_kcontrol_new)HDA_CODEC_MUTE(name, node->nid, index, HDA_INPUT); snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index); if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) return err; created = 1; } else if ((node->wid_caps & AC_WCAP_OUT_AMP) && (node->amp_out_caps & AC_AMPCAP_MUTE)) { - knew = (snd_kcontrol_new_t)HDA_CODEC_MUTE(name, node->nid, 0, HDA_OUTPUT); + knew = (struct snd_kcontrol_new)HDA_CODEC_MUTE(name, node->nid, 0, HDA_OUTPUT); snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid); if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) return err; @@ -645,14 +645,14 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, sprintf(name, "%s Volume", dir_sfx); if ((node->wid_caps & AC_WCAP_IN_AMP) && (node->amp_in_caps & AC_AMPCAP_NUM_STEPS)) { - knew = (snd_kcontrol_new_t)HDA_CODEC_VOLUME(name, node->nid, index, HDA_INPUT); + knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, index, HDA_INPUT); snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index); if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) return err; created = 1; } else if ((node->wid_caps & AC_WCAP_OUT_AMP) && (node->amp_out_caps & AC_AMPCAP_NUM_STEPS)) { - knew = (snd_kcontrol_new_t)HDA_CODEC_VOLUME(name, node->nid, 0, HDA_OUTPUT); + knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, 0, HDA_OUTPUT); snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid); if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) return err; @@ -667,7 +667,7 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, */ static int check_existing_control(struct hda_codec *codec, const char *type, const char *dir) { - snd_ctl_elem_id_t id; + struct snd_ctl_elem_id id; memset(&id, 0, sizeof(id)); sprintf(id.name, "%s %s Volume", type, dir); id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; @@ -710,7 +710,7 @@ static int build_input_controls(struct hda_codec *codec) /* create input MUX if multiple sources are available */ if (spec->input_mux.num_items > 1) { - static snd_kcontrol_new_t cap_sel = { + static struct snd_kcontrol_new cap_sel = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Capture Source", .info = capture_source_info, diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 31d3c7ef5842..502290424c67 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -60,12 +60,12 @@ #define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) -int snd_hda_mixer_amp_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo); -int snd_hda_mixer_amp_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); -int snd_hda_mixer_amp_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); -int snd_hda_mixer_amp_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo); -int snd_hda_mixer_amp_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); -int snd_hda_mixer_amp_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); +int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); +int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); +int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); /* mono switch binding multiple inputs */ #define HDA_BIND_MUTE_MONO(xname, nid, channel, indices, direction) \ @@ -78,8 +78,8 @@ int snd_hda_mixer_amp_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t /* stereo switch binding multiple inputs */ #define HDA_BIND_MUTE(xname,nid,indices,dir) HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir) -int snd_hda_mixer_bind_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); -int snd_hda_mixer_bind_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol); +int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid); int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid); @@ -97,12 +97,12 @@ struct hda_input_mux { struct hda_input_mux_item items[HDA_MAX_NUM_INPUTS]; }; -int snd_hda_input_mux_info(const struct hda_input_mux *imux, snd_ctl_elem_info_t *uinfo); +int snd_hda_input_mux_info(const struct hda_input_mux *imux, struct snd_ctl_elem_info *uinfo); int snd_hda_input_mux_put(struct hda_codec *codec, const struct hda_input_mux *imux, - snd_ctl_elem_value_t *ucontrol, hda_nid_t nid, + struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, unsigned int *cur_val); - /* +/* * Channel mode helper */ struct hda_channel_mode { @@ -110,12 +110,12 @@ struct hda_channel_mode { const struct hda_verb *sequence; }; -int snd_hda_ch_mode_info(struct hda_codec *codec, snd_ctl_elem_info_t *uinfo, +int snd_hda_ch_mode_info(struct hda_codec *codec, struct snd_ctl_elem_info *uinfo, const struct hda_channel_mode *chmode, int num_chmodes); -int snd_hda_ch_mode_get(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, +int snd_hda_ch_mode_get(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int max_channels); -int snd_hda_ch_mode_put(struct hda_codec *codec, snd_ctl_elem_value_t *ucontrol, +int snd_hda_ch_mode_put(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, const struct hda_channel_mode *chmode, int num_chmodes, int *max_channelsp); @@ -138,11 +138,11 @@ struct hda_multi_out { int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_dig_close(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out *mout, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream); + struct snd_pcm_substream *substream); int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_out *mout); /* @@ -170,13 +170,13 @@ struct hda_board_config { }; int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_config *tbl); -int snd_hda_add_new_ctls(struct hda_codec *codec, snd_kcontrol_new_t *knew); +int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); /* * power management */ #ifdef CONFIG_PM -int snd_hda_resume_ctls(struct hda_codec *codec, snd_kcontrol_new_t *knew); +int snd_hda_resume_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); int snd_hda_resume_spdif_out(struct hda_codec *codec); int snd_hda_resume_spdif_in(struct hda_codec *codec); #endif diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 39ddf1cd9019..8cc5773958f6 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -47,7 +47,7 @@ static const char *get_wid_type_name(unsigned int wid_value) return "UNKOWN Widget"; } -static void print_amp_caps(snd_info_buffer_t *buffer, +static void print_amp_caps(struct snd_info_buffer *buffer, struct hda_codec *codec, hda_nid_t nid, int dir) { unsigned int caps; @@ -66,7 +66,7 @@ static void print_amp_caps(snd_info_buffer_t *buffer, (caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT); } -static void print_amp_vals(snd_info_buffer_t *buffer, +static void print_amp_vals(struct snd_info_buffer *buffer, struct hda_codec *codec, hda_nid_t nid, int dir, int stereo, int indices) { @@ -91,7 +91,7 @@ static void print_amp_vals(snd_info_buffer_t *buffer, snd_iprintf(buffer, "\n"); } -static void print_pcm_caps(snd_info_buffer_t *buffer, +static void print_pcm_caps(struct snd_info_buffer *buffer, struct hda_codec *codec, hda_nid_t nid) { unsigned int pcm = snd_hda_param_read(codec, nid, AC_PAR_PCM); @@ -160,7 +160,7 @@ static const char *get_jack_color(u32 cfg) return "UNKNOWN"; } -static void print_pin_caps(snd_info_buffer_t *buffer, +static void print_pin_caps(struct snd_info_buffer *buffer, struct hda_codec *codec, hda_nid_t nid) { static char *jack_conns[4] = { "Jack", "N/A", "Fixed", "Both" }; @@ -194,7 +194,7 @@ static void print_pin_caps(snd_info_buffer_t *buffer, } -static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer) +static void print_codec_info(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct hda_codec *codec = entry->private_data; char buf[32]; @@ -309,7 +309,7 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer) int snd_hda_codec_proc_new(struct hda_codec *codec) { char name[32]; - snd_info_entry_t *entry; + struct snd_info_entry *entry; int err; snprintf(name, sizeof(name), "codec#%d", codec->addr); diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 4687736aa0d7..1f371fe6b92f 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -28,7 +28,7 @@ #include "hda_local.h" struct ad198x_spec { - snd_kcontrol_new_t *mixers[5]; + struct snd_kcontrol_new *mixers[5]; int num_mixers; const struct hda_verb *init_verbs[3]; /* initialization verbs @@ -65,7 +65,7 @@ struct ad198x_spec { /* * input MUX handling (common part) */ -static int ad198x_mux_enum_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int ad198x_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *spec = codec->spec; @@ -73,7 +73,7 @@ static int ad198x_mux_enum_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u return snd_hda_input_mux_info(spec->input_mux, uinfo); } -static int ad198x_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad198x_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *spec = codec->spec; @@ -83,7 +83,7 @@ static int ad198x_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u return 0; } -static int ad198x_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad198x_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *spec = codec->spec; @@ -135,7 +135,7 @@ static int ad198x_build_controls(struct hda_codec *codec) */ static int ad198x_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream); @@ -145,7 +145,7 @@ static int ad198x_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag, @@ -154,7 +154,7 @@ static int ad198x_playback_pcm_prepare(struct hda_pcm_stream *hinfo, static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); @@ -165,7 +165,7 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, */ static int ad198x_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; return snd_hda_multi_out_dig_open(codec, &spec->multiout); @@ -173,7 +173,7 @@ static int ad198x_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, static int ad198x_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; return snd_hda_multi_out_dig_close(codec, &spec->multiout); @@ -186,7 +186,7 @@ static int ad198x_capture_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number], @@ -196,7 +196,7 @@ static int ad198x_capture_pcm_prepare(struct hda_pcm_stream *hinfo, static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number], @@ -348,7 +348,7 @@ static struct hda_input_mux ad1986a_capture_source = { #define ad1986a_pcm_amp_vol_info snd_hda_mixer_amp_volume_info -static int ad1986a_pcm_amp_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1986a_pcm_amp_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *ad = codec->spec; @@ -359,7 +359,7 @@ static int ad1986a_pcm_amp_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_ return 0; } -static int ad1986a_pcm_amp_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1986a_pcm_amp_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *ad = codec->spec; @@ -377,7 +377,7 @@ static int ad1986a_pcm_amp_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_ #define ad1986a_pcm_amp_sw_info snd_hda_mixer_amp_switch_info -static int ad1986a_pcm_amp_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1986a_pcm_amp_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *ad = codec->spec; @@ -388,7 +388,7 @@ static int ad1986a_pcm_amp_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -static int ad1986a_pcm_amp_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1986a_pcm_amp_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *ad = codec->spec; @@ -407,7 +407,7 @@ static int ad1986a_pcm_amp_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t /* * mixers */ -static snd_kcontrol_new_t ad1986a_mixers[] = { +static struct snd_kcontrol_new ad1986a_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", @@ -570,7 +570,7 @@ static struct hda_input_mux ad1983_capture_source = { /* * SPDIF playback route */ -static int ad1983_spdif_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int ad1983_spdif_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts[] = { "PCM", "ADC" }; @@ -583,7 +583,7 @@ static int ad1983_spdif_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -static int ad1983_spdif_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1983_spdif_route_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *spec = codec->spec; @@ -592,7 +592,7 @@ static int ad1983_spdif_route_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -static int ad1983_spdif_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct ad198x_spec *spec = codec->spec; @@ -606,7 +606,7 @@ static int ad1983_spdif_route_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -static snd_kcontrol_new_t ad1983_mixers[] = { +static struct snd_kcontrol_new ad1983_mixers[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), @@ -736,7 +736,7 @@ static struct hda_input_mux ad1981_capture_source = { }, }; -static snd_kcontrol_new_t ad1981_mixers[] = { +static struct snd_kcontrol_new ad1981_mixers[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Front Playback Switch", 0x05, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x06, 0x0, HDA_OUTPUT), diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index 37ee1246b2dd..9a6981162982 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c @@ -79,14 +79,14 @@ struct cmi_spec { /* * input MUX */ -static int cmi_mux_enum_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int cmi_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; return snd_hda_input_mux_info(spec->input_mux, uinfo); } -static int cmi_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int cmi_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; @@ -96,7 +96,7 @@ static int cmi_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon return 0; } -static int cmi_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int cmi_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; @@ -149,7 +149,7 @@ static struct hda_channel_mode cmi9880_channel_modes[3] = { { 8, cmi9880_ch8_init }, }; -static int cmi_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int cmi_ch_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; @@ -157,7 +157,7 @@ static int cmi_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo spec->num_channel_modes); } -static int cmi_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int cmi_ch_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; @@ -165,7 +165,7 @@ static int cmi_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont spec->num_channel_modes, spec->multiout.max_channels); } -static int cmi_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int cmi_ch_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct cmi_spec *spec = codec->spec; @@ -175,7 +175,7 @@ static int cmi_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont /* */ -static snd_kcontrol_new_t cmi9880_basic_mixer[] = { +static struct snd_kcontrol_new cmi9880_basic_mixer[] = { /* CMI9880 has no playback volumes! */ HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), /* front */ HDA_CODEC_MUTE("Surround Playback Switch", 0x04, 0x0, HDA_OUTPUT), @@ -207,7 +207,7 @@ static snd_kcontrol_new_t cmi9880_basic_mixer[] = { /* * shared I/O pins */ -static snd_kcontrol_new_t cmi9880_ch_mode_mixer[] = { +static struct snd_kcontrol_new cmi9880_ch_mode_mixer[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Channel Mode", @@ -452,7 +452,7 @@ static int cmi9880_resume(struct hda_codec *codec) */ static int cmi9880_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream); @@ -462,7 +462,7 @@ static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag, @@ -471,7 +471,7 @@ static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream *hinfo, static int cmi9880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); @@ -482,7 +482,7 @@ static int cmi9880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, */ static int cmi9880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; return snd_hda_multi_out_dig_open(codec, &spec->multiout); @@ -490,7 +490,7 @@ static int cmi9880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, static int cmi9880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; return snd_hda_multi_out_dig_close(codec, &spec->multiout); @@ -503,7 +503,7 @@ static int cmi9880_capture_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; @@ -514,7 +514,7 @@ static int cmi9880_capture_pcm_prepare(struct hda_pcm_stream *hinfo, static int cmi9880_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct cmi_spec *spec = codec->spec; diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3ff72c49cd26..62e6993056e6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -63,7 +63,7 @@ enum { struct alc_spec { /* codec parameterization */ - snd_kcontrol_new_t *mixers[3]; /* mixer arrays */ + struct snd_kcontrol_new *mixers[3]; /* mixer arrays */ unsigned int num_mixers; const struct hda_verb *init_verbs[3]; /* initialization verbs @@ -104,7 +104,7 @@ struct alc_spec { /* dynamic controls, init_verbs and input_mux */ struct auto_pin_cfg autocfg; unsigned int num_kctl_alloc, num_kctl_used; - snd_kcontrol_new_t *kctl_alloc; + struct snd_kcontrol_new *kctl_alloc; struct hda_input_mux private_imux; hda_nid_t private_dac_nids[4]; }; @@ -113,14 +113,14 @@ struct alc_spec { /* * input MUX handling */ -static int alc_mux_enum_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int alc_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; return snd_hda_input_mux_info(spec->input_mux, uinfo); } -static int alc_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -130,7 +130,7 @@ static int alc_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon return 0; } -static int alc_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -143,7 +143,7 @@ static int alc_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon /* * channel mode setting */ -static int alc880_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int alc880_ch_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -151,7 +151,7 @@ static int alc880_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui spec->num_channel_mode); } -static int alc880_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc880_ch_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -159,7 +159,7 @@ static int alc880_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc spec->num_channel_mode, spec->multiout.max_channels); } -static int alc880_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc880_ch_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -173,7 +173,7 @@ static int alc880_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc * supported, so VrefEn can't be controlled using these functions as they * stand. */ -static int alc_pinctl_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int alc_pinctl_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -182,7 +182,7 @@ static int alc_pinctl_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -static int alc_pinctl_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_pinctl_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value & 0xffff; @@ -195,7 +195,7 @@ static int alc_pinctl_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -static int alc_pinctl_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_pinctl_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = kcontrol->private_value & 0xffff; @@ -284,7 +284,7 @@ static struct hda_channel_mode alc880_threestack_modes[2] = { { 6, alc880_threestack_ch6_init }, }; -static snd_kcontrol_new_t alc880_three_stack_mixer[] = { +static struct snd_kcontrol_new alc880_three_stack_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT), @@ -315,7 +315,7 @@ static snd_kcontrol_new_t alc880_three_stack_mixer[] = { }; /* capture mixer elements */ -static snd_kcontrol_new_t alc880_capture_mixer[] = { +static struct snd_kcontrol_new alc880_capture_mixer[] = { HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), @@ -339,7 +339,7 @@ static snd_kcontrol_new_t alc880_capture_mixer[] = { }; /* capture mixer elements (in case NID 0x07 not available) */ -static snd_kcontrol_new_t alc880_capture_alt_mixer[] = { +static struct snd_kcontrol_new alc880_capture_alt_mixer[] = { HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), @@ -371,7 +371,7 @@ static snd_kcontrol_new_t alc880_capture_alt_mixer[] = { */ /* additional mixers to alc880_three_stack_mixer */ -static snd_kcontrol_new_t alc880_five_stack_mixer[] = { +static struct snd_kcontrol_new alc880_five_stack_mixer[] = { HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT), { } /* end */ @@ -428,7 +428,7 @@ static struct hda_channel_mode alc880_sixstack_modes[1] = { { 8, NULL }, }; -static snd_kcontrol_new_t alc880_six_stack_mixer[] = { +static struct snd_kcontrol_new alc880_six_stack_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT), @@ -496,7 +496,7 @@ static struct hda_channel_mode alc880_w810_modes[1] = { }; /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */ -static snd_kcontrol_new_t alc880_w810_base_mixer[] = { +static struct snd_kcontrol_new alc880_w810_base_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT), @@ -527,7 +527,7 @@ static struct hda_channel_mode alc880_2_jack_modes[1] = { { 2, NULL } }; -static snd_kcontrol_new_t alc880_z71v_mixer[] = { +static struct snd_kcontrol_new alc880_z71v_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT), @@ -553,7 +553,7 @@ static hda_nid_t alc880_f1734_dac_nids[1] = { }; #define ALC880_F1734_HP_DAC 0x02 -static snd_kcontrol_new_t alc880_f1734_mixer[] = { +static struct snd_kcontrol_new alc880_f1734_mixer[] = { HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Internal Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT), @@ -578,7 +578,7 @@ static snd_kcontrol_new_t alc880_f1734_mixer[] = { #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */ #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */ -static snd_kcontrol_new_t alc880_asus_mixer[] = { +static struct snd_kcontrol_new alc880_asus_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT), @@ -613,14 +613,14 @@ static snd_kcontrol_new_t alc880_asus_mixer[] = { */ /* additional mixers to alc880_asus_mixer */ -static snd_kcontrol_new_t alc880_asus_w1v_mixer[] = { +static struct snd_kcontrol_new alc880_asus_w1v_mixer[] = { HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT), HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT), { } /* end */ }; /* additional mixers to alc880_asus_mixer */ -static snd_kcontrol_new_t alc880_pcbeep_mixer[] = { +static struct snd_kcontrol_new alc880_pcbeep_mixer[] = { HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), { } /* end */ @@ -974,7 +974,7 @@ static int alc_resume(struct hda_codec *codec) */ static int alc880_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream); @@ -984,7 +984,7 @@ static int alc880_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag, @@ -993,7 +993,7 @@ static int alc880_playback_pcm_prepare(struct hda_pcm_stream *hinfo, static int alc880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); @@ -1004,7 +1004,7 @@ static int alc880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, */ static int alc880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; return snd_hda_multi_out_dig_open(codec, &spec->multiout); @@ -1012,7 +1012,7 @@ static int alc880_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, static int alc880_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; return snd_hda_multi_out_dig_close(codec, &spec->multiout); @@ -1025,7 +1025,7 @@ static int alc880_capture_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; @@ -1036,7 +1036,7 @@ static int alc880_capture_pcm_prepare(struct hda_pcm_stream *hinfo, static int alc880_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct alc_spec *spec = codec->spec; @@ -1185,7 +1185,7 @@ static struct hda_channel_mode alc880_test_modes[4] = { { 8, NULL }, }; -static int alc_test_pin_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts[] = { "N/A", "Line Out", "HP Out", @@ -1200,7 +1200,7 @@ static int alc_test_pin_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * return 0; } -static int alc_test_pin_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = (hda_nid_t)kcontrol->private_value; @@ -1226,7 +1226,7 @@ static int alc_test_pin_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int alc_test_pin_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = (hda_nid_t)kcontrol->private_value; @@ -1252,7 +1252,7 @@ static int alc_test_pin_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int alc_test_pin_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts[] = { "Front", "Surround", "CLFE", "Side" @@ -1266,7 +1266,7 @@ static int alc_test_pin_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * return 0; } -static int alc_test_pin_src_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = (hda_nid_t)kcontrol->private_value; @@ -1277,7 +1277,7 @@ static int alc_test_pin_src_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int alc_test_pin_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = (hda_nid_t)kcontrol->private_value; @@ -1310,7 +1310,7 @@ static int alc_test_pin_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * .private_value = nid \ } -static snd_kcontrol_new_t alc880_test_mixer[] = { +static struct snd_kcontrol_new alc880_test_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT), @@ -1527,7 +1527,7 @@ static struct hda_board_config alc880_cfg_tbl[] = { * configuration template - to be copied to the spec instance */ struct alc_config_preset { - snd_kcontrol_new_t *mixers[4]; + struct snd_kcontrol_new *mixers[4]; const struct hda_verb *init_verbs[4]; unsigned int num_dacs; hda_nid_t *dac_nids; @@ -1698,7 +1698,7 @@ enum { ALC_CTL_WIDGET_MUTE, ALC_CTL_BIND_MUTE, }; -static snd_kcontrol_new_t alc880_control_templates[] = { +static struct snd_kcontrol_new alc880_control_templates[] = { HDA_CODEC_VOLUME(NULL, 0, 0, 0), HDA_CODEC_MUTE(NULL, 0, 0, 0), HDA_BIND_MUTE(NULL, 0, 0, 0), @@ -1707,7 +1707,7 @@ static snd_kcontrol_new_t alc880_control_templates[] = { /* add dynamic controls */ static int add_control(struct alc_spec *spec, int type, const char *name, unsigned long val) { - snd_kcontrol_new_t *knew; + struct snd_kcontrol_new *knew; if (spec->num_kctl_used >= spec->num_kctl_alloc) { int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC; @@ -2168,7 +2168,7 @@ static struct hda_channel_mode alc260_modes[1] = { { 2, NULL }, }; -static snd_kcontrol_new_t alc260_base_mixer[] = { +static struct snd_kcontrol_new alc260_base_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT), @@ -2197,7 +2197,7 @@ static snd_kcontrol_new_t alc260_base_mixer[] = { { } /* end */ }; -static snd_kcontrol_new_t alc260_hp_mixer[] = { +static struct snd_kcontrol_new alc260_hp_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT), @@ -2224,7 +2224,7 @@ static snd_kcontrol_new_t alc260_hp_mixer[] = { { } /* end */ }; -static snd_kcontrol_new_t alc260_fujitsu_mixer[] = { +static struct snd_kcontrol_new alc260_fujitsu_mixer[] = { HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT), ALC_PINCTL_SWITCH("Headphone Amp Switch", 0x14, PIN_HP_AMP), @@ -2498,7 +2498,7 @@ static struct hda_input_mux alc882_capture_source = { #define alc882_mux_enum_info alc_mux_enum_info #define alc882_mux_enum_get alc_mux_enum_get -static int alc882_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct alc_spec *spec = codec->spec; @@ -2526,7 +2526,7 @@ static int alc882_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b */ -static snd_kcontrol_new_t alc882_base_mixer[] = { +static struct snd_kcontrol_new alc882_base_mixer[] = { HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT), diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index 12b5de29f42f..8f8840e6002b 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c @@ -95,8 +95,8 @@ struct si3054_spec { #define PRIVATE_REG(val) ((val>>16)&0xffff) #define PRIVATE_MASK(val) (val&0xffff) -static int si3054_switch_info(snd_kcontrol_t *kcontrol, - snd_ctl_elem_info_t *uinfo) +static int si3054_switch_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -105,8 +105,8 @@ static int si3054_switch_info(snd_kcontrol_t *kcontrol, return 0; } -static int si3054_switch_get(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *uvalue) +static int si3054_switch_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *uvalue) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); u16 reg = PRIVATE_REG(kcontrol->private_value); @@ -115,8 +115,8 @@ static int si3054_switch_get(snd_kcontrol_t *kcontrol, return 0; } -static int si3054_switch_put(snd_kcontrol_t *kcontrol, - snd_ctl_elem_value_t *uvalue) +static int si3054_switch_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *uvalue) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); u16 reg = PRIVATE_REG(kcontrol->private_value); @@ -138,7 +138,7 @@ static int si3054_switch_put(snd_kcontrol_t *kcontrol, } -static snd_kcontrol_new_t si3054_modem_mixer[] = { +static struct snd_kcontrol_new si3054_modem_mixer[] = { SI3054_KCONTROL("Off-hook Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_OH), SI3054_KCONTROL("Caller ID Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_CID), {} @@ -158,7 +158,7 @@ static int si3054_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { u16 val; @@ -175,10 +175,10 @@ static int si3054_pcm_prepare(struct hda_pcm_stream *hinfo, static int si3054_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { static unsigned int rates[] = { 8000, 9600, 16000 }; - static snd_pcm_hw_constraint_list_t hw_constraints_rates = { + static struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 33a8adaea768..d8d68f5b6131 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -41,7 +41,7 @@ #define STAC_UNSOL_ENABLE (AC_USRSP_EN | STAC_HP_EVENT) struct sigmatel_spec { - snd_kcontrol_new_t *mixers[4]; + struct snd_kcontrol_new *mixers[4]; unsigned int num_mixers; unsigned int surr_switch: 1; @@ -66,7 +66,7 @@ struct sigmatel_spec { /* codec specific stuff */ struct hda_verb *init; - snd_kcontrol_new_t *mixer; + struct snd_kcontrol_new *mixer; /* capture source */ struct hda_input_mux *input_mux; @@ -81,7 +81,7 @@ struct sigmatel_spec { /* dynamic controls and input_mux */ struct auto_pin_cfg autocfg; unsigned int num_kctl_alloc, num_kctl_used; - snd_kcontrol_new_t *kctl_alloc; + struct snd_kcontrol_new *kctl_alloc; struct hda_input_mux private_imux; }; @@ -116,14 +116,14 @@ static hda_nid_t stac922x_pin_nids[10] = { }; #endif -static int stac92xx_mux_enum_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; return snd_hda_input_mux_info(spec->input_mux, uinfo); } -static int stac92xx_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int stac92xx_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; @@ -133,7 +133,7 @@ static int stac92xx_mux_enum_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t return 0; } -static int stac92xx_mux_enum_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; @@ -157,7 +157,7 @@ static struct hda_verb stac922x_core_init[] = { static int stac922x_channel_modes[3] = {2, 6, 8}; -static int stac922x_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int stac922x_ch_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; @@ -172,7 +172,7 @@ static int stac922x_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * return 0; } -static int stac922x_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int stac922x_ch_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; @@ -181,7 +181,7 @@ static int stac922x_ch_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int stac922x_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int stac922x_ch_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; @@ -198,7 +198,7 @@ static int stac922x_ch_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 1; } -static snd_kcontrol_new_t stac9200_mixer[] = { +static struct snd_kcontrol_new stac9200_mixer[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), { @@ -216,7 +216,7 @@ static snd_kcontrol_new_t stac9200_mixer[] = { }; /* This needs to be generated dynamically based on sequence */ -static snd_kcontrol_new_t stac922x_mixer[] = { +static struct snd_kcontrol_new stac922x_mixer[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Source", @@ -231,7 +231,7 @@ static snd_kcontrol_new_t stac922x_mixer[] = { { } /* end */ }; -static snd_kcontrol_new_t stac922x_ch_mode_mixer[] = { +static struct snd_kcontrol_new stac922x_ch_mode_mixer[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Channel Mode", @@ -320,7 +320,7 @@ static void stac92xx_set_config_regs(struct hda_codec *codec) */ static int stac92xx_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream); @@ -333,7 +333,7 @@ static int stac92xx_playback_pcm_open(struct hda_pcm_stream *hinfo, static int stac92xx_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { hda_nid_t *nids = mout->dac_nids; int chs = substream->runtime->channels; @@ -380,7 +380,7 @@ static int stac92xx_playback_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; return stac92xx_multi_out_analog_prepare(codec, &spec->multiout, stream_tag, @@ -389,7 +389,7 @@ static int stac92xx_playback_pcm_prepare(struct hda_pcm_stream *hinfo, static int stac92xx_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); @@ -400,7 +400,7 @@ static int stac92xx_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, */ static int stac92xx_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; return snd_hda_multi_out_dig_open(codec, &spec->multiout); @@ -408,7 +408,7 @@ static int stac92xx_dig_playback_pcm_open(struct hda_pcm_stream *hinfo, static int stac92xx_dig_playback_pcm_close(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; return snd_hda_multi_out_dig_close(codec, &spec->multiout); @@ -422,7 +422,7 @@ static int stac92xx_capture_pcm_prepare(struct hda_pcm_stream *hinfo, struct hda_codec *codec, unsigned int stream_tag, unsigned int format, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; @@ -433,7 +433,7 @@ static int stac92xx_capture_pcm_prepare(struct hda_pcm_stream *hinfo, static int stac92xx_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, - snd_pcm_substream_t *substream) + struct snd_pcm_substream *substream) { struct sigmatel_spec *spec = codec->spec; @@ -516,7 +516,7 @@ enum { STAC_CTL_WIDGET_MUTE, }; -static snd_kcontrol_new_t stac92xx_control_templates[] = { +static struct snd_kcontrol_new stac92xx_control_templates[] = { HDA_CODEC_VOLUME(NULL, 0, 0, 0), HDA_CODEC_MUTE(NULL, 0, 0, 0), }; @@ -524,7 +524,7 @@ static snd_kcontrol_new_t stac92xx_control_templates[] = { /* add dynamic controls */ static int stac92xx_add_control(struct sigmatel_spec *spec, int type, const char *name, unsigned long val) { - snd_kcontrol_new_t *knew; + struct snd_kcontrol_new *knew; if (spec->num_kctl_used >= spec->num_kctl_alloc) { int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC; -- cgit v1.2.3 From 54d174031576a2855c49611d83d4946bde81b504 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 21 Nov 2005 16:33:22 +0100 Subject: [ALSA] hda-codec - Fix connection list parsing Modules: HDA Codec driver,HDA generic driver - Fix connection list parsing (with ranged flag). - Increase the max number of connections - Introduce widget capabilities cache - Power up/down widgets at init, suspend and resume Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 155 ++++++++++++++++++++++++++++++----------- sound/pci/hda/hda_codec.h | 13 +++- sound/pci/hda/hda_local.h | 14 +++- sound/pci/hda/patch_realtek.c | 3 +- sound/pci/hda/patch_sigmatel.c | 25 +------ 5 files changed, 140 insertions(+), 70 deletions(-) (limited to 'sound/pci/hda/hda_codec.h') diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 7f4e19951bae..402ce00c6a13 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -155,8 +155,9 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *conn_list, int max_conns) { unsigned int parm; - int i, j, conn_len, num_tupples, conns; + int i, conn_len, conns; unsigned int shift, num_elems, mask; + hda_nid_t prev_nid; snd_assert(conn_list && max_conns > 0, return -EINVAL); @@ -171,7 +172,6 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, num_elems = 4; } conn_len = parm & AC_CLIST_LENGTH; - num_tupples = num_elems / 2; mask = (1 << (shift-1)) - 1; if (! conn_len) @@ -186,40 +186,38 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, /* multi connection */ conns = 0; - for (i = 0; i < conn_len; i += num_elems) { - parm = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_LIST, i); - for (j = 0; j < num_tupples; j++) { - int range_val; - hda_nid_t val1, val2, n; - range_val = parm & (1 << (shift-1)); /* ranges */ - val1 = parm & mask; - parm >>= shift; - val2 = parm & mask; - parm >>= shift; - if (range_val) { - /* ranges between val1 and val2 */ - if (val1 > val2) { - snd_printk(KERN_WARNING "hda_codec: invalid dep_range_val %x:%x\n", val1, val2); - continue; - } - for (n = val1; n <= val2; n++) { - if (conns >= max_conns) - return -EINVAL; - conn_list[conns++] = n; - } - } else { - if (! val1) - break; - if (conns >= max_conns) - return -EINVAL; - conn_list[conns++] = val1; - if (! val2) - break; - if (conns >= max_conns) + prev_nid = 0; + for (i = 0; i < conn_len; i++) { + int range_val; + hda_nid_t val, n; + + if (i % num_elems == 0) + parm = snd_hda_codec_read(codec, nid, 0, + AC_VERB_GET_CONNECT_LIST, i); + range_val = !! (parm & (1 << (shift-1))); /* ranges */ + val = parm & mask; + parm >>= shift; + if (range_val) { + /* ranges between the previous and this one */ + if (! prev_nid || prev_nid >= val) { + snd_printk(KERN_WARNING "hda_codec: invalid dep_range_val %x:%x\n", prev_nid, val); + continue; + } + for (n = prev_nid + 1; n <= val; n++) { + if (conns >= max_conns) { + snd_printk(KERN_ERR "Too many connections\n"); return -EINVAL; - conn_list[conns++] = val2; + } + conn_list[conns++] = n; } + } else { + if (conns >= max_conns) { + snd_printk(KERN_ERR "Too many connections\n"); + return -EINVAL; + } + conn_list[conns++] = val; } + prev_nid = val; } return conns; } @@ -455,6 +453,27 @@ static void setup_fg_nodes(struct hda_codec *codec) } } +/* + * read widget caps for each widget and store in cache + */ +static int read_widget_caps(struct hda_codec *codec, hda_nid_t fg_node) +{ + int i; + hda_nid_t nid; + + codec->num_nodes = snd_hda_get_sub_nodes(codec, fg_node, + &codec->start_nid); + codec->wcaps = kmalloc(codec->num_nodes * 4, GFP_KERNEL); + if (! codec->wcaps) + return -ENOMEM; + nid = codec->start_nid; + for (i = 0; i < codec->num_nodes; i++, nid++) + codec->wcaps[i] = snd_hda_param_read(codec, nid, + AC_PAR_AUDIO_WIDGET_CAP); + return 0; +} + + /* * codec destructor */ @@ -467,6 +486,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) if (codec->patch_ops.free) codec->patch_ops.free(codec); kfree(codec->amp_info); + kfree(codec->wcaps); kfree(codec); } @@ -520,6 +540,12 @@ int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, return -ENODEV; } + if (read_widget_caps(codec, codec->afg ? codec->afg : codec->mfg) < 0) { + snd_printk(KERN_ERR "hda_codec: cannot malloc\n"); + snd_hda_codec_free(codec); + return -ENOMEM; + } + if (! codec->subsystem_id) { hda_nid_t nid = codec->afg ? codec->afg : codec->mfg; codec->subsystem_id = snd_hda_codec_read(codec, nid, 0, @@ -647,7 +673,7 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) if (! info) return 0; if (! (info->status & INFO_AMP_CAPS)) { - if (!(snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP) & AC_WCAP_AMP_OVRD)) + if (! (get_wcaps(codec, nid) & AC_WCAP_AMP_OVRD)) nid = codec->afg; info->amp_caps = snd_hda_param_read(codec, nid, direction == HDA_OUTPUT ? AC_PAR_AMP_OUT_CAP : AC_PAR_AMP_IN_CAP); @@ -1195,6 +1221,31 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) } +/* + * set power state of the codec + */ +static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, + unsigned int power_state) +{ + hda_nid_t nid, nid_start; + int nodes; + + snd_hda_codec_write(codec, fg, 0, AC_VERB_SET_POWER_STATE, + power_state); + + nodes = snd_hda_get_sub_nodes(codec, fg, &nid_start); + for (nid = nid_start; nid < nodes + nid_start; nid++) { + if (get_wcaps(codec, nid) & AC_WCAP_POWER) + snd_hda_codec_write(codec, nid, 0, + AC_VERB_SET_POWER_STATE, + power_state); + } + + if (power_state == AC_PWRST_D0) + msleep(10); +} + + /** * snd_hda_build_controls - build mixer controls * @bus: the BUS @@ -1222,6 +1273,9 @@ int snd_hda_build_controls(struct hda_bus *bus) list_for_each(p, &bus->codec_list) { struct hda_codec *codec = list_entry(p, struct hda_codec, list); int err; + hda_set_power_state(codec, + codec->afg ? codec->afg : codec->mfg, + AC_PWRST_D0); if (! codec->patch_ops.init) continue; err = codec->patch_ops.init(codec); @@ -1340,7 +1394,7 @@ int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid, val = 0; if (nid != codec->afg && - snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP) & AC_WCAP_FORMAT_OVRD) { + (get_wcaps(codec, nid) & AC_WCAP_FORMAT_OVRD)) { val = snd_hda_param_read(codec, nid, AC_PAR_PCM); if (val == -1) return -EIO; @@ -1362,7 +1416,7 @@ int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid, unsigned int bps; unsigned int wcaps; - wcaps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); + wcaps = get_wcaps(codec, nid); streams = snd_hda_param_read(codec, nid, AC_PAR_STREAM); if (streams == -1) return -EIO; @@ -1432,7 +1486,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, unsigned int val = 0, rate, stream; if (nid != codec->afg && - snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP) & AC_WCAP_FORMAT_OVRD) { + (get_wcaps(codec, nid) & AC_WCAP_FORMAT_OVRD)) { val = snd_hda_param_read(codec, nid, AC_PAR_PCM); if (val == -1) return 0; @@ -1658,9 +1712,21 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) int err; for (; knew->name; knew++) { - err = snd_ctl_add(codec->bus->card, snd_ctl_new1(knew, codec)); - if (err < 0) - return err; + struct snd_kcontrol *kctl; + kctl = snd_ctl_new1(knew, codec); + if (! kctl) + return -ENOMEM; + err = snd_ctl_add(codec->bus->card, kctl); + if (err < 0) { + if (! codec->addr) + return err; + kctl = snd_ctl_new1(knew, codec); + if (! kctl) + return -ENOMEM; + kctl->id.device = codec->addr; + if ((err = snd_ctl_add(codec->bus->card, kctl)) < 0) + return err; + } } return 0; } @@ -1874,8 +1940,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid_start); for (nid = nid_start; nid < nodes + nid_start; nid++) { - unsigned int wid_caps = snd_hda_param_read(codec, nid, - AC_PAR_AUDIO_WIDGET_CAP); + unsigned int wid_caps = get_wcaps(codec, nid); unsigned int wid_type = (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; unsigned int def_conf; short assoc, loc; @@ -1993,6 +2058,9 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) struct hda_codec *codec = list_entry(p, struct hda_codec, list); if (codec->patch_ops.suspend) codec->patch_ops.suspend(codec, state); + hda_set_power_state(codec, + codec->afg ? codec->afg : codec->mfg, + AC_PWRST_D3); } return 0; } @@ -2010,6 +2078,9 @@ int snd_hda_resume(struct hda_bus *bus) list_for_each(p, &bus->codec_list) { struct hda_codec *codec = list_entry(p, struct hda_codec, list); + hda_set_power_state(codec, + codec->afg ? codec->afg : codec->mfg, + AC_PWRST_D0); if (codec->patch_ops.resume) codec->patch_ops.resume(codec); } diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 0b5c36788898..63e26c7a2b7a 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -214,6 +214,12 @@ enum { #define AC_PWRST_D2SUP (1<<2) #define AC_PWRST_D3SUP (1<<3) +/* Power state values */ +#define AC_PWRST_D0 0x00 +#define AC_PWRST_D1 0x01 +#define AC_PWRST_D2 0x02 +#define AC_PWRST_D3 0x03 + /* Processing capabilies */ #define AC_PCAP_BENIGN (1<<0) #define AC_PCAP_NUM_COEF (0xff<<8) @@ -376,7 +382,7 @@ enum { }; /* max. connections to a widget */ -#define HDA_MAX_CONNECTIONS 16 +#define HDA_MAX_CONNECTIONS 32 /* max. codec address */ #define HDA_MAX_CODEC_ADDRESS 0x0f @@ -542,6 +548,11 @@ struct hda_codec { /* codec specific info */ void *spec; + /* widget capabilities cache */ + unsigned int num_nodes; + hda_nid_t start_nid; + u32 *wcaps; + /* hash for amp access */ u16 amp_hash[32]; int num_amp_entries; diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 502290424c67..ded32359b654 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -87,7 +87,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid); /* * input MUX helper */ -#define HDA_MAX_NUM_INPUTS 8 +#define HDA_MAX_NUM_INPUTS 16 struct hda_input_mux_item { const char *label; unsigned int index; @@ -243,4 +243,16 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c #define PIN_HP 0xc0 #define PIN_HP_AMP 0x80 +/* + * get widget capabilities + */ +static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) +{ + if (nid < codec->start_nid || + nid >= codec->start_nid + codec->num_nodes) + return snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); + return codec->wcaps[nid - codec->start_nid]; +} + + #endif /* __SOUND_HDA_LOCAL_H */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 62e6993056e6..77c5f95ea55b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2091,8 +2091,7 @@ static int patch_alc880(struct hda_codec *codec) if (! spec->adc_nids && spec->input_mux) { /* check whether NID 0x07 is valid */ - unsigned int wcap = snd_hda_param_read(codec, alc880_adc_nids[0], - AC_PAR_AUDIO_WIDGET_CAP); + unsigned int wcap = get_wcaps(codec, alc880_adc_nids[0]); wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; /* get type */ if (wcap != AC_WID_AUD_IN) { spec->adc_nids = alc880_adc_nids_alt; diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index d8d68f5b6131..c8c539cb4a8f 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -624,7 +624,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, struct auto_pin if (! pin) return 0; - wid_caps = snd_hda_param_read(codec, pin, AC_PAR_AUDIO_WIDGET_CAP); + wid_caps = get_wcaps(codec, pin); if (wid_caps & AC_WCAP_UNSOL_CAP) /* Enable unsolicited responses on the HP widget */ snd_hda_codec_write(codec, pin, 0, @@ -786,33 +786,10 @@ static int stac9200_parse_auto_config(struct hda_codec *codec) return 1; } -static int stac92xx_init_pstate(struct hda_codec *codec) -{ - hda_nid_t nid, nid_start; - int nodes; - - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_POWER_STATE, 0x00); - - nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid_start); - for (nid = nid_start; nid < nodes + nid_start; nid++) { - unsigned int wid_caps = snd_hda_param_read(codec, nid, - AC_PAR_AUDIO_WIDGET_CAP); - if (wid_caps & AC_WCAP_POWER) - snd_hda_codec_write(codec, nid, 0, - AC_VERB_SET_POWER_STATE, 0x00); - } - - mdelay(100); - - return 0; -} - static int stac92xx_init(struct hda_codec *codec) { struct sigmatel_spec *spec = codec->spec; - stac92xx_init_pstate(codec); - snd_hda_sequence_write(codec, spec->init); stac92xx_auto_init_multi_out(codec); -- cgit v1.2.3