Lines Matching refs:gpio

11 #include <linux/gpio.h>
12 #include <linux/gpio/consumer.h>
210 /* gpio detect */
211 static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
213 struct snd_soc_jack *jack = gpio->jack;
217 enable = gpiod_get_value_cansleep(gpio->desc);
218 if (gpio->invert)
222 report = gpio->report;
226 if (gpio->jack_status_check)
227 report = gpio->jack_status_check(gpio->data);
229 snd_soc_jack_report(jack, report, gpio->report);
232 /* irq handler for gpio pin */
235 struct snd_soc_jack_gpio *gpio = data;
236 struct device *dev = gpio->jack->card->dev;
238 trace_snd_soc_jack_irq(gpio->name);
241 pm_wakeup_event(dev, gpio->debounce_time + 50);
243 queue_delayed_work(system_power_efficient_wq, &gpio->work,
244 msecs_to_jiffies(gpio->debounce_time));
249 /* gpio work */
252 struct snd_soc_jack_gpio *gpio;
254 gpio = container_of(work, struct snd_soc_jack_gpio, work.work);
255 snd_soc_jack_gpio_detect(gpio);
261 struct snd_soc_jack_gpio *gpio =
272 queue_delayed_work(system_power_efficient_wq, &gpio->work, 0);
306 * @gpios: array of gpio pins
308 * This function will request gpio, set data direction and request irq
309 * for each gpio in the array.
327 "ASoC: No name for gpio at index %d\n", i);
343 "ASoC: Cannot get gpio at index %d: %d",
349 if (!gpio_is_valid(gpios[i].gpio)) {
351 "ASoC: Invalid gpio %d\n",
352 gpios[i].gpio);
357 ret = gpio_request_one(gpios[i].gpio, GPIOF_IN,
362 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.