aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm5102.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm5102.c')
-rw-r--r--sound/soc/codecs/wm5102.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index f439ae052128..6d0fe0ac95a3 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -28,6 +28,7 @@
28 28
29#include <linux/mfd/arizona/core.h> 29#include <linux/mfd/arizona/core.h>
30#include <linux/mfd/arizona/registers.h> 30#include <linux/mfd/arizona/registers.h>
31#include <asm/unaligned.h>
31 32
32#include "arizona.h" 33#include "arizona.h"
33#include "wm5102.h" 34#include "wm5102.h"
@@ -580,7 +581,7 @@ static const struct reg_default wm5102_sysclk_revb_patch[] = {
580static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, 581static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w,
581 struct snd_kcontrol *kcontrol, int event) 582 struct snd_kcontrol *kcontrol, int event)
582{ 583{
583 struct snd_soc_codec *codec = w->codec; 584 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
584 struct arizona *arizona = dev_get_drvdata(codec->dev->parent); 585 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
585 struct regmap *regmap = arizona->regmap; 586 struct regmap *regmap = arizona->regmap;
586 const struct reg_default *patch = NULL; 587 const struct reg_default *patch = NULL;
@@ -617,11 +618,10 @@ static int wm5102_out_comp_coeff_get(struct snd_kcontrol *kcontrol,
617{ 618{
618 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 619 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
619 struct arizona *arizona = dev_get_drvdata(codec->dev->parent); 620 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
620 uint16_t data;
621 621
622 mutex_lock(&arizona->dac_comp_lock); 622 mutex_lock(&arizona->dac_comp_lock);
623 data = cpu_to_be16(arizona->dac_comp_coeff); 623 put_unaligned_be16(arizona->dac_comp_coeff,
624 memcpy(ucontrol->value.bytes.data, &data, sizeof(data)); 624 ucontrol->value.bytes.data);
625 mutex_unlock(&arizona->dac_comp_lock); 625 mutex_unlock(&arizona->dac_comp_lock);
626 626
627 return 0; 627 return 0;
@@ -1272,19 +1272,24 @@ SND_SOC_DAPM_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
1272 1272
1273SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM, 1273SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
1274 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev, 1274 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
1275 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1275 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1276 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1276SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM, 1277SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
1277 ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev, 1278 ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
1278 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1279 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1280 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1279SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1, 1281SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1,
1280 ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1282 ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1281 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1283 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1284 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1282SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1, 1285SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1,
1283 ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1286 ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1284 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1287 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1288 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1285SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1, 1289SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
1286 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1290 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1287 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1291 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1292 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1288SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, 1293SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
1289 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1294 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1290 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1295 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),