Lines Matching full:gpios

206 	struct snd_soc_jack_gpio *gpios;  member
279 struct snd_soc_jack_gpio *gpios) in jack_free_gpios() argument
284 gpiod_unexport(gpios[i].desc); in jack_free_gpios()
285 unregister_pm_notifier(&gpios[i].pm_notifier); in jack_free_gpios()
286 free_irq(gpiod_to_irq(gpios[i].desc), &gpios[i]); in jack_free_gpios()
287 cancel_delayed_work_sync(&gpios[i].work); in jack_free_gpios()
288 gpiod_put(gpios[i].desc); in jack_free_gpios()
289 gpios[i].jack = NULL; in jack_free_gpios()
297 jack_free_gpios(tbl->jack, tbl->count, tbl->gpios); in jack_devres_free_gpios()
305 * @gpios: array of gpio pins
311 struct snd_soc_jack_gpio *gpios) in snd_soc_jack_add_gpios() argument
321 tbl->gpios = gpios; in snd_soc_jack_add_gpios()
324 if (!gpios[i].name) { in snd_soc_jack_add_gpios()
331 if (gpios[i].desc) { in snd_soc_jack_add_gpios()
334 } else if (gpios[i].gpiod_dev) { in snd_soc_jack_add_gpios()
336 gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev, in snd_soc_jack_add_gpios()
337 gpios[i].name, in snd_soc_jack_add_gpios()
338 gpios[i].idx, GPIOD_IN); in snd_soc_jack_add_gpios()
339 if (IS_ERR(gpios[i].desc)) { in snd_soc_jack_add_gpios()
340 ret = PTR_ERR(gpios[i].desc); in snd_soc_jack_add_gpios()
341 dev_err(gpios[i].gpiod_dev, in snd_soc_jack_add_gpios()
352 INIT_DELAYED_WORK(&gpios[i].work, gpio_work); in snd_soc_jack_add_gpios()
353 gpios[i].jack = jack; in snd_soc_jack_add_gpios()
355 ret = request_any_context_irq(gpiod_to_irq(gpios[i].desc), in snd_soc_jack_add_gpios()
360 gpios[i].name, in snd_soc_jack_add_gpios()
361 &gpios[i]); in snd_soc_jack_add_gpios()
365 if (gpios[i].wake) { in snd_soc_jack_add_gpios()
366 ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1); in snd_soc_jack_add_gpios()
377 gpios[i].pm_notifier.notifier_call = snd_soc_jack_pm_notifier; in snd_soc_jack_add_gpios()
378 register_pm_notifier(&gpios[i].pm_notifier); in snd_soc_jack_add_gpios()
381 gpiod_export(gpios[i].desc, false); in snd_soc_jack_add_gpios()
384 schedule_delayed_work(&gpios[i].work, in snd_soc_jack_add_gpios()
385 msecs_to_jiffies(gpios[i].debounce_time)); in snd_soc_jack_add_gpios()
392 jack_free_gpios(jack, i, gpios); in snd_soc_jack_add_gpios()
405 * @gpios: array of gpio pins
412 int count, struct snd_soc_jack_gpio *gpios) in snd_soc_jack_add_gpiods() argument
417 gpios[i].gpiod_dev = gpiod_dev; in snd_soc_jack_add_gpiods()
419 return snd_soc_jack_add_gpios(jack, count, gpios); in snd_soc_jack_add_gpiods()
428 * @gpios: array of gpio pins
433 struct snd_soc_jack_gpio *gpios) in snd_soc_jack_free_gpios() argument
435 jack_free_gpios(jack, count, gpios); in snd_soc_jack_free_gpios()