/* We abuse kcontrol_new.subdev field to pass the NID corresponding to * the given new control. If id.subdev has a bit flag HDA_SUBDEV_NID_FLAG, * snd_hda_ctl_add() takes the lower-bit subdev value as a valid NID. * * Note that the subdevice field is cleared again before the real registration * in snd_hda_ctl_add(), so that this value won't appear in the outside.
*/ #define HDA_SUBDEV_NID_FLAG (1U << 31) #define HDA_SUBDEV_AMP_FLAG (1U << 30)
struct hda_vmaster_mute_hook { /* below two fields must be filled by the caller of * snd_hda_add_vmaster_hook() beforehand
*/ struct snd_kcontrol *sw_kctl; void (*hook)(void *, int); /* below are initialized automatically */ struct hda_codec *codec;
};
struct hda_multi_out { int num_dacs; /* # of DACs, must be more than 1 */ const hda_nid_t *dac_nids; /* DAC list */
hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */
hda_nid_t hp_out_nid[HDA_MAX_OUTS]; /* DACs for multiple HPs */
hda_nid_t extra_out_nid[HDA_MAX_OUTS]; /* other (e.g. speaker) DACs */
hda_nid_t dig_out_nid; /* digital out audio widget */ const hda_nid_t *follower_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */ int share_spdif; /* share SPDIF pin */ /* PCM information for both analog and SPDIF DACs */ unsignedint analog_rates; unsignedint analog_maxbps;
u64 analog_formats; unsignedint spdif_rates; unsignedint spdif_maxbps;
u64 spdif_formats;
};
int snd_hda_create_spdif_share_sw(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_dig_close(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsignedint stream_tag, unsignedint format, struct snd_pcm_substream *substream); int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, struct hda_multi_out *mout); int snd_hda_multi_out_analog_open(struct hda_codec *codec, struct hda_multi_out *mout, struct snd_pcm_substream *substream, struct hda_pcm_stream *hinfo); int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, struct hda_multi_out *mout, unsignedint stream_tag, unsignedint format, struct snd_pcm_substream *substream); int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_out *mout);
struct hda_fixup { int type; bool chained:1; /* call the chained fixup(s) after this */ bool chained_before:1; /* call the chained fixup(s) before this */ int chain_id; union { conststruct hda_pintbl *pins; conststruct hda_verb *verbs; void (*func)(struct hda_codec *codec, conststruct hda_fixup *fix, int action);
} v;
};
/* * extended form of snd_pci_quirk: * for PCI SSID matching, use SND_PCI_QUIRK() like before; * for codec SSID matching, use the new HDA_CODEC_QUIRK() instead
*/ struct hda_quirk { unsignedshort subvendor; /* PCI subvendor ID */ unsignedshort subdevice; /* PCI subdevice ID */ unsignedshort subdevice_mask; /* bitmask to match */ bool match_codec_ssid; /* match only with codec SSID */ int value; /* value */ #ifdef CONFIG_SND_DEBUG_VERBOSE constchar *name; /* name of the device (optional) */ #endif
};
/** * _snd_hda_set_pin_ctl - Set a pin-control value safely * @codec: the codec instance * @pin: the pin NID to set the control * @val: the pin-control value (AC_PINCTL_* bits) * * This function sets the pin-control value to the given pin, but * filters out the invalid pin-control bits when the pin has no such * capabilities. For example, when PIN_HP is passed but the pin has no * HP-drive capability, the HP bit is omitted. * * The function doesn't check the input VREF capability bits, though. * Use snd_hda_get_default_vref() to guess the right value. * Also, this function is only for analog pins, not for HDMI pins.
*/ staticinlineint
snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, unsignedint val)
{ return _snd_hda_set_pin_ctl(codec, pin, val, false);
}
/** * snd_hda_set_pin_ctl_cache - Set a pin-control value safely * @codec: the codec instance * @pin: the pin NID to set the control * @val: the pin-control value (AC_PINCTL_* bits) * * Just like snd_hda_set_pin_ctl() but write to cache as well.
*/ staticinlineint
snd_hda_set_pin_ctl_cache(struct hda_codec *codec, hda_nid_t pin, unsignedint val)
{ 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, unsignedint val);
/* Set the codec power_state flag to indicate to allow unsol event handling; * see hda_codec_unsol_event() in hda_bind.c. Calling this might confuse the * state tracking, so use with care.
*/ staticinlinevoid snd_hda_codec_allow_unsol_events(struct hda_codec *codec)
{
codec->core.dev.power.power_state = PMSG_ON;
}
/* get the widget type from widget capability bits */ staticinlineint get_wcaps_type(unsignedint wcaps)
{ if (!wcaps) return -1; /* invalid type */ return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
}
u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, unsignedint caps); /** * snd_hda_query_pin_caps - Query PIN capabilities * @codec: the HD-auio codec * @nid: the NID to query * * Query PIN capabilities for the given widget. * Returns the obtained capability bits. * * When cap bits have been already read, this doesn't read again but * returns the cached value.
*/ staticinline u32
snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid)
{ return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
}
/** * snd_hda_override_pin_caps - Override the pin capabilities * @codec: the CODEC * @nid: the NID to override * @caps: the capability bits to set * * Override the cached PIN capabilitiy bits value by the given one. * * Returns zero if successful or a negative error code.
*/ staticinlineint
snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, unsignedint caps)
{ return snd_hdac_override_parm(&codec->core, nid, AC_PAR_PIN_CAP, caps);
}
bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, unsignedint bits);
struct hda_loopback_check { conststruct hda_amp_list *amplist; int power_on;
};
int snd_hda_check_amp_list_power(struct hda_codec *codec, struct hda_loopback_check *check,
hda_nid_t nid);
/* check whether the actual power state matches with the target state */ staticinlinebool
snd_hda_check_power_state(struct hda_codec *codec, hda_nid_t nid, unsignedint target_state)
{ return snd_hdac_check_power_state(&codec->core, nid, target_state);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.