diff options
-rw-r--r-- | Documentation/devicetree/bindings/sound/da7219.txt | 8 | ||||
-rw-r--r-- | include/sound/da7219.h | 14 | ||||
-rw-r--r-- | sound/soc/codecs/da7219.c | 89 | ||||
-rw-r--r-- | sound/soc/codecs/da7219.h | 9 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 26 |
5 files changed, 46 insertions, 100 deletions
diff --git a/Documentation/devicetree/bindings/sound/da7219.txt b/Documentation/devicetree/bindings/sound/da7219.txt index 1b7030911a3b..cf61681826b6 100644 --- a/Documentation/devicetree/bindings/sound/da7219.txt +++ b/Documentation/devicetree/bindings/sound/da7219.txt | |||
@@ -28,13 +28,15 @@ Optional properties: | |||
28 | - clocks : phandle and clock specifier for codec MCLK. | 28 | - clocks : phandle and clock specifier for codec MCLK. |
29 | - clock-names : Clock name string for 'clocks' attribute, should be "mclk". | 29 | - clock-names : Clock name string for 'clocks' attribute, should be "mclk". |
30 | 30 | ||
31 | - dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine | ||
32 | [<1050>, <1100>, <1200>, <1400>] | ||
33 | - dlg,micbias-lvl : Voltage (mV) for Mic Bias | 31 | - dlg,micbias-lvl : Voltage (mV) for Mic Bias |
34 | [<1800>, <2000>, <2200>, <2400>, <2600>] | 32 | [<1600>, <1800>, <2000>, <2200>, <2400>, <2600>] |
35 | - dlg,mic-amp-in-sel : Mic input source type | 33 | - dlg,mic-amp-in-sel : Mic input source type |
36 | ["diff", "se_p", "se_n"] | 34 | ["diff", "se_p", "se_n"] |
37 | 35 | ||
36 | Deprecated properties: | ||
37 | - dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine | ||
38 | (LDO unavailable in production HW so property no longer required). | ||
39 | |||
38 | ====== | 40 | ====== |
39 | 41 | ||
40 | Child node - 'da7219_aad': | 42 | Child node - 'da7219_aad': |
diff --git a/include/sound/da7219.h b/include/sound/da7219.h index 3f39e135312d..02876acdc840 100644 --- a/include/sound/da7219.h +++ b/include/sound/da7219.h | |||
@@ -14,17 +14,10 @@ | |||
14 | #ifndef __DA7219_PDATA_H | 14 | #ifndef __DA7219_PDATA_H |
15 | #define __DA7219_PDATA_H | 15 | #define __DA7219_PDATA_H |
16 | 16 | ||
17 | /* LDO */ | ||
18 | enum da7219_ldo_lvl_sel { | ||
19 | DA7219_LDO_LVL_SEL_1_05V = 0, | ||
20 | DA7219_LDO_LVL_SEL_1_10V, | ||
21 | DA7219_LDO_LVL_SEL_1_20V, | ||
22 | DA7219_LDO_LVL_SEL_1_40V, | ||
23 | }; | ||
24 | |||
25 | /* Mic Bias */ | 17 | /* Mic Bias */ |
26 | enum da7219_micbias_voltage { | 18 | enum da7219_micbias_voltage { |
27 | DA7219_MICBIAS_1_8V = 1, | 19 | DA7219_MICBIAS_1_6V = 0, |
20 | DA7219_MICBIAS_1_8V, | ||
28 | DA7219_MICBIAS_2_0V, | 21 | DA7219_MICBIAS_2_0V, |
29 | DA7219_MICBIAS_2_2V, | 22 | DA7219_MICBIAS_2_2V, |
30 | DA7219_MICBIAS_2_4V, | 23 | DA7219_MICBIAS_2_4V, |
@@ -41,9 +34,6 @@ enum da7219_mic_amp_in_sel { | |||
41 | struct da7219_aad_pdata; | 34 | struct da7219_aad_pdata; |
42 | 35 | ||
43 | struct da7219_pdata { | 36 | struct da7219_pdata { |
44 | /* Internal LDO */ | ||
45 | enum da7219_ldo_lvl_sel ldo_lvl_sel; | ||
46 | |||
47 | /* Mic */ | 37 | /* Mic */ |
48 | enum da7219_micbias_voltage micbias_lvl; | 38 | enum da7219_micbias_voltage micbias_lvl; |
49 | enum da7219_mic_amp_in_sel mic_amp_in_sel; | 39 | enum da7219_mic_amp_in_sel mic_amp_in_sel; |
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index f238c1e8a69c..c6d3b32bb4ae 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c | |||
@@ -968,10 +968,11 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = { | |||
968 | {"Mixin PGA", NULL, "Mic PGA"}, | 968 | {"Mixin PGA", NULL, "Mic PGA"}, |
969 | {"ADC", NULL, "Mixin PGA"}, | 969 | {"ADC", NULL, "Mixin PGA"}, |
970 | 970 | ||
971 | {"Sidetone Filter", NULL, "ADC"}, | ||
972 | {"Mixer In", NULL, "Mixer In Supply"}, | 971 | {"Mixer In", NULL, "Mixer In Supply"}, |
973 | {"Mixer In", "Mic Switch", "ADC"}, | 972 | {"Mixer In", "Mic Switch", "ADC"}, |
974 | 973 | ||
974 | {"Sidetone Filter", NULL, "Mixer In"}, | ||
975 | |||
975 | {"Tone Generator", NULL, "TONE"}, | 976 | {"Tone Generator", NULL, "TONE"}, |
976 | 977 | ||
977 | DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"), | 978 | DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"), |
@@ -1073,11 +1074,8 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
1073 | u32 freq_ref; | 1074 | u32 freq_ref; |
1074 | u64 frac_div; | 1075 | u64 frac_div; |
1075 | 1076 | ||
1076 | /* Verify 32KHz, 2MHz - 54MHz MCLK provided, and set input divider */ | 1077 | /* Verify 2MHz - 54MHz MCLK provided, and set input divider */ |
1077 | if (da7219->mclk_rate == 32768) { | 1078 | if (da7219->mclk_rate < 2000000) { |
1078 | indiv_bits = DA7219_PLL_INDIV_2_5_MHZ; | ||
1079 | indiv = DA7219_PLL_INDIV_2_5_MHZ_VAL; | ||
1080 | } else if (da7219->mclk_rate < 2000000) { | ||
1081 | dev_err(codec->dev, "PLL input clock %d below valid range\n", | 1079 | dev_err(codec->dev, "PLL input clock %d below valid range\n", |
1082 | da7219->mclk_rate); | 1080 | da7219->mclk_rate); |
1083 | return -EINVAL; | 1081 | return -EINVAL; |
@@ -1118,9 +1116,6 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
1118 | case DA7219_SYSCLK_PLL_SRM: | 1116 | case DA7219_SYSCLK_PLL_SRM: |
1119 | pll_ctrl |= DA7219_PLL_MODE_SRM; | 1117 | pll_ctrl |= DA7219_PLL_MODE_SRM; |
1120 | break; | 1118 | break; |
1121 | case DA7219_SYSCLK_PLL_32KHZ: | ||
1122 | pll_ctrl |= DA7219_PLL_MODE_32KHZ; | ||
1123 | break; | ||
1124 | default: | 1119 | default: |
1125 | dev_err(codec->dev, "Invalid PLL config\n"); | 1120 | dev_err(codec->dev, "Invalid PLL config\n"); |
1126 | return -EINVAL; | 1121 | return -EINVAL; |
@@ -1306,7 +1301,7 @@ static int da7219_hw_params(struct snd_pcm_substream *substream, | |||
1306 | } | 1301 | } |
1307 | 1302 | ||
1308 | channels = params_channels(params); | 1303 | channels = params_channels(params); |
1309 | if ((channels < 1) | (channels > DA7219_DAI_CH_NUM_MAX)) { | 1304 | if ((channels < 1) || (channels > DA7219_DAI_CH_NUM_MAX)) { |
1310 | dev_err(codec->dev, | 1305 | dev_err(codec->dev, |
1311 | "Invalid number of channels, only 1 to %d supported\n", | 1306 | "Invalid number of channels, only 1 to %d supported\n", |
1312 | DA7219_DAI_CH_NUM_MAX); | 1307 | DA7219_DAI_CH_NUM_MAX); |
@@ -1405,28 +1400,12 @@ static const struct of_device_id da7219_of_match[] = { | |||
1405 | }; | 1400 | }; |
1406 | MODULE_DEVICE_TABLE(of, da7219_of_match); | 1401 | MODULE_DEVICE_TABLE(of, da7219_of_match); |
1407 | 1402 | ||
1408 | static enum da7219_ldo_lvl_sel da7219_of_ldo_lvl(struct snd_soc_codec *codec, | ||
1409 | u32 val) | ||
1410 | { | ||
1411 | switch (val) { | ||
1412 | case 1050: | ||
1413 | return DA7219_LDO_LVL_SEL_1_05V; | ||
1414 | case 1100: | ||
1415 | return DA7219_LDO_LVL_SEL_1_10V; | ||
1416 | case 1200: | ||
1417 | return DA7219_LDO_LVL_SEL_1_20V; | ||
1418 | case 1400: | ||
1419 | return DA7219_LDO_LVL_SEL_1_40V; | ||
1420 | default: | ||
1421 | dev_warn(codec->dev, "Invalid LDO level"); | ||
1422 | return DA7219_LDO_LVL_SEL_1_05V; | ||
1423 | } | ||
1424 | } | ||
1425 | |||
1426 | static enum da7219_micbias_voltage | 1403 | static enum da7219_micbias_voltage |
1427 | da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val) | 1404 | da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val) |
1428 | { | 1405 | { |
1429 | switch (val) { | 1406 | switch (val) { |
1407 | case 1600: | ||
1408 | return DA7219_MICBIAS_1_6V; | ||
1430 | case 1800: | 1409 | case 1800: |
1431 | return DA7219_MICBIAS_1_8V; | 1410 | return DA7219_MICBIAS_1_8V; |
1432 | case 2000: | 1411 | case 2000: |
@@ -1469,9 +1448,6 @@ static struct da7219_pdata *da7219_of_to_pdata(struct snd_soc_codec *codec) | |||
1469 | if (!pdata) | 1448 | if (!pdata) |
1470 | return NULL; | 1449 | return NULL; |
1471 | 1450 | ||
1472 | if (of_property_read_u32(np, "dlg,ldo-lvl", &of_val32) >= 0) | ||
1473 | pdata->ldo_lvl_sel = da7219_of_ldo_lvl(codec, of_val32); | ||
1474 | |||
1475 | if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0) | 1451 | if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0) |
1476 | pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32); | 1452 | pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32); |
1477 | else | 1453 | else |
@@ -1516,24 +1492,13 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec, | |||
1516 | snd_soc_update_bits(codec, DA7219_REFERENCES, | 1492 | snd_soc_update_bits(codec, DA7219_REFERENCES, |
1517 | DA7219_BIAS_EN_MASK, | 1493 | DA7219_BIAS_EN_MASK, |
1518 | DA7219_BIAS_EN_MASK); | 1494 | DA7219_BIAS_EN_MASK); |
1519 | |||
1520 | /* Enable Internal Digital LDO */ | ||
1521 | snd_soc_update_bits(codec, DA7219_LDO_CTRL, | ||
1522 | DA7219_LDO_EN_MASK, | ||
1523 | DA7219_LDO_EN_MASK); | ||
1524 | } | 1495 | } |
1525 | break; | 1496 | break; |
1526 | case SND_SOC_BIAS_OFF: | 1497 | case SND_SOC_BIAS_OFF: |
1527 | /* Only disable if jack detection not active */ | 1498 | /* Only disable master bias if jack detection not active */ |
1528 | if (!da7219->aad->jack) { | 1499 | if (!da7219->aad->jack) |
1529 | /* Bypass Internal Digital LDO */ | ||
1530 | snd_soc_update_bits(codec, DA7219_LDO_CTRL, | ||
1531 | DA7219_LDO_EN_MASK, 0); | ||
1532 | |||
1533 | /* Master bias */ | ||
1534 | snd_soc_update_bits(codec, DA7219_REFERENCES, | 1500 | snd_soc_update_bits(codec, DA7219_REFERENCES, |
1535 | DA7219_BIAS_EN_MASK, 0); | 1501 | DA7219_BIAS_EN_MASK, 0); |
1536 | } | ||
1537 | 1502 | ||
1538 | /* MCLK */ | 1503 | /* MCLK */ |
1539 | if (da7219->mclk) | 1504 | if (da7219->mclk) |
@@ -1600,21 +1565,9 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec) | |||
1600 | if (pdata) { | 1565 | if (pdata) { |
1601 | u8 micbias_lvl = 0; | 1566 | u8 micbias_lvl = 0; |
1602 | 1567 | ||
1603 | /* Internal LDO */ | ||
1604 | switch (pdata->ldo_lvl_sel) { | ||
1605 | case DA7219_LDO_LVL_SEL_1_05V: | ||
1606 | case DA7219_LDO_LVL_SEL_1_10V: | ||
1607 | case DA7219_LDO_LVL_SEL_1_20V: | ||
1608 | case DA7219_LDO_LVL_SEL_1_40V: | ||
1609 | snd_soc_update_bits(codec, DA7219_LDO_CTRL, | ||
1610 | DA7219_LDO_LEVEL_SELECT_MASK, | ||
1611 | (pdata->ldo_lvl_sel << | ||
1612 | DA7219_LDO_LEVEL_SELECT_SHIFT)); | ||
1613 | break; | ||
1614 | } | ||
1615 | |||
1616 | /* Mic Bias voltages */ | 1568 | /* Mic Bias voltages */ |
1617 | switch (pdata->micbias_lvl) { | 1569 | switch (pdata->micbias_lvl) { |
1570 | case DA7219_MICBIAS_1_6V: | ||
1618 | case DA7219_MICBIAS_1_8V: | 1571 | case DA7219_MICBIAS_1_8V: |
1619 | case DA7219_MICBIAS_2_0V: | 1572 | case DA7219_MICBIAS_2_0V: |
1620 | case DA7219_MICBIAS_2_2V: | 1573 | case DA7219_MICBIAS_2_2V: |
@@ -1662,10 +1615,12 @@ static int da7219_probe(struct snd_soc_codec *codec) | |||
1662 | /* Check if MCLK provided */ | 1615 | /* Check if MCLK provided */ |
1663 | da7219->mclk = devm_clk_get(codec->dev, "mclk"); | 1616 | da7219->mclk = devm_clk_get(codec->dev, "mclk"); |
1664 | if (IS_ERR(da7219->mclk)) { | 1617 | if (IS_ERR(da7219->mclk)) { |
1665 | if (PTR_ERR(da7219->mclk) != -ENOENT) | 1618 | if (PTR_ERR(da7219->mclk) != -ENOENT) { |
1666 | return PTR_ERR(da7219->mclk); | 1619 | ret = PTR_ERR(da7219->mclk); |
1667 | else | 1620 | goto err_disable_reg; |
1621 | } else { | ||
1668 | da7219->mclk = NULL; | 1622 | da7219->mclk = NULL; |
1623 | } | ||
1669 | } | 1624 | } |
1670 | 1625 | ||
1671 | /* Default PC counter to free-running */ | 1626 | /* Default PC counter to free-running */ |
@@ -1693,7 +1648,16 @@ static int da7219_probe(struct snd_soc_codec *codec) | |||
1693 | snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK); | 1648 | snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK); |
1694 | 1649 | ||
1695 | /* Initialise AAD block */ | 1650 | /* Initialise AAD block */ |
1696 | return da7219_aad_init(codec); | 1651 | ret = da7219_aad_init(codec); |
1652 | if (ret) | ||
1653 | goto err_disable_reg; | ||
1654 | |||
1655 | return 0; | ||
1656 | |||
1657 | err_disable_reg: | ||
1658 | regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); | ||
1659 | |||
1660 | return ret; | ||
1697 | } | 1661 | } |
1698 | 1662 | ||
1699 | static int da7219_remove(struct snd_soc_codec *codec) | 1663 | static int da7219_remove(struct snd_soc_codec *codec) |
@@ -1776,7 +1740,7 @@ static struct reg_default da7219_reg_defaults[] = { | |||
1776 | { DA7219_DIG_ROUTING_DAC, 0x32 }, | 1740 | { DA7219_DIG_ROUTING_DAC, 0x32 }, |
1777 | { DA7219_DAI_OFFSET_LOWER, 0x00 }, | 1741 | { DA7219_DAI_OFFSET_LOWER, 0x00 }, |
1778 | { DA7219_DAI_OFFSET_UPPER, 0x00 }, | 1742 | { DA7219_DAI_OFFSET_UPPER, 0x00 }, |
1779 | { DA7219_REFERENCES, 0x00 }, | 1743 | { DA7219_REFERENCES, 0x08 }, |
1780 | { DA7219_MIXIN_L_SELECT, 0x00 }, | 1744 | { DA7219_MIXIN_L_SELECT, 0x00 }, |
1781 | { DA7219_MIXIN_L_GAIN, 0x03 }, | 1745 | { DA7219_MIXIN_L_GAIN, 0x03 }, |
1782 | { DA7219_ADC_L_GAIN, 0x6F }, | 1746 | { DA7219_ADC_L_GAIN, 0x6F }, |
@@ -1811,7 +1775,6 @@ static struct reg_default da7219_reg_defaults[] = { | |||
1811 | { DA7219_CHIP_ID1, 0x23 }, | 1775 | { DA7219_CHIP_ID1, 0x23 }, |
1812 | { DA7219_CHIP_ID2, 0x93 }, | 1776 | { DA7219_CHIP_ID2, 0x93 }, |
1813 | { DA7219_CHIP_REVISION, 0x00 }, | 1777 | { DA7219_CHIP_REVISION, 0x00 }, |
1814 | { DA7219_LDO_CTRL, 0x00 }, | ||
1815 | { DA7219_IO_CTRL, 0x00 }, | 1778 | { DA7219_IO_CTRL, 0x00 }, |
1816 | { DA7219_GAIN_RAMP_CTRL, 0x00 }, | 1779 | { DA7219_GAIN_RAMP_CTRL, 0x00 }, |
1817 | { DA7219_PC_COUNT, 0x02 }, | 1780 | { DA7219_PC_COUNT, 0x02 }, |
diff --git a/sound/soc/codecs/da7219.h b/sound/soc/codecs/da7219.h index b514268c6c56..5a787e738084 100644 --- a/sound/soc/codecs/da7219.h +++ b/sound/soc/codecs/da7219.h | |||
@@ -85,7 +85,6 @@ | |||
85 | #define DA7219_CHIP_ID1 0x81 | 85 | #define DA7219_CHIP_ID1 0x81 |
86 | #define DA7219_CHIP_ID2 0x82 | 86 | #define DA7219_CHIP_ID2 0x82 |
87 | #define DA7219_CHIP_REVISION 0x83 | 87 | #define DA7219_CHIP_REVISION 0x83 |
88 | #define DA7219_LDO_CTRL 0x90 | ||
89 | #define DA7219_IO_CTRL 0x91 | 88 | #define DA7219_IO_CTRL 0x91 |
90 | #define DA7219_GAIN_RAMP_CTRL 0x92 | 89 | #define DA7219_GAIN_RAMP_CTRL 0x92 |
91 | #define DA7219_PC_COUNT 0x94 | 90 | #define DA7219_PC_COUNT 0x94 |
@@ -207,7 +206,6 @@ | |||
207 | #define DA7219_PLL_MODE_BYPASS (0x0 << 6) | 206 | #define DA7219_PLL_MODE_BYPASS (0x0 << 6) |
208 | #define DA7219_PLL_MODE_NORMAL (0x1 << 6) | 207 | #define DA7219_PLL_MODE_NORMAL (0x1 << 6) |
209 | #define DA7219_PLL_MODE_SRM (0x2 << 6) | 208 | #define DA7219_PLL_MODE_SRM (0x2 << 6) |
210 | #define DA7219_PLL_MODE_32KHZ (0x3 << 6) | ||
211 | 209 | ||
212 | /* DA7219_PLL_FRAC_TOP = 0x22 */ | 210 | /* DA7219_PLL_FRAC_TOP = 0x22 */ |
213 | #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT 0 | 211 | #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT 0 |
@@ -569,12 +567,6 @@ | |||
569 | #define DA7219_CHIP_MAJOR_SHIFT 4 | 567 | #define DA7219_CHIP_MAJOR_SHIFT 4 |
570 | #define DA7219_CHIP_MAJOR_MASK (0xF << 4) | 568 | #define DA7219_CHIP_MAJOR_MASK (0xF << 4) |
571 | 569 | ||
572 | /* DA7219_LDO_CTRL = 0x90 */ | ||
573 | #define DA7219_LDO_LEVEL_SELECT_SHIFT 4 | ||
574 | #define DA7219_LDO_LEVEL_SELECT_MASK (0x3 << 4) | ||
575 | #define DA7219_LDO_EN_SHIFT 7 | ||
576 | #define DA7219_LDO_EN_MASK (0x1 << 7) | ||
577 | |||
578 | /* DA7219_IO_CTRL = 0x91 */ | 570 | /* DA7219_IO_CTRL = 0x91 */ |
579 | #define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0 | 571 | #define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0 |
580 | #define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0) | 572 | #define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0) |
@@ -787,7 +779,6 @@ enum da7219_sys_clk { | |||
787 | DA7219_SYSCLK_MCLK = 0, | 779 | DA7219_SYSCLK_MCLK = 0, |
788 | DA7219_SYSCLK_PLL, | 780 | DA7219_SYSCLK_PLL, |
789 | DA7219_SYSCLK_PLL_SRM, | 781 | DA7219_SYSCLK_PLL_SRM, |
790 | DA7219_SYSCLK_PLL_32KHZ | ||
791 | }; | 782 | }; |
792 | 783 | ||
793 | /* Regulators */ | 784 | /* Regulators */ |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 149cd5c61440..19f7486bf335 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1536,35 +1536,35 @@ static int soc_link_dai_widgets(struct snd_soc_card *card, | |||
1536 | { | 1536 | { |
1537 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 1537 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
1538 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | 1538 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
1539 | struct snd_soc_dapm_widget *play_w, *capture_w; | 1539 | struct snd_soc_dapm_widget *sink, *source; |
1540 | int ret; | 1540 | int ret; |
1541 | 1541 | ||
1542 | if (rtd->num_codecs > 1) | 1542 | if (rtd->num_codecs > 1) |
1543 | dev_warn(card->dev, "ASoC: Multiple codecs not supported yet\n"); | 1543 | dev_warn(card->dev, "ASoC: Multiple codecs not supported yet\n"); |
1544 | 1544 | ||
1545 | /* link the DAI widgets */ | 1545 | /* link the DAI widgets */ |
1546 | play_w = codec_dai->playback_widget; | 1546 | sink = codec_dai->playback_widget; |
1547 | capture_w = cpu_dai->capture_widget; | 1547 | source = cpu_dai->capture_widget; |
1548 | if (play_w && capture_w) { | 1548 | if (sink && source) { |
1549 | ret = snd_soc_dapm_new_pcm(card, dai_link->params, | 1549 | ret = snd_soc_dapm_new_pcm(card, dai_link->params, |
1550 | dai_link->num_params, capture_w, | 1550 | dai_link->num_params, |
1551 | play_w); | 1551 | source, sink); |
1552 | if (ret != 0) { | 1552 | if (ret != 0) { |
1553 | dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n", | 1553 | dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n", |
1554 | play_w->name, capture_w->name, ret); | 1554 | sink->name, source->name, ret); |
1555 | return ret; | 1555 | return ret; |
1556 | } | 1556 | } |
1557 | } | 1557 | } |
1558 | 1558 | ||
1559 | play_w = cpu_dai->playback_widget; | 1559 | sink = cpu_dai->playback_widget; |
1560 | capture_w = codec_dai->capture_widget; | 1560 | source = codec_dai->capture_widget; |
1561 | if (play_w && capture_w) { | 1561 | if (sink && source) { |
1562 | ret = snd_soc_dapm_new_pcm(card, dai_link->params, | 1562 | ret = snd_soc_dapm_new_pcm(card, dai_link->params, |
1563 | dai_link->num_params, capture_w, | 1563 | dai_link->num_params, |
1564 | play_w); | 1564 | source, sink); |
1565 | if (ret != 0) { | 1565 | if (ret != 0) { |
1566 | dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n", | 1566 | dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n", |
1567 | play_w->name, capture_w->name, ret); | 1567 | sink->name, source->name, ret); |
1568 | return ret; | 1568 | return ret; |
1569 | } | 1569 | } |
1570 | } | 1570 | } |