Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170275
b: refs/heads/master
c: 1731437
h: refs/heads/master
i:
  170273: b483a66
  170271: 9fcdab3
v: v3
  • Loading branch information
Lydia Wang authored and Takashi Iwai committed Oct 11, 2009
1 parent b99eec6 commit b7ca326
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5271101faf1655d862849f42518c2a88ef394fb
refs/heads/master: 173143791068ac9f155c378a591d0b3d6c4a45ca
41 changes: 35 additions & 6 deletions trunk/sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,10 @@ static int via_playback_pcm_open(struct hda_pcm_stream *hinfo,
struct snd_pcm_substream *substream)
{
struct via_spec *spec = codec->spec;
int idle = substream->pstr->substream_opened == 1
&& substream->ref_count == 0;

analog_low_current_mode(codec, idle);
return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
hinfo);
}
Expand Down Expand Up @@ -1089,6 +1093,11 @@ static int via_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
}

/* init power states */
set_jack_power_state(codec);
analog_low_current_mode(codec, 1);

via_free_kctls(codec); /* no longer needed */
return 0;
}
Expand Down Expand Up @@ -2312,6 +2321,17 @@ static struct hda_verb vt1708B_uniwill_init_verbs[] = {
{ }
};

static int via_pcm_open_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
int idle = substream->pstr->substream_opened == 1
&& substream->ref_count == 0;

analog_low_current_mode(codec, idle);
return 0;
}

static struct hda_pcm_stream vt1708B_8ch_pcm_analog_playback = {
.substreams = 2,
.channels_min = 2,
Expand All @@ -2320,7 +2340,8 @@ static struct hda_pcm_stream vt1708B_8ch_pcm_analog_playback = {
.ops = {
.open = via_playback_pcm_open,
.prepare = via_playback_multi_pcm_prepare,
.cleanup = via_playback_multi_pcm_cleanup
.cleanup = via_playback_multi_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand All @@ -2342,8 +2363,10 @@ static struct hda_pcm_stream vt1708B_pcm_analog_capture = {
.channels_max = 2,
.nid = 0x13, /* NID to query formats and rates */
.ops = {
.open = via_pcm_open_close,
.prepare = via_capture_pcm_prepare,
.cleanup = via_capture_pcm_cleanup
.cleanup = via_capture_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand Down Expand Up @@ -2800,7 +2823,8 @@ static struct hda_pcm_stream vt1708S_pcm_analog_playback = {
.ops = {
.open = via_playback_pcm_open,
.prepare = via_playback_pcm_prepare,
.cleanup = via_playback_pcm_cleanup
.cleanup = via_playback_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand All @@ -2810,8 +2834,10 @@ static struct hda_pcm_stream vt1708S_pcm_analog_capture = {
.channels_max = 2,
.nid = 0x13, /* NID to query formats and rates */
.ops = {
.open = via_pcm_open_close,
.prepare = via_capture_pcm_prepare,
.cleanup = via_capture_pcm_cleanup
.cleanup = via_capture_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand Down Expand Up @@ -3236,7 +3262,8 @@ static struct hda_pcm_stream vt1702_pcm_analog_playback = {
.ops = {
.open = via_playback_pcm_open,
.prepare = via_playback_multi_pcm_prepare,
.cleanup = via_playback_multi_pcm_cleanup
.cleanup = via_playback_multi_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand All @@ -3246,8 +3273,10 @@ static struct hda_pcm_stream vt1702_pcm_analog_capture = {
.channels_max = 2,
.nid = 0x12, /* NID to query formats and rates */
.ops = {
.open = via_pcm_open_close,
.prepare = via_capture_pcm_prepare,
.cleanup = via_capture_pcm_cleanup
.cleanup = via_capture_pcm_cleanup,
.close = via_pcm_open_close
},
};

Expand Down

0 comments on commit b7ca326

Please sign in to comment.