Lines Matching refs:jack
40 struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins, in snd_soc_card_jack_new() argument
45 mutex_init(&jack->mutex); in snd_soc_card_jack_new()
46 jack->card = card; in snd_soc_card_jack_new()
47 INIT_LIST_HEAD(&jack->pins); in snd_soc_card_jack_new()
48 INIT_LIST_HEAD(&jack->jack_zones); in snd_soc_card_jack_new()
49 BLOCKING_INIT_NOTIFIER_HEAD(&jack->notifier); in snd_soc_card_jack_new()
51 ret = snd_jack_new(card->snd_card, id, type, &jack->jack, false, false); in snd_soc_card_jack_new()
56 return snd_soc_jack_add_pins(jack, num_pins, pins); in snd_soc_card_jack_new()
76 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) in snd_soc_jack_report() argument
83 trace_snd_soc_jack_report(jack, mask, status); in snd_soc_jack_report()
85 if (!jack) in snd_soc_jack_report()
88 dapm = &jack->card->dapm; in snd_soc_jack_report()
90 mutex_lock(&jack->mutex); in snd_soc_jack_report()
92 jack->status &= ~mask; in snd_soc_jack_report()
93 jack->status |= status & mask; in snd_soc_jack_report()
95 trace_snd_soc_jack_notify(jack, status); in snd_soc_jack_report()
97 list_for_each_entry(pin, &jack->pins, list) { in snd_soc_jack_report()
98 enable = pin->mask & jack->status; in snd_soc_jack_report()
113 blocking_notifier_call_chain(&jack->notifier, jack->status, jack); in snd_soc_jack_report()
118 snd_jack_report(jack->jack, jack->status); in snd_soc_jack_report()
120 mutex_unlock(&jack->mutex); in snd_soc_jack_report()
134 int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count, in snd_soc_jack_add_zones() argument
141 list_add(&(zones[i].list), &jack->jack_zones); in snd_soc_jack_add_zones()
157 int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage) in snd_soc_jack_get_type() argument
161 list_for_each_entry(zone, &jack->jack_zones, list) { in snd_soc_jack_get_type()
181 int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, in snd_soc_jack_add_pins() argument
188 dev_err(jack->card->dev, "ASoC: No name for pin %d\n", in snd_soc_jack_add_pins()
193 dev_err(jack->card->dev, "ASoC: No mask for pin %d" in snd_soc_jack_add_pins()
199 list_add(&(pins[i].list), &jack->pins); in snd_soc_jack_add_pins()
200 snd_jack_add_new_kctl(jack->jack, pins[i].pin, pins[i].mask); in snd_soc_jack_add_pins()
207 snd_soc_jack_report(jack, 0, 0); in snd_soc_jack_add_pins()
225 void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, in snd_soc_jack_notifier_register() argument
228 blocking_notifier_chain_register(&jack->notifier, nb); in snd_soc_jack_notifier_register()
240 void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, in snd_soc_jack_notifier_unregister() argument
243 blocking_notifier_chain_unregister(&jack->notifier, nb); in snd_soc_jack_notifier_unregister()
251 struct snd_soc_jack *jack = gpio->jack; in snd_soc_jack_gpio_detect() local
267 snd_soc_jack_report(jack, report, gpio->report); in snd_soc_jack_gpio_detect()
274 struct device *dev = gpio->jack->card->dev; in gpio_handler()
306 int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, in snd_soc_jack_add_gpios() argument
313 dev_err(jack->card->dev, in snd_soc_jack_add_gpios()
337 dev_err(jack->card->dev, in snd_soc_jack_add_gpios()
353 gpios[i].jack = jack; in snd_soc_jack_add_gpios()
367 dev_err(jack->card->dev, in snd_soc_jack_add_gpios()
385 snd_soc_jack_free_gpios(jack, i, gpios); in snd_soc_jack_add_gpios()
403 struct snd_soc_jack *jack, in snd_soc_jack_add_gpiods() argument
411 return snd_soc_jack_add_gpios(jack, count, gpios); in snd_soc_jack_add_gpiods()
424 void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, in snd_soc_jack_free_gpios() argument
434 gpios[i].jack = NULL; in snd_soc_jack_free_gpios()