Unverified Commit 7b95ee0d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown
Browse files

ASoC: soc-jack: Get rid of legacy GPIO support

parent 4ed0915f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ struct snd_soc_jack_zone {
/**
 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
 *
 * @gpio:         legacy gpio number
 * @idx:          gpio descriptor index within the function of the GPIO
 *                consumer device
 * @gpiod_dev:    GPIO consumer device
@@ -59,7 +58,6 @@ struct snd_soc_jack_zone {
 *		       ADC).
 */
struct snd_soc_jack_gpio {
	unsigned int gpio;
	unsigned int idx;
	struct device *gpiod_dev;
	const char *name;
+0 −2
Original line number Diff line number Diff line
@@ -752,8 +752,6 @@ int simple_util_init_jack(struct snd_soc_card *card,
	if (!prefix)
		prefix = "";

	sjack->gpio.gpio = -ENOENT;

	if (is_hp) {
		snprintf(prop, sizeof(prop), "%shp-det", prefix);
		pin_name	= pin ? pin : "Headphones";
+4 −19
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@

#include <sound/jack.h>
#include <sound/soc.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
@@ -345,22 +344,10 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
				goto undo;
			}
		} else {
			/* legacy GPIO number */
			if (!gpio_is_valid(gpios[i].gpio)) {
				dev_err(jack->card->dev,
					"ASoC: Invalid gpio %d\n",
					gpios[i].gpio);
			dev_err(jack->card->dev, "ASoC: Invalid gpio at index %d\n", i);
		        ret = -EINVAL;
		        goto undo;
		}

			ret = gpio_request_one(gpios[i].gpio, GPIOF_IN,
					       gpios[i].name);
			if (ret)
				goto undo;

			gpios[i].desc = gpio_to_desc(gpios[i].gpio);
		}
got_gpio:
		INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
		gpios[i].jack = jack;
@@ -373,7 +360,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
					      gpios[i].name,
					      &gpios[i]);
		if (ret < 0)
			goto err;
			goto undo;

		if (gpios[i].wake) {
			ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1);
@@ -401,8 +388,6 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
	devres_add(jack->card->dev, tbl);
	return 0;

err:
	gpio_free(gpios[i].gpio);
undo:
	jack_free_gpios(jack, i, gpios);
	devres_free(tbl);