Commit 28aedaf7 authored by Norberto Lopes's avatar Norberto Lopes Committed by Takashi Iwai

ALSA: sound/pci/hda/hda_codec.c: various coding style fixes

Signed-off-by: default avatarNorberto Lopes <nlopes.ml@gmail.com>
Acked-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 20645d70
...@@ -978,7 +978,8 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -978,7 +978,8 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
unsigned int codec_addr,
struct hda_codec **codecp) struct hda_codec **codecp)
{ {
struct hda_codec *codec; struct hda_codec *codec;
...@@ -1186,7 +1187,7 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream); ...@@ -1186,7 +1187,7 @@ EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream);
*/ */
/* FIXME: more better hash key? */ /* FIXME: more better hash key? */
#define HDA_HASH_KEY(nid,dir,idx) (u32)((nid) + ((idx) << 16) + ((dir) << 24)) #define HDA_HASH_KEY(nid, dir, idx) (u32)((nid) + ((idx) << 16) + ((dir) << 24))
#define HDA_HASH_PINCAP_KEY(nid) (u32)((nid) + (0x02 << 24)) #define HDA_HASH_PINCAP_KEY(nid) (u32)((nid) + (0x02 << 24))
#define HDA_HASH_PARPCM_KEY(nid) (u32)((nid) + (0x03 << 24)) #define HDA_HASH_PARPCM_KEY(nid) (u32)((nid) + (0x03 << 24))
#define HDA_HASH_PARSTR_KEY(nid) (u32)((nid) + (0x04 << 24)) #define HDA_HASH_PARSTR_KEY(nid) (u32)((nid) + (0x04 << 24))
...@@ -1356,7 +1357,8 @@ u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) ...@@ -1356,7 +1357,8 @@ u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
if (!codec->no_trigger_sense) { if (!codec->no_trigger_sense) {
pincap = snd_hda_query_pin_caps(codec, nid); pincap = snd_hda_query_pin_caps(codec, nid);
if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); snd_hda_codec_read(codec, nid, 0,
AC_VERB_SET_PIN_SENSE, 0);
} }
return snd_hda_codec_read(codec, nid, 0, return snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_PIN_SENSE, 0); AC_VERB_GET_PIN_SENSE, 0);
...@@ -2439,27 +2441,27 @@ static struct snd_kcontrol_new dig_mixes[] = { ...@@ -2439,27 +2441,27 @@ static struct snd_kcontrol_new dig_mixes[] = {
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, CON_MASK),
.info = snd_hda_spdif_mask_info, .info = snd_hda_spdif_mask_info,
.get = snd_hda_spdif_cmask_get, .get = snd_hda_spdif_cmask_get,
}, },
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PRO_MASK),
.info = snd_hda_spdif_mask_info, .info = snd_hda_spdif_mask_info,
.get = snd_hda_spdif_pmask_get, .get = snd_hda_spdif_pmask_get,
}, },
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
.info = snd_hda_spdif_mask_info, .info = snd_hda_spdif_mask_info,
.get = snd_hda_spdif_default_get, .get = snd_hda_spdif_default_get,
.put = snd_hda_spdif_default_put, .put = snd_hda_spdif_default_put,
}, },
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH),
.info = snd_hda_spdif_out_switch_info, .info = snd_hda_spdif_out_switch_info,
.get = snd_hda_spdif_out_switch_get, .get = snd_hda_spdif_out_switch_get,
.put = snd_hda_spdif_out_switch_put, .put = snd_hda_spdif_out_switch_put,
...@@ -2610,7 +2612,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol, ...@@ -2610,7 +2612,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol,
static struct snd_kcontrol_new dig_in_ctls[] = { static struct snd_kcontrol_new dig_in_ctls[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH),
.info = snd_hda_spdif_in_switch_info, .info = snd_hda_spdif_in_switch_info,
.get = snd_hda_spdif_in_switch_get, .get = snd_hda_spdif_in_switch_get,
.put = snd_hda_spdif_in_switch_put, .put = snd_hda_spdif_in_switch_put,
...@@ -2618,7 +2620,7 @@ static struct snd_kcontrol_new dig_in_ctls[] = { ...@@ -2618,7 +2620,7 @@ static struct snd_kcontrol_new dig_in_ctls[] = {
{ {
.access = SNDRV_CTL_ELEM_ACCESS_READ, .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = SNDRV_CTL_NAME_IEC958("",CAPTURE,DEFAULT), .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, DEFAULT),
.info = snd_hda_spdif_mask_info, .info = snd_hda_spdif_mask_info,
.get = snd_hda_spdif_in_status_get, .get = snd_hda_spdif_in_status_get,
}, },
...@@ -2979,8 +2981,12 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, ...@@ -2979,8 +2981,12 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
val |= channels - 1; val |= channels - 1;
switch (snd_pcm_format_width(format)) { switch (snd_pcm_format_width(format)) {
case 8: val |= 0x00; break; case 8:
case 16: val |= 0x10; break; val |= 0x00;
break;
case 16:
val |= 0x10;
break;
case 20: case 20:
case 24: case 24:
case 32: case 32:
...@@ -3298,7 +3304,8 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type) ...@@ -3298,7 +3304,8 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type)
if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits)) if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits))
return audio_idx[type][i]; return audio_idx[type][i];
snd_printk(KERN_WARNING "Too many %s devices\n", snd_hda_pcm_type_name[type]); snd_printk(KERN_WARNING "Too many %s devices\n",
snd_hda_pcm_type_name[type]);
return -EAGAIN; return -EAGAIN;
} }
...@@ -4089,7 +4096,7 @@ static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) ...@@ -4089,7 +4096,7 @@ static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
/* /*
* Sort an associated group of pins according to their sequence numbers. * Sort an associated group of pins according to their sequence numbers.
*/ */
static void sort_pins_by_sequence(hda_nid_t * pins, short * sequences, static void sort_pins_by_sequence(hda_nid_t *pins, short *sequences,
int num_pins) int num_pins)
{ {
int i, j; int i, j;
...@@ -4186,9 +4193,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4186,9 +4193,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
case AC_JACK_SPEAKER: case AC_JACK_SPEAKER:
seq = get_defcfg_sequence(def_conf); seq = get_defcfg_sequence(def_conf);
assoc = get_defcfg_association(def_conf); assoc = get_defcfg_association(def_conf);
if (! assoc) if (!assoc)
continue; continue;
if (! assoc_speaker) if (!assoc_speaker)
assoc_speaker = assoc; assoc_speaker = assoc;
else if (assoc_speaker != assoc) else if (assoc_speaker != assoc)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment