struct hda_jack_tbl {
hda_nid_t nid; int dev_id; unsignedchar tag; /* unsol event tag */ struct hda_jack_callback *callback; /* jack-detection stuff */ unsignedint pin_sense; /* cached pin-sense value */ unsignedint jack_detect:1; /* capable of jack-detection? */ unsignedint jack_dirty:1; /* needs to update? */ unsignedint phantom_jack:1; /* a fixed, always present port? */ unsignedint block_report:1; /* in a transitional state - do not report to userspace */
hda_nid_t gating_jack; /* valid when gating jack plugged */
hda_nid_t gated_jack; /* gated is dependent on this jack */
hda_nid_t key_report_jack; /* key reports to this jack */ int type; int button_state; struct snd_jack *jack;
};
struct hda_jack_keymap { enum snd_jack_types type; int key;
};
struct hda_jack_tbl *
snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id);
/** * snd_hda_jack_tbl_get - query the jack-table entry for the given NID * @codec: the HDA codec * @nid: pin NID to refer to
*/ staticinlinestruct hda_jack_tbl *
snd_hda_jack_tbl_get(struct hda_codec *codec, hda_nid_t nid)
{ return snd_hda_jack_tbl_get_mst(codec, nid, 0);
}
struct hda_jack_tbl *
snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec, unsignedchar tag, int dev_id);
/** * snd_hda_jack_detect_enable - enable the jack-detection * @codec: the HDA codec * @nid: pin NID to enable * @func: callback function to register * * In the case of error, the return value will be a pointer embedded with * errno. Check and handle the return value appropriately with standard * macros such as @IS_ERR() and @PTR_ERR().
*/ staticinlinestruct hda_jack_callback *
snd_hda_jack_detect_enable_callback(struct hda_codec *codec, hda_nid_t nid,
hda_jack_callback_fn cb)
{ return snd_hda_jack_detect_enable_callback_mst(codec, nid, 0, cb);
}
int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,
hda_nid_t gating_nid);
void snd_hda_jack_set_button_state(struct hda_codec *codec, hda_nid_t jack_nid, int button_state);
u32 snd_hda_jack_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id);
/* the jack state returned from snd_hda_jack_detect_state() */ enum {
HDA_JACK_NOT_PRESENT, HDA_JACK_PRESENT, HDA_JACK_PHANTOM,
};
int snd_hda_jack_detect_state_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id);
/** * snd_hda_jack_detect_state - query pin Presence Detect status * @codec: the CODEC to sense * @nid: the pin NID to sense * * Query and return the pin's Presence Detect status, as either * HDA_JACK_NOT_PRESENT, HDA_JACK_PRESENT or HDA_JACK_PHANTOM.
*/ staticinlineint
snd_hda_jack_detect_state(struct hda_codec *codec, hda_nid_t nid)
{ return snd_hda_jack_detect_state_mst(codec, nid, 0);
}
/** * snd_hda_jack_detect_mst - Detect the jack * @codec: the HDA codec * @nid: pin NID to check jack detection * @dev_id: pin device entry id
*/ staticinlinebool
snd_hda_jack_detect_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id)
{ return snd_hda_jack_detect_state_mst(codec, nid, dev_id) !=
HDA_JACK_NOT_PRESENT;
}
/** * snd_hda_jack_detect - Detect the jack * @codec: the HDA codec * @nid: pin NID to check jack detection
*/ staticinlinebool
snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid)
{ return snd_hda_jack_detect_mst(codec, nid, 0);
}
int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id, constchar *name, bool phantom_jack, int type, conststruct hda_jack_keymap *keymap);
/** * snd_hda_jack_add_kctl - Add a kctl for the given pin * @codec: the HDA codec * @nid: pin NID to assign * @name: string name for the jack * @phantom_jack: flag to deal as a phantom jack * @type: jack type bits to be reported, 0 for guessing from pincfg * @keymap: optional jack / key mapping * * This assigns a jack-detection kctl to the given pin. The kcontrol * will have the given name and index.
*/ staticinlineint
snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid, constchar *name, bool phantom_jack, int type, conststruct hda_jack_keymap *keymap)
{ return snd_hda_jack_add_kctl_mst(codec, nid, 0,
name, phantom_jack, type, keymap);
}
int snd_hda_jack_add_kctls(struct hda_codec *codec, conststruct auto_pin_cfg *cfg);
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.