Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353113
b: refs/heads/master
c: d7fdc00
h: refs/heads/master
i:
  353111: 4e0fed9
v: v3
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent 8160cb9 commit e161447
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 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: 980428cecc4ca767bd9dd61fc286cd4124fd34af
refs/heads/master: d7fdc00ae50b3dc02364301b334a6352c58e9e85
27 changes: 27 additions & 0 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,32 @@ unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid)
}
EXPORT_SYMBOL_HDA(snd_hda_codec_get_pincfg);

/* remember the current pinctl target value */
int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
unsigned int val)
{
struct hda_pincfg *pin;

pin = look_up_pincfg(codec, &codec->init_pins, nid);
if (!pin)
return -EINVAL;
pin->target = val;
return 0;
}
EXPORT_SYMBOL_HDA(snd_hda_codec_set_pin_target);

/* return the current pinctl target value */
int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid)
{
struct hda_pincfg *pin;

pin = look_up_pincfg(codec, &codec->init_pins, nid);
if (!pin)
return 0;
return pin->target;
}
EXPORT_SYMBOL_HDA(snd_hda_codec_get_pin_target);

/**
* snd_hda_shutup_pins - Shut up all pins
* @codec: the HDA codec
Expand Down Expand Up @@ -5266,6 +5292,7 @@ int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
val &= ~(AC_PINCTL_IN_EN | AC_PINCTL_VREFEN);
}
}
snd_hda_codec_set_pin_target(codec, pin, val);
if (cached)
return snd_hda_codec_update_cache(codec, pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, val);
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,8 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec);
/* the struct for codec->pin_configs */
struct hda_pincfg {
hda_nid_t nid;
unsigned char ctrl; /* current pin control value */
unsigned char pad; /* reserved */
unsigned char ctrl; /* original pin control value */
unsigned char target; /* target pin control value */
unsigned int cfg; /* default configuration */
};

Expand Down
4 changes: 4 additions & 0 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ snd_hda_set_pin_ctl_cache(struct hda_codec *codec, hda_nid_t pin,
return _snd_hda_set_pin_ctl(codec, pin, val, true);
}

int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid);
int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
unsigned int val);

/*
* get widget capabilities
*/
Expand Down

0 comments on commit e161447

Please sign in to comment.