Skip to content

Commit

Permalink
ALSA: hda - Remove redundant VT1709 and VT1708B codes
Browse files Browse the repository at this point in the history
Unify the VT1709 10ch and 6ch parsers, as well as VT1708B 8ch and 4ch
parsers.  They have no difference now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 21, 2011
1 parent 09a9ad6 commit ddd304d
Showing 1 changed file with 19 additions and 67 deletions.
86 changes: 19 additions & 67 deletions sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,32 +2291,7 @@ static int patch_vt1708(struct hda_codec *codec)
return 0;
}

static int patch_vt1709_10ch(struct hda_codec *codec)
{
struct via_spec *spec;
int err;

/* create a codec specific record */
spec = via_new_spec(codec);
if (spec == NULL)
return -ENOMEM;

spec->aa_mix_nid = 0x18;

err = via_parse_auto_config(codec);
if (err < 0) {
via_free(codec);
return err;
}

codec->patch_ops = via_patch_ops;

return 0;
}
/*
* generic initialization of ADC, input mixers and output mixers
*/
static int patch_vt1709_6ch(struct hda_codec *codec)
static int patch_vt1709(struct hda_codec *codec)
{
struct via_spec *spec;
int err;
Expand Down Expand Up @@ -2420,13 +2395,14 @@ static void set_widgets_power_state_vt1708B(struct hda_codec *codec)
}

static int patch_vt1708S(struct hda_codec *codec);
static int patch_vt1708B_8ch(struct hda_codec *codec)
static int patch_vt1708B(struct hda_codec *codec)
{
struct via_spec *spec;
int err;

if (get_codec_type(codec) == VT1708BCE)
return patch_vt1708S(codec);

/* create a codec specific record */
spec = via_new_spec(codec);
if (spec == NULL)
Expand All @@ -2448,30 +2424,6 @@ static int patch_vt1708B_8ch(struct hda_codec *codec)
return 0;
}

static int patch_vt1708B_4ch(struct hda_codec *codec)
{
struct via_spec *spec;
int err;

/* create a codec specific record */
spec = via_new_spec(codec);
if (spec == NULL)
return -ENOMEM;

/* automatic parse from the BIOS config */
err = via_parse_auto_config(codec);
if (err < 0) {
via_free(codec);
return err;
}

codec->patch_ops = via_patch_ops;

spec->set_widgets_power_state = set_widgets_power_state_vt1708B;

return 0;
}

/* Patch for VT1708S */
static const struct hda_verb vt1708S_init_verbs[] = {
/* Enable Mic Boost Volume backdoor */
Expand Down Expand Up @@ -3275,37 +3227,37 @@ static const struct hda_codec_preset snd_hda_preset_via[] = {
{ .id = 0x1106170a, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x1106170b, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x1106e710, .name = "VT1709 10-Ch",
.patch = patch_vt1709_10ch},
.patch = patch_vt1709},
{ .id = 0x1106e711, .name = "VT1709 10-Ch",
.patch = patch_vt1709_10ch},
.patch = patch_vt1709},
{ .id = 0x1106e712, .name = "VT1709 10-Ch",
.patch = patch_vt1709_10ch},
.patch = patch_vt1709},
{ .id = 0x1106e713, .name = "VT1709 10-Ch",
.patch = patch_vt1709_10ch},
.patch = patch_vt1709},
{ .id = 0x1106e714, .name = "VT1709 6-Ch",
.patch = patch_vt1709_6ch},
.patch = patch_vt1709},
{ .id = 0x1106e715, .name = "VT1709 6-Ch",
.patch = patch_vt1709_6ch},
.patch = patch_vt1709},
{ .id = 0x1106e716, .name = "VT1709 6-Ch",
.patch = patch_vt1709_6ch},
.patch = patch_vt1709},
{ .id = 0x1106e717, .name = "VT1709 6-Ch",
.patch = patch_vt1709_6ch},
.patch = patch_vt1709},
{ .id = 0x1106e720, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B_8ch},
.patch = patch_vt1708B},
{ .id = 0x1106e721, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B_8ch},
.patch = patch_vt1708B},
{ .id = 0x1106e722, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B_8ch},
.patch = patch_vt1708B},
{ .id = 0x1106e723, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B_8ch},
.patch = patch_vt1708B},
{ .id = 0x1106e724, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B_4ch},
.patch = patch_vt1708B},
{ .id = 0x1106e725, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B_4ch},
.patch = patch_vt1708B},
{ .id = 0x1106e726, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B_4ch},
.patch = patch_vt1708B},
{ .id = 0x1106e727, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B_4ch},
.patch = patch_vt1708B},
{ .id = 0x11060397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11061397, .name = "VT1708S",
Expand Down

0 comments on commit ddd304d

Please sign in to comment.