diff options
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 0ec9248165bc..17d425775c99 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -502,6 +502,44 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, | |||
502 | #define PIN_HP (AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN) | 502 | #define PIN_HP (AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN) |
503 | #define PIN_HP_AMP (AC_PINCTL_HP_EN) | 503 | #define PIN_HP_AMP (AC_PINCTL_HP_EN) |
504 | 504 | ||
505 | int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, | ||
506 | unsigned int val, bool cached); | ||
507 | |||
508 | /** | ||
509 | * _snd_hda_set_pin_ctl - Set a pin-control value safely | ||
510 | * @codec: the codec instance | ||
511 | * @pin: the pin NID to set the control | ||
512 | * @val: the pin-control value (AC_PINCTL_* bits) | ||
513 | * | ||
514 | * This function sets the pin-control value to the given pin, but | ||
515 | * filters out the invalid pin-control bits when the pin has no such | ||
516 | * capabilities. For example, when PIN_HP is passed but the pin has no | ||
517 | * HP-drive capability, the HP bit is omitted. | ||
518 | * | ||
519 | * The function doesn't check the input VREF capability bits, though. | ||
520 | * Also, this function is only for analog pins, not for HDMI pins. | ||
521 | */ | ||
522 | static inline int | ||
523 | snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, unsigned int val) | ||
524 | { | ||
525 | return _snd_hda_set_pin_ctl(codec, pin, val, false); | ||
526 | } | ||
527 | |||
528 | /** | ||
529 | * snd_hda_set_pin_ctl_cache - Set a pin-control value safely | ||
530 | * @codec: the codec instance | ||
531 | * @pin: the pin NID to set the control | ||
532 | * @val: the pin-control value (AC_PINCTL_* bits) | ||
533 | * | ||
534 | * Just like snd_hda_set_pin_ctl() but write to cache as well. | ||
535 | */ | ||
536 | static inline int | ||
537 | snd_hda_set_pin_ctl_cache(struct hda_codec *codec, hda_nid_t pin, | ||
538 | unsigned int val) | ||
539 | { | ||
540 | return _snd_hda_set_pin_ctl(codec, pin, val, true); | ||
541 | } | ||
542 | |||
505 | /* | 543 | /* |
506 | * get widget capabilities | 544 | * get widget capabilities |
507 | */ | 545 | */ |