20 #include <linux/export.h>
41 INIT_LIST_HEAD(&jack->
pins);
71 trace_snd_soc_jack_report(jack, mask, status);
86 trace_snd_soc_jack_notify(jack, status);
126 for (i = 0; i <
count; i++) {
127 INIT_LIST_HEAD(&zones[i].
list);
128 list_add(&(zones[i].list), &jack->
jack_zones);
149 if (micbias_voltage >= zone->
min_mv &&
150 micbias_voltage < zone->
max_mv)
173 for (i = 0; i <
count; i++) {
184 INIT_LIST_HEAD(&pins[i].
list);
185 list_add(&(pins[i].list), &jack->
pins);
234 #ifdef CONFIG_GPIOLIB
236 static void snd_soc_jack_gpio_detect(
struct snd_soc_jack_gpio *
gpio)
247 report = gpio->report;
251 if (gpio->jack_status_check)
252 report = gpio->jack_status_check();
260 struct snd_soc_jack_gpio *gpio =
data;
261 struct device *
dev = gpio->jack->codec->card->dev;
263 trace_snd_soc_jack_irq(gpio->name);
265 if (device_may_wakeup(dev))
277 struct snd_soc_jack_gpio *
gpio;
279 gpio =
container_of(work,
struct snd_soc_jack_gpio, work.work);
280 snd_soc_jack_gpio_detect(gpio);
294 struct snd_soc_jack_gpio *gpios)
298 for (i = 0; i <
count; i++) {
299 if (!gpio_is_valid(gpios[i].gpio)) {
305 if (!gpios[i].
name) {
321 gpios[
i].jack = jack;
336 "Failed to mark GPIO %d as wake source: %d\n",
341 gpio_export(gpios[i].gpio,
false);
344 snd_soc_jack_gpio_detect(&gpios[i]);
352 snd_soc_jack_free_gpios(jack, i, gpios);
367 void snd_soc_jack_free_gpios(
struct snd_soc_jack *jack,
int count,
368 struct snd_soc_jack_gpio *gpios)
372 for (i = 0; i <
count; i++) {
373 gpio_unexport(gpios[i].gpio);
377 gpios[
i].jack =
NULL;