aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r--sound/soc/codecs/wm_adsp.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index bb5f7b4e3ebb..060027182dcb 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -242,7 +242,7 @@ struct wm_coeff_ctl {
242static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol, 242static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
243 struct snd_ctl_elem_value *ucontrol) 243 struct snd_ctl_elem_value *ucontrol)
244{ 244{
245 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 245 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
246 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 246 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
247 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec); 247 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec);
248 248
@@ -254,7 +254,7 @@ static int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
254static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol, 254static int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
255 struct snd_ctl_elem_value *ucontrol) 255 struct snd_ctl_elem_value *ucontrol)
256{ 256{
257 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 257 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 258 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
259 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec); 259 struct wm_adsp *adsp = snd_soc_codec_get_drvdata(codec);
260 260
@@ -1543,16 +1543,16 @@ static void wm_adsp2_boot_work(struct work_struct *work)
1543 ret = regmap_read(dsp->regmap, 1543 ret = regmap_read(dsp->regmap,
1544 dsp->base + ADSP2_CLOCKING, &val); 1544 dsp->base + ADSP2_CLOCKING, &val);
1545 if (ret != 0) { 1545 if (ret != 0) {
1546 dev_err(dsp->dev, "Failed to read clocking: %d\n", ret); 1546 adsp_err(dsp, "Failed to read clocking: %d\n", ret);
1547 return; 1547 return;
1548 } 1548 }
1549 1549
1550 if ((val & ADSP2_CLK_SEL_MASK) >= 3) { 1550 if ((val & ADSP2_CLK_SEL_MASK) >= 3) {
1551 ret = regulator_enable(dsp->dvfs); 1551 ret = regulator_enable(dsp->dvfs);
1552 if (ret != 0) { 1552 if (ret != 0) {
1553 dev_err(dsp->dev, 1553 adsp_err(dsp,
1554 "Failed to enable supply: %d\n", 1554 "Failed to enable supply: %d\n",
1555 ret); 1555 ret);
1556 return; 1556 return;
1557 } 1557 }
1558 1558
@@ -1560,9 +1560,9 @@ static void wm_adsp2_boot_work(struct work_struct *work)
1560 1800000, 1560 1800000,
1561 1800000); 1561 1800000);
1562 if (ret != 0) { 1562 if (ret != 0) {
1563 dev_err(dsp->dev, 1563 adsp_err(dsp,
1564 "Failed to raise supply: %d\n", 1564 "Failed to raise supply: %d\n",
1565 ret); 1565 ret);
1566 return; 1566 return;
1567 } 1567 }
1568 } 1568 }
@@ -1625,7 +1625,7 @@ int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
1625 break; 1625 break;
1626 default: 1626 default:
1627 break; 1627 break;
1628 }; 1628 }
1629 1629
1630 return 0; 1630 return 0;
1631} 1631}
@@ -1672,15 +1672,15 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
1672 ret = regulator_set_voltage(dsp->dvfs, 1200000, 1672 ret = regulator_set_voltage(dsp->dvfs, 1200000,
1673 1800000); 1673 1800000);
1674 if (ret != 0) 1674 if (ret != 0)
1675 dev_warn(dsp->dev, 1675 adsp_warn(dsp,
1676 "Failed to lower supply: %d\n", 1676 "Failed to lower supply: %d\n",
1677 ret); 1677 ret);
1678 1678
1679 ret = regulator_disable(dsp->dvfs); 1679 ret = regulator_disable(dsp->dvfs);
1680 if (ret != 0) 1680 if (ret != 0)
1681 dev_err(dsp->dev, 1681 adsp_err(dsp,
1682 "Failed to enable supply: %d\n", 1682 "Failed to enable supply: %d\n",
1683 ret); 1683 ret);
1684 } 1684 }
1685 1685
1686 list_for_each_entry(ctl, &dsp->ctl_list, list) 1686 list_for_each_entry(ctl, &dsp->ctl_list, list)
@@ -1732,28 +1732,25 @@ int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs)
1732 adsp->dvfs = devm_regulator_get(adsp->dev, "DCVDD"); 1732 adsp->dvfs = devm_regulator_get(adsp->dev, "DCVDD");
1733 if (IS_ERR(adsp->dvfs)) { 1733 if (IS_ERR(adsp->dvfs)) {
1734 ret = PTR_ERR(adsp->dvfs); 1734 ret = PTR_ERR(adsp->dvfs);
1735 dev_err(adsp->dev, "Failed to get DCVDD: %d\n", ret); 1735 adsp_err(adsp, "Failed to get DCVDD: %d\n", ret);
1736 return ret; 1736 return ret;
1737 } 1737 }
1738 1738
1739 ret = regulator_enable(adsp->dvfs); 1739 ret = regulator_enable(adsp->dvfs);
1740 if (ret != 0) { 1740 if (ret != 0) {
1741 dev_err(adsp->dev, "Failed to enable DCVDD: %d\n", 1741 adsp_err(adsp, "Failed to enable DCVDD: %d\n", ret);
1742 ret);
1743 return ret; 1742 return ret;
1744 } 1743 }
1745 1744
1746 ret = regulator_set_voltage(adsp->dvfs, 1200000, 1800000); 1745 ret = regulator_set_voltage(adsp->dvfs, 1200000, 1800000);
1747 if (ret != 0) { 1746 if (ret != 0) {
1748 dev_err(adsp->dev, "Failed to initialise DVFS: %d\n", 1747 adsp_err(adsp, "Failed to initialise DVFS: %d\n", ret);
1749 ret);
1750 return ret; 1748 return ret;
1751 } 1749 }
1752 1750
1753 ret = regulator_disable(adsp->dvfs); 1751 ret = regulator_disable(adsp->dvfs);
1754 if (ret != 0) { 1752 if (ret != 0) {
1755 dev_err(adsp->dev, "Failed to disable DCVDD: %d\n", 1753 adsp_err(adsp, "Failed to disable DCVDD: %d\n", ret);
1756 ret);
1757 return ret; 1754 return ret;
1758 } 1755 }
1759 } 1756 }