ASoC: soc-jack: Get rid of legacy GPIO support
No more users. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240326171134.1414462-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4ed0915f5b
commit
7b95ee0db7
@ -44,7 +44,6 @@ struct snd_soc_jack_zone {
|
|||||||
/**
|
/**
|
||||||
* struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
|
* 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
|
* @idx: gpio descriptor index within the function of the GPIO
|
||||||
* consumer device
|
* consumer device
|
||||||
* @gpiod_dev: GPIO consumer device
|
* @gpiod_dev: GPIO consumer device
|
||||||
@ -59,7 +58,6 @@ struct snd_soc_jack_zone {
|
|||||||
* ADC).
|
* ADC).
|
||||||
*/
|
*/
|
||||||
struct snd_soc_jack_gpio {
|
struct snd_soc_jack_gpio {
|
||||||
unsigned int gpio;
|
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
struct device *gpiod_dev;
|
struct device *gpiod_dev;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -752,8 +752,6 @@ int simple_util_init_jack(struct snd_soc_card *card,
|
|||||||
if (!prefix)
|
if (!prefix)
|
||||||
prefix = "";
|
prefix = "";
|
||||||
|
|
||||||
sjack->gpio.gpio = -ENOENT;
|
|
||||||
|
|
||||||
if (is_hp) {
|
if (is_hp) {
|
||||||
snprintf(prop, sizeof(prop), "%shp-det", prefix);
|
snprintf(prop, sizeof(prop), "%shp-det", prefix);
|
||||||
pin_name = pin ? pin : "Headphones";
|
pin_name = pin ? pin : "Headphones";
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include <sound/jack.h>
|
#include <sound/jack.h>
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <linux/gpio.h>
|
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
@ -345,21 +344,9 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
|
|||||||
goto undo;
|
goto undo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* legacy GPIO number */
|
dev_err(jack->card->dev, "ASoC: Invalid gpio at index %d\n", i);
|
||||||
if (!gpio_is_valid(gpios[i].gpio)) {
|
ret = -EINVAL;
|
||||||
dev_err(jack->card->dev,
|
goto undo;
|
||||||
"ASoC: Invalid gpio %d\n",
|
|
||||||
gpios[i].gpio);
|
|
||||||
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:
|
got_gpio:
|
||||||
INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
|
INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
|
||||||
@ -373,7 +360,7 @@ got_gpio:
|
|||||||
gpios[i].name,
|
gpios[i].name,
|
||||||
&gpios[i]);
|
&gpios[i]);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto undo;
|
||||||
|
|
||||||
if (gpios[i].wake) {
|
if (gpios[i].wake) {
|
||||||
ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1);
|
ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1);
|
||||||
@ -401,8 +388,6 @@ got_gpio:
|
|||||||
devres_add(jack->card->dev, tbl);
|
devres_add(jack->card->dev, tbl);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
|
||||||
gpio_free(gpios[i].gpio);
|
|
||||||
undo:
|
undo:
|
||||||
jack_free_gpios(jack, i, gpios);
|
jack_free_gpios(jack, i, gpios);
|
||||||
devres_free(tbl);
|
devres_free(tbl);
|
||||||
|
Loading…
Reference in New Issue
Block a user