参照元

説明

引数

返り値

参考

実装

/**
 * snd_soc_card_jack_new - Create a new jack
 * @card:  ASoC card
 * @id:    an identifying string for this jack
 * @type:  a bitmask of enum snd_jack_type values that can be detected by
 *         this jack
 * @jack:  structure to use for the jack
 * @pins:  Array of jack pins to be added to the jack or NULL
 * @num_pins: Number of elements in the @pins array
 *
 * Creates a new jack object.
 *
 * Returns zero if successful, or a negative error code on failure.
 * On success jack will be initialised.
 */
int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
        struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins,
        unsigned int num_pins)
{
        int ret;

        mutex_init(&jack->mutex);
        jack->card = card;
        INIT_LIST_HEAD(&jack->pins);
        INIT_LIST_HEAD(&jack->jack_zones);
        BLOCKING_INIT_NOTIFIER_HEAD(&jack->notifier);
        ret = snd_jack_new(card->snd_card, id, type, &jack->jack, false, false);
        if (ret)
                return ret;
        if (num_pins)
                return snd_soc_jack_add_pins(jack, num_pins, pins);
        return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_card_jack_new);

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-07-27 (水) 17:33:32