参照元

説明

引数

返り値

参考

実装

/**
 * snd_soc_jack_add_pins - Associate DAPM pins with an ASoC jack
 *
 * @jack:  ASoC jack
 * @count: Number of pins
 * @pins:  Array of pins
 *
 * After this function has been called the DAPM pins specified in the
 * pins array will have their status updated to reflect the current
 * state of the jack whenever the jack status is updated.
 */
int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
                          struct snd_soc_jack_pin *pins)
{
        int i;

        for (i = 0; i < count; i++) {
                if (!pins[i].pin) {
                        dev_err(jack->card->dev, "ASoC: No name for pin %d\n",
                                i);
                        return -EINVAL;
                }
                if (!pins[i].mask) {
                        dev_err(jack->card->dev, "ASoC: No mask for pin %d"
                                " (%s)\n", i, pins[i].pin);
                        return -EINVAL;
                }
                INIT_LIST_HEAD(&pins[i].list);
                list_add(&(pins[i].list), &jack->pins);
                snd_jack_add_new_kctl(jack->jack, pins[i].pin, pins[i].mask);
        }

        /* Update to reflect the last reported status; canned jack
         * implementations are likely to set their state before the
         * card has an opportunity to associate pins.
         */
        snd_soc_jack_report(jack, 0, 0);
        return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_jack_add_pins);

コメント


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