Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Mark Brown
7b95ee0d 4ed0915f

+4 -23
-2
include/sound/soc-jack.h
··· 44 44 /** 45 45 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection 46 46 * 47 - * @gpio: legacy gpio number 48 47 * @idx: gpio descriptor index within the function of the GPIO 49 48 * consumer device 50 49 * @gpiod_dev: GPIO consumer device ··· 58 59 * ADC). 59 60 */ 60 61 struct snd_soc_jack_gpio { 61 - unsigned int gpio; 62 62 unsigned int idx; 63 63 struct device *gpiod_dev; 64 64 const char *name;
-2
sound/soc/generic/simple-card-utils.c
··· 752 752 if (!prefix) 753 753 prefix = ""; 754 754 755 - sjack->gpio.gpio = -ENOENT; 756 - 757 755 if (is_hp) { 758 756 snprintf(prop, sizeof(prop), "%shp-det", prefix); 759 757 pin_name = pin ? pin : "Headphones";
+4 -19
sound/soc/soc-jack.c
··· 8 8 9 9 #include <sound/jack.h> 10 10 #include <sound/soc.h> 11 - #include <linux/gpio.h> 12 11 #include <linux/gpio/consumer.h> 13 12 #include <linux/interrupt.h> 14 13 #include <linux/workqueue.h> ··· 344 345 goto undo; 345 346 } 346 347 } else { 347 - /* legacy GPIO number */ 348 - if (!gpio_is_valid(gpios[i].gpio)) { 349 - dev_err(jack->card->dev, 350 - "ASoC: Invalid gpio %d\n", 351 - gpios[i].gpio); 352 - ret = -EINVAL; 353 - goto undo; 354 - } 355 - 356 - ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, 357 - gpios[i].name); 358 - if (ret) 359 - goto undo; 360 - 361 - gpios[i].desc = gpio_to_desc(gpios[i].gpio); 348 + dev_err(jack->card->dev, "ASoC: Invalid gpio at index %d\n", i); 349 + ret = -EINVAL; 350 + goto undo; 362 351 } 363 352 got_gpio: 364 353 INIT_DELAYED_WORK(&gpios[i].work, gpio_work); ··· 360 373 gpios[i].name, 361 374 &gpios[i]); 362 375 if (ret < 0) 363 - goto err; 376 + goto undo; 364 377 365 378 if (gpios[i].wake) { 366 379 ret = irq_set_irq_wake(gpiod_to_irq(gpios[i].desc), 1); ··· 388 401 devres_add(jack->card->dev, tbl); 389 402 return 0; 390 403 391 - err: 392 - gpio_free(gpios[i].gpio); 393 404 undo: 394 405 jack_free_gpios(jack, i, gpios); 395 406 devres_free(tbl);