aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-07-27 10:52:19 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:09 -0400
commitd01ce99fc53271cd8ef0ef6b9a2790177fd410a1 (patch)
treed6723036b6bd896c120cf49dd049ddf182ec703d /sound/pci/hda/hda_local.h
parente2340465ec9587362a057524d3e2163377366771 (diff)
[ALSA] hda-intel - Coding style fixes
Fix codes to follow more to the standard kernel coding style. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h99
1 files changed, 66 insertions, 33 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index f91ea5ec9f6d..c8d34a5b081f 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -26,7 +26,8 @@
26/* 26/*
27 * for mixer controls 27 * for mixer controls
28 */ 28 */
29#define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19)) 29#define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \
30 ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19))
30/* mono volume with index (index=0,1,...) (channel=1,2) */ 31/* mono volume with index (index=0,1,...) (channel=1,2) */
31#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 32#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
32 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 33 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
@@ -64,13 +65,20 @@
64#define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ 65#define HDA_CODEC_MUTE(xname, nid, xindex, direction) \
65 HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) 66 HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction)
66 67
67int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); 68int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
68int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 69 struct snd_ctl_elem_info *uinfo);
69int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 70int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
70int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv); 71 struct snd_ctl_elem_value *ucontrol);
71int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); 72int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol,
72int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 73 struct snd_ctl_elem_value *ucontrol);
73int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 74int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
75 unsigned int size, unsigned int __user *tlv);
76int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
77 struct snd_ctl_elem_info *uinfo);
78int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol,
79 struct snd_ctl_elem_value *ucontrol);
80int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
81 struct snd_ctl_elem_value *ucontrol);
74/* lowlevel accessor with caching; use carefully */ 82/* lowlevel accessor with caching; use carefully */
75int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, 83int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch,
76 int direction, int index); 84 int direction, int index);
@@ -86,10 +94,13 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch,
86 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, indices, direction) } 94 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, indices, direction) }
87 95
88/* stereo switch binding multiple inputs */ 96/* stereo switch binding multiple inputs */
89#define HDA_BIND_MUTE(xname,nid,indices,dir) HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir) 97#define HDA_BIND_MUTE(xname,nid,indices,dir) \
98 HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir)
90 99
91int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 100int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol,
92int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 101 struct snd_ctl_elem_value *ucontrol);
102int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
103 struct snd_ctl_elem_value *ucontrol);
93 104
94int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid); 105int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid);
95int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid); 106int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid);
@@ -107,8 +118,10 @@ struct hda_input_mux {
107 struct hda_input_mux_item items[HDA_MAX_NUM_INPUTS]; 118 struct hda_input_mux_item items[HDA_MAX_NUM_INPUTS];
108}; 119};
109 120
110int snd_hda_input_mux_info(const struct hda_input_mux *imux, struct snd_ctl_elem_info *uinfo); 121int snd_hda_input_mux_info(const struct hda_input_mux *imux,
111int snd_hda_input_mux_put(struct hda_codec *codec, const struct hda_input_mux *imux, 122 struct snd_ctl_elem_info *uinfo);
123int snd_hda_input_mux_put(struct hda_codec *codec,
124 const struct hda_input_mux *imux,
112 struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, 125 struct snd_ctl_elem_value *ucontrol, hda_nid_t nid,
113 unsigned int *cur_val); 126 unsigned int *cur_val);
114 127
@@ -120,13 +133,19 @@ struct hda_channel_mode {
120 const struct hda_verb *sequence; 133 const struct hda_verb *sequence;
121}; 134};
122 135
123int snd_hda_ch_mode_info(struct hda_codec *codec, struct snd_ctl_elem_info *uinfo, 136int snd_hda_ch_mode_info(struct hda_codec *codec,
124 const struct hda_channel_mode *chmode, int num_chmodes); 137 struct snd_ctl_elem_info *uinfo,
125int snd_hda_ch_mode_get(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, 138 const struct hda_channel_mode *chmode,
126 const struct hda_channel_mode *chmode, int num_chmodes, 139 int num_chmodes);
140int snd_hda_ch_mode_get(struct hda_codec *codec,
141 struct snd_ctl_elem_value *ucontrol,
142 const struct hda_channel_mode *chmode,
143 int num_chmodes,
127 int max_channels); 144 int max_channels);
128int snd_hda_ch_mode_put(struct hda_codec *codec, struct snd_ctl_elem_value *ucontrol, 145int snd_hda_ch_mode_put(struct hda_codec *codec,
129 const struct hda_channel_mode *chmode, int num_chmodes, 146 struct snd_ctl_elem_value *ucontrol,
147 const struct hda_channel_mode *chmode,
148 int num_chmodes,
130 int *max_channelsp); 149 int *max_channelsp);
131 150
132/* 151/*
@@ -146,20 +165,25 @@ struct hda_multi_out {
146 int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ 165 int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */
147}; 166};
148 167
149int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout); 168int snd_hda_multi_out_dig_open(struct hda_codec *codec,
150int snd_hda_multi_out_dig_close(struct hda_codec *codec, struct hda_multi_out *mout); 169 struct hda_multi_out *mout);
170int snd_hda_multi_out_dig_close(struct hda_codec *codec,
171 struct hda_multi_out *mout);
151int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, 172int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
152 struct hda_multi_out *mout, 173 struct hda_multi_out *mout,
153 unsigned int stream_tag, 174 unsigned int stream_tag,
154 unsigned int format, 175 unsigned int format,
155 struct snd_pcm_substream *substream); 176 struct snd_pcm_substream *substream);
156int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out *mout, 177int snd_hda_multi_out_analog_open(struct hda_codec *codec,
178 struct hda_multi_out *mout,
157 struct snd_pcm_substream *substream); 179 struct snd_pcm_substream *substream);
158int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, 180int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
181 struct hda_multi_out *mout,
159 unsigned int stream_tag, 182 unsigned int stream_tag,
160 unsigned int format, 183 unsigned int format,
161 struct snd_pcm_substream *substream); 184 struct snd_pcm_substream *substream);
162int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_out *mout); 185int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
186 struct hda_multi_out *mout);
163 187
164/* 188/*
165 * generic codec parser 189 * generic codec parser
@@ -181,7 +205,8 @@ static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; }
181int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 205int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
182 const char **modelnames, 206 const char **modelnames,
183 const struct snd_pci_quirk *pci_list); 207 const struct snd_pci_quirk *pci_list);
184int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); 208int snd_hda_add_new_ctls(struct hda_codec *codec,
209 struct snd_kcontrol_new *knew);
185 210
186/* 211/*
187 * power management 212 * power management
@@ -232,7 +257,9 @@ extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST];
232 257
233struct auto_pin_cfg { 258struct auto_pin_cfg {
234 int line_outs; 259 int line_outs;
235 hda_nid_t line_out_pins[5]; /* sorted in the order of Front/Surr/CLFE/Side */ 260 hda_nid_t line_out_pins[5]; /* sorted in the order of
261 * Front/Surr/CLFE/Side
262 */
236 int speaker_outs; 263 int speaker_outs;
237 hda_nid_t speaker_pins[5]; 264 hda_nid_t speaker_pins[5];
238 int hp_outs; 265 int hp_outs;
@@ -243,13 +270,19 @@ struct auto_pin_cfg {
243 hda_nid_t dig_in_pin; 270 hda_nid_t dig_in_pin;
244}; 271};
245 272
246#define get_defcfg_connect(cfg) ((cfg & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT) 273#define get_defcfg_connect(cfg) \
247#define get_defcfg_association(cfg) ((cfg & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT) 274 ((cfg & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT)
248#define get_defcfg_location(cfg) ((cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT) 275#define get_defcfg_association(cfg) \
249#define get_defcfg_sequence(cfg) (cfg & AC_DEFCFG_SEQUENCE) 276 ((cfg & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT)
250#define get_defcfg_device(cfg) ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) 277#define get_defcfg_location(cfg) \
251 278 ((cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT)
252int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg, 279#define get_defcfg_sequence(cfg) \
280 (cfg & AC_DEFCFG_SEQUENCE)
281#define get_defcfg_device(cfg) \
282 ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)
283
284int snd_hda_parse_pin_def_config(struct hda_codec *codec,
285 struct auto_pin_cfg *cfg,
253 hda_nid_t *ignore_nids); 286 hda_nid_t *ignore_nids);
254 287
255/* amp values */ 288/* amp values */