Lines Matching refs:gpios

207 	struct snd_soc_jack_gpio *gpios;  member
280 struct snd_soc_jack_gpio *gpios) in jack_free_gpios() argument
285 gpiod_unexport(gpios[i].desc); in jack_free_gpios()
286 unregister_pm_notifier(&gpios[i].pm_notifier); in jack_free_gpios()
287 free_irq(gpiod_to_irq(gpios[i].desc), &gpios[i]); in jack_free_gpios()
288 cancel_delayed_work_sync(&gpios[i].work); in jack_free_gpios()
289 gpiod_put(gpios[i].desc); in jack_free_gpios()
290 gpios[i].jack = NULL; in jack_free_gpios()
298 jack_free_gpios(tbl->jack, tbl->count, tbl->gpios); in jack_devres_free_gpios()
312 struct snd_soc_jack_gpio *gpios) in snd_soc_jack_add_gpios() argument
322 tbl->gpios = gpios; in snd_soc_jack_add_gpios()
325 if (!gpios[i].name) { in snd_soc_jack_add_gpios()
332 if (gpios[i].desc) { in snd_soc_jack_add_gpios()
335 } else if (gpios[i].gpiod_dev) { in snd_soc_jack_add_gpios()
337 gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev, in snd_soc_jack_add_gpios()
338 gpios[i].name, in snd_soc_jack_add_gpios()
339 gpios[i].idx, GPIOD_IN); in snd_soc_jack_add_gpios()
340 if (IS_ERR(gpios[i].desc)) { in snd_soc_jack_add_gpios()
341 ret = PTR_ERR(gpios[i].desc); in snd_soc_jack_add_gpios()
342 dev_err(gpios[i].gpiod_dev, in snd_soc_jack_add_gpios()
349 if (!gpio_is_valid(gpios[i].gpio)) { in snd_soc_jack_add_gpios()
352 gpios[i].gpio); in snd_soc_jack_add_gpios()
357 ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, in snd_soc_jack_add_gpios()
358 gpios[i].name); in snd_soc_jack_add_gpios()
362 gpios[i].desc = gpio_to_desc(gpios[i].gpio); in snd_soc_jack_add_gpios()
365 INIT_DELAYED_WORK(&gpios[i].work, gpio_work); in snd_soc_jack_add_gpios()
366 gpios[i].jack = jack; in snd_soc_jack_add_gpios()
368 ret = request_any_context_irq(gpiod_to_irq(gpios[i].desc), in snd_soc_jack_add_gpios()
373 gpios[i].name, in snd_soc_jack_add_gpios()
374 &gpios[i]); in snd_soc_jack_add_gpios()
378 if (gpios[i].wake) { in snd_soc_jack_add_gpios()
379 ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1); in snd_soc_jack_add_gpios()
390 gpios[i].pm_notifier.notifier_call = snd_soc_jack_pm_notifier; in snd_soc_jack_add_gpios()
391 register_pm_notifier(&gpios[i].pm_notifier); in snd_soc_jack_add_gpios()
394 gpiod_export(gpios[i].desc, false); in snd_soc_jack_add_gpios()
397 schedule_delayed_work(&gpios[i].work, in snd_soc_jack_add_gpios()
398 msecs_to_jiffies(gpios[i].debounce_time)); in snd_soc_jack_add_gpios()
405 gpio_free(gpios[i].gpio); in snd_soc_jack_add_gpios()
407 jack_free_gpios(jack, i, gpios); in snd_soc_jack_add_gpios()
427 int count, struct snd_soc_jack_gpio *gpios) in snd_soc_jack_add_gpiods() argument
432 gpios[i].gpiod_dev = gpiod_dev; in snd_soc_jack_add_gpiods()
434 return snd_soc_jack_add_gpios(jack, count, gpios); in snd_soc_jack_add_gpiods()
448 struct snd_soc_jack_gpio *gpios) in snd_soc_jack_free_gpios() argument
450 jack_free_gpios(jack, count, gpios); in snd_soc_jack_free_gpios()