Lines Matching defs:gpio
11 #include <linux/gpio.h>
12 #include <linux/gpio/consumer.h>
211 /* gpio detect */
212 static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
214 struct snd_soc_jack *jack = gpio->jack;
218 enable = gpiod_get_value_cansleep(gpio->desc);
219 if (gpio->invert)
223 report = gpio->report;
227 if (gpio->jack_status_check)
228 report = gpio->jack_status_check(gpio->data);
230 snd_soc_jack_report(jack, report, gpio->report);
233 /* irq handler for gpio pin */
236 struct snd_soc_jack_gpio *gpio = data;
237 struct device *dev = gpio->jack->card->dev;
239 trace_snd_soc_jack_irq(gpio->name);
242 pm_wakeup_event(dev, gpio->debounce_time + 50);
244 queue_delayed_work(system_power_efficient_wq, &gpio->work,
245 msecs_to_jiffies(gpio->debounce_time));
250 /* gpio work */
253 struct snd_soc_jack_gpio *gpio;
255 gpio = container_of(work, struct snd_soc_jack_gpio, work.work);
256 snd_soc_jack_gpio_detect(gpio);
262 struct snd_soc_jack_gpio *gpio =
273 queue_delayed_work(system_power_efficient_wq, &gpio->work, 0);
307 * @gpios: array of gpio pins
309 * This function will request gpio, set data direction and request irq
310 * for each gpio in the array.
328 "ASoC: No name for gpio at index %d\n", i);
344 "ASoC: Cannot get gpio at index %d: %d",
350 if (!gpio_is_valid(gpios[i].gpio)) {
352 "ASoC: Invalid gpio %d\n",
353 gpios[i].gpio);
358 ret = gpio_request_one(gpios[i].gpio, GPIOF_IN,
363 gpios[i].desc = gpio_to_desc(gpios[i].gpio);
405 gpio_free(gpios[i].gpio);
420 * @gpios: array of gpio pins
422 * This function will request gpio, set data direction and request irq
423 * for each gpio in the array.
443 * @gpios: array of gpio pins
445 * Release gpio and irq resources for gpio pins associated with an ASoC jack.