From 2f702a19154ddbd294825c0588593e1eef10b1e2 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 25 Nov 2011 10:13:37 +0800 Subject: ASoC: Convert pxa directory to module_platform_driver Factor out some boilerplate code. Signed-off-by: Axel Lin Acked-by: Marek Vasut Acked-by: Robert Jarzmik Signed-off-by: Mark Brown --- sound/soc/pxa/hx4700.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'sound/soc/pxa/hx4700.c') diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 65c124831a00..e32afaf1ebbb 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -236,18 +236,7 @@ static struct platform_driver hx4700_audio_driver = { .remove = __devexit_p(hx4700_audio_remove), }; -static int __init hx4700_modinit(void) -{ - return platform_driver_register(&hx4700_audio_driver); -} -module_init(hx4700_modinit); - -static void __exit hx4700_modexit(void) -{ - platform_driver_unregister(&hx4700_audio_driver); -} - -module_exit(hx4700_modexit); +module_platform_driver(hx4700_audio_driver); MODULE_AUTHOR("Philipp Zabel"); MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700"); -- cgit v1.2.3 From 673847cfb0b07ba42d23f32d42e59eeda81c3b2f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 20 Dec 2011 16:13:26 +0800 Subject: ASoC: Use dai_fmt in hx4700 machine driver Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/pxa/hx4700.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'sound/soc/pxa/hx4700.c') diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 03ef9f393434..8260207818a5 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -65,20 +65,6 @@ static int hx4700_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int ret = 0; - /* set codec DAI configuration */ - ret = snd_soc_dai_set_fmt(codec_dai, - SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - - /* set cpu DAI configuration */ - ret = snd_soc_dai_set_fmt(cpu_dai, - SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - /* set the I2S system clock as output */ ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, SND_SOC_CLOCK_OUT); @@ -175,6 +161,8 @@ static struct snd_soc_dai_link hx4700_dai = { .platform_name = "pxa-pcm-audio", .codec_name = "ak4641.0-0012", .init = hx4700_ak4641_init, + .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, .ops = &hx4700_ops, }; -- cgit v1.2.3 From 561c6a172f065fa918d0ff3cecdca1b22dca893f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 22 Dec 2011 09:44:43 +0800 Subject: ASoC: pxa: Add .owner to struct snd_soc_card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missed .owner of struct snd_soc_card will prevent the module from being removed from underneath its users. Reported-by: Lothar Waßmann Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/pxa/corgi.c | 1 + sound/soc/pxa/e740_wm9705.c | 1 + sound/soc/pxa/e750_wm9705.c | 1 + sound/soc/pxa/e800_wm9712.c | 1 + sound/soc/pxa/em-x270.c | 1 + sound/soc/pxa/hx4700.c | 1 + sound/soc/pxa/imote2.c | 1 + sound/soc/pxa/magician.c | 1 + sound/soc/pxa/mioa701_wm9713.c | 1 + sound/soc/pxa/palm27x.c | 1 + sound/soc/pxa/raumfeld.c | 2 ++ sound/soc/pxa/saarb.c | 1 + sound/soc/pxa/spitz.c | 1 + sound/soc/pxa/tavorevb3.c | 1 + sound/soc/pxa/tosa.c | 1 + sound/soc/pxa/z2.c | 1 + sound/soc/pxa/zylonite.c | 1 + 17 files changed, 18 insertions(+) (limited to 'sound/soc/pxa/hx4700.c') diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index b0e2fb720910..5e5004a84073 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c @@ -317,6 +317,7 @@ static struct snd_soc_dai_link corgi_dai = { /* corgi audio machine driver */ static struct snd_soc_card snd_soc_corgi = { .name = "Corgi", + .owner = THIS_MODULE, .dai_link = &corgi_dai, .num_links = 1, }; diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 203ab78a4d68..7b1bc2390039 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c @@ -133,6 +133,7 @@ static struct snd_soc_dai_link e740_dai[] = { static struct snd_soc_card e740 = { .name = "Toshiba e740", + .owner = THIS_MODULE, .dai_link = e740_dai, .num_links = ARRAY_SIZE(e740_dai), }; diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index 27f90cc44234..47b89d71e287 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c @@ -116,6 +116,7 @@ static struct snd_soc_dai_link e750_dai[] = { static struct snd_soc_card e750 = { .name = "Toshiba e750", + .owner = THIS_MODULE, .dai_link = e750_dai, .num_links = ARRAY_SIZE(e750_dai), }; diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 858bf94160c5..ea9707ec6f28 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c @@ -106,6 +106,7 @@ static struct snd_soc_dai_link e800_dai[] = { static struct snd_soc_card e800 = { .name = "Toshiba e800", + .owner = THIS_MODULE, .dai_link = e800_dai, .num_links = ARRAY_SIZE(e800_dai), }; diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c index b13a4252812d..64743a05aeae 100644 --- a/sound/soc/pxa/em-x270.c +++ b/sound/soc/pxa/em-x270.c @@ -54,6 +54,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { static struct snd_soc_card em_x270 = { .name = "EM-X270", + .owner = THIS_MODULE, .dai_link = em_x270_dai, .num_links = ARRAY_SIZE(em_x270_dai), }; diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 8260207818a5..2a342c92d829 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -169,6 +169,7 @@ static struct snd_soc_dai_link hx4700_dai = { /* hx4700 audio machine driver */ static struct snd_soc_card snd_soc_card_hx4700 = { .name = "iPAQ hx4700", + .owner = THIS_MODULE, .dai_link = &hx4700_dai, .num_links = 1, .dapm_widgets = hx4700_dapm_widgets, diff --git a/sound/soc/pxa/imote2.c b/sound/soc/pxa/imote2.c index dc905aec6294..b93dafd32b80 100644 --- a/sound/soc/pxa/imote2.c +++ b/sound/soc/pxa/imote2.c @@ -60,6 +60,7 @@ static struct snd_soc_dai_link imote2_dai = { static struct snd_soc_card imote2 = { .name = "Imote2", + .owner = THIS_MODULE, .dai_link = &imote2_dai, .num_links = 1, }; diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index e79f516c400e..3f7a8ecb9720 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c @@ -452,6 +452,7 @@ static struct snd_soc_dai_link magician_dai[] = { /* magician audio machine driver */ static struct snd_soc_card snd_soc_card_magician = { .name = "Magician", + .owner = THIS_MODULE, .dai_link = magician_dai, .num_links = ARRAY_SIZE(magician_dai), diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 0e73a7f718e4..9c585af59b5f 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -181,6 +181,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { static struct snd_soc_card mioa701 = { .name = "MioA701", + .owner = THIS_MODULE, .dai_link = mioa701_dai, .num_links = ARRAY_SIZE(mioa701_dai), }; diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index f313eca40fdc..db24bc685bd3 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c @@ -146,6 +146,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { static struct snd_soc_card palm27x_asoc = { .name = "Palm/PXA27x", + .owner = THIS_MODULE, .dai_link = palm27x_dai, .num_links = ARRAY_SIZE(palm27x_dai), }; diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c index b899a3bc8f42..ba1545188ec6 100644 --- a/sound/soc/pxa/raumfeld.c +++ b/sound/soc/pxa/raumfeld.c @@ -260,6 +260,7 @@ static struct snd_soc_dai_link snd_soc_raumfeld_speaker_dai[] = static struct snd_soc_card snd_soc_raumfeld_connector = { .name = "Raumfeld Connector", + .owner = THIS_MODULE, .dai_link = snd_soc_raumfeld_connector_dai, .num_links = ARRAY_SIZE(snd_soc_raumfeld_connector_dai), .suspend_post = raumfeld_analog_suspend, @@ -268,6 +269,7 @@ static struct snd_soc_card snd_soc_raumfeld_connector = { static struct snd_soc_card snd_soc_raumfeld_speaker = { .name = "Raumfeld Speaker", + .owner = THIS_MODULE, .dai_link = snd_soc_raumfeld_speaker_dai, .num_links = ARRAY_SIZE(snd_soc_raumfeld_speaker_dai), .suspend_post = raumfeld_analog_suspend, diff --git a/sound/soc/pxa/saarb.c b/sound/soc/pxa/saarb.c index d9467a2c6de0..2e21712cec67 100644 --- a/sound/soc/pxa/saarb.c +++ b/sound/soc/pxa/saarb.c @@ -125,6 +125,7 @@ static struct snd_soc_dai_link saarb_dai[] = { static struct snd_soc_card snd_soc_card_saarb = { .name = "Saarb", + .owner = THIS_MODULE, .dai_link = saarb_dai, .num_links = ARRAY_SIZE(saarb_dai), }; diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index c2d6ff9b1588..bb060482c00d 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c @@ -319,6 +319,7 @@ static struct snd_soc_dai_link spitz_dai = { /* spitz audio machine driver */ static struct snd_soc_card snd_soc_spitz = { .name = "Spitz", + .owner = THIS_MODULE, .dai_link = &spitz_dai, .num_links = 1, }; diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/tavorevb3.c index eeec892e0e04..4bef12cd424d 100644 --- a/sound/soc/pxa/tavorevb3.c +++ b/sound/soc/pxa/tavorevb3.c @@ -125,6 +125,7 @@ static struct snd_soc_dai_link evb3_dai[] = { static struct snd_soc_card snd_soc_card_evb3 = { .name = "Tavor EVB3", + .owner = THIS_MODULE, .dai_link = evb3_dai, .num_links = ARRAY_SIZE(evb3_dai), }; diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index 3f394de297a2..564ef08a89f2 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c @@ -236,6 +236,7 @@ static struct snd_soc_dai_link tosa_dai[] = { static struct snd_soc_card tosa = { .name = "Tosa", + .owner = THIS_MODULE, .dai_link = tosa_dai, .num_links = ARRAY_SIZE(tosa_dai), }; diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index b311ffe04b71..d6807e0372bd 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -202,6 +202,7 @@ static struct snd_soc_dai_link z2_dai = { /* z2 audio machine driver */ static struct snd_soc_card snd_soc_z2 = { .name = "Z2", + .owner = THIS_MODULE, .dai_link = &z2_dai, .num_links = 1, }; diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index 580aae38e502..ceb656695b0f 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c @@ -249,6 +249,7 @@ static int zylonite_resume_pre(struct snd_soc_card *card) static struct snd_soc_card zylonite = { .name = "Zylonite", + .owner = THIS_MODULE, .probe = &zylonite_probe, .remove = &zylonite_remove, .suspend_post = &zylonite_suspend_post, -- cgit v1.2.3