Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182650
b: refs/heads/master
c: ea52bf2
h: refs/heads/master
v: v3
  • Loading branch information
Daniel T Chen authored and Takashi Iwai committed Dec 28, 2009
1 parent e874fc8 commit 9035c66
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 014c41fce1bd5cec381e70fc6f58fdfc96cdaf69
refs/heads/master: ea52bf260ecbb175339af3178c15788df21b7516
68 changes: 68 additions & 0 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ static int ad198x_build_pcms(struct hda_codec *codec)
return 0;
}

static inline void ad198x_shutup(struct hda_codec *codec)
{
snd_hda_shutup_pins(codec);
}

static void ad198x_free_kctls(struct hda_codec *codec)
{
struct ad198x_spec *spec = codec->spec;
Expand All @@ -454,18 +459,76 @@ static void ad198x_free_kctls(struct hda_codec *codec)
snd_array_free(&spec->kctls);
}

static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
hda_nid_t hp)
{
struct ad198x_spec *spec = codec->spec;
snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
!spec->inv_eapd ? 0x00 : 0x02);
snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
!spec->inv_eapd ? 0x00 : 0x02);
}

static void ad198x_power_eapd(struct hda_codec *codec)
{
/* We currently only handle front, HP */
switch (codec->vendor_id) {
case 0x11d41882:
case 0x11d4882a:
case 0x11d41884:
case 0x11d41984:
case 0x11d41883:
case 0x11d4184a:
case 0x11d4194a:
case 0x11d4194b:
ad198x_power_eapd_write(codec, 0x12, 0x11);
break;
case 0x11d41981:
case 0x11d41983:
ad198x_power_eapd_write(codec, 0x05, 0x06);
break;
case 0x11d41986:
ad198x_power_eapd_write(codec, 0x1b, 0x1a);
break;
case 0x11d41988:
case 0x11d4198b:
case 0x11d4989a:
case 0x11d4989b:
ad198x_power_eapd_write(codec, 0x29, 0x22);
break;
}
}

static void ad198x_free(struct hda_codec *codec)
{
struct ad198x_spec *spec = codec->spec;

if (!spec)
return;

ad198x_shutup(codec);
ad198x_free_kctls(codec);
kfree(spec);
snd_hda_detach_beep_device(codec);
}

#ifdef SND_HDA_NEEDS_RESUME
static int ad198x_suspend(struct hda_codec *codec, pm_message_t state)
{
ad198x_shutup(codec);
ad198x_power_eapd(codec);
return 0;
}

static int ad198x_resume(struct hda_codec *codec)
{
ad198x_init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
return 0;
}
#endif

static struct hda_codec_ops ad198x_patch_ops = {
.build_controls = ad198x_build_controls,
.build_pcms = ad198x_build_pcms,
Expand All @@ -474,6 +537,11 @@ static struct hda_codec_ops ad198x_patch_ops = {
#ifdef CONFIG_SND_HDA_POWER_SAVE
.check_power_status = ad198x_check_power_status,
#endif
#ifdef SND_HDA_NEEDS_RESUME
.suspend = ad198x_suspend,
.resume = ad198x_resume,
#endif
.reboot_notify = ad198x_shutup,
};


Expand Down

0 comments on commit 9035c66

Please sign in to comment.