参照元

説明

引数

返り値

参考

実装

/**
 * snd_soc_jack_report - Report the current status for a jack
 *
 * @jack:   the jack
 * @status: a bitmask of enum snd_jack_type values that are currently detected.
 * @mask:   a bitmask of enum snd_jack_type values that being reported.
 *
 * If configured using snd_soc_jack_add_pins() then the associated
 * DAPM pins will be enabled or disabled as appropriate and DAPM
 * synchronised.
 *
 * Note: This function uses mutexes and should be called from a
 * context which can sleep (such as a workqueue).
 */
void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
{
        struct snd_soc_dapm_context *dapm;
        struct snd_soc_jack_pin *pin;
        unsigned int sync = 0;
        int enable;
        trace_snd_soc_jack_report(jack, mask, status);
        if (!jack)
                return;

        dapm = &jack->card->dapm;

        mutex_lock(&jack->mutex);
        jack->status &= ~mask;
        jack->status |= status & mask;

        trace_snd_soc_jack_notify(jack, status);
        list_for_each_entry(pin, &jack->pins, list) {
                enable = pin->mask & jack->status;

                if (pin->invert)
                        enable = !enable;

                if (enable)
                        snd_soc_dapm_enable_pin(dapm, pin->pin);
                else
                        snd_soc_dapm_disable_pin(dapm, pin->pin);
                /* we need to sync for this case only */
                sync = 1;
        }

        /* Report before the DAPM sync to help users updating micbias status */
        blocking_notifier_call_chain(&jack->notifier, jack->status, jack);
        if (sync)
                snd_soc_dapm_sync(dapm);
        snd_jack_report(jack->jack, jack->status);
        mutex_unlock(&jack->mutex);
}
EXPORT_SYMBOL_GPL(snd_soc_jack_report);

コメント


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