aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8753.c
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2009-03-02 20:41:00 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-04 17:29:47 -0500
commit6335d05548eece40092000aa91b64a50310d69d5 (patch)
treeac72c74562f349879a127b4067827476a7875c88 /sound/soc/codecs/wm8753.c
parentff09d49ad0176a5f52a398c137a7ff5f669d6be4 (diff)
ASoC: make ops a pointer in 'struct snd_soc_dai'
Considering the fact that most cpu_dai or codec_dai are using a same 'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better made a pointer instead, to make sharing easier and code a bit cleaner. The patch below is rather preliminary since the asoc tree is being actively developed, and this touches almost every piece of code, (and possibly many others in development need to be changed as well). Building of all codecs are OK, yet to every SoC, I didn't test that. Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r--sound/soc/codecs/wm8753.c90
1 files changed, 50 insertions, 40 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 7f353e935d71..cc6e57f9acf8 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1306,6 +1306,51 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec,
1306 * 3. Voice disabled - HIFI over HIFI 1306 * 3. Voice disabled - HIFI over HIFI
1307 * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture 1307 * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture
1308 */ 1308 */
1309static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode1 = {
1310 .hw_params = wm8753_i2s_hw_params,
1311 .digital_mute = wm8753_mute,
1312 .set_fmt = wm8753_mode1h_set_dai_fmt,
1313 .set_clkdiv = wm8753_set_dai_clkdiv,
1314 .set_pll = wm8753_set_dai_pll,
1315 .set_sysclk = wm8753_set_dai_sysclk,
1316};
1317
1318static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode1 = {
1319 .hw_params = wm8753_pcm_hw_params,
1320 .digital_mute = wm8753_mute,
1321 .set_fmt = wm8753_mode1v_set_dai_fmt,
1322 .set_clkdiv = wm8753_set_dai_clkdiv,
1323 .set_pll = wm8753_set_dai_pll,
1324 .set_sysclk = wm8753_set_dai_sysclk,
1325};
1326
1327static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode2 = {
1328 .hw_params = wm8753_pcm_hw_params,
1329 .digital_mute = wm8753_mute,
1330 .set_fmt = wm8753_mode2_set_dai_fmt,
1331 .set_clkdiv = wm8753_set_dai_clkdiv,
1332 .set_pll = wm8753_set_dai_pll,
1333 .set_sysclk = wm8753_set_dai_sysclk,
1334};
1335
1336static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode3 = {
1337 .hw_params = wm8753_i2s_hw_params,
1338 .digital_mute = wm8753_mute,
1339 .set_fmt = wm8753_mode3_4_set_dai_fmt,
1340 .set_clkdiv = wm8753_set_dai_clkdiv,
1341 .set_pll = wm8753_set_dai_pll,
1342 .set_sysclk = wm8753_set_dai_sysclk,
1343};
1344
1345static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode4 = {
1346 .hw_params = wm8753_i2s_hw_params,
1347 .digital_mute = wm8753_mute,
1348 .set_fmt = wm8753_mode3_4_set_dai_fmt,
1349 .set_clkdiv = wm8753_set_dai_clkdiv,
1350 .set_pll = wm8753_set_dai_pll,
1351 .set_sysclk = wm8753_set_dai_sysclk,
1352};
1353
1309static const struct snd_soc_dai wm8753_all_dai[] = { 1354static const struct snd_soc_dai wm8753_all_dai[] = {
1310/* DAI HiFi mode 1 */ 1355/* DAI HiFi mode 1 */
1311{ .name = "WM8753 HiFi", 1356{ .name = "WM8753 HiFi",
@@ -1322,14 +1367,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
1322 .channels_max = 2, 1367 .channels_max = 2,
1323 .rates = WM8753_RATES, 1368 .rates = WM8753_RATES,
1324 .formats = WM8753_FORMATS}, 1369 .formats = WM8753_FORMATS},
1325 .ops = { 1370 .ops = &wm8753_dai_ops_hifi_mode1,
1326 .hw_params = wm8753_i2s_hw_params,
1327 .digital_mute = wm8753_mute,
1328 .set_fmt = wm8753_mode1h_set_dai_fmt,
1329 .set_clkdiv = wm8753_set_dai_clkdiv,
1330 .set_pll = wm8753_set_dai_pll,
1331 .set_sysclk = wm8753_set_dai_sysclk,
1332 },
1333}, 1371},
1334/* DAI Voice mode 1 */ 1372/* DAI Voice mode 1 */
1335{ .name = "WM8753 Voice", 1373{ .name = "WM8753 Voice",
@@ -1346,14 +1384,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
1346 .channels_max = 2, 1384 .channels_max = 2,
1347 .rates = WM8753_RATES, 1385 .rates = WM8753_RATES,
1348 .formats = WM8753_FORMATS,}, 1386 .formats = WM8753_FORMATS,},
1349 .ops = { 1387 .ops = &wm8753_dai_ops_voice_mode1,
1350 .hw_params = wm8753_pcm_hw_params,
1351 .digital_mute = wm8753_mute,
1352 .set_fmt = wm8753_mode1v_set_dai_fmt,
1353 .set_clkdiv = wm8753_set_dai_clkdiv,
1354 .set_pll = wm8753_set_dai_pll,
1355 .set_sysclk = wm8753_set_dai_sysclk,
1356 },
1357}, 1388},
1358/* DAI HiFi mode 2 - dummy */ 1389/* DAI HiFi mode 2 - dummy */
1359{ .name = "WM8753 HiFi", 1390{ .name = "WM8753 HiFi",
@@ -1374,14 +1405,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
1374 .channels_max = 2, 1405 .channels_max = 2,
1375 .rates = WM8753_RATES, 1406 .rates = WM8753_RATES,
1376 .formats = WM8753_FORMATS,}, 1407 .formats = WM8753_FORMATS,},
1377 .ops = { 1408 .ops = &wm8753_dai_ops_voice_mode2,
1378 .hw_params = wm8753_pcm_hw_params,
1379 .digital_mute = wm8753_mute,
1380 .set_fmt = wm8753_mode2_set_dai_fmt,
1381 .set_clkdiv = wm8753_set_dai_clkdiv,
1382 .set_pll = wm8753_set_dai_pll,
1383 .set_sysclk = wm8753_set_dai_sysclk,
1384 },
1385}, 1409},
1386/* DAI HiFi mode 3 */ 1410/* DAI HiFi mode 3 */
1387{ .name = "WM8753 HiFi", 1411{ .name = "WM8753 HiFi",
@@ -1398,14 +1422,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
1398 .channels_max = 2, 1422 .channels_max = 2,
1399 .rates = WM8753_RATES, 1423 .rates = WM8753_RATES,
1400 .formats = WM8753_FORMATS,}, 1424 .formats = WM8753_FORMATS,},
1401 .ops = { 1425 .ops = &wm8753_dai_ops_hifi_mode3,
1402 .hw_params = wm8753_i2s_hw_params,
1403 .digital_mute = wm8753_mute,
1404 .set_fmt = wm8753_mode3_4_set_dai_fmt,
1405 .set_clkdiv = wm8753_set_dai_clkdiv,
1406 .set_pll = wm8753_set_dai_pll,
1407 .set_sysclk = wm8753_set_dai_sysclk,
1408 },
1409}, 1426},
1410/* DAI Voice mode 3 - dummy */ 1427/* DAI Voice mode 3 - dummy */
1411{ .name = "WM8753 Voice", 1428{ .name = "WM8753 Voice",
@@ -1426,14 +1443,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
1426 .channels_max = 2, 1443 .channels_max = 2,
1427 .rates = WM8753_RATES, 1444 .rates = WM8753_RATES,
1428 .formats = WM8753_FORMATS,}, 1445 .formats = WM8753_FORMATS,},
1429 .ops = { 1446 .ops = &wm8753_dai_ops_hifi_mode4,
1430 .hw_params = wm8753_i2s_hw_params,
1431 .digital_mute = wm8753_mute,
1432 .set_fmt = wm8753_mode3_4_set_dai_fmt,
1433 .set_clkdiv = wm8753_set_dai_clkdiv,
1434 .set_pll = wm8753_set_dai_pll,
1435 .set_sysclk = wm8753_set_dai_sysclk,
1436 },
1437}, 1447},
1438/* DAI Voice mode 4 - dummy */ 1448/* DAI Voice mode 4 - dummy */
1439{ .name = "WM8753 Voice", 1449{ .name = "WM8753 Voice",