diff options
| -rw-r--r-- | sound/soc/codecs/wm_adsp.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index ff0ce6ba1b69..0f6eeb199351 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
| @@ -862,15 +862,13 @@ static int wmfw_add_ctl(struct wm_adsp *dsp, struct wm_coeff_ctl *ctl) | |||
| 862 | kcontrol->access |= SNDRV_CTL_ELEM_ACCESS_VOLATILE; | 862 | kcontrol->access |= SNDRV_CTL_ELEM_ACCESS_VOLATILE; |
| 863 | } | 863 | } |
| 864 | 864 | ||
| 865 | ret = snd_soc_add_card_controls(dsp->card, | 865 | ret = snd_soc_add_card_controls(dsp->card, kcontrol, 1); |
| 866 | kcontrol, 1); | ||
| 867 | if (ret < 0) | 866 | if (ret < 0) |
| 868 | goto err_kcontrol; | 867 | goto err_kcontrol; |
| 869 | 868 | ||
| 870 | kfree(kcontrol); | 869 | kfree(kcontrol); |
| 871 | 870 | ||
| 872 | ctl->kcontrol = snd_soc_card_get_kcontrol(dsp->card, | 871 | ctl->kcontrol = snd_soc_card_get_kcontrol(dsp->card, ctl->name); |
| 873 | ctl->name); | ||
| 874 | 872 | ||
| 875 | return 0; | 873 | return 0; |
| 876 | 874 | ||
| @@ -890,9 +888,7 @@ static int wm_coeff_init_control_caches(struct wm_adsp *dsp) | |||
| 890 | if (ctl->flags & WMFW_CTL_FLAG_VOLATILE) | 888 | if (ctl->flags & WMFW_CTL_FLAG_VOLATILE) |
| 891 | continue; | 889 | continue; |
| 892 | 890 | ||
| 893 | ret = wm_coeff_read_control(ctl, | 891 | ret = wm_coeff_read_control(ctl, ctl->cache, ctl->len); |
| 894 | ctl->cache, | ||
| 895 | ctl->len); | ||
| 896 | if (ret < 0) | 892 | if (ret < 0) |
| 897 | return ret; | 893 | return ret; |
| 898 | } | 894 | } |
| @@ -909,9 +905,7 @@ static int wm_coeff_sync_controls(struct wm_adsp *dsp) | |||
| 909 | if (!ctl->enabled) | 905 | if (!ctl->enabled) |
| 910 | continue; | 906 | continue; |
| 911 | if (ctl->set && !(ctl->flags & WMFW_CTL_FLAG_VOLATILE)) { | 907 | if (ctl->set && !(ctl->flags & WMFW_CTL_FLAG_VOLATILE)) { |
| 912 | ret = wm_coeff_write_control(ctl, | 908 | ret = wm_coeff_write_control(ctl, ctl->cache, ctl->len); |
| 913 | ctl->cache, | ||
| 914 | ctl->len); | ||
| 915 | if (ret < 0) | 909 | if (ret < 0) |
| 916 | return ret; | 910 | return ret; |
| 917 | } | 911 | } |
| @@ -1507,8 +1501,7 @@ static void *wm_adsp_read_algs(struct wm_adsp *dsp, size_t n_algs, | |||
| 1507 | 1501 | ||
| 1508 | ret = regmap_raw_read(dsp->regmap, pos, alg, len * 2); | 1502 | ret = regmap_raw_read(dsp->regmap, pos, alg, len * 2); |
| 1509 | if (ret != 0) { | 1503 | if (ret != 0) { |
| 1510 | adsp_err(dsp, "Failed to read algorithm list: %d\n", | 1504 | adsp_err(dsp, "Failed to read algorithm list: %d\n", ret); |
| 1511 | ret); | ||
| 1512 | kfree(alg); | 1505 | kfree(alg); |
| 1513 | return ERR_PTR(ret); | 1506 | return ERR_PTR(ret); |
| 1514 | } | 1507 | } |
| @@ -2007,8 +2000,7 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w, | |||
| 2007 | goto err_mutex; | 2000 | goto err_mutex; |
| 2008 | } | 2001 | } |
| 2009 | 2002 | ||
| 2010 | val = (val & dsp->sysclk_mask) | 2003 | val = (val & dsp->sysclk_mask) >> dsp->sysclk_shift; |
| 2011 | >> dsp->sysclk_shift; | ||
| 2012 | 2004 | ||
| 2013 | ret = regmap_update_bits(dsp->regmap, | 2005 | ret = regmap_update_bits(dsp->regmap, |
| 2014 | dsp->base + ADSP1_CONTROL_31, | 2006 | dsp->base + ADSP1_CONTROL_31, |
| @@ -2101,8 +2093,7 @@ static int wm_adsp2_ena(struct wm_adsp *dsp) | |||
| 2101 | 2093 | ||
| 2102 | /* Wait for the RAM to start, should be near instantaneous */ | 2094 | /* Wait for the RAM to start, should be near instantaneous */ |
| 2103 | for (count = 0; count < 10; ++count) { | 2095 | for (count = 0; count < 10; ++count) { |
| 2104 | ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1, | 2096 | ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1, &val); |
| 2105 | &val); | ||
| 2106 | if (ret != 0) | 2097 | if (ret != 0) |
| 2107 | return ret; | 2098 | return ret; |
| 2108 | 2099 | ||
