diff options
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/Kconfig | 18 | ||||
-rw-r--r-- | sound/soc/samsung/Makefile | 8 | ||||
-rw-r--r-- | sound/soc/samsung/ac97.c | 16 | ||||
-rw-r--r-- | sound/soc/samsung/dma.c | 12 | ||||
-rw-r--r-- | sound/soc/samsung/i2s.c | 36 | ||||
-rw-r--r-- | sound/soc/samsung/idma.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/idma.h | 2 | ||||
-rw-r--r-- | sound/soc/samsung/littlemill.c | 252 | ||||
-rw-r--r-- | sound/soc/samsung/lowland.c | 236 | ||||
-rw-r--r-- | sound/soc/samsung/pcm.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/s3c2412-i2s.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx-i2s.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx_simtec_hermes.c | 16 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c | 18 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx_uda134x.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/smdk_wm8580pcm.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/smdk_wm8994pcm.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/spdif.c | 14 | ||||
-rw-r--r-- | sound/soc/samsung/speyside.c | 15 | ||||
-rw-r--r-- | sound/soc/samsung/tobermory.c (renamed from sound/soc/samsung/speyside_wm8962.c) | 77 |
20 files changed, 578 insertions, 240 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 53aaa69eda0..f3417f2311b 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -193,8 +193,22 @@ config SND_SOC_SPEYSIDE select SND_SOC_WM9081 select SND_SOC_WM1250_EV1 -config SND_SOC_SPEYSIDE_WM8962 - tristate "Audio support for Wolfson Speyside with WM8962" +config SND_SOC_TOBERMORY + tristate "Audio support for Wolfson Tobermory" depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410 select SND_SAMSUNG_I2S select SND_SOC_WM8962 + +config SND_SOC_LOWLAND + tristate "Audio support for Wolfson Lowland" + depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410 + select SND_SAMSUNG_I2S + select SND_SOC_WM5100 + select SND_SOC_WM9081 + +config SND_SOC_LITTLEMILL + tristate "Audio support for Wolfson Littlemill" + depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410 + select SND_SAMSUNG_I2S + select MFD_WM8994 + select SND_SOC_WM8994 diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile index 8509d3c4366..9d03beb40c8 100644 --- a/sound/soc/samsung/Makefile +++ b/sound/soc/samsung/Makefile @@ -39,7 +39,9 @@ snd-soc-smdk-spdif-objs := smdk_spdif.o snd-soc-smdk-wm8580pcm-objs := smdk_wm8580pcm.o snd-soc-smdk-wm8994pcm-objs := smdk_wm8994pcm.o snd-soc-speyside-objs := speyside.o -snd-soc-speyside-wm8962-objs := speyside_wm8962.o +snd-soc-tobermory-objs := tobermory.o +snd-soc-lowland-objs := lowland.o +snd-soc-littlemill-objs := littlemill.o obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o @@ -60,4 +62,6 @@ obj-$(CONFIG_SND_SOC_GONI_AQUILA_WM8994) += snd-soc-goni-wm8994.o obj-$(CONFIG_SND_SOC_SMDK_WM8580_PCM) += snd-soc-smdk-wm8580pcm.o obj-$(CONFIG_SND_SOC_SMDK_WM8994_PCM) += snd-soc-smdk-wm8994pcm.o obj-$(CONFIG_SND_SOC_SPEYSIDE) += snd-soc-speyside.o -obj-$(CONFIG_SND_SOC_SPEYSIDE_WM8962) += snd-soc-speyside-wm8962.o +obj-$(CONFIG_SND_SOC_TOBERMORY) += snd-soc-tobermory.o +obj-$(CONFIG_SND_SOC_LOWLAND) += snd-soc-lowland.o +obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index 16521e3ffc0..7b9bf93e370 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c @@ -329,12 +329,12 @@ static int s3c_ac97_mic_trigger(struct snd_pcm_substream *substream, return 0; } -static struct snd_soc_dai_ops s3c_ac97_dai_ops = { +static const struct snd_soc_dai_ops s3c_ac97_dai_ops = { .hw_params = s3c_ac97_hw_params, .trigger = s3c_ac97_trigger, }; -static struct snd_soc_dai_ops s3c_ac97_mic_dai_ops = { +static const struct snd_soc_dai_ops s3c_ac97_mic_dai_ops = { .hw_params = s3c_ac97_hw_mic_params, .trigger = s3c_ac97_mic_trigger, }; @@ -509,17 +509,7 @@ static struct platform_driver s3c_ac97_driver = { }, }; -static int __init s3c_ac97_init(void) -{ - return platform_driver_register(&s3c_ac97_driver); -} -module_init(s3c_ac97_init); - -static void __exit s3c_ac97_exit(void) -{ - platform_driver_unregister(&s3c_ac97_driver); -} -module_exit(s3c_ac97_exit); +module_platform_driver(s3c_ac97_driver); MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); MODULE_DESCRIPTION("AC97 driver for the Samsung SoC"); diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index a68b2644178..797c3d5e79e 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -458,17 +458,7 @@ static struct platform_driver asoc_dma_driver = { .remove = __devexit_p(samsung_asoc_platform_remove), }; -static int __init samsung_asoc_init(void) -{ - return platform_driver_register(&asoc_dma_driver); -} -module_init(samsung_asoc_init); - -static void __exit samsung_asoc_exit(void) -{ - platform_driver_unregister(&asoc_dma_driver); -} -module_exit(samsung_asoc_exit); +module_platform_driver(asoc_dma_driver); MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); MODULE_DESCRIPTION("Samsung ASoC DMA Driver"); diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index bff42bf370b..ff5d9194d11 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -881,7 +881,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) writel(CON_RSTCLR, i2s->addr + I2SCON); if (i2s->quirks & QUIRK_SEC_DAI) - idma_reg_addr_init((void *)i2s->addr, + idma_reg_addr_init(i2s->addr, i2s->sec_dai->idma_playback.dma_addr); probe_exit: @@ -923,7 +923,7 @@ static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) return 0; } -static struct snd_soc_dai_ops samsung_i2s_dai_ops = { +static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { .trigger = i2s_trigger, .hw_params = i2s_hw_params, .set_fmt = i2s_set_fmt, @@ -945,7 +945,7 @@ struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) { struct i2s_dai *i2s; - i2s = kzalloc(sizeof(struct i2s_dai), GFP_KERNEL); + i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL); if (i2s == NULL) return NULL; @@ -972,10 +972,8 @@ struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) i2s->pdev = platform_device_register_resndata(NULL, pdev->name, pdev->id + SAMSUNG_I2S_SECOFF, NULL, 0, NULL, 0); - if (IS_ERR(i2s->pdev)) { - kfree(i2s); + if (IS_ERR(i2s->pdev)) return NULL; - } } /* Pre-assign snd_soc_dai_set_drvdata */ @@ -1048,7 +1046,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev) if (!pri_dai) { dev_err(&pdev->dev, "Unable to alloc I2S_pri\n"); ret = -ENOMEM; - goto err1; + goto err; } pri_dai->dma_playback.dma_addr = regs_base + I2STXD; @@ -1073,7 +1071,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev) if (!sec_dai) { dev_err(&pdev->dev, "Unable to alloc I2S_sec\n"); ret = -ENOMEM; - goto err2; + goto err; } sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; sec_dai->dma_playback.client = @@ -1092,17 +1090,13 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev) if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) { dev_err(&pdev->dev, "Unable to configure gpio\n"); ret = -EINVAL; - goto err3; + goto err; } snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv); return 0; -err3: - kfree(sec_dai); -err2: - kfree(pri_dai); -err1: +err: release_mem_region(regs_base, resource_size(res)); return ret; @@ -1128,8 +1122,6 @@ static __devexit int samsung_i2s_remove(struct platform_device *pdev) i2s->pri_dai = NULL; i2s->sec_dai = NULL; - kfree(i2s); - snd_soc_unregister_dai(&pdev->dev); return 0; @@ -1144,17 +1136,7 @@ static struct platform_driver samsung_i2s_driver = { }, }; -static int __init samsung_i2s_init(void) -{ - return platform_driver_register(&samsung_i2s_driver); -} -module_init(samsung_i2s_init); - -static void __exit samsung_i2s_exit(void) -{ - platform_driver_unregister(&samsung_i2s_driver); -} -module_exit(samsung_i2s_exit); +module_platform_driver(samsung_i2s_driver); /* Module information */ MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index c41178efc90..baf97ebadd4 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -403,7 +403,7 @@ static int idma_new(struct snd_soc_pcm_runtime *rtd) return ret; } -void idma_reg_addr_init(void *regs, dma_addr_t addr) +void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr) { spin_lock_init(&idma.lock); idma.regs = regs; @@ -437,17 +437,7 @@ static struct platform_driver asoc_idma_driver = { .remove = __devexit_p(asoc_idma_platform_remove), }; -static int __init asoc_idma_init(void) -{ - return platform_driver_register(&asoc_idma_driver); -} -module_init(asoc_idma_init); - -static void __exit asoc_idma_exit(void) -{ - platform_driver_unregister(&asoc_idma_driver); -} -module_exit(asoc_idma_exit); +module_platform_driver(asoc_idma_driver); MODULE_AUTHOR("Jaswinder Singh, <jassisinghbrar@gmail.com>"); MODULE_DESCRIPTION("Samsung ASoC IDMA Driver"); diff --git a/sound/soc/samsung/idma.h b/sound/soc/samsung/idma.h index 48273216166..8644946973e 100644 --- a/sound/soc/samsung/idma.h +++ b/sound/soc/samsung/idma.h @@ -14,7 +14,7 @@ #ifndef __SND_SOC_SAMSUNG_IDMA_H_ #define __SND_SOC_SAMSUNG_IDMA_H_ -extern void idma_reg_addr_init(void *regs, dma_addr_t addr); +extern void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr); /* dma_state */ #define LPAM_DMA_STOP 0 diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c new file mode 100644 index 00000000000..5cea59beec9 --- /dev/null +++ b/sound/soc/samsung/littlemill.c @@ -0,0 +1,252 @@ +/* + * Littlemill audio support + * + * Copyright 2011 Wolfson Microelectronics + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/jack.h> +#include <linux/gpio.h> +#include <linux/module.h> + +#include "../codecs/wm8994.h" + +static int sample_rate = 44100; + +static int littlemill_set_bias_level(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level) +{ + struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; + int ret; + + if (dapm->dev != codec_dai->dev) + return 0; + + switch (level) { + case SND_SOC_BIAS_PREPARE: + /* + * If we've not already clocked things via hw_params() + * then do so now, otherwise these are noops. + */ + if (dapm->bias_level == SND_SOC_BIAS_STANDBY) { + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, + WM8994_FLL_SRC_MCLK2, 32768, + sample_rate * 512); + if (ret < 0) { + pr_err("Failed to start FLL: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_sysclk(codec_dai, + WM8994_SYSCLK_FLL1, + sample_rate * 512, + SND_SOC_CLOCK_IN); + if (ret < 0) { + pr_err("Failed to set SYSCLK: %d\n", ret); + return ret; + } + } + break; + + default: + break; + } + + return 0; +} + +static int littlemill_set_bias_level_post(struct snd_soc_card *card, + struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level) +{ + struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; + int ret; + + if (dapm->dev != codec_dai->dev) + return 0; + + switch (level) { + case SND_SOC_BIAS_STANDBY: + ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_MCLK2, + 32768, SND_SOC_CLOCK_IN); + if (ret < 0) { + pr_err("Failed to switch away from FLL: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, + 0, 0, 0); + if (ret < 0) { + pr_err("Failed to stop FLL: %d\n", ret); + return ret; + } + break; + + default: + break; + } + + dapm->bias_level = level; + + return 0; +} + +static int littlemill_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *codec_dai = rtd->codec_dai; + int ret; + + sample_rate = params_rate(params); + + ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, + WM8994_FLL_SRC_MCLK2, 32768, + sample_rate * 512); + if (ret < 0) { + pr_err("Failed to start FLL: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_sysclk(codec_dai, + WM8994_SYSCLK_FLL1, + sample_rate * 512, + SND_SOC_CLOCK_IN); + if (ret < 0) { + pr_err("Failed to set SYSCLK: %d\n", ret); + return ret; + } + + return 0; +} + +static struct snd_soc_ops littlemill_ops = { + .hw_params = littlemill_hw_params, +}; + +static struct snd_soc_dai_link littlemill_dai[] = { + { + .name = "CPU", + .stream_name = "CPU", + .cpu_dai_name = "samsung-i2s.0", + .codec_dai_name = "wm8994-aif1", + .platform_name = "samsung-audio", + .codec_name = "wm8994-codec", + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM, + .ops = &littlemill_ops, + }, +}; + +static struct snd_soc_dapm_widget widgets[] = { + SND_SOC_DAPM_HP("Headphone", NULL), + + SND_SOC_DAPM_MIC("AMIC", NULL), + SND_SOC_DAPM_MIC("DMIC", NULL), +}; + +static struct snd_soc_dapm_route audio_paths[] = { + { "Headphone", NULL, "HPOUT1L" }, + { "Headphone", NULL, "HPOUT1R" }, + + { "AMIC", NULL, "MICBIAS1" }, /* Default for AMICBIAS jumper */ + { "IN1LN", NULL, "AMIC" }, + + { "DMIC", NULL, "MICBIAS2" }, /* Default for DMICBIAS jumper */ + { "DMIC1DAT", NULL, "DMIC" }, + { "DMIC2DAT", NULL, "DMIC" }, +}; + +static struct snd_soc_jack littlemill_headset; + +static int littlemill_late_probe(struct snd_soc_card *card) +{ + struct snd_soc_codec *codec = card->rtd[0].codec; + struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; + int ret; + + ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_MCLK2, + 32768, SND_SOC_CLOCK_IN); + if (ret < 0) + return ret; + + ret = snd_soc_jack_new(codec, "Headset", + SND_JACK_HEADSET | SND_JACK_MECHANICAL | + SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3 | + SND_JACK_BTN_4 | SND_JACK_BTN_5, + &littlemill_headset); + if (ret) + return ret; + + /* This will check device compatibility itself */ + wm8958_mic_detect(codec, &littlemill_headset, NULL, NULL); + + return 0; +} + +static struct snd_soc_card littlemill = { + .name = "Littlemill", + .dai_link = littlemill_dai, + .num_links = ARRAY_SIZE(littlemill_dai), + + .set_bias_level = littlemill_set_bias_level, + .set_bias_level_post = littlemill_set_bias_level_post, + + .dapm_widgets = widgets, + .num_dapm_widgets = ARRAY_SIZE(widgets), + .dapm_routes = audio_paths, + .num_dapm_routes = ARRAY_SIZE(audio_paths), + + .late_probe = littlemill_late_probe, +}; + +static __devinit int littlemill_probe(struct platform_device *pdev) +{ + struct snd_soc_card *card = &littlemill; + int ret; + + card->dev = &pdev->dev; + + ret = snd_soc_register_card(card); + if (ret) { + dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", + ret); + return ret; + } + + return 0; +} + +static int __devexit littlemill_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + + return 0; +} + +static struct platform_driver littlemill_driver = { + .driver = { + .name = "littlemill", + .owner = THIS_MODULE, + .pm = &snd_soc_pm_ops, + }, + .probe = littlemill_probe, + .remove = __devexit_p(littlemill_remove), +}; + +module_platform_driver(littlemill_driver); + +MODULE_DESCRIPTION("Littlemill audio support"); +MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:littlemill"); diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c new file mode 100644 index 00000000000..4216a06b45f --- /dev/null +++ b/sound/soc/samsung/lowland.c @@ -0,0 +1,236 @@ +/* + * Lowland audio support + * + * Copyright 2011 Wolfson Microelectronics + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/jack.h> +#include <linux/gpio.h> +#include <linux/module.h> + +#include "../codecs/wm5100.h" +#include "../codecs/wm9081.h" + +#define MCLK1_RATE (44100 * 512) +#define CLKOUT_RATE (44100 * 256) + +static int lowland_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_dai *codec_dai = rtd->codec_dai; + int ret; + + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret < 0) + return ret; + + ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S + | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM); + if (ret < 0) + return ret; + + return 0; +} + +static struct snd_soc_ops lowland_ops = { + .hw_params = lowland_hw_params, +}; + +static struct snd_soc_jack lowland_headset; + +/* Headset jack detection DAPM pins */ +static struct snd_soc_jack_pin lowland_headset_pins[] = { + { + .pin = "Headphone", + .mask = SND_JACK_HEADPHONE | SND_JACK_LINEOUT, + }, + { + .pin = "Headset Mic", + .mask = SND_JACK_MICROPHONE, + }, +}; + +static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_codec *codec = rtd->codec; + int ret; + + ret = snd_soc_codec_set_sysclk(codec, WM5100_CLK_SYSCLK, + WM5100_CLKSRC_MCLK1, MCLK1_RATE, + SND_SOC_CLOCK_IN); + if (ret < 0) { + pr_err("Failed to set SYSCLK clock source: %d\n", ret); + return ret; + } + + /* Clock OPCLK, used by the other audio components. */ + ret = snd_soc_codec_set_sysclk(codec, WM5100_CLK_OPCLK, 0, + CLKOUT_RATE, 0); + if (ret < 0) { + pr_err("Failed to set OPCLK rate: %d\n", ret); + return ret; + } + + ret = snd_soc_jack_new(codec, "Headset", + SND_JACK_LINEOUT | SND_JACK_HEADSET | + SND_JACK_BTN_0, + &lowland_headset); + if (ret) + return ret; + + ret = snd_soc_jack_add_pins(&lowland_headset, + ARRAY_SIZE(lowland_headset_pins), + lowland_headset_pins); + if (ret) + return ret; + + wm5100_detect(codec, &lowland_headset); + + return 0; +} + +static struct snd_soc_dai_link lowland_dai[] = { + { + .name = "CPU", + .stream_name = "CPU", + .cpu_dai_name = "samsung-i2s.0", + .codec_dai_name = "wm5100-aif1", + .platform_name = "samsung-audio", + .codec_name = "wm5100.1-001a", + .ops = &lowland_ops, + .init = lowland_wm5100_init, + }, + { + .name = "Baseband", + .stream_name = "Baseband", + .cpu_dai_name = "wm5100-aif2", + .codec_dai_name = "wm1250-ev1", + .codec_name = "wm1250-ev1.1-0027", + .ops = &lowland_ops, + .ignore_suspend = 1, + }, +}; + +static int lowland_wm9081_init(struct snd_soc_dapm_context *dapm) +{ + snd_soc_dapm_nc_pin(dapm, "LINEOUT"); + + /* At any time the WM9081 is active it will have this clock */ + return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK, 0, + CLKOUT_RATE, 0); +} + +static struct snd_soc_aux_dev lowland_aux_dev[] = { + { + .name = "wm9081", + .codec_name = "wm9081.1-006c", + .init = lowland_wm9081_init, + }, +}; + +static struct snd_soc_codec_conf lowland_codec_conf[] = { + { + .dev_name = "wm9081.1-006c", + .name_prefix = "Sub", + }, +}; + +static const struct snd_kcontrol_new controls[] = { + SOC_DAPM_PIN_SWITCH("Main Speaker"), + SOC_DAPM_PIN_SWITCH("Main DMIC"), + SOC_DAPM_PIN_SWITCH("Main AMIC"), + SOC_DAPM_PIN_SWITCH("WM1250 Input"), + SOC_DAPM_PIN_SWITCH("WM1250 Output"), + SOC_DAPM_PIN_SWITCH("Headphone"), +}; + +static struct snd_soc_dapm_widget widgets[] = { + SND_SOC_DAPM_HP("Headphone", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), + + SND_SOC_DAPM_SPK("Main Speaker", NULL), + + SND_SOC_DAPM_MIC("Main AMIC", NULL), + SND_SOC_DAPM_MIC("Main DMIC", NULL), +}; + +static struct snd_soc_dapm_route audio_paths[] = { + { "Sub IN1", NULL, "HPOUT2L" }, + { "Sub IN2", NULL, "HPOUT2R" }, + + { "Main Speaker", NULL, "Sub SPKN" }, + { "Main Speaker", NULL, "Sub SPKP" }, + { "Main Speaker", NULL, "SPKDAT1" }, +}; + +static struct snd_soc_card lowland = { + .name = "Lowland", + .dai_link = lowland_dai, + .num_links = ARRAY_SIZE(lowland_dai), + .aux_dev = lowland_aux_dev, + .num_aux_devs = ARRAY_SIZE(lowland_aux_dev), + .codec_conf = lowland_codec_conf, + .num_configs = ARRAY_SIZE(lowland_codec_conf), + + .controls = controls, + .num_controls = ARRAY_SIZE(controls), + .dapm_widgets = widgets, + .num_dapm_widgets = ARRAY_SIZE(widgets), + .dapm_routes = audio_paths, + .num_dapm_routes = ARRAY_SIZE(audio_paths), +}; + +static __devinit int lowland_probe(struct platform_device *pdev) +{ + struct snd_soc_card *card = &lowland; + int ret; + + card->dev = &pdev->dev; + + ret = snd_soc_register_card(card); + if (ret) { + dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", + ret); + return ret; + } + + return 0; +} + +static int __devexit lowland_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + + return 0; +} + +static struct platform_driver lowland_driver = { + .driver = { + .name = "lowland", + .owner = THIS_MODULE, + .pm = &snd_soc_pm_ops, + }, + .probe = lowland_probe, + .remove = __devexit_p(lowland_remove), +}; + +module_platform_driver(lowland_driver); + +MODULE_DESCRIPTION("Lowland audio support"); +MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:lowland"); diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 05a47cf7f06..beef63fca05 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -452,7 +452,7 @@ static int s3c_pcm_set_sysclk(struct snd_soc_dai *cpu_dai, return 0; } -static struct snd_soc_dai_ops s3c_pcm_dai_ops = { +static const struct snd_soc_dai_ops s3c_pcm_dai_ops = { .set_sysclk = s3c_pcm_set_sysclk, .set_clkdiv = s3c_pcm_set_clkdiv, .trigger = s3c_pcm_trigger, @@ -632,17 +632,7 @@ static struct platform_driver s3c_pcm_driver = { }, }; -static int __init s3c_pcm_init(void) -{ - return platform_driver_register(&s3c_pcm_driver); -} -module_init(s3c_pcm_init); - -static void __exit s3c_pcm_exit(void) -{ - platform_driver_unregister(&s3c_pcm_driver); -} -module_exit(s3c_pcm_exit); +module_platform_driver(s3c_pcm_driver); /* Module information */ MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 7bbec25e6e1..72185078ddf 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -142,7 +142,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream, SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) -static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = { +static const struct snd_soc_dai_ops s3c2412_i2s_dai_ops = { .hw_params = s3c2412_i2s_hw_params, }; @@ -184,17 +184,7 @@ static struct platform_driver s3c2412_iis_driver = { }, }; -static int __init s3c2412_i2s_init(void) -{ - return platform_driver_register(&s3c2412_iis_driver); -} -module_init(s3c2412_i2s_init); - -static void __exit s3c2412_i2s_exit(void) -{ - platform_driver_unregister(&s3c2412_iis_driver); -} -module_exit(s3c2412_i2s_exit); +module_platform_driver(s3c2412_iis_driver); /* Module information */ MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 558c64bbed2..c4aa4d412fb 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -444,7 +444,7 @@ static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) -static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = { +static const struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = { .trigger = s3c24xx_i2s_trigger, .hw_params = s3c24xx_i2s_hw_params, .set_fmt = s3c24xx_i2s_set_fmt, @@ -489,17 +489,7 @@ static struct platform_driver s3c24xx_iis_driver = { }, }; -static int __init s3c24xx_i2s_init(void) -{ - return platform_driver_register(&s3c24xx_iis_driver); -} -module_init(s3c24xx_i2s_init); - -static void __exit s3c24xx_i2s_exit(void) -{ - platform_driver_unregister(&s3c24xx_iis_driver); -} -module_exit(s3c24xx_i2s_exit); +module_platform_driver(s3c24xx_iis_driver); /* Module information */ MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); diff --git a/sound/soc/samsung/s3c24xx_simtec_hermes.c b/sound/soc/samsung/s3c24xx_simtec_hermes.c index d125e79baf7..502798100f2 100644 --- a/sound/soc/samsung/s3c24xx_simtec_hermes.c +++ b/sound/soc/samsung/s3c24xx_simtec_hermes.c @@ -114,21 +114,9 @@ static struct platform_driver simtec_audio_hermes_platdrv = { .remove = __devexit_p(simtec_audio_remove), }; -MODULE_ALIAS("platform:s3c24xx-simtec-hermes-snd"); - -static int __init simtec_hermes_modinit(void) -{ - return platform_driver_register(&simtec_audio_hermes_platdrv); -} - -static void __exit simtec_hermes_modexit(void) -{ - platform_driver_unregister(&simtec_audio_hermes_platdrv); -} - -module_init(simtec_hermes_modinit); -module_exit(simtec_hermes_modexit); +module_platform_driver(simtec_audio_hermes_platdrv); +MODULE_ALIAS("platform:s3c24xx-simtec-hermes-snd"); MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c index 5e4fd46b720..89b57b5c3e1 100644 --- a/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c +++ b/sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c @@ -92,7 +92,7 @@ static int __devinit simtec_audio_tlv320aic23_probe(struct platform_device *pd) return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23); } -static struct platform_driver simtec_audio_tlv320aic23_platdrv = { +static struct platform_driver simtec_audio_tlv320aic23_driver = { .driver = { .owner = THIS_MODULE, .name = "s3c24xx-simtec-tlv320aic23", @@ -102,21 +102,9 @@ static struct platform_driver simtec_audio_tlv320aic23_platdrv = { .remove = __devexit_p(simtec_audio_remove), }; -MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23"); - -static int __init simtec_tlv320aic23_modinit(void) -{ - return platform_driver_register(&simtec_audio_tlv320aic23_platdrv); -} - -static void __exit simtec_tlv320aic23_modexit(void) -{ - platform_driver_unregister(&simtec_audio_tlv320aic23_platdrv); -} - -module_init(simtec_tlv320aic23_modinit); -module_exit(simtec_tlv320aic23_modexit); +module_platform_driver(simtec_audio_tlv320aic23_driver); +MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23"); MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c index 548c6ac6e7b..62b69fb6a08 100644 --- a/sound/soc/samsung/s3c24xx_uda134x.c +++ b/sound/soc/samsung/s3c24xx_uda134x.c @@ -343,19 +343,7 @@ static struct platform_driver s3c24xx_uda134x_driver = { }, }; -static int __init s3c24xx_uda134x_init(void) -{ - return platform_driver_register(&s3c24xx_uda134x_driver); -} - -static void __exit s3c24xx_uda134x_exit(void) -{ - platform_driver_unregister(&s3c24xx_uda134x_driver); -} - - -module_init(s3c24xx_uda134x_init); -module_exit(s3c24xx_uda134x_exit); +module_platform_driver(s3c24xx_uda134x_driver); MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>"); MODULE_DESCRIPTION("S3C24XX_UDA134X ALSA SoC audio driver"); diff --git a/sound/soc/samsung/smdk_wm8580pcm.c b/sound/soc/samsung/smdk_wm8580pcm.c index 0677473e6b6..49dfafbf3df 100644 --- a/sound/soc/samsung/smdk_wm8580pcm.c +++ b/sound/soc/samsung/smdk_wm8580pcm.c @@ -188,19 +188,7 @@ static struct platform_driver snd_smdk_driver = { .remove = __devexit_p(snd_smdk_remove), }; -static int __init smdk_audio_init(void) -{ - return platform_driver_register(&snd_smdk_driver); -} - -module_init(smdk_audio_init); - -static void __exit smdk_audio_exit(void) -{ - platform_driver_unregister(&snd_smdk_driver); -} - -module_exit(smdk_audio_exit); +module_platform_driver(snd_smdk_driver); MODULE_AUTHOR("Sangbeom Kim, <sbkim73@samsung.com>"); MODULE_DESCRIPTION("ALSA SoC SMDK WM8580 for PCM"); diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c index da9c2a264d9..23c7fb71ddf 100644 --- a/sound/soc/samsung/smdk_wm8994pcm.c +++ b/sound/soc/samsung/smdk_wm8994pcm.c @@ -158,19 +158,7 @@ static struct platform_driver snd_smdk_driver = { .remove = __devexit_p(snd_smdk_remove), }; -static int __init smdk_audio_init(void) -{ - return platform_driver_register(&snd_smdk_driver); -} - -module_init(smdk_audio_init); - -static void __exit smdk_audio_exit(void) -{ - platform_driver_unregister(&snd_smdk_driver); -} - -module_exit(smdk_audio_exit); +module_platform_driver(snd_smdk_driver); MODULE_AUTHOR("Sangbeom Kim, <sbkim73@samsung.com>"); MODULE_DESCRIPTION("ALSA SoC SMDK WM8994 for PCM"); diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index 468cff1bb1a..a5a56a12034 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c @@ -334,7 +334,7 @@ static int spdif_resume(struct snd_soc_dai *cpu_dai) #define spdif_resume NULL #endif -static struct snd_soc_dai_ops spdif_dai_ops = { +static const struct snd_soc_dai_ops spdif_dai_ops = { .set_sysclk = spdif_set_sysclk, .trigger = spdif_trigger, .hw_params = spdif_hw_params, @@ -483,17 +483,7 @@ static struct platform_driver samsung_spdif_driver = { }, }; -static int __init spdif_init(void) -{ - return platform_driver_register(&samsung_spdif_driver); -} -module_init(spdif_init); - -static void __exit spdif_exit(void) -{ - platform_driver_unregister(&samsung_spdif_driver); -} -module_exit(spdif_exit); +module_platform_driver(samsung_spdif_driver); MODULE_AUTHOR("Seungwhan Youn, <sw.youn@samsung.com>"); MODULE_DESCRIPTION("Samsung S/PDIF Controller Driver"); diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 4b8e35410eb..18e6356e86d 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -222,8 +222,6 @@ static struct snd_soc_dai_link speyside_dai[] = { static int speyside_wm9081_init(struct snd_soc_dapm_context *dapm) { - snd_soc_dapm_nc_pin(dapm, "LINEOUT"); - /* At any time the WM9081 is active it will have this clock */ return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK, 0, 48000 * 256, 0); @@ -308,6 +306,7 @@ static struct snd_soc_card speyside = { .num_dapm_widgets = ARRAY_SIZE(widgets), .dapm_routes = audio_paths, .num_dapm_routes = ARRAY_SIZE(audio_paths), + .fully_routed = true, .late_probe = speyside_late_probe, }; @@ -348,17 +347,7 @@ static struct platform_driver speyside_driver = { .remove = __devexit_p(speyside_remove), }; -static int __init speyside_audio_init(void) -{ - return platform_driver_register(&speyside_driver); -} -module_init(speyside_audio_init); - -static void __exit speyside_audio_exit(void) -{ - platform_driver_unregister(&speyside_driver); -} -module_exit(speyside_audio_exit); +module_platform_driver(speyside_driver); MODULE_DESCRIPTION("Speyside audio support"); MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); diff --git a/sound/soc/samsung/speyside_wm8962.c b/sound/soc/samsung/tobermory.c index e3e27166cc5..6f91c65c5a0 100644 --- a/sound/soc/samsung/speyside_wm8962.c +++ b/sound/soc/samsung/tobermory.c @@ -1,5 +1,5 @@ /* - * Speyside with WM8962 audio support + * Tobermory audio support * * Copyright 2011 Wolfson Microelectronics * @@ -19,7 +19,7 @@ static int sample_rate = 44100; -static int speyside_wm8962_set_bias_level(struct snd_soc_card *card, +static int tobermory_set_bias_level(struct snd_soc_card *card, struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) { @@ -56,7 +56,7 @@ static int speyside_wm8962_set_bias_level(struct snd_soc_card *card, return 0; } -static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card, +static int tobermory_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) { @@ -92,7 +92,7 @@ static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card, return 0; } -static int speyside_wm8962_hw_params(struct snd_pcm_substream *substream, +static int tobermory_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { sample_rate = params_rate(params); @@ -100,11 +100,11 @@ static int speyside_wm8962_hw_params(struct snd_pcm_substream *substream, return 0; } -static struct snd_soc_ops speyside_wm8962_ops = { - .hw_params = speyside_wm8962_hw_params, +static struct snd_soc_ops tobermory_ops = { + .hw_params = tobermory_hw_params, }; -static struct snd_soc_dai_link speyside_wm8962_dai[] = { +static struct snd_soc_dai_link tobermory_dai[] = { { .name = "CPU", .stream_name = "CPU", @@ -114,7 +114,7 @@ static struct snd_soc_dai_link speyside_wm8962_dai[] = { .codec_name = "wm8962.1-001a", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, - .ops = &speyside_wm8962_ops, + .ops = &tobermory_ops, }, }; @@ -152,10 +152,10 @@ static struct snd_soc_dapm_route audio_paths[] = { { "DMICDAT", NULL, "DMIC" }, }; -static struct snd_soc_jack speyside_wm8962_headset; +static struct snd_soc_jack tobermory_headset; /* Headset jack detection DAPM pins */ -static struct snd_soc_jack_pin speyside_wm8962_headset_pins[] = { +static struct snd_soc_jack_pin tobermory_headset_pins[] = { { .pin = "Headset Mic", .mask = SND_JACK_MICROPHONE, @@ -166,7 +166,7 @@ static struct snd_soc_jack_pin speyside_wm8962_headset_pins[] = { }, }; -static int speyside_wm8962_late_probe(struct snd_soc_card *card) +static int tobermory_late_probe(struct snd_soc_card *card) { struct snd_soc_codec *codec = card->rtd[0].codec; struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; @@ -179,28 +179,28 @@ static int speyside_wm8962_late_probe(struct snd_soc_card *card) ret = snd_soc_jack_new(codec, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, - &speyside_wm8962_headset); + &tobermory_headset); if (ret) return ret; - ret = snd_soc_jack_add_pins(&speyside_wm8962_headset, - ARRAY_SIZE(speyside_wm8962_headset_pins), - speyside_wm8962_headset_pins); + ret = snd_soc_jack_add_pins(&tobermory_headset, + ARRAY_SIZE(tobermory_headset_pins), + tobermory_headset_pins); if (ret) return ret; - wm8962_mic_detect(codec, &speyside_wm8962_headset); + wm8962_mic_detect(codec, &tobermory_headset); return 0; } -static struct snd_soc_card speyside_wm8962 = { - .name = "Speyside WM8962", - .dai_link = speyside_wm8962_dai, - .num_links = ARRAY_SIZE(speyside_wm8962_dai), +static struct snd_soc_card tobermory = { + .name = "Tobermory", + .dai_link = tobermory_dai, + .num_links = ARRAY_SIZE(tobermory_dai), - .set_bias_level = speyside_wm8962_set_bias_level, - .set_bias_level_post = speyside_wm8962_set_bias_level_post, + .set_bias_level = tobermory_set_bias_level, + .set_bias_level_post = tobermory_set_bias_level_post, .controls = controls, .num_controls = ARRAY_SIZE(controls), @@ -208,13 +208,14 @@ static struct snd_soc_card speyside_wm8962 = { .num_dapm_widgets = ARRAY_SIZE(widgets), .dapm_routes = audio_paths, .num_dapm_routes = ARRAY_SIZE(audio_paths), + .fully_routed = true, - .late_probe = speyside_wm8962_late_probe, + .late_probe = tobermory_late_probe, }; -static __devinit int speyside_wm8962_probe(struct platform_device *pdev) +static __devinit int tobermory_probe(struct platform_device *pdev) { - struct snd_soc_card *card = &speyside_wm8962; + struct snd_soc_card *card = &tobermory; int ret; card->dev = &pdev->dev; @@ -229,7 +230,7 @@ static __devinit int speyside_wm8962_probe(struct platform_device *pdev) return 0; } -static int __devexit speyside_wm8962_remove(struct platform_device *pdev) +static int __devexit tobermory_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); @@ -238,29 +239,19 @@ static int __devexit speyside_wm8962_remove(struct platform_device *pdev) return 0; } -static struct platform_driver speyside_wm8962_driver = { +static struct platform_driver tobermory_driver = { .driver = { - .name = "speyside-wm8962", + .name = "tobermory", .owner = THIS_MODULE, .pm = &snd_soc_pm_ops, }, - .probe = speyside_wm8962_probe, - .remove = __devexit_p(speyside_wm8962_remove), + .probe = tobermory_probe, + .remove = __devexit_p(tobermory_remove), }; -static int __init speyside_wm8962_audio_init(void) -{ - return platform_driver_register(&speyside_wm8962_driver); -} -module_init(speyside_wm8962_audio_init); - -static void __exit speyside_wm8962_audio_exit(void) -{ - platform_driver_unregister(&speyside_wm8962_driver); -} -module_exit(speyside_wm8962_audio_exit); +module_platform_driver(tobermory_driver); -MODULE_DESCRIPTION("Speyside WM8962 audio support"); +MODULE_DESCRIPTION("Tobermory audio support"); MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:speyside-wm8962"); +MODULE_ALIAS("platform:tobermory"); |