diff options
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r-- | sound/soc/codecs/wm8753.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index d426eaa22185..6c21b50c9375 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -922,7 +922,8 @@ static int wm8753_vdac_adc_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
922 | * Set PCM DAI bit size and sample rate. | 922 | * Set PCM DAI bit size and sample rate. |
923 | */ | 923 | */ |
924 | static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream, | 924 | static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream, |
925 | struct snd_pcm_hw_params *params) | 925 | struct snd_pcm_hw_params *params, |
926 | struct snd_soc_dai *dai) | ||
926 | { | 927 | { |
927 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 928 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
928 | struct snd_soc_device *socdev = rtd->socdev; | 929 | struct snd_soc_device *socdev = rtd->socdev; |
@@ -1155,7 +1156,8 @@ static int wm8753_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
1155 | * Set PCM DAI bit size and sample rate. | 1156 | * Set PCM DAI bit size and sample rate. |
1156 | */ | 1157 | */ |
1157 | static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream, | 1158 | static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream, |
1158 | struct snd_pcm_hw_params *params) | 1159 | struct snd_pcm_hw_params *params, |
1160 | struct snd_soc_dai *dai) | ||
1159 | { | 1161 | { |
1160 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 1162 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
1161 | struct snd_soc_device *socdev = rtd->socdev; | 1163 | struct snd_soc_device *socdev = rtd->socdev; |
@@ -1323,16 +1325,15 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1323 | .channels_min = 1, | 1325 | .channels_min = 1, |
1324 | .channels_max = 2, | 1326 | .channels_max = 2, |
1325 | .rates = WM8753_RATES, | 1327 | .rates = WM8753_RATES, |
1326 | .formats = WM8753_FORMATS,}, | 1328 | .formats = WM8753_FORMATS}, |
1327 | .capture = { /* dummy for fast DAI switching */ | 1329 | .capture = { /* dummy for fast DAI switching */ |
1328 | .stream_name = "Capture", | 1330 | .stream_name = "Capture", |
1329 | .channels_min = 1, | 1331 | .channels_min = 1, |
1330 | .channels_max = 2, | 1332 | .channels_max = 2, |
1331 | .rates = WM8753_RATES, | 1333 | .rates = WM8753_RATES, |
1332 | .formats = WM8753_FORMATS,}, | 1334 | .formats = WM8753_FORMATS}, |
1333 | .ops = { | 1335 | .ops = { |
1334 | .hw_params = wm8753_i2s_hw_params,}, | 1336 | .hw_params = wm8753_i2s_hw_params, |
1335 | .dai_ops = { | ||
1336 | .digital_mute = wm8753_mute, | 1337 | .digital_mute = wm8753_mute, |
1337 | .set_fmt = wm8753_mode1h_set_dai_fmt, | 1338 | .set_fmt = wm8753_mode1h_set_dai_fmt, |
1338 | .set_clkdiv = wm8753_set_dai_clkdiv, | 1339 | .set_clkdiv = wm8753_set_dai_clkdiv, |
@@ -1356,8 +1357,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1356 | .rates = WM8753_RATES, | 1357 | .rates = WM8753_RATES, |
1357 | .formats = WM8753_FORMATS,}, | 1358 | .formats = WM8753_FORMATS,}, |
1358 | .ops = { | 1359 | .ops = { |
1359 | .hw_params = wm8753_pcm_hw_params,}, | 1360 | .hw_params = wm8753_pcm_hw_params, |
1360 | .dai_ops = { | ||
1361 | .digital_mute = wm8753_mute, | 1361 | .digital_mute = wm8753_mute, |
1362 | .set_fmt = wm8753_mode1v_set_dai_fmt, | 1362 | .set_fmt = wm8753_mode1v_set_dai_fmt, |
1363 | .set_clkdiv = wm8753_set_dai_clkdiv, | 1363 | .set_clkdiv = wm8753_set_dai_clkdiv, |
@@ -1385,8 +1385,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1385 | .rates = WM8753_RATES, | 1385 | .rates = WM8753_RATES, |
1386 | .formats = WM8753_FORMATS,}, | 1386 | .formats = WM8753_FORMATS,}, |
1387 | .ops = { | 1387 | .ops = { |
1388 | .hw_params = wm8753_pcm_hw_params,}, | 1388 | .hw_params = wm8753_pcm_hw_params, |
1389 | .dai_ops = { | ||
1390 | .digital_mute = wm8753_mute, | 1389 | .digital_mute = wm8753_mute, |
1391 | .set_fmt = wm8753_mode2_set_dai_fmt, | 1390 | .set_fmt = wm8753_mode2_set_dai_fmt, |
1392 | .set_clkdiv = wm8753_set_dai_clkdiv, | 1391 | .set_clkdiv = wm8753_set_dai_clkdiv, |
@@ -1410,8 +1409,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1410 | .rates = WM8753_RATES, | 1409 | .rates = WM8753_RATES, |
1411 | .formats = WM8753_FORMATS,}, | 1410 | .formats = WM8753_FORMATS,}, |
1412 | .ops = { | 1411 | .ops = { |
1413 | .hw_params = wm8753_i2s_hw_params,}, | 1412 | .hw_params = wm8753_i2s_hw_params, |
1414 | .dai_ops = { | ||
1415 | .digital_mute = wm8753_mute, | 1413 | .digital_mute = wm8753_mute, |
1416 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | 1414 | .set_fmt = wm8753_mode3_4_set_dai_fmt, |
1417 | .set_clkdiv = wm8753_set_dai_clkdiv, | 1415 | .set_clkdiv = wm8753_set_dai_clkdiv, |
@@ -1439,8 +1437,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = { | |||
1439 | .rates = WM8753_RATES, | 1437 | .rates = WM8753_RATES, |
1440 | .formats = WM8753_FORMATS,}, | 1438 | .formats = WM8753_FORMATS,}, |
1441 | .ops = { | 1439 | .ops = { |
1442 | .hw_params = wm8753_i2s_hw_params,}, | 1440 | .hw_params = wm8753_i2s_hw_params, |
1443 | .dai_ops = { | ||
1444 | .digital_mute = wm8753_mute, | 1441 | .digital_mute = wm8753_mute, |
1445 | .set_fmt = wm8753_mode3_4_set_dai_fmt, | 1442 | .set_fmt = wm8753_mode3_4_set_dai_fmt, |
1446 | .set_clkdiv = wm8753_set_dai_clkdiv, | 1443 | .set_clkdiv = wm8753_set_dai_clkdiv, |
@@ -1608,7 +1605,7 @@ static int wm8753_init(struct snd_soc_device *socdev) | |||
1608 | 1605 | ||
1609 | wm8753_add_controls(codec); | 1606 | wm8753_add_controls(codec); |
1610 | wm8753_add_widgets(codec); | 1607 | wm8753_add_widgets(codec); |
1611 | ret = snd_soc_register_card(socdev); | 1608 | ret = snd_soc_init_card(socdev); |
1612 | if (ret < 0) { | 1609 | if (ret < 0) { |
1613 | printk(KERN_ERR "wm8753: failed to register card\n"); | 1610 | printk(KERN_ERR "wm8753: failed to register card\n"); |
1614 | goto card_err; | 1611 | goto card_err; |
@@ -1877,6 +1874,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = { | |||
1877 | }; | 1874 | }; |
1878 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753); | 1875 | EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753); |
1879 | 1876 | ||
1877 | static int __init wm8753_modinit(void) | ||
1878 | { | ||
1879 | return snd_soc_register_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai)); | ||
1880 | } | ||
1881 | module_init(wm8753_modinit); | ||
1882 | |||
1883 | static void __exit wm8753_exit(void) | ||
1884 | { | ||
1885 | snd_soc_unregister_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai)); | ||
1886 | } | ||
1887 | module_exit(wm8753_exit); | ||
1888 | |||
1880 | MODULE_DESCRIPTION("ASoC WM8753 driver"); | 1889 | MODULE_DESCRIPTION("ASoC WM8753 driver"); |
1881 | MODULE_AUTHOR("Liam Girdwood"); | 1890 | MODULE_AUTHOR("Liam Girdwood"); |
1882 | MODULE_LICENSE("GPL"); | 1891 | MODULE_LICENSE("GPL"); |