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: samsung: GPIO descriptor conversion

Merge series from Linus Walleij <linus.walleij@linaro.org>:

This drops unused includes and converts one Samsung
codec to use GPIO descriptors.

+30 -12
-1
sound/soc/samsung/bells.c
··· 7 7 #include <sound/soc.h> 8 8 #include <sound/soc-dapm.h> 9 9 #include <sound/jack.h> 10 - #include <linux/gpio.h> 11 10 #include <linux/module.h> 12 11 13 12 #include "../codecs/wm5102.h"
-1
sound/soc/samsung/littlemill.c
··· 7 7 #include <sound/soc.h> 8 8 #include <sound/soc-dapm.h> 9 9 #include <sound/jack.h> 10 - #include <linux/gpio.h> 11 10 #include <linux/module.h> 12 11 13 12 #include "../codecs/wm8994.h"
-1
sound/soc/samsung/lowland.c
··· 7 7 #include <sound/soc.h> 8 8 #include <sound/soc-dapm.h> 9 9 #include <sound/jack.h> 10 - #include <linux/gpio.h> 11 10 #include <linux/module.h> 12 11 13 12 #include "../codecs/wm5100.h"
+30 -7
sound/soc/samsung/speyside.c
··· 7 7 #include <sound/soc.h> 8 8 #include <sound/soc-dapm.h> 9 9 #include <sound/jack.h> 10 - #include <linux/gpio.h> 10 + #include <linux/gpio/machine.h> 11 + #include <linux/gpio/consumer.h> 11 12 #include <linux/module.h> 12 13 13 14 #include "../codecs/wm8996.h" 14 15 #include "../codecs/wm9081.h" 15 16 16 - #define WM8996_HPSEL_GPIO 214 17 17 #define MCLK_AUDIO_RATE (512 * 48000) 18 18 19 19 static int speyside_set_bias_level(struct snd_soc_card *card, ··· 105 105 }, 106 106 }; 107 107 108 + static struct gpio_desc *speyside_hpsel_gpio; 108 109 /* Default the headphone selection to active high */ 109 110 static int speyside_jack_polarity; 110 111 ··· 124 123 int polarity) 125 124 { 126 125 speyside_jack_polarity = !polarity; 127 - gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity); 126 + gpiod_direction_output(speyside_hpsel_gpio, speyside_jack_polarity); 128 127 129 128 /* Re-run DAPM to make sure we're using the correct mic bias */ 130 129 snd_soc_dapm_sync(snd_soc_component_get_dapm(component)); ··· 146 145 { 147 146 struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0); 148 147 struct snd_soc_component *component = dai->component; 148 + enum gpiod_flags flags; 149 149 int ret; 150 150 151 151 ret = snd_soc_dai_set_sysclk(dai, WM8996_SYSCLK_MCLK2, 32768, 0); 152 152 if (ret < 0) 153 153 return ret; 154 154 155 - ret = gpio_request(WM8996_HPSEL_GPIO, "HP_SEL"); 156 - if (ret != 0) 157 - pr_err("Failed to request HP_SEL GPIO: %d\n", ret); 158 - gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity); 155 + if (speyside_jack_polarity) 156 + flags = GPIOD_OUT_HIGH; 157 + else 158 + flags = GPIOD_OUT_LOW; 159 + speyside_hpsel_gpio = devm_gpiod_get(rtd->card->dev, 160 + "hp-sel", 161 + flags); 162 + if (IS_ERR(speyside_hpsel_gpio)) 163 + return PTR_ERR(speyside_hpsel_gpio); 159 164 160 165 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset", 161 166 SND_JACK_LINEOUT | SND_JACK_HEADSET | ··· 332 325 .late_probe = speyside_late_probe, 333 326 }; 334 327 328 + static struct gpiod_lookup_table wm8996_gpiod_table = { 329 + /* Hardcoded device name in board file mach-crag6410.c */ 330 + .dev_id = "speyside", 331 + .table = { 332 + /* 333 + * This line was hardcoded to 214 in the global GPIO 334 + * number space, S3C GPIO macros seems top set the 335 + * wm8996 codec GPIO start offset to 212, so this will 336 + * be GPIO 214 - 212 = 2 on the wm8996. 337 + */ 338 + GPIO_LOOKUP("wm8996", 2, "hp-sel", GPIO_ACTIVE_HIGH), 339 + { }, 340 + }, 341 + }; 342 + 335 343 static int speyside_probe(struct platform_device *pdev) 336 344 { 337 345 struct snd_soc_card *card = &speyside; ··· 354 332 355 333 card->dev = &pdev->dev; 356 334 335 + gpiod_add_lookup_table(&wm8996_gpiod_table); 357 336 ret = devm_snd_soc_register_card(&pdev->dev, card); 358 337 if (ret) 359 338 dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
-1
sound/soc/samsung/tm2_wm5110.c
··· 6 6 // Sylwester Nawrocki <s.nawrocki@samsung.com> 7 7 8 8 #include <linux/clk.h> 9 - #include <linux/gpio.h> 10 9 #include <linux/gpio/consumer.h> 11 10 #include <linux/module.h> 12 11 #include <linux/of.h>
-1
sound/soc/samsung/tobermory.c
··· 7 7 #include <sound/soc.h> 8 8 #include <sound/soc-dapm.h> 9 9 #include <sound/jack.h> 10 - #include <linux/gpio.h> 11 10 #include <linux/module.h> 12 11 13 12 #include "../codecs/wm8962.h"