*参照元 [#xb7df35c] #backlinks *説明 [#b5083cfb] -パス: [[linux-4.4.1/sound/soc/soc-jack.c]] -FIXME: これは何? --説明 **引数 [#k94fca46] -struct snd_soc_jack *jack -- --[[linux-4.4.1/snd_soc_jack]] -int count -- -struct snd_soc_jack_pin *pins -- --[[linux-4.4.1/snd_soc_jack_pin]] **返り値 [#q6cfd7a6] -int -- **参考 [#o9adf8c1] *実装 [#x08324db] /** * 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; } - --[[linux-4.4.1/dev_err()]] 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); - --[[linux-4.4.1/INIT_LIST_HEAD()]] --[[linux-4.4.1/list_add()]] --[[linux-4.4.1/snd_jack_add_new_kctl()]] } /* 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); - --[[linux-4.4.1/snd_soc_jack_report()]] return 0; } EXPORT_SYMBOL_GPL(snd_soc_jack_add_pins); - --[[linux-4.4.1/EXPORT_SYMBOL_GPL()]] *コメント [#e5f451a3]