Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fix/asoc' into for-linus

+55 -68
+21 -24
Documentation/sound/alsa/soc/codec.txt
··· 27 27 28 28 1 - Codec DAI and PCM configuration 29 29 ----------------------------------- 30 - Each codec driver must have a struct snd_soc_codec_dai to define its DAI and 30 + Each codec driver must have a struct snd_soc_dai_driver to define its DAI and 31 31 PCM capabilities and operations. This struct is exported so that it can be 32 32 registered with the core by your machine driver. 33 33 34 34 e.g. 35 35 36 - struct snd_soc_codec_dai wm8731_dai = { 37 - .name = "WM8731", 38 - /* playback capabilities */ 36 + static struct snd_soc_dai_ops wm8731_dai_ops = { 37 + .prepare = wm8731_pcm_prepare, 38 + .hw_params = wm8731_hw_params, 39 + .shutdown = wm8731_shutdown, 40 + .digital_mute = wm8731_mute, 41 + .set_sysclk = wm8731_set_dai_sysclk, 42 + .set_fmt = wm8731_set_dai_fmt, 43 + }; 44 + 45 + struct snd_soc_dai_driver wm8731_dai = { 46 + .name = "wm8731-hifi", 39 47 .playback = { 40 48 .stream_name = "Playback", 41 49 .channels_min = 1, 42 50 .channels_max = 2, 43 51 .rates = WM8731_RATES, 44 52 .formats = WM8731_FORMATS,}, 45 - /* capture capabilities */ 46 53 .capture = { 47 54 .stream_name = "Capture", 48 55 .channels_min = 1, 49 56 .channels_max = 2, 50 57 .rates = WM8731_RATES, 51 58 .formats = WM8731_FORMATS,}, 52 - /* pcm operations - see section 4 below */ 53 - .ops = { 54 - .prepare = wm8731_pcm_prepare, 55 - .hw_params = wm8731_hw_params, 56 - .shutdown = wm8731_shutdown, 57 - }, 58 - /* DAI operations - see DAI.txt */ 59 - .dai_ops = { 60 - .digital_mute = wm8731_mute, 61 - .set_sysclk = wm8731_set_dai_sysclk, 62 - .set_fmt = wm8731_set_dai_fmt, 63 - } 59 + .ops = &wm8731_dai_ops, 60 + .symmetric_rates = 1, 64 61 }; 65 - EXPORT_SYMBOL_GPL(wm8731_dai); 66 62 67 63 68 64 2 - Codec control IO ··· 182 186 183 187 i.e. 184 188 185 - static int wm8974_mute(struct snd_soc_codec *codec, 186 - struct snd_soc_codec_dai *dai, int mute) 189 + static int wm8974_mute(struct snd_soc_dai *dai, int mute) 187 190 { 188 - u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; 189 - if(mute) 190 - wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); 191 + struct snd_soc_codec *codec = dai->codec; 192 + u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; 193 + 194 + if (mute) 195 + snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40); 191 196 else 192 - wm8974_write(codec, WM8974_DAC, mute_reg); 197 + snd_soc_write(codec, WM8974_DAC, mute_reg); 193 198 return 0; 194 199 }
+9 -29
Documentation/sound/alsa/soc/machine.txt
··· 12 12 struct snd_soc_card { 13 13 char *name; 14 14 15 + ... 16 + 15 17 int (*probe)(struct platform_device *pdev); 16 18 int (*remove)(struct platform_device *pdev); 17 19 ··· 24 22 int (*resume_pre)(struct platform_device *pdev); 25 23 int (*resume_post)(struct platform_device *pdev); 26 24 27 - /* machine stream operations */ 28 - struct snd_soc_ops *ops; 25 + ... 29 26 30 27 /* CPU <--> Codec DAI links */ 31 28 struct snd_soc_dai_link *dai_link; 32 29 int num_links; 30 + 31 + ... 33 32 }; 34 33 35 34 probe()/remove() ··· 43 40 The machine driver has pre and post versions of suspend and resume to take care 44 41 of any machine audio tasks that have to be done before or after the codec, DAIs 45 42 and DMA is suspended and resumed. Optional. 46 - 47 - 48 - Machine operations 49 - ------------------ 50 - The machine specific audio operations can be set here. Again this is optional. 51 43 52 44 53 45 Machine DAI Configuration ··· 59 61 static struct snd_soc_dai_link corgi_dai = { 60 62 .name = "WM8731", 61 63 .stream_name = "WM8731", 62 - .cpu_dai = &pxa_i2s_dai, 63 - .codec_dai = &wm8731_dai, 64 + .cpu_dai_name = "pxa-is2-dai", 65 + .codec_dai_name = "wm8731-hifi", 66 + .platform_name = "pxa-pcm-audio", 67 + .codec_name = "wm8713-codec.0-001a", 64 68 .init = corgi_wm8731_init, 65 69 .ops = &corgi_ops, 66 70 }; ··· 74 74 .name = "Corgi", 75 75 .dai_link = &corgi_dai, 76 76 .num_links = 1, 77 - }; 78 - 79 - 80 - Machine Audio Subsystem 81 - ----------------------- 82 - 83 - The machine soc device glues the platform, machine and codec driver together. 84 - Private data can also be set here. e.g. 85 - 86 - /* corgi audio private data */ 87 - static struct wm8731_setup_data corgi_wm8731_setup = { 88 - .i2c_address = 0x1b, 89 - }; 90 - 91 - /* corgi audio subsystem */ 92 - static struct snd_soc_device corgi_snd_devdata = { 93 - .machine = &snd_soc_corgi, 94 - .platform = &pxa2xx_soc_platform, 95 - .codec_dev = &soc_codec_dev_wm8731, 96 - .codec_data = &corgi_wm8731_setup, 97 77 }; 98 78 99 79
+10 -2
Documentation/sound/alsa/soc/platform.txt
··· 20 20 int (*trigger)(struct snd_pcm_substream *, int); 21 21 }; 22 22 23 - The platform driver exports its DMA functionality via struct snd_soc_platform:- 23 + The platform driver exports its DMA functionality via struct 24 + snd_soc_platform_driver:- 24 25 25 - struct snd_soc_platform { 26 + struct snd_soc_platform_driver { 26 27 char *name; 27 28 28 29 int (*probe)(struct platform_device *pdev); ··· 34 33 /* pcm creation and destruction */ 35 34 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); 36 35 void (*pcm_free)(struct snd_pcm *); 36 + 37 + /* 38 + * For platform caused delay reporting. 39 + * Optional. 40 + */ 41 + snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, 42 + struct snd_soc_dai *); 37 43 38 44 /* platform stream ops */ 39 45 struct snd_pcm_ops *pcm_ops;
+6 -5
sound/soc/blackfin/Kconfig
··· 1 1 config SND_BF5XX_I2S 2 2 tristate "SoC I2S Audio for the ADI BF5xx chip" 3 3 depends on BLACKFIN 4 + select SND_BF5XX_SOC_SPORT 4 5 help 5 6 Say Y or M if you want to add support for codecs attached to 6 7 the Blackfin SPORT (synchronous serial ports) interface in I2S ··· 36 35 config SND_BF5XX_TDM 37 36 tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" 38 37 depends on (BLACKFIN && SND_SOC) 38 + select SND_BF5XX_SOC_SPORT 39 39 help 40 40 Say Y or M if you want to add support for codecs attached to 41 41 the Blackfin SPORT (synchronous serial ports) interface in TDM ··· 63 61 config SND_BF5XX_AC97 64 62 tristate "SoC AC97 Audio for the ADI BF5xx chip" 65 63 depends on BLACKFIN 64 + select AC97_BUS 65 + select SND_SOC_AC97_BUS 66 + select SND_BF5XX_SOC_SPORT 67 + select SND_BF5XX_SOC_AC97 66 68 help 67 69 Say Y or M if you want to add support for codecs attached to 68 70 the Blackfin SPORT (synchronous serial ports) interface in slot 16 ··· 128 122 129 123 config SND_BF5XX_SOC_I2S 130 124 tristate 131 - select SND_BF5XX_SOC_SPORT 132 125 133 126 config SND_BF5XX_SOC_TDM 134 127 tristate 135 - select SND_BF5XX_SOC_SPORT 136 128 137 129 config SND_BF5XX_SOC_AC97 138 130 tristate 139 - select AC97_BUS 140 - select SND_SOC_AC97_BUS 141 - select SND_BF5XX_SOC_SPORT 142 131 143 132 config SND_BF5XX_SPORT_NUM 144 133 int "Set a SPORT for Sound chip"
+2 -2
sound/soc/blackfin/bf5xx-ac97.c
··· 260 260 pr_debug("%s : sport %d\n", __func__, dai->id); 261 261 if (!dai->active) 262 262 return 0; 263 - if (dai->capture.active) 263 + if (dai->capture_active) 264 264 sport_rx_stop(sport); 265 - if (dai->playback.active) 265 + if (dai->playback_active) 266 266 sport_tx_stop(sport); 267 267 return 0; 268 268 }
+5 -5
sound/soc/blackfin/bf5xx-tdm.c
··· 210 210 #ifdef CONFIG_PM 211 211 static int bf5xx_tdm_suspend(struct snd_soc_dai *dai) 212 212 { 213 - struct sport_device *sport = dai->private_data; 213 + struct sport_device *sport = snd_soc_dai_get_drvdata(dai); 214 214 215 215 if (!dai->active) 216 216 return 0; ··· 235 235 ret = -EBUSY; 236 236 } 237 237 238 - ret = sport_config_rx(sport, IRFS, 0x1F, 0, 0); 238 + ret = sport_config_rx(sport, 0, 0x1F, 0, 0); 239 239 if (ret) { 240 240 pr_err("SPORT is busy!\n"); 241 241 ret = -EBUSY; 242 242 } 243 243 244 - ret = sport_config_tx(sport, ITFS, 0x1F, 0, 0); 244 + ret = sport_config_tx(sport, 0, 0x1F, 0, 0); 245 245 if (ret) { 246 246 pr_err("SPORT is busy!\n"); 247 247 ret = -EBUSY; ··· 303 303 goto sport_config_err; 304 304 } 305 305 306 - ret = sport_config_rx(sport_handle, IRFS, 0x1F, 0, 0); 306 + ret = sport_config_rx(sport_handle, 0, 0x1F, 0, 0); 307 307 if (ret) { 308 308 pr_err("SPORT is busy!\n"); 309 309 ret = -EBUSY; 310 310 goto sport_config_err; 311 311 } 312 312 313 - ret = sport_config_tx(sport_handle, ITFS, 0x1F, 0, 0); 313 + ret = sport_config_tx(sport_handle, 0, 0x1F, 0, 0); 314 314 if (ret) { 315 315 pr_err("SPORT is busy!\n"); 316 316 ret = -EBUSY;
+2 -1
sound/soc/pxa/z2.c
··· 104 104 .name = "hsdet-gpio", 105 105 .report = SND_JACK_HEADSET, 106 106 .debounce_time = 200, 107 + .invert = 1, 107 108 }, 108 109 }; 109 110 ··· 193 192 .cpu_dai_name = "pxa2xx-i2s", 194 193 .codec_dai_name = "wm8750-hifi", 195 194 .platform_name = "pxa-pcm-audio", 196 - .codec_name = "wm8750-codec.0-001a", 195 + .codec_name = "wm8750-codec.0-001b", 197 196 .init = z2_wm8750_init, 198 197 .ops = &z2_ops, 199 198 };