diff --git a/[refs] b/[refs] index 046afaa401e5..8148f334b202 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 57512c6432783c9695ef54f875f705584c65c733 +refs/heads/master: f9ede4eca01cc64ce37549c282b6fde727c0ec84 diff --git a/trunk/arch/arm/mach-s3c6400/include/mach/map.h b/trunk/arch/arm/mach-s3c6400/include/mach/map.h index 866be31872a5..fc8b223bad4f 100644 --- a/trunk/arch/arm/mach-s3c6400/include/mach/map.h +++ b/trunk/arch/arm/mach-s3c6400/include/mach/map.h @@ -48,8 +48,6 @@ #define S3C64XX_PA_IIS1 (0x7F003000) #define S3C64XX_PA_TIMER (0x7F006000) #define S3C64XX_PA_IIC0 (0x7F004000) -#define S3C64XX_PA_PCM0 (0x7F009000) -#define S3C64XX_PA_PCM1 (0x7F00A000) #define S3C64XX_PA_IISV4 (0x7F00D000) #define S3C64XX_PA_IIC1 (0x7F00F000) diff --git a/trunk/arch/arm/plat-s3c/include/plat/audio.h b/trunk/arch/arm/plat-s3c/include/plat/audio.h deleted file mode 100644 index f22d23bb6271..000000000000 --- a/trunk/arch/arm/plat-s3c/include/plat/audio.h +++ /dev/null @@ -1,17 +0,0 @@ -/* arch/arm/plat-s3c/include/plat/audio.h - * - * Copyright (c) 2009 Samsung Electronics Co. Ltd - * Author: Jaswinder Singh - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -/** - * struct s3c_audio_pdata - common platform data for audio device drivers - * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode - */ -struct s3c_audio_pdata { - int (*cfg_gpio)(struct platform_device *); -}; diff --git a/trunk/arch/arm/plat-s3c/include/plat/devs.h b/trunk/arch/arm/plat-s3c/include/plat/devs.h index 932cbbbb4273..0f540ea1e999 100644 --- a/trunk/arch/arm/plat-s3c/include/plat/devs.h +++ b/trunk/arch/arm/plat-s3c/include/plat/devs.h @@ -28,9 +28,6 @@ extern struct platform_device s3c64xx_device_iis0; extern struct platform_device s3c64xx_device_iis1; extern struct platform_device s3c64xx_device_iisv4; -extern struct platform_device s3c64xx_device_pcm0; -extern struct platform_device s3c64xx_device_pcm1; - extern struct platform_device s3c_device_fb; extern struct platform_device s3c_device_usb; extern struct platform_device s3c_device_lcd; diff --git a/trunk/arch/arm/plat-s3c64xx/dev-audio.c b/trunk/arch/arm/plat-s3c64xx/dev-audio.c index 9e07344913d9..1322beb40dd7 100644 --- a/trunk/arch/arm/plat-s3c64xx/dev-audio.c +++ b/trunk/arch/arm/plat-s3c64xx/dev-audio.c @@ -15,14 +15,9 @@ #include #include -#include -#include #include -#include -#include -#include -#include + static struct resource s3c64xx_iis0_resource[] = { [0] = { @@ -71,97 +66,3 @@ struct platform_device s3c64xx_device_iisv4 = { .resource = s3c64xx_iisv4_resource, }; EXPORT_SYMBOL(s3c64xx_device_iisv4); - - -/* PCM Controller platform_devices */ - -static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) -{ - switch (pdev->id) { - case 0: - s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK); - s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC); - s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN); - s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT); - break; - case 1: - s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK); - s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC); - s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN); - s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT); - break; - default: - printk(KERN_DEBUG "Invalid PCM Controller number!"); - return -EINVAL; - } - - return 0; -} - -static struct resource s3c64xx_pcm0_resource[] = { - [0] = { - .start = S3C64XX_PA_PCM0, - .end = S3C64XX_PA_PCM0 + 0x100 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = DMACH_PCM0_TX, - .end = DMACH_PCM0_TX, - .flags = IORESOURCE_DMA, - }, - [2] = { - .start = DMACH_PCM0_RX, - .end = DMACH_PCM0_RX, - .flags = IORESOURCE_DMA, - }, -}; - -struct s3c_audio_pdata s3c_pcm0_pdata = { - .cfg_gpio = s3c64xx_pcm_cfg_gpio, -}; - -struct platform_device s3c64xx_device_pcm0 = { - .name = "samsung-pcm", - .id = 0, - .num_resources = ARRAY_SIZE(s3c64xx_pcm0_resource), - .resource = s3c64xx_pcm0_resource, - .dev = { - .platform_data = &s3c_pcm0_pdata, - }, -}; -EXPORT_SYMBOL(s3c64xx_device_pcm0); - -static struct resource s3c64xx_pcm1_resource[] = { - [0] = { - .start = S3C64XX_PA_PCM1, - .end = S3C64XX_PA_PCM1 + 0x100 - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = DMACH_PCM1_TX, - .end = DMACH_PCM1_TX, - .flags = IORESOURCE_DMA, - }, - [2] = { - .start = DMACH_PCM1_RX, - .end = DMACH_PCM1_RX, - .flags = IORESOURCE_DMA, - }, -}; - -struct s3c_audio_pdata s3c_pcm1_pdata = { - .cfg_gpio = s3c64xx_pcm_cfg_gpio, -}; - -struct platform_device s3c64xx_device_pcm1 = { - .name = "samsung-pcm", - .id = 1, - .num_resources = ARRAY_SIZE(s3c64xx_pcm1_resource), - .resource = s3c64xx_pcm1_resource, - .dev = { - .platform_data = &s3c_pcm1_pdata, - }, -}; -EXPORT_SYMBOL(s3c64xx_device_pcm1); diff --git a/trunk/sound/soc/codecs/ad1836.c b/trunk/sound/soc/codecs/ad1836.c index 2c18e3d1b71e..b4be96decf32 100644 --- a/trunk/sound/soc/codecs/ad1836.c +++ b/trunk/sound/soc/codecs/ad1836.c @@ -385,6 +385,7 @@ static int ad1836_probe(struct platform_device *pdev) snd_soc_dapm_new_controls(codec, ad1836_dapm_widgets, ARRAY_SIZE(ad1836_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); + snd_soc_dapm_new_widgets(codec); pcm_err: return ret; diff --git a/trunk/sound/soc/codecs/ad1938.c b/trunk/sound/soc/codecs/ad1938.c index 5d489186c05b..3b2222a0c808 100644 --- a/trunk/sound/soc/codecs/ad1938.c +++ b/trunk/sound/soc/codecs/ad1938.c @@ -592,6 +592,7 @@ static int ad1938_probe(struct platform_device *pdev) snd_soc_dapm_new_controls(codec, ad1938_dapm_widgets, ARRAY_SIZE(ad1938_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); + snd_soc_dapm_new_widgets(codec); ad1938_set_bias_level(codec, SND_SOC_BIAS_STANDBY); diff --git a/trunk/sound/soc/codecs/ak4535.c b/trunk/sound/soc/codecs/ak4535.c index ff966567e2ba..57a6846a9a1f 100644 --- a/trunk/sound/soc/codecs/ak4535.c +++ b/trunk/sound/soc/codecs/ak4535.c @@ -294,6 +294,7 @@ static int ak4535_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/ak4671.c b/trunk/sound/soc/codecs/ak4671.c index 82fca284d007..364832ccd748 100644 --- a/trunk/sound/soc/codecs/ak4671.c +++ b/trunk/sound/soc/codecs/ak4671.c @@ -441,6 +441,7 @@ static int ak4671_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/cx20442.c b/trunk/sound/soc/codecs/cx20442.c index e000cdfec1ec..dda751c885cb 100644 --- a/trunk/sound/soc/codecs/cx20442.c +++ b/trunk/sound/soc/codecs/cx20442.c @@ -93,6 +93,7 @@ static int cx20442_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, cx20442_audio_map, ARRAY_SIZE(cx20442_audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/ssm2602.c b/trunk/sound/soc/codecs/ssm2602.c index d2ff1cde6883..b3130339d29a 100644 --- a/trunk/sound/soc/codecs/ssm2602.c +++ b/trunk/sound/soc/codecs/ssm2602.c @@ -210,6 +210,7 @@ static int ssm2602_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_conn, ARRAY_SIZE(audio_conn)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/tlv320aic23.c b/trunk/sound/soc/codecs/tlv320aic23.c index 1709e3f614a8..ee8cb2c08b87 100644 --- a/trunk/sound/soc/codecs/tlv320aic23.c +++ b/trunk/sound/soc/codecs/tlv320aic23.c @@ -395,6 +395,7 @@ static int tlv320aic23_add_widgets(struct snd_soc_codec *codec) /* set up audio path interconnects */ snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/tlv320aic3x.c b/trunk/sound/soc/codecs/tlv320aic3x.c index 2b4dc2b0b017..03cad250f58d 100644 --- a/trunk/sound/soc/codecs/tlv320aic3x.c +++ b/trunk/sound/soc/codecs/tlv320aic3x.c @@ -753,6 +753,7 @@ static int aic3x_add_widgets(struct snd_soc_codec *codec) /* set up audio path interconnects */ snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/tlv320dac33.c b/trunk/sound/soc/codecs/tlv320dac33.c index 2a013e46ae14..bff476d65d05 100644 --- a/trunk/sound/soc/codecs/tlv320dac33.c +++ b/trunk/sound/soc/codecs/tlv320dac33.c @@ -462,6 +462,7 @@ static int dac33_add_widgets(struct snd_soc_codec *codec) /* set up audio path interconnects */ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/twl4030.c b/trunk/sound/soc/codecs/twl4030.c index 5f1681f6ca76..510b8b226f96 100644 --- a/trunk/sound/soc/codecs/twl4030.c +++ b/trunk/sound/soc/codecs/twl4030.c @@ -1493,6 +1493,7 @@ static int twl4030_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/uda1380.c b/trunk/sound/soc/codecs/uda1380.c index a2763c2e7348..a42e47d94630 100644 --- a/trunk/sound/soc/codecs/uda1380.c +++ b/trunk/sound/soc/codecs/uda1380.c @@ -378,6 +378,7 @@ static int uda1380_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8350.c b/trunk/sound/soc/codecs/wm8350.c index f82125d9e85a..2e35a354b166 100644 --- a/trunk/sound/soc/codecs/wm8350.c +++ b/trunk/sound/soc/codecs/wm8350.c @@ -800,7 +800,7 @@ static int wm8350_add_widgets(struct snd_soc_codec *codec) return ret; } - return 0; + return snd_soc_dapm_new_widgets(codec); } static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, diff --git a/trunk/sound/soc/codecs/wm8400.c b/trunk/sound/soc/codecs/wm8400.c index b432f4d4a324..584af68af22a 100644 --- a/trunk/sound/soc/codecs/wm8400.c +++ b/trunk/sound/soc/codecs/wm8400.c @@ -915,6 +915,7 @@ static int wm8400_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8510.c b/trunk/sound/soc/codecs/wm8510.c index 265e68c75df8..e3c21ebcc08e 100644 --- a/trunk/sound/soc/codecs/wm8510.c +++ b/trunk/sound/soc/codecs/wm8510.c @@ -219,6 +219,7 @@ static int wm8510_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8523.c b/trunk/sound/soc/codecs/wm8523.c index d3a61d7ea0c5..2e2b01d6c82b 100644 --- a/trunk/sound/soc/codecs/wm8523.c +++ b/trunk/sound/soc/codecs/wm8523.c @@ -117,6 +117,7 @@ static int wm8523_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8580.c b/trunk/sound/soc/codecs/wm8580.c index d077df6f5e75..dde50d118181 100644 --- a/trunk/sound/soc/codecs/wm8580.c +++ b/trunk/sound/soc/codecs/wm8580.c @@ -315,6 +315,7 @@ static int wm8580_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8711.c b/trunk/sound/soc/codecs/wm8711.c index 24a35603bcf7..70e0675b5d4a 100644 --- a/trunk/sound/soc/codecs/wm8711.c +++ b/trunk/sound/soc/codecs/wm8711.c @@ -99,6 +99,7 @@ static int wm8711_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8728.c b/trunk/sound/soc/codecs/wm8728.c index 3fb653ba363a..1252a8a486a6 100644 --- a/trunk/sound/soc/codecs/wm8728.c +++ b/trunk/sound/soc/codecs/wm8728.c @@ -74,6 +74,8 @@ static int wm8728_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); + return 0; } diff --git a/trunk/sound/soc/codecs/wm8731.c b/trunk/sound/soc/codecs/wm8731.c index 3a497810f939..e3675e7a9813 100644 --- a/trunk/sound/soc/codecs/wm8731.c +++ b/trunk/sound/soc/codecs/wm8731.c @@ -159,6 +159,7 @@ static int wm8731_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8750.c b/trunk/sound/soc/codecs/wm8750.c index 475c67ac7818..50a3d6590588 100644 --- a/trunk/sound/soc/codecs/wm8750.c +++ b/trunk/sound/soc/codecs/wm8750.c @@ -403,6 +403,7 @@ static int wm8750_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8753.c b/trunk/sound/soc/codecs/wm8753.c index d6850dacda29..c652bc04cc81 100644 --- a/trunk/sound/soc/codecs/wm8753.c +++ b/trunk/sound/soc/codecs/wm8753.c @@ -673,6 +673,7 @@ static int wm8753_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8900.c b/trunk/sound/soc/codecs/wm8900.c index c9438dd62df3..85f67dbe211d 100644 --- a/trunk/sound/soc/codecs/wm8900.c +++ b/trunk/sound/soc/codecs/wm8900.c @@ -618,6 +618,8 @@ static int wm8900_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); + return 0; } diff --git a/trunk/sound/soc/codecs/wm8903.c b/trunk/sound/soc/codecs/wm8903.c index b8cae1758642..bfeff4ee5de9 100644 --- a/trunk/sound/soc/codecs/wm8903.c +++ b/trunk/sound/soc/codecs/wm8903.c @@ -919,6 +919,8 @@ static int wm8903_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon)); + snd_soc_dapm_new_widgets(codec); + return 0; } diff --git a/trunk/sound/soc/codecs/wm8940.c b/trunk/sound/soc/codecs/wm8940.c index 3d850b97037a..fc80aa6c913c 100644 --- a/trunk/sound/soc/codecs/wm8940.c +++ b/trunk/sound/soc/codecs/wm8940.c @@ -298,6 +298,7 @@ static int wm8940_add_widgets(struct snd_soc_codec *codec) ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); if (ret) goto error_ret; + ret = snd_soc_dapm_new_widgets(codec); error_ret: return ret; diff --git a/trunk/sound/soc/codecs/wm8960.c b/trunk/sound/soc/codecs/wm8960.c index d07bcc1e1c60..40390afa75f3 100644 --- a/trunk/sound/soc/codecs/wm8960.c +++ b/trunk/sound/soc/codecs/wm8960.c @@ -307,6 +307,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8961.c b/trunk/sound/soc/codecs/wm8961.c index a8007d58813f..07e389574db1 100644 --- a/trunk/sound/soc/codecs/wm8961.c +++ b/trunk/sound/soc/codecs/wm8961.c @@ -986,6 +986,7 @@ static int wm8961_probe(struct platform_device *pdev) snd_soc_dapm_new_controls(codec, wm8961_dapm_widgets, ARRAY_SIZE(wm8961_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); + snd_soc_dapm_new_widgets(codec); return ret; diff --git a/trunk/sound/soc/codecs/wm8971.c b/trunk/sound/soc/codecs/wm8971.c index d9540d55fc89..56a66e89ab91 100644 --- a/trunk/sound/soc/codecs/wm8971.c +++ b/trunk/sound/soc/codecs/wm8971.c @@ -338,6 +338,8 @@ static int wm8971_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); + return 0; } diff --git a/trunk/sound/soc/codecs/wm8974.c b/trunk/sound/soc/codecs/wm8974.c index 81c57b5c591c..c245f0ee0ec2 100644 --- a/trunk/sound/soc/codecs/wm8974.c +++ b/trunk/sound/soc/codecs/wm8974.c @@ -276,6 +276,7 @@ static int wm8974_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8988.c b/trunk/sound/soc/codecs/wm8988.c index 2862e4dced27..bee292e37d1b 100644 --- a/trunk/sound/soc/codecs/wm8988.c +++ b/trunk/sound/soc/codecs/wm8988.c @@ -790,6 +790,7 @@ static int wm8988_probe(struct platform_device *pdev) snd_soc_dapm_new_controls(codec, wm8988_dapm_widgets, ARRAY_SIZE(wm8988_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return ret; diff --git a/trunk/sound/soc/codecs/wm8990.c b/trunk/sound/soc/codecs/wm8990.c index 341481e0e830..e43cb2c8b915 100644 --- a/trunk/sound/soc/codecs/wm8990.c +++ b/trunk/sound/soc/codecs/wm8990.c @@ -920,6 +920,7 @@ static int wm8990_add_widgets(struct snd_soc_codec *codec) /* set up the WM8990 audio map */ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm8993.c b/trunk/sound/soc/codecs/wm8993.c index 5e32f2ed5fc2..0d4d2be92b64 100644 --- a/trunk/sound/soc/codecs/wm8993.c +++ b/trunk/sound/soc/codecs/wm8993.c @@ -1464,6 +1464,8 @@ static int wm8993_probe(struct platform_device *pdev) wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff, wm8993->pdata.lineout2_diff); + snd_soc_dapm_new_widgets(codec); + return ret; err: diff --git a/trunk/sound/soc/codecs/wm9081.c b/trunk/sound/soc/codecs/wm9081.c index c468497314ba..3f1f84421312 100644 --- a/trunk/sound/soc/codecs/wm9081.c +++ b/trunk/sound/soc/codecs/wm9081.c @@ -1262,6 +1262,7 @@ static int wm9081_probe(struct platform_device *pdev) snd_soc_dapm_new_controls(codec, wm9081_dapm_widgets, ARRAY_SIZE(wm9081_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); + snd_soc_dapm_new_widgets(codec); return ret; diff --git a/trunk/sound/soc/codecs/wm9705.c b/trunk/sound/soc/codecs/wm9705.c index dfffc6c778c0..0e817b8705cd 100644 --- a/trunk/sound/soc/codecs/wm9705.c +++ b/trunk/sound/soc/codecs/wm9705.c @@ -205,6 +205,7 @@ static int wm9705_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_new_controls(codec, wm9705_dapm_widgets, ARRAY_SIZE(wm9705_dapm_widgets)); snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm9712.c b/trunk/sound/soc/codecs/wm9712.c index 2a0872273007..155cacf124ea 100644 --- a/trunk/sound/soc/codecs/wm9712.c +++ b/trunk/sound/soc/codecs/wm9712.c @@ -436,6 +436,7 @@ static int wm9712_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/codecs/wm9713.c b/trunk/sound/soc/codecs/wm9713.c index 00bac315fb3b..5f81ecd20a81 100644 --- a/trunk/sound/soc/codecs/wm9713.c +++ b/trunk/sound/soc/codecs/wm9713.c @@ -625,6 +625,7 @@ static int wm9713_add_widgets(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); + snd_soc_dapm_new_widgets(codec); return 0; } diff --git a/trunk/sound/soc/davinci/davinci-i2s.c b/trunk/sound/soc/davinci/davinci-i2s.c index d336786683b4..2ab809359c08 100644 --- a/trunk/sound/soc/davinci/davinci-i2s.c +++ b/trunk/sound/soc/davinci/davinci-i2s.c @@ -98,6 +98,11 @@ enum { }; struct davinci_mcbsp_dev { + /* + * dma_params must be first because rtd->dai->cpu_dai->private_data + * is cast to a pointer of an array of struct davinci_pcm_dma_params in + * davinci_pcm_open. + */ struct davinci_pcm_dma_params dma_params[2]; void __iomem *base; #define MOD_DSP_A 0 @@ -544,7 +549,6 @@ static int davinci_i2s_probe(struct platform_device *pdev) dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; davinci_i2s_dai.private_data = dev; - davinci_i2s_dai.dma_data = dev->dma_params; ret = snd_soc_register_dai(&davinci_i2s_dai); if (ret != 0) goto err_free_mem; diff --git a/trunk/sound/soc/davinci/davinci-mcasp.c b/trunk/sound/soc/davinci/davinci-mcasp.c index 0a302e1080d9..50ad0519a8fa 100644 --- a/trunk/sound/soc/davinci/davinci-mcasp.c +++ b/trunk/sound/soc/davinci/davinci-mcasp.c @@ -904,7 +904,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev) dma_data->channel = res->start; davinci_mcasp_dai[pdata->op_mode].private_data = dev; - davinci_mcasp_dai[pdata->op_mode].dma_data = dev->dma_params; davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev; ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]); diff --git a/trunk/sound/soc/davinci/davinci-mcasp.h b/trunk/sound/soc/davinci/davinci-mcasp.h index 582c9249ef09..9d179cc88f7b 100644 --- a/trunk/sound/soc/davinci/davinci-mcasp.h +++ b/trunk/sound/soc/davinci/davinci-mcasp.h @@ -39,6 +39,11 @@ enum { }; struct davinci_audio_dev { + /* + * dma_params must be first because rtd->dai->cpu_dai->private_data + * is cast to a pointer of an array of struct davinci_pcm_dma_params in + * davinci_pcm_open. + */ struct davinci_pcm_dma_params dma_params[2]; void __iomem *base; int sample_rate; diff --git a/trunk/sound/soc/davinci/davinci-pcm.c b/trunk/sound/soc/davinci/davinci-pcm.c index 187ee965bf0b..fb10f1d63fdb 100644 --- a/trunk/sound/soc/davinci/davinci-pcm.c +++ b/trunk/sound/soc/davinci/davinci-pcm.c @@ -253,11 +253,10 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) struct davinci_runtime_data *prtd; int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->dma_data; - struct davinci_pcm_dma_params *params; - if (!pa) + struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data; + struct davinci_pcm_dma_params *params = &pa[substream->stream]; + if (!params) return -ENODEV; - params = &pa[substream->stream]; snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); /* ensure that buffer size is a multiple of period size */ diff --git a/trunk/sound/soc/omap/Kconfig b/trunk/sound/soc/omap/Kconfig index 4dc6b15a852f..bb5731a22bed 100644 --- a/trunk/sound/soc/omap/Kconfig +++ b/trunk/sound/soc/omap/Kconfig @@ -43,13 +43,12 @@ config SND_OMAP_SOC_OSK5912 Say Y if you want to add support for SoC audio on osk5912. config SND_OMAP_SOC_OVERO - tristate "SoC Audio support for Gumstix Overo and CompuLab CM-T35" - depends on TWL4030_CORE && SND_OMAP_SOC && (MACH_OVERO || MACH_CM_T35) + tristate "SoC Audio support for Gumstix Overo" + depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OVERO select SND_OMAP_SOC_MCBSP select SND_SOC_TWL4030 help - Say Y if you want to add support for SoC audio on the - Gumstix Overo or CompuLab CM-T35 + Say Y if you want to add support for SoC audio on the Gumstix Overo. config SND_OMAP_SOC_OMAP2EVM tristate "SoC Audio support for OMAP2EVM board" diff --git a/trunk/sound/soc/omap/overo.c b/trunk/sound/soc/omap/overo.c index 97a4d6308bd6..ec4f8fd8b3a2 100644 --- a/trunk/sound/soc/omap/overo.c +++ b/trunk/sound/soc/omap/overo.c @@ -107,8 +107,8 @@ static int __init overo_soc_init(void) { int ret; - if (!(machine_is_overo() || machine_is_cm_t35())) { - pr_debug("Incomatible machine!\n"); + if (!machine_is_overo()) { + pr_debug("Not Overo!\n"); return -ENODEV; } printk(KERN_INFO "overo SoC init\n"); diff --git a/trunk/sound/soc/s3c24xx/Kconfig b/trunk/sound/soc/s3c24xx/Kconfig index b489f1ae103d..d7912f1e4627 100644 --- a/trunk/sound/soc/s3c24xx/Kconfig +++ b/trunk/sound/soc/s3c24xx/Kconfig @@ -24,9 +24,6 @@ config SND_S3C64XX_SOC_I2S select SND_S3C_I2SV2_SOC select S3C64XX_DMA -config SND_S3C_SOC_PCM - tristate - config SND_S3C2443_SOC_AC97 tristate select S3C2410_DMA diff --git a/trunk/sound/soc/s3c24xx/Makefile b/trunk/sound/soc/s3c24xx/Makefile index b744657733d7..7790406f90b7 100644 --- a/trunk/sound/soc/s3c24xx/Makefile +++ b/trunk/sound/soc/s3c24xx/Makefile @@ -1,11 +1,10 @@ # S3c24XX Platform Support -snd-soc-s3c24xx-objs := s3c-dma.o +snd-soc-s3c24xx-objs := s3c24xx-pcm.o snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o snd-soc-s3c2412-i2s-objs := s3c2412-i2s.o snd-soc-s3c64xx-i2s-objs := s3c64xx-i2s.o snd-soc-s3c2443-ac97-objs := s3c2443-ac97.o snd-soc-s3c-i2s-v2-objs := s3c-i2s-v2.o -snd-soc-s3c-pcm-objs := s3c-pcm.o obj-$(CONFIG_SND_S3C24XX_SOC) += snd-soc-s3c24xx.o obj-$(CONFIG_SND_S3C24XX_SOC_I2S) += snd-soc-s3c24xx-i2s.o @@ -13,7 +12,6 @@ obj-$(CONFIG_SND_S3C2443_SOC_AC97) += snd-soc-s3c2443-ac97.o obj-$(CONFIG_SND_S3C2412_SOC_I2S) += snd-soc-s3c2412-i2s.o obj-$(CONFIG_SND_S3C64XX_SOC_I2S) += snd-soc-s3c64xx-i2s.o obj-$(CONFIG_SND_S3C_I2SV2_SOC) += snd-soc-s3c-i2s-v2.o -obj-$(CONFIG_SND_S3C_SOC_PCM) += snd-soc-s3c-pcm.o # S3C24XX Machine Support snd-soc-jive-wm8750-objs := jive_wm8750.o diff --git a/trunk/sound/soc/s3c24xx/jive_wm8750.c b/trunk/sound/soc/s3c24xx/jive_wm8750.c index 59dc2c6b56d9..93e6c87b7399 100644 --- a/trunk/sound/soc/s3c24xx/jive_wm8750.c +++ b/trunk/sound/soc/s3c24xx/jive_wm8750.c @@ -25,7 +25,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c2412-i2s.h" #include "../codecs/wm8750.h" diff --git a/trunk/sound/soc/s3c24xx/ln2440sbc_alc650.c b/trunk/sound/soc/s3c24xx/ln2440sbc_alc650.c index d00d359a03e6..12c71482d258 100644 --- a/trunk/sound/soc/s3c24xx/ln2440sbc_alc650.c +++ b/trunk/sound/soc/s3c24xx/ln2440sbc_alc650.c @@ -24,7 +24,7 @@ #include #include "../codecs/ac97.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-ac97.h" static struct snd_soc_card ln2440sbc; diff --git a/trunk/sound/soc/s3c24xx/neo1973_gta02_wm8753.c b/trunk/sound/soc/s3c24xx/neo1973_gta02_wm8753.c index dea83d30a5c9..26409a9cef9e 100644 --- a/trunk/sound/soc/s3c24xx/neo1973_gta02_wm8753.c +++ b/trunk/sound/soc/s3c24xx/neo1973_gta02_wm8753.c @@ -32,7 +32,7 @@ #include #include #include "../codecs/wm8753.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" static struct snd_soc_card neo1973_gta02; diff --git a/trunk/sound/soc/s3c24xx/neo1973_wm8753.c b/trunk/sound/soc/s3c24xx/neo1973_wm8753.c index 0cb4f86f6d1e..77de6c5127d2 100644 --- a/trunk/sound/soc/s3c24xx/neo1973_wm8753.c +++ b/trunk/sound/soc/s3c24xx/neo1973_wm8753.c @@ -36,7 +36,7 @@ #include "../codecs/wm8753.h" #include "lm4857.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" /* define the scenarios */ diff --git a/trunk/sound/soc/s3c24xx/s3c-i2s-v2.c b/trunk/sound/soc/s3c24xx/s3c-i2s-v2.c index e994d8374fe6..28b0ab255096 100644 --- a/trunk/sound/soc/s3c24xx/s3c-i2s-v2.c +++ b/trunk/sound/soc/s3c24xx/s3c-i2s-v2.c @@ -35,7 +35,7 @@ #include #include "s3c-i2s-v2.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #undef S3C_IIS_V2_SUPPORTED @@ -394,7 +394,7 @@ static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd, int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); unsigned long irqs; int ret = 0; - int channel = ((struct s3c_dma_params *) + int channel = ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->channel; pr_debug("Entered %s\n", __func__); diff --git a/trunk/sound/soc/s3c24xx/s3c-i2s-v2.h b/trunk/sound/soc/s3c24xx/s3c-i2s-v2.h index ecf8eaaed1db..f66854a77fb2 100644 --- a/trunk/sound/soc/s3c24xx/s3c-i2s-v2.h +++ b/trunk/sound/soc/s3c24xx/s3c-i2s-v2.h @@ -49,8 +49,8 @@ struct s3c_i2sv2_info { unsigned char master; - struct s3c_dma_params *dma_playback; - struct s3c_dma_params *dma_capture; + struct s3c24xx_pcm_dma_params *dma_playback; + struct s3c24xx_pcm_dma_params *dma_capture; u32 suspend_iismod; u32 suspend_iiscon; diff --git a/trunk/sound/soc/s3c24xx/s3c-pcm.c b/trunk/sound/soc/s3c24xx/s3c-pcm.c deleted file mode 100644 index 9e61a7c2d9ac..000000000000 --- a/trunk/sound/soc/s3c24xx/s3c-pcm.c +++ /dev/null @@ -1,552 +0,0 @@ -/* sound/soc/s3c24xx/s3c-pcm.c - * - * ALSA SoC Audio Layer - S3C PCM-Controller driver - * - * Copyright (c) 2009 Samsung Electronics Co. Ltd - * Author: Jaswinder Singh - * based upon I2S drivers by Ben Dooks. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "s3c-dma.h" -#include "s3c-pcm.h" - -static struct s3c2410_dma_client s3c_pcm_dma_client_out = { - .name = "PCM Stereo out" -}; - -static struct s3c2410_dma_client s3c_pcm_dma_client_in = { - .name = "PCM Stereo in" -}; - -static struct s3c_dma_params s3c_pcm_stereo_out[] = { - [0] = { - .client = &s3c_pcm_dma_client_out, - .dma_size = 4, - }, - [1] = { - .client = &s3c_pcm_dma_client_out, - .dma_size = 4, - }, -}; - -static struct s3c_dma_params s3c_pcm_stereo_in[] = { - [0] = { - .client = &s3c_pcm_dma_client_in, - .dma_size = 4, - }, - [1] = { - .client = &s3c_pcm_dma_client_in, - .dma_size = 4, - }, -}; - -static struct s3c_pcm_info s3c_pcm[2]; - -static inline struct s3c_pcm_info *to_info(struct snd_soc_dai *cpu_dai) -{ - return cpu_dai->private_data; -} - -static void s3c_pcm_snd_txctrl(struct s3c_pcm_info *pcm, int on) -{ - void __iomem *regs = pcm->regs; - u32 ctl, clkctl; - - clkctl = readl(regs + S3C_PCM_CLKCTL); - ctl = readl(regs + S3C_PCM_CTL); - ctl &= ~(S3C_PCM_CTL_TXDIPSTICK_MASK - << S3C_PCM_CTL_TXDIPSTICK_SHIFT); - - if (on) { - ctl |= S3C_PCM_CTL_TXDMA_EN; - ctl |= S3C_PCM_CTL_TXFIFO_EN; - ctl |= S3C_PCM_CTL_ENABLE; - ctl |= (0x20<idleclk) - clkctl |= S3C_PCM_CLKCTL_SERCLK_EN; - } - } - - writel(clkctl, regs + S3C_PCM_CLKCTL); - writel(ctl, regs + S3C_PCM_CTL); -} - -static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on) -{ - void __iomem *regs = pcm->regs; - u32 ctl, clkctl; - - ctl = readl(regs + S3C_PCM_CTL); - clkctl = readl(regs + S3C_PCM_CLKCTL); - - if (on) { - ctl |= S3C_PCM_CTL_RXDMA_EN; - ctl |= S3C_PCM_CTL_RXFIFO_EN; - ctl |= S3C_PCM_CTL_ENABLE; - clkctl |= S3C_PCM_CLKCTL_SERCLK_EN; - } else { - ctl &= ~S3C_PCM_CTL_RXDMA_EN; - ctl &= ~S3C_PCM_CTL_RXFIFO_EN; - - if (!(ctl & S3C_PCM_CTL_TXFIFO_EN)) { - ctl &= ~S3C_PCM_CTL_ENABLE; - if (!pcm->idleclk) - clkctl |= S3C_PCM_CLKCTL_SERCLK_EN; - } - } - - writel(clkctl, regs + S3C_PCM_CLKCTL); - writel(ctl, regs + S3C_PCM_CTL); -} - -static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, - struct snd_soc_dai *dai) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct s3c_pcm_info *pcm = to_info(rtd->dai->cpu_dai); - unsigned long flags; - - dev_dbg(pcm->dev, "Entered %s\n", __func__); - - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_RESUME: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - spin_lock_irqsave(&pcm->lock, flags); - - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) - s3c_pcm_snd_rxctrl(pcm, 1); - else - s3c_pcm_snd_txctrl(pcm, 1); - - spin_unlock_irqrestore(&pcm->lock, flags); - break; - - case SNDRV_PCM_TRIGGER_STOP: - case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - spin_lock_irqsave(&pcm->lock, flags); - - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) - s3c_pcm_snd_rxctrl(pcm, 0); - else - s3c_pcm_snd_txctrl(pcm, 0); - - spin_unlock_irqrestore(&pcm->lock, flags); - break; - - default: - return -EINVAL; - } - - return 0; -} - -static int s3c_pcm_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct snd_soc_dai *socdai) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai_link *dai = rtd->dai; - struct s3c_pcm_info *pcm = to_info(dai->cpu_dai); - void __iomem *regs = pcm->regs; - struct clk *clk; - int sclk_div, sync_div; - unsigned long flags; - u32 clkctl; - - dev_dbg(pcm->dev, "Entered %s\n", __func__); - - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - dai->cpu_dai->dma_data = pcm->dma_playback; - else - dai->cpu_dai->dma_data = pcm->dma_capture; - - /* Strictly check for sample size */ - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: - break; - default: - return -EINVAL; - } - - spin_lock_irqsave(&pcm->lock, flags); - - /* Get hold of the PCMSOURCE_CLK */ - clkctl = readl(regs + S3C_PCM_CLKCTL); - if (clkctl & S3C_PCM_CLKCTL_SERCLKSEL_PCLK) - clk = pcm->pclk; - else - clk = pcm->cclk; - - /* Set the SCLK divider */ - sclk_div = clk_get_rate(clk) / pcm->sclk_per_fs / - params_rate(params) / 2 - 1; - - clkctl &= ~(S3C_PCM_CLKCTL_SCLKDIV_MASK - << S3C_PCM_CLKCTL_SCLKDIV_SHIFT); - clkctl |= ((sclk_div & S3C_PCM_CLKCTL_SCLKDIV_MASK) - << S3C_PCM_CLKCTL_SCLKDIV_SHIFT); - - /* Set the SYNC divider */ - sync_div = pcm->sclk_per_fs - 1; - - clkctl &= ~(S3C_PCM_CLKCTL_SYNCDIV_MASK - << S3C_PCM_CLKCTL_SYNCDIV_SHIFT); - clkctl |= ((sync_div & S3C_PCM_CLKCTL_SYNCDIV_MASK) - << S3C_PCM_CLKCTL_SYNCDIV_SHIFT); - - writel(clkctl, regs + S3C_PCM_CLKCTL); - - spin_unlock_irqrestore(&pcm->lock, flags); - - dev_dbg(pcm->dev, "PCMSOURCE_CLK-%lu SCLK=%ufs \ - SCLK_DIV=%d SYNC_DIV=%d\n", - clk_get_rate(clk), pcm->sclk_per_fs, - sclk_div, sync_div); - - return 0; -} - -static int s3c_pcm_set_fmt(struct snd_soc_dai *cpu_dai, - unsigned int fmt) -{ - struct s3c_pcm_info *pcm = to_info(cpu_dai); - void __iomem *regs = pcm->regs; - unsigned long flags; - int ret = 0; - u32 ctl; - - dev_dbg(pcm->dev, "Entered %s\n", __func__); - - spin_lock_irqsave(&pcm->lock, flags); - - ctl = readl(regs + S3C_PCM_CTL); - - switch (fmt & SND_SOC_DAIFMT_INV_MASK) { - case SND_SOC_DAIFMT_NB_NF: - /* Nothing to do, NB_NF by default */ - break; - default: - dev_err(pcm->dev, "Unsupported clock inversion!\n"); - ret = -EINVAL; - goto exit; - } - - switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBS_CFS: - /* Nothing to do, Master by default */ - break; - default: - dev_err(pcm->dev, "Unsupported master/slave format!\n"); - ret = -EINVAL; - goto exit; - } - - switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) { - case SND_SOC_DAIFMT_CONT: - pcm->idleclk = 1; - break; - case SND_SOC_DAIFMT_GATED: - pcm->idleclk = 0; - break; - default: - dev_err(pcm->dev, "Invalid Clock gating request!\n"); - ret = -EINVAL; - goto exit; - } - - switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { - case SND_SOC_DAIFMT_DSP_A: - ctl |= S3C_PCM_CTL_TXMSB_AFTER_FSYNC; - ctl |= S3C_PCM_CTL_RXMSB_AFTER_FSYNC; - break; - case SND_SOC_DAIFMT_DSP_B: - ctl &= ~S3C_PCM_CTL_TXMSB_AFTER_FSYNC; - ctl &= ~S3C_PCM_CTL_RXMSB_AFTER_FSYNC; - break; - default: - dev_err(pcm->dev, "Unsupported data format!\n"); - ret = -EINVAL; - goto exit; - } - - writel(ctl, regs + S3C_PCM_CTL); - -exit: - spin_unlock_irqrestore(&pcm->lock, flags); - - return ret; -} - -static int s3c_pcm_set_clkdiv(struct snd_soc_dai *cpu_dai, - int div_id, int div) -{ - struct s3c_pcm_info *pcm = to_info(cpu_dai); - - switch (div_id) { - case S3C_PCM_SCLK_PER_FS: - pcm->sclk_per_fs = div; - break; - - default: - return -EINVAL; - } - - return 0; -} - -static int s3c_pcm_set_sysclk(struct snd_soc_dai *cpu_dai, - int clk_id, unsigned int freq, int dir) -{ - struct s3c_pcm_info *pcm = to_info(cpu_dai); - void __iomem *regs = pcm->regs; - u32 clkctl = readl(regs + S3C_PCM_CLKCTL); - - switch (clk_id) { - case S3C_PCM_CLKSRC_PCLK: - clkctl |= S3C_PCM_CLKCTL_SERCLKSEL_PCLK; - break; - - case S3C_PCM_CLKSRC_MUX: - clkctl &= ~S3C_PCM_CLKCTL_SERCLKSEL_PCLK; - - if (clk_get_rate(pcm->cclk) != freq) - clk_set_rate(pcm->cclk, freq); - - break; - - default: - return -EINVAL; - } - - writel(clkctl, regs + S3C_PCM_CLKCTL); - - return 0; -} - -static 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, - .hw_params = s3c_pcm_hw_params, - .set_fmt = s3c_pcm_set_fmt, -}; - -#define S3C_PCM_RATES SNDRV_PCM_RATE_8000_96000 - -#define S3C_PCM_DECLARE(n) \ -{ \ - .name = "samsung-pcm", \ - .id = (n), \ - .symmetric_rates = 1, \ - .ops = &s3c_pcm_dai_ops, \ - .playback = { \ - .channels_min = 2, \ - .channels_max = 2, \ - .rates = S3C_PCM_RATES, \ - .formats = SNDRV_PCM_FMTBIT_S16_LE, \ - }, \ - .capture = { \ - .channels_min = 2, \ - .channels_max = 2, \ - .rates = S3C_PCM_RATES, \ - .formats = SNDRV_PCM_FMTBIT_S16_LE, \ - }, \ -} - -struct snd_soc_dai s3c_pcm_dai[] = { - S3C_PCM_DECLARE(0), - S3C_PCM_DECLARE(1), -}; -EXPORT_SYMBOL_GPL(s3c_pcm_dai); - -static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) -{ - struct s3c_pcm_info *pcm; - struct snd_soc_dai *dai; - struct resource *mem_res, *dmatx_res, *dmarx_res; - struct s3c_audio_pdata *pcm_pdata; - int ret; - - /* Check for valid device index */ - if ((pdev->id < 0) || pdev->id >= ARRAY_SIZE(s3c_pcm)) { - dev_err(&pdev->dev, "id %d out of range\n", pdev->id); - return -EINVAL; - } - - pcm_pdata = pdev->dev.platform_data; - - /* Check for availability of necessary resource */ - dmatx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); - if (!dmatx_res) { - dev_err(&pdev->dev, "Unable to get PCM-TX dma resource\n"); - return -ENXIO; - } - - dmarx_res = platform_get_resource(pdev, IORESOURCE_DMA, 1); - if (!dmarx_res) { - dev_err(&pdev->dev, "Unable to get PCM-RX dma resource\n"); - return -ENXIO; - } - - mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem_res) { - dev_err(&pdev->dev, "Unable to get register resource\n"); - return -ENXIO; - } - - if (pcm_pdata && pcm_pdata->cfg_gpio && pcm_pdata->cfg_gpio(pdev)) { - dev_err(&pdev->dev, "Unable to configure gpio\n"); - return -EINVAL; - } - - pcm = &s3c_pcm[pdev->id]; - pcm->dev = &pdev->dev; - - spin_lock_init(&pcm->lock); - - dai = &s3c_pcm_dai[pdev->id]; - dai->dev = &pdev->dev; - - /* Default is 128fs */ - pcm->sclk_per_fs = 128; - - pcm->cclk = clk_get(&pdev->dev, "audio-bus"); - if (IS_ERR(pcm->cclk)) { - dev_err(&pdev->dev, "failed to get audio-bus\n"); - ret = PTR_ERR(pcm->cclk); - goto err1; - } - clk_enable(pcm->cclk); - - /* record our pcm structure for later use in the callbacks */ - dai->private_data = pcm; - - if (!request_mem_region(mem_res->start, - resource_size(mem_res), "samsung-pcm")) { - dev_err(&pdev->dev, "Unable to request register region\n"); - ret = -EBUSY; - goto err2; - } - - pcm->regs = ioremap(mem_res->start, 0x100); - if (pcm->regs == NULL) { - dev_err(&pdev->dev, "cannot ioremap registers\n"); - ret = -ENXIO; - goto err3; - } - - pcm->pclk = clk_get(&pdev->dev, "pcm"); - if (IS_ERR(pcm->pclk)) { - dev_err(&pdev->dev, "failed to get pcm_clock\n"); - ret = -ENOENT; - goto err4; - } - clk_enable(pcm->pclk); - - ret = snd_soc_register_dai(dai); - if (ret != 0) { - dev_err(&pdev->dev, "failed to get pcm_clock\n"); - goto err5; - } - - s3c_pcm_stereo_in[pdev->id].dma_addr = mem_res->start - + S3C_PCM_RXFIFO; - s3c_pcm_stereo_out[pdev->id].dma_addr = mem_res->start - + S3C_PCM_TXFIFO; - - s3c_pcm_stereo_in[pdev->id].channel = dmarx_res->start; - s3c_pcm_stereo_out[pdev->id].channel = dmatx_res->start; - - pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; - pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; - - return 0; - -err5: - clk_disable(pcm->pclk); - clk_put(pcm->pclk); -err4: - iounmap(pcm->regs); -err3: - release_mem_region(mem_res->start, resource_size(mem_res)); -err2: - clk_disable(pcm->cclk); - clk_put(pcm->cclk); -err1: - return ret; -} - -static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev) -{ - struct s3c_pcm_info *pcm = &s3c_pcm[pdev->id]; - struct resource *mem_res; - - iounmap(pcm->regs); - - mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(mem_res->start, resource_size(mem_res)); - - clk_disable(pcm->cclk); - clk_disable(pcm->pclk); - clk_put(pcm->pclk); - clk_put(pcm->cclk); - - return 0; -} - -static struct platform_driver s3c_pcm_driver = { - .probe = s3c_pcm_dev_probe, - .remove = s3c_pcm_dev_remove, - .driver = { - .name = "samsung-pcm", - .owner = THIS_MODULE, - }, -}; - -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 information */ -MODULE_AUTHOR("Jaswinder Singh, "); -MODULE_DESCRIPTION("S3C PCM Controller Driver"); -MODULE_LICENSE("GPL"); diff --git a/trunk/sound/soc/s3c24xx/s3c-pcm.h b/trunk/sound/soc/s3c24xx/s3c-pcm.h deleted file mode 100644 index 69ff9971692f..000000000000 --- a/trunk/sound/soc/s3c24xx/s3c-pcm.h +++ /dev/null @@ -1,123 +0,0 @@ -/* sound/soc/s3c24xx/s3c-pcm.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ - -#ifndef __S3C_PCM_H -#define __S3C_PCM_H __FILE__ - -/*Register Offsets */ -#define S3C_PCM_CTL (0x00) -#define S3C_PCM_CLKCTL (0x04) -#define S3C_PCM_TXFIFO (0x08) -#define S3C_PCM_RXFIFO (0x0C) -#define S3C_PCM_IRQCTL (0x10) -#define S3C_PCM_IRQSTAT (0x14) -#define S3C_PCM_FIFOSTAT (0x18) -#define S3C_PCM_CLRINT (0x20) - -/* PCM_CTL Bit-Fields */ -#define S3C_PCM_CTL_TXDIPSTICK_MASK (0x3f) -#define S3C_PCM_CTL_TXDIPSTICK_SHIFT (13) -#define S3C_PCM_CTL_RXDIPSTICK_MSK (0x3f<<7) -#define S3C_PCM_CTL_TXDMA_EN (0x1<<6) -#define S3C_PCM_CTL_RXDMA_EN (0x1<<5) -#define S3C_PCM_CTL_TXMSB_AFTER_FSYNC (0x1<<4) -#define S3C_PCM_CTL_RXMSB_AFTER_FSYNC (0x1<<3) -#define S3C_PCM_CTL_TXFIFO_EN (0x1<<2) -#define S3C_PCM_CTL_RXFIFO_EN (0x1<<1) -#define S3C_PCM_CTL_ENABLE (0x1<<0) - -/* PCM_CLKCTL Bit-Fields */ -#define S3C_PCM_CLKCTL_SERCLK_EN (0x1<<19) -#define S3C_PCM_CLKCTL_SERCLKSEL_PCLK (0x1<<18) -#define S3C_PCM_CLKCTL_SCLKDIV_MASK (0x1ff) -#define S3C_PCM_CLKCTL_SYNCDIV_MASK (0x1ff) -#define S3C_PCM_CLKCTL_SCLKDIV_SHIFT (9) -#define S3C_PCM_CLKCTL_SYNCDIV_SHIFT (0) - -/* PCM_TXFIFO Bit-Fields */ -#define S3C_PCM_TXFIFO_DVALID (0x1<<16) -#define S3C_PCM_TXFIFO_DATA_MSK (0xffff<<0) - -/* PCM_RXFIFO Bit-Fields */ -#define S3C_PCM_RXFIFO_DVALID (0x1<<16) -#define S3C_PCM_RXFIFO_DATA_MSK (0xffff<<0) - -/* PCM_IRQCTL Bit-Fields */ -#define S3C_PCM_IRQCTL_IRQEN (0x1<<14) -#define S3C_PCM_IRQCTL_WRDEN (0x1<<12) -#define S3C_PCM_IRQCTL_TXEMPTYEN (0x1<<11) -#define S3C_PCM_IRQCTL_TXALMSTEMPTYEN (0x1<<10) -#define S3C_PCM_IRQCTL_TXFULLEN (0x1<<9) -#define S3C_PCM_IRQCTL_TXALMSTFULLEN (0x1<<8) -#define S3C_PCM_IRQCTL_TXSTARVEN (0x1<<7) -#define S3C_PCM_IRQCTL_TXERROVRFLEN (0x1<<6) -#define S3C_PCM_IRQCTL_RXEMPTEN (0x1<<5) -#define S3C_PCM_IRQCTL_RXALMSTEMPTEN (0x1<<4) -#define S3C_PCM_IRQCTL_RXFULLEN (0x1<<3) -#define S3C_PCM_IRQCTL_RXALMSTFULLEN (0x1<<2) -#define S3C_PCM_IRQCTL_RXSTARVEN (0x1<<1) -#define S3C_PCM_IRQCTL_RXERROVRFLEN (0x1<<0) - -/* PCM_IRQSTAT Bit-Fields */ -#define S3C_PCM_IRQSTAT_IRQPND (0x1<<13) -#define S3C_PCM_IRQSTAT_WRD_XFER (0x1<<12) -#define S3C_PCM_IRQSTAT_TXEMPTY (0x1<<11) -#define S3C_PCM_IRQSTAT_TXALMSTEMPTY (0x1<<10) -#define S3C_PCM_IRQSTAT_TXFULL (0x1<<9) -#define S3C_PCM_IRQSTAT_TXALMSTFULL (0x1<<8) -#define S3C_PCM_IRQSTAT_TXSTARV (0x1<<7) -#define S3C_PCM_IRQSTAT_TXERROVRFL (0x1<<6) -#define S3C_PCM_IRQSTAT_RXEMPT (0x1<<5) -#define S3C_PCM_IRQSTAT_RXALMSTEMPT (0x1<<4) -#define S3C_PCM_IRQSTAT_RXFULL (0x1<<3) -#define S3C_PCM_IRQSTAT_RXALMSTFULL (0x1<<2) -#define S3C_PCM_IRQSTAT_RXSTARV (0x1<<1) -#define S3C_PCM_IRQSTAT_RXERROVRFL (0x1<<0) - -/* PCM_FIFOSTAT Bit-Fields */ -#define S3C_PCM_FIFOSTAT_TXCNT_MSK (0x3f<<14) -#define S3C_PCM_FIFOSTAT_TXFIFOEMPTY (0x1<<13) -#define S3C_PCM_FIFOSTAT_TXFIFOALMSTEMPTY (0x1<<12) -#define S3C_PCM_FIFOSTAT_TXFIFOFULL (0x1<<11) -#define S3C_PCM_FIFOSTAT_TXFIFOALMSTFULL (0x1<<10) -#define S3C_PCM_FIFOSTAT_RXCNT_MSK (0x3f<<4) -#define S3C_PCM_FIFOSTAT_RXFIFOEMPTY (0x1<<3) -#define S3C_PCM_FIFOSTAT_RXFIFOALMSTEMPTY (0x1<<2) -#define S3C_PCM_FIFOSTAT_RXFIFOFULL (0x1<<1) -#define S3C_PCM_FIFOSTAT_RXFIFOALMSTFULL (0x1<<0) - -#define S3C_PCM_CLKSRC_PCLK 0 -#define S3C_PCM_CLKSRC_MUX 1 - -#define S3C_PCM_SCLK_PER_FS 0 - -/** - * struct s3c_pcm_info - S3C PCM Controller information - * @dev: The parent device passed to use from the probe. - * @regs: The pointer to the device register block. - * @dma_playback: DMA information for playback channel. - * @dma_capture: DMA information for capture channel. - */ -struct s3c_pcm_info { - spinlock_t lock; - struct device *dev; - void __iomem *regs; - - unsigned int sclk_per_fs; - - /* Whether to keep PCMSCLK enabled even when idle(no active xfer) */ - unsigned int idleclk; - - struct clk *pclk; - struct clk *cclk; - - struct s3c_dma_params *dma_playback; - struct s3c_dma_params *dma_capture; -}; - -#endif /* __S3C_PCM_H */ diff --git a/trunk/sound/soc/s3c24xx/s3c2412-i2s.c b/trunk/sound/soc/s3c24xx/s3c2412-i2s.c index 359e59346ba2..ac5e47b082fb 100644 --- a/trunk/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/trunk/sound/soc/s3c24xx/s3c2412-i2s.c @@ -37,7 +37,7 @@ #include #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c2412-i2s.h" #define S3C2412_I2S_DEBUG 0 @@ -50,14 +50,14 @@ static struct s3c2410_dma_client s3c2412_dma_client_in = { .name = "I2S PCM Stereo in" }; -static struct s3c_dma_params s3c2412_i2s_pcm_stereo_out = { +static struct s3c24xx_pcm_dma_params s3c2412_i2s_pcm_stereo_out = { .client = &s3c2412_dma_client_out, .channel = DMACH_I2S_OUT, .dma_addr = S3C2410_PA_IIS + S3C2412_IISTXD, .dma_size = 4, }; -static struct s3c_dma_params s3c2412_i2s_pcm_stereo_in = { +static struct s3c24xx_pcm_dma_params s3c2412_i2s_pcm_stereo_in = { .client = &s3c2412_dma_client_in, .channel = DMACH_I2S_IN, .dma_addr = S3C2410_PA_IIS + S3C2412_IISRXD, diff --git a/trunk/sound/soc/s3c24xx/s3c2443-ac97.c b/trunk/sound/soc/s3c24xx/s3c2443-ac97.c index 0191e3acb0b4..b25e9f968df9 100644 --- a/trunk/sound/soc/s3c24xx/s3c2443-ac97.c +++ b/trunk/sound/soc/s3c24xx/s3c2443-ac97.c @@ -35,7 +35,7 @@ #include #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-ac97.h" struct s3c24xx_ac97_info { @@ -188,21 +188,21 @@ static struct s3c2410_dma_client s3c2443_dma_client_micin = { .name = "AC97 Mic Mono in" }; -static struct s3c_dma_params s3c2443_ac97_pcm_stereo_out = { +static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_out = { .client = &s3c2443_dma_client_out, .channel = DMACH_PCM_OUT, .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, .dma_size = 4, }; -static struct s3c_dma_params s3c2443_ac97_pcm_stereo_in = { +static struct s3c24xx_pcm_dma_params s3c2443_ac97_pcm_stereo_in = { .client = &s3c2443_dma_client_in, .channel = DMACH_PCM_IN, .dma_addr = S3C2440_PA_AC97 + S3C_AC97_PCM_DATA, .dma_size = 4, }; -static struct s3c_dma_params s3c2443_ac97_mic_mono_in = { +static struct s3c24xx_pcm_dma_params s3c2443_ac97_mic_mono_in = { .client = &s3c2443_dma_client_micin, .channel = DMACH_MIC_IN, .dma_addr = S3C2440_PA_AC97 + S3C_AC97_MIC_DATA, @@ -290,7 +290,7 @@ static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd, { u32 ac_glbctrl; struct snd_soc_pcm_runtime *rtd = substream->private_data; - int channel = ((struct s3c_dma_params *) + int channel = ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->channel; ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); @@ -339,7 +339,7 @@ static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream, { u32 ac_glbctrl; struct snd_soc_pcm_runtime *rtd = substream->private_data; - int channel = ((struct s3c_dma_params *) + int channel = ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->channel; ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); diff --git a/trunk/sound/soc/s3c24xx/s3c24xx-i2s.c b/trunk/sound/soc/s3c24xx/s3c24xx-i2s.c index 0bc5950b9f02..c76b8bb214bc 100644 --- a/trunk/sound/soc/s3c24xx/s3c24xx-i2s.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx-i2s.c @@ -38,7 +38,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" static struct s3c2410_dma_client s3c24xx_dma_client_out = { @@ -49,14 +49,14 @@ static struct s3c2410_dma_client s3c24xx_dma_client_in = { .name = "I2S PCM Stereo in" }; -static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_out = { +static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_out = { .client = &s3c24xx_dma_client_out, .channel = DMACH_I2S_OUT, .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO, .dma_size = 2, }; -static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_in = { +static struct s3c24xx_pcm_dma_params s3c24xx_i2s_pcm_stereo_in = { .client = &s3c24xx_dma_client_in, .channel = DMACH_I2S_IN, .dma_addr = S3C2410_PA_IIS + S3C2410_IISFIFO, @@ -258,12 +258,12 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream, switch (params_format(params)) { case SNDRV_PCM_FORMAT_S8: iismod &= ~S3C2410_IISMOD_16BIT; - ((struct s3c_dma_params *) + ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->dma_size = 1; break; case SNDRV_PCM_FORMAT_S16_LE: iismod |= S3C2410_IISMOD_16BIT; - ((struct s3c_dma_params *) + ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->dma_size = 2; break; default: @@ -280,7 +280,7 @@ static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; - int channel = ((struct s3c_dma_params *) + int channel = ((struct s3c24xx_pcm_dma_params *) rtd->dai->cpu_dai->dma_data)->channel; pr_debug("Entered %s\n", __func__); diff --git a/trunk/sound/soc/s3c24xx/s3c-dma.c b/trunk/sound/soc/s3c24xx/s3c24xx-pcm.c similarity index 82% rename from trunk/sound/soc/s3c24xx/s3c-dma.c rename to trunk/sound/soc/s3c24xx/s3c24xx-pcm.c index 7725e26d6c91..151a69463269 100644 --- a/trunk/sound/soc/s3c24xx/s3c-dma.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx-pcm.c @@ -1,5 +1,5 @@ /* - * s3c-dma.c -- ALSA Soc Audio Layer + * s3c24xx-pcm.c -- ALSA Soc Audio Layer * * (c) 2006 Wolfson Microelectronics PLC. * Graeme Gregory graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com @@ -30,9 +30,9 @@ #include #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" -static const struct snd_pcm_hardware s3c_dma_hardware = { +static const struct snd_pcm_hardware s3c24xx_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | @@ -62,15 +62,15 @@ struct s3c24xx_runtime_data { dma_addr_t dma_start; dma_addr_t dma_pos; dma_addr_t dma_end; - struct s3c_dma_params *params; + struct s3c24xx_pcm_dma_params *params; }; -/* s3c_dma_enqueue +/* s3c24xx_pcm_enqueue * * place a dma buffer onto the queue for the dma system * to handle. */ -static void s3c_dma_enqueue(struct snd_pcm_substream *substream) +static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream) { struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; dma_addr_t pos = prtd->dma_pos; @@ -79,13 +79,12 @@ static void s3c_dma_enqueue(struct snd_pcm_substream *substream) pr_debug("Entered %s\n", __func__); - if (s3c_dma_has_circular()) + if (s3c_dma_has_circular()) { limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period; - else + } else limit = prtd->dma_limit; - pr_debug("%s: loaded %d, limit %d\n", - __func__, prtd->dma_loaded, limit); + pr_debug("%s: loaded %d, limit %d\n", __func__, prtd->dma_loaded, limit); while (prtd->dma_loaded < limit) { unsigned long len = prtd->dma_period; @@ -133,19 +132,19 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel, spin_lock(&prtd->lock); if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) { prtd->dma_loaded--; - s3c_dma_enqueue(substream); + s3c24xx_pcm_enqueue(substream); } spin_unlock(&prtd->lock); } -static int s3c_dma_hw_params(struct snd_pcm_substream *substream, +static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_pcm_runtime *runtime = substream->runtime; struct s3c24xx_runtime_data *prtd = runtime->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct s3c_dma_params *dma = rtd->dai->cpu_dai->dma_data; + struct s3c24xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; unsigned long totbytes = params_buffer_bytes(params); int ret = 0; @@ -198,7 +197,7 @@ static int s3c_dma_hw_params(struct snd_pcm_substream *substream, return 0; } -static int s3c_dma_hw_free(struct snd_pcm_substream *substream) +static int s3c24xx_pcm_hw_free(struct snd_pcm_substream *substream) { struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; @@ -215,7 +214,7 @@ static int s3c_dma_hw_free(struct snd_pcm_substream *substream) return 0; } -static int s3c_dma_prepare(struct snd_pcm_substream *substream) +static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream) { struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; int ret = 0; @@ -248,12 +247,12 @@ static int s3c_dma_prepare(struct snd_pcm_substream *substream) prtd->dma_pos = prtd->dma_start; /* enqueue dma buffers */ - s3c_dma_enqueue(substream); + s3c24xx_pcm_enqueue(substream); return ret; } -static int s3c_dma_trigger(struct snd_pcm_substream *substream, int cmd) +static int s3c24xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; int ret = 0; @@ -288,7 +287,7 @@ static int s3c_dma_trigger(struct snd_pcm_substream *substream, int cmd) } static snd_pcm_uframes_t -s3c_dma_pointer(struct snd_pcm_substream *substream) +s3c24xx_pcm_pointer(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct s3c24xx_runtime_data *prtd = runtime->private_data; @@ -323,7 +322,7 @@ s3c_dma_pointer(struct snd_pcm_substream *substream) return bytes_to_frames(substream->runtime, res); } -static int s3c_dma_open(struct snd_pcm_substream *substream) +static int s3c24xx_pcm_open(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct s3c24xx_runtime_data *prtd; @@ -331,7 +330,7 @@ static int s3c_dma_open(struct snd_pcm_substream *substream) pr_debug("Entered %s\n", __func__); snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); - snd_soc_set_runtime_hwparams(substream, &s3c_dma_hardware); + snd_soc_set_runtime_hwparams(substream, &s3c24xx_pcm_hardware); prtd = kzalloc(sizeof(struct s3c24xx_runtime_data), GFP_KERNEL); if (prtd == NULL) @@ -343,7 +342,7 @@ static int s3c_dma_open(struct snd_pcm_substream *substream) return 0; } -static int s3c_dma_close(struct snd_pcm_substream *substream) +static int s3c24xx_pcm_close(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct s3c24xx_runtime_data *prtd = runtime->private_data; @@ -351,14 +350,14 @@ static int s3c_dma_close(struct snd_pcm_substream *substream) pr_debug("Entered %s\n", __func__); if (!prtd) - pr_debug("s3c_dma_close called with prtd == NULL\n"); + pr_debug("s3c24xx_pcm_close called with prtd == NULL\n"); kfree(prtd); return 0; } -static int s3c_dma_mmap(struct snd_pcm_substream *substream, +static int s3c24xx_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -371,23 +370,23 @@ static int s3c_dma_mmap(struct snd_pcm_substream *substream, runtime->dma_bytes); } -static struct snd_pcm_ops s3c_dma_ops = { - .open = s3c_dma_open, - .close = s3c_dma_close, +static struct snd_pcm_ops s3c24xx_pcm_ops = { + .open = s3c24xx_pcm_open, + .close = s3c24xx_pcm_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = s3c_dma_hw_params, - .hw_free = s3c_dma_hw_free, - .prepare = s3c_dma_prepare, - .trigger = s3c_dma_trigger, - .pointer = s3c_dma_pointer, - .mmap = s3c_dma_mmap, + .hw_params = s3c24xx_pcm_hw_params, + .hw_free = s3c24xx_pcm_hw_free, + .prepare = s3c24xx_pcm_prepare, + .trigger = s3c24xx_pcm_trigger, + .pointer = s3c24xx_pcm_pointer, + .mmap = s3c24xx_pcm_mmap, }; -static int s3c_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) +static int s3c24xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) { struct snd_pcm_substream *substream = pcm->streams[stream].substream; struct snd_dma_buffer *buf = &substream->dma_buffer; - size_t size = s3c_dma_hardware.buffer_bytes_max; + size_t size = s3c24xx_pcm_hardware.buffer_bytes_max; pr_debug("Entered %s\n", __func__); @@ -402,7 +401,7 @@ static int s3c_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) return 0; } -static void s3c_dma_free_dma_buffers(struct snd_pcm *pcm) +static void s3c24xx_pcm_free_dma_buffers(struct snd_pcm *pcm) { struct snd_pcm_substream *substream; struct snd_dma_buffer *buf; @@ -425,9 +424,9 @@ static void s3c_dma_free_dma_buffers(struct snd_pcm *pcm) } } -static u64 s3c_dma_mask = DMA_BIT_MASK(32); +static u64 s3c24xx_pcm_dmamask = DMA_BIT_MASK(32); -static int s3c_dma_new(struct snd_card *card, +static int s3c24xx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, struct snd_pcm *pcm) { int ret = 0; @@ -435,19 +434,19 @@ static int s3c_dma_new(struct snd_card *card, pr_debug("Entered %s\n", __func__); if (!card->dev->dma_mask) - card->dev->dma_mask = &s3c_dma_mask; + card->dev->dma_mask = &s3c24xx_pcm_dmamask; if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask = 0xffffffff; if (dai->playback.channels_min) { - ret = s3c_preallocate_dma_buffer(pcm, + ret = s3c24xx_pcm_preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_PLAYBACK); if (ret) goto out; } if (dai->capture.channels_min) { - ret = s3c_preallocate_dma_buffer(pcm, + ret = s3c24xx_pcm_preallocate_dma_buffer(pcm, SNDRV_PCM_STREAM_CAPTURE); if (ret) goto out; @@ -458,9 +457,9 @@ static int s3c_dma_new(struct snd_card *card, struct snd_soc_platform s3c24xx_soc_platform = { .name = "s3c24xx-audio", - .pcm_ops = &s3c_dma_ops, - .pcm_new = s3c_dma_new, - .pcm_free = s3c_dma_free_dma_buffers, + .pcm_ops = &s3c24xx_pcm_ops, + .pcm_new = s3c24xx_pcm_new, + .pcm_free = s3c24xx_pcm_free_dma_buffers, }; EXPORT_SYMBOL_GPL(s3c24xx_soc_platform); @@ -477,5 +476,5 @@ static void __exit s3c24xx_soc_platform_exit(void) module_exit(s3c24xx_soc_platform_exit); MODULE_AUTHOR("Ben Dooks, "); -MODULE_DESCRIPTION("Samsung S3C Audio DMA module"); +MODULE_DESCRIPTION("Samsung S3C24XX PCM DMA module"); MODULE_LICENSE("GPL"); diff --git a/trunk/sound/soc/s3c24xx/s3c-dma.h b/trunk/sound/soc/s3c24xx/s3c24xx-pcm.h similarity index 87% rename from trunk/sound/soc/s3c24xx/s3c-dma.h rename to trunk/sound/soc/s3c24xx/s3c24xx-pcm.h index 69bb6bf6fc1c..0088c79822ea 100644 --- a/trunk/sound/soc/s3c24xx/s3c-dma.h +++ b/trunk/sound/soc/s3c24xx/s3c24xx-pcm.h @@ -1,5 +1,5 @@ /* - * s3c-dma.h -- + * s3c24xx-pcm.h -- * * 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 @@ -9,13 +9,13 @@ * ALSA PCM interface for the Samsung S3C24xx CPU */ -#ifndef _S3C_AUDIO_H -#define _S3C_AUDIO_H +#ifndef _S3C24XX_PCM_H +#define _S3C24XX_PCM_H #define ST_RUNNING (1<<0) #define ST_OPENED (1<<1) -struct s3c_dma_params { +struct s3c24xx_pcm_dma_params { struct s3c2410_dma_client *client; /* stream identifier */ int channel; /* Channel ID */ dma_addr_t dma_addr; diff --git a/trunk/sound/soc/s3c24xx/s3c24xx_simtec.c b/trunk/sound/soc/s3c24xx/s3c24xx_simtec.c index 507b2ed5d58b..1966e0d5652d 100644 --- a/trunk/sound/soc/s3c24xx/s3c24xx_simtec.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx_simtec.c @@ -21,7 +21,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" #include "s3c24xx_simtec.h" diff --git a/trunk/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c b/trunk/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c index bdf8951af8e3..8346bd96eaf5 100644 --- a/trunk/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx_simtec_hermes.c @@ -18,7 +18,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" #include "s3c24xx_simtec.h" diff --git a/trunk/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c b/trunk/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c index 185c0acb5ce6..25797e096175 100644 --- a/trunk/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c @@ -18,7 +18,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" #include "s3c24xx_simtec.h" diff --git a/trunk/sound/soc/s3c24xx/s3c24xx_uda134x.c b/trunk/sound/soc/s3c24xx/s3c24xx_uda134x.c index 052d59659c29..c215d32d6322 100644 --- a/trunk/sound/soc/s3c24xx/s3c24xx_uda134x.c +++ b/trunk/sound/soc/s3c24xx/s3c24xx_uda134x.c @@ -24,7 +24,7 @@ #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-i2s.h" #include "../codecs/uda134x.h" diff --git a/trunk/sound/soc/s3c24xx/s3c64xx-i2s.c b/trunk/sound/soc/s3c24xx/s3c64xx-i2s.c index cc7edb5f792d..d68cae15561c 100644 --- a/trunk/sound/soc/s3c24xx/s3c64xx-i2s.c +++ b/trunk/sound/soc/s3c24xx/s3c64xx-i2s.c @@ -35,7 +35,7 @@ #include #include -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c64xx-i2s.h" static struct s3c2410_dma_client s3c64xx_dma_client_out = { @@ -46,7 +46,7 @@ static struct s3c2410_dma_client s3c64xx_dma_client_in = { .name = "I2S PCM Stereo in" }; -static struct s3c_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { +static struct s3c24xx_pcm_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { [0] = { .channel = DMACH_I2S0_OUT, .client = &s3c64xx_dma_client_out, @@ -61,7 +61,7 @@ static struct s3c_dma_params s3c64xx_i2s_pcm_stereo_out[2] = { }, }; -static struct s3c_dma_params s3c64xx_i2s_pcm_stereo_in[2] = { +static struct s3c24xx_pcm_dma_params s3c64xx_i2s_pcm_stereo_in[2] = { [0] = { .channel = DMACH_I2S0_IN, .client = &s3c64xx_dma_client_in, diff --git a/trunk/sound/soc/s3c24xx/smdk2443_wm9710.c b/trunk/sound/soc/s3c24xx/smdk2443_wm9710.c index 12b783b12fcb..a2a4f5323c17 100644 --- a/trunk/sound/soc/s3c24xx/smdk2443_wm9710.c +++ b/trunk/sound/soc/s3c24xx/smdk2443_wm9710.c @@ -20,7 +20,7 @@ #include #include "../codecs/ac97.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c24xx-ac97.h" static struct snd_soc_card smdk2443; diff --git a/trunk/sound/soc/s3c24xx/smdk64xx_wm8580.c b/trunk/sound/soc/s3c24xx/smdk64xx_wm8580.c index efe4901213a3..216dd1e8e378 100644 --- a/trunk/sound/soc/s3c24xx/smdk64xx_wm8580.c +++ b/trunk/sound/soc/s3c24xx/smdk64xx_wm8580.c @@ -19,7 +19,7 @@ #include #include "../codecs/wm8580.h" -#include "s3c-dma.h" +#include "s3c24xx-pcm.h" #include "s3c64xx-i2s.h" #define S3C64XX_I2S_V4 2 diff --git a/trunk/sound/soc/s6000/s6000-pcm.c b/trunk/sound/soc/s6000/s6000-pcm.c index 83b8028e209d..0eb1722f6581 100644 --- a/trunk/sound/soc/s6000/s6000-pcm.c +++ b/trunk/sound/soc/s6000/s6000-pcm.c @@ -423,7 +423,7 @@ static void s6000_pcm_free(struct snd_pcm *pcm) snd_pcm_lib_preallocate_free_for_all(pcm); } -static u64 s6000_pcm_dmamask = DMA_32BIT_MASK; +static u64 s6000_pcm_dmamask = DMA_BIT_MASK(32); static int s6000_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, struct snd_pcm *pcm) @@ -435,7 +435,7 @@ static int s6000_pcm_new(struct snd_card *card, if (!card->dev->dma_mask) card->dev->dma_mask = &s6000_pcm_dmamask; if (!card->dev->coherent_dma_mask) - card->dev->coherent_dma_mask = DMA_32BIT_MASK; + card->dev->coherent_dma_mask = DMA_BIT_MASK(32); if (params->dma_in) { s6dmac_disable_chan(DMA_MASK_DMAC(params->dma_in),