aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 21:03:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 21:03:56 -0500
commit6b5a12dbca7a8681ecb78dbebaedc1f8364ebd10 (patch)
tree497bc67a98e8bf5247dd453d05ab0dba4c31e424 /sound
parent5083c54264d21bf9b8a4766068f51581854d772c (diff)
parent2cb58c016673c4c8b8ec59e71c5ec4b2c6a76afb (diff)
Merge tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC multiplatform code updates from Arnd Bergmann: "This branch is the culmination of 5 years of effort to bring the ARMv6 and ARMv7 platforms together such that they can all be enabled and boot the same kernel. It has been a tremendous amount of cleanup and refactoring by a huge number of people, and creation of several new (and major) subsystems to better abstract out all the platform details in an appropriate manner. The bulk of this branch is a large patchset from Arnd that brings several of the more minor and older platforms we have closer to multiplatform support. Among these are MMP, S3C64xx, Orion5x, mv78xx0 and realview Much of this is moving around header files from old mach directories, but there are also some cleanup patches of debug_ll (lowlevel debug per-platform options) and other parts. Linus Walleij also has some patchs to clean up the older ARM Realview platforms by finally introducing DT support, and Rob Herring has some for ARM Versatile which is now DT-only. Both of these platforms are now multiplatform. Finally, a couple of patches from Russell for Dove PMU, and a fix from Valentin Rothberg for Exynos ADC, which were rebased on top of the series to avoid conflicts" * tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (75 commits) ARM: realview: don't select SMP_ON_UP for UP builds ARM: s3c: simplify s3c_irqwake_{e,}intallow definition ARM: s3c64xx: fix pm-debug compilation iio: exynos-adc: fix irqf_oneshot.cocci warnings ARM: realview: build realview-dt SMP support only when used ARM: realview: select apropriate targets ARM: realview: clean up header files ARM: realview: make all header files local ARM: no longer make CPU targets visible separately ARM: integrator: use explicit core module options ARM: realview: enable multiplatform ARM: make default platform work for NOMMU ARM: debug-ll: move DEBUG_LL_UART_EFM32 to correct Kconfig location ARM: defconfig: use correct debug_ll settings ARM: versatile: convert to multi-platform ARM: versatile: merge mach code into a single file ARM: versatile: switch to DT only booting and remove legacy code ARM: versatile: add DT based PCI detection ARM: pxa: mark ezx structures as __maybe_unused ARM: pxa: mark raumfeld init functions as __maybe_unused ...
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/smartq_wm8987.c76
1 files changed, 26 insertions, 50 deletions
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index a0fe37fbed9f..425ee2ba37f0 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -13,15 +13,12 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/gpio.h> 16#include <linux/gpio/consumer.h>
17#include <linux/module.h> 17#include <linux/module.h>
18 18
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/jack.h> 20#include <sound/jack.h>
21 21
22#include <mach/gpio-samsung.h>
23#include <asm/mach-types.h>
24
25#include "i2s.h" 22#include "i2s.h"
26#include "../codecs/wm8750.h" 23#include "../codecs/wm8750.h"
27 24
@@ -96,7 +93,7 @@ static struct snd_soc_jack_pin smartq_jack_pins[] = {
96 93
97static struct snd_soc_jack_gpio smartq_jack_gpios[] = { 94static struct snd_soc_jack_gpio smartq_jack_gpios[] = {
98 { 95 {
99 .gpio = S3C64XX_GPL(12), 96 .gpio = -1,
100 .name = "headphone detect", 97 .name = "headphone detect",
101 .report = SND_JACK_HEADPHONE, 98 .report = SND_JACK_HEADPHONE,
102 .debounce_time = 200, 99 .debounce_time = 200,
@@ -113,7 +110,9 @@ static int smartq_speaker_event(struct snd_soc_dapm_widget *w,
113 struct snd_kcontrol *k, 110 struct snd_kcontrol *k,
114 int event) 111 int event)
115{ 112{
116 gpio_set_value(S3C64XX_GPK(12), SND_SOC_DAPM_EVENT_OFF(event)); 113 struct gpio_desc *gpio = snd_soc_card_get_drvdata(&snd_soc_smartq);
114
115 gpiod_set_value(gpio, SND_SOC_DAPM_EVENT_OFF(event));
117 116
118 return 0; 117 return 0;
119} 118}
@@ -199,62 +198,39 @@ static struct snd_soc_card snd_soc_smartq = {
199 .num_controls = ARRAY_SIZE(wm8987_smartq_controls), 198 .num_controls = ARRAY_SIZE(wm8987_smartq_controls),
200}; 199};
201 200
202static struct platform_device *smartq_snd_device; 201static int smartq_probe(struct platform_device *pdev)
203
204static int __init smartq_init(void)
205{ 202{
203 struct gpio_desc *gpio;
206 int ret; 204 int ret;
207 205
208 if (!machine_is_smartq7() && !machine_is_smartq5()) { 206 platform_set_drvdata(pdev, &snd_soc_smartq);
209 pr_info("Only SmartQ is supported by this ASoC driver\n");
210 return -ENODEV;
211 }
212
213 smartq_snd_device = platform_device_alloc("soc-audio", -1);
214 if (!smartq_snd_device)
215 return -ENOMEM;
216
217 platform_set_drvdata(smartq_snd_device, &snd_soc_smartq);
218
219 ret = platform_device_add(smartq_snd_device);
220 if (ret) {
221 platform_device_put(smartq_snd_device);
222 return ret;
223 }
224 207
225 /* Initialise GPIOs used by amplifiers */ 208 /* Initialise GPIOs used by amplifiers */
226 ret = gpio_request(S3C64XX_GPK(12), "amplifiers shutdown"); 209 gpio = devm_gpiod_get(&pdev->dev, "amplifiers shutdown",
227 if (ret) { 210 GPIOD_OUT_HIGH);
228 dev_err(&smartq_snd_device->dev, "Failed to register GPK12\n"); 211 if (IS_ERR(gpio)) {
229 goto err_unregister_device; 212 dev_err(&pdev->dev, "Failed to register GPK12\n");
213 ret = PTR_ERR(gpio);
214 goto out;
230 } 215 }
216 snd_soc_card_set_drvdata(&snd_soc_smartq, gpio);
231 217
232 /* Disable amplifiers */ 218 ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_smartq);
233 ret = gpio_direction_output(S3C64XX_GPK(12), 1); 219 if (ret)
234 if (ret) { 220 dev_err(&pdev->dev, "Failed to register card\n");
235 dev_err(&smartq_snd_device->dev, "Failed to configure GPK12\n");
236 goto err_free_gpio_amp_shut;
237 }
238
239 return 0;
240
241err_free_gpio_amp_shut:
242 gpio_free(S3C64XX_GPK(12));
243err_unregister_device:
244 platform_device_unregister(smartq_snd_device);
245 221
222out:
246 return ret; 223 return ret;
247} 224}
248 225
249static void __exit smartq_exit(void) 226static struct platform_driver smartq_driver = {
250{ 227 .driver = {
251 gpio_free(S3C64XX_GPK(12)); 228 .name = "smartq-audio",
252 229 },
253 platform_device_unregister(smartq_snd_device); 230 .probe = smartq_probe,
254} 231};
255 232
256module_init(smartq_init); 233module_platform_driver(smartq_driver);
257module_exit(smartq_exit);
258 234
259/* Module information */ 235/* Module information */
260MODULE_AUTHOR("Maurus Cuelenaere <mcuelenaere@gmail.com>"); 236MODULE_AUTHOR("Maurus Cuelenaere <mcuelenaere@gmail.com>");