diff options
| author | Takashi Iwai <tiwai@suse.de> | 2013-11-21 09:07:44 -0500 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2013-11-21 09:07:44 -0500 |
| commit | ee71a70e95e4a01be17cf4dfe0339f9774bb5927 (patch) | |
| tree | d10ce27c2a3cfee5332a91275f5426640d3bdc4b | |
| parent | b8362e70cbbb397db50939bc4c7c78dc3246c3eb (diff) | |
| parent | 9a5c543dd71952719d40429b6ef252a46c9b2246 (diff) | |
Merge tag 'asoc-v3.13-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.13
A bunch of device specific fixes, nothing with a general impact here.
| -rw-r--r-- | sound/soc/codecs/ab8500-codec.c | 66 | ||||
| -rw-r--r-- | sound/soc/codecs/arizona.c | 4 | ||||
| -rw-r--r-- | sound/soc/codecs/wm5110.c | 43 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/core.c | 13 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/scu.c | 2 |
5 files changed, 86 insertions, 42 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 21ae8d4fdbfb..1ad92cbf0b24 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c | |||
| @@ -126,8 +126,6 @@ struct ab8500_codec_drvdata_dbg { | |||
| 126 | 126 | ||
| 127 | /* Private data for AB8500 device-driver */ | 127 | /* Private data for AB8500 device-driver */ |
| 128 | struct ab8500_codec_drvdata { | 128 | struct ab8500_codec_drvdata { |
| 129 | struct regmap *regmap; | ||
| 130 | |||
| 131 | /* Sidetone */ | 129 | /* Sidetone */ |
| 132 | long *sid_fir_values; | 130 | long *sid_fir_values; |
| 133 | enum sid_state sid_status; | 131 | enum sid_state sid_status; |
| @@ -168,34 +166,48 @@ static inline const char *amic_type_str(enum amic_type type) | |||
| 168 | */ | 166 | */ |
| 169 | 167 | ||
| 170 | /* Read a register from the audio-bank of AB8500 */ | 168 | /* Read a register from the audio-bank of AB8500 */ |
| 171 | static int ab8500_codec_read_reg(void *context, unsigned int reg, | 169 | static unsigned int ab8500_codec_read_reg(struct snd_soc_codec *codec, |
| 172 | unsigned int *value) | 170 | unsigned int reg) |
| 173 | { | 171 | { |
| 174 | struct device *dev = context; | ||
| 175 | int status; | 172 | int status; |
| 173 | unsigned int value = 0; | ||
| 176 | 174 | ||
| 177 | u8 value8; | 175 | u8 value8; |
| 178 | status = abx500_get_register_interruptible(dev, AB8500_AUDIO, | 176 | status = abx500_get_register_interruptible(codec->dev, AB8500_AUDIO, |
| 179 | reg, &value8); | 177 | reg, &value8); |
| 180 | *value = (unsigned int)value8; | 178 | if (status < 0) { |
| 179 | dev_err(codec->dev, | ||
| 180 | "%s: ERROR: Register (0x%02x:0x%02x) read failed (%d).\n", | ||
| 181 | __func__, (u8)AB8500_AUDIO, (u8)reg, status); | ||
| 182 | } else { | ||
| 183 | dev_dbg(codec->dev, | ||
| 184 | "%s: Read 0x%02x from register 0x%02x:0x%02x\n", | ||
| 185 | __func__, value8, (u8)AB8500_AUDIO, (u8)reg); | ||
| 186 | value = (unsigned int)value8; | ||
| 187 | } | ||
| 181 | 188 | ||
| 182 | return status; | 189 | return value; |
| 183 | } | 190 | } |
| 184 | 191 | ||
| 185 | /* Write to a register in the audio-bank of AB8500 */ | 192 | /* Write to a register in the audio-bank of AB8500 */ |
| 186 | static int ab8500_codec_write_reg(void *context, unsigned int reg, | 193 | static int ab8500_codec_write_reg(struct snd_soc_codec *codec, |
| 187 | unsigned int value) | 194 | unsigned int reg, unsigned int value) |
| 188 | { | 195 | { |
| 189 | struct device *dev = context; | 196 | int status; |
| 190 | 197 | ||
| 191 | return abx500_set_register_interruptible(dev, AB8500_AUDIO, | 198 | status = abx500_set_register_interruptible(codec->dev, AB8500_AUDIO, |
| 192 | reg, value); | 199 | reg, value); |
| 193 | } | 200 | if (status < 0) |
| 201 | dev_err(codec->dev, | ||
| 202 | "%s: ERROR: Register (%02x:%02x) write failed (%d).\n", | ||
| 203 | __func__, (u8)AB8500_AUDIO, (u8)reg, status); | ||
| 204 | else | ||
| 205 | dev_dbg(codec->dev, | ||
| 206 | "%s: Wrote 0x%02x into register %02x:%02x\n", | ||
| 207 | __func__, (u8)value, (u8)AB8500_AUDIO, (u8)reg); | ||
| 194 | 208 | ||
| 195 | static const struct regmap_config ab8500_codec_regmap = { | 209 | return status; |
| 196 | .reg_read = ab8500_codec_read_reg, | 210 | } |
| 197 | .reg_write = ab8500_codec_write_reg, | ||
| 198 | }; | ||
| 199 | 211 | ||
| 200 | /* | 212 | /* |
| 201 | * Controls - DAPM | 213 | * Controls - DAPM |
| @@ -2473,13 +2485,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) | |||
| 2473 | 2485 | ||
| 2474 | dev_dbg(dev, "%s: Enter.\n", __func__); | 2486 | dev_dbg(dev, "%s: Enter.\n", __func__); |
| 2475 | 2487 | ||
| 2476 | snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP); | ||
| 2477 | |||
| 2478 | /* Setup AB8500 according to board-settings */ | 2488 | /* Setup AB8500 according to board-settings */ |
| 2479 | pdata = dev_get_platdata(dev->parent); | 2489 | pdata = dev_get_platdata(dev->parent); |
| 2480 | 2490 | ||
| 2481 | codec->control_data = drvdata->regmap; | ||
| 2482 | |||
| 2483 | if (np) { | 2491 | if (np) { |
| 2484 | if (!pdata) | 2492 | if (!pdata) |
| 2485 | pdata = devm_kzalloc(dev, | 2493 | pdata = devm_kzalloc(dev, |
| @@ -2557,6 +2565,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) | |||
| 2557 | 2565 | ||
| 2558 | static struct snd_soc_codec_driver ab8500_codec_driver = { | 2566 | static struct snd_soc_codec_driver ab8500_codec_driver = { |
| 2559 | .probe = ab8500_codec_probe, | 2567 | .probe = ab8500_codec_probe, |
| 2568 | .read = ab8500_codec_read_reg, | ||
| 2569 | .write = ab8500_codec_write_reg, | ||
| 2570 | .reg_word_size = sizeof(u8), | ||
| 2560 | .controls = ab8500_ctrls, | 2571 | .controls = ab8500_ctrls, |
| 2561 | .num_controls = ARRAY_SIZE(ab8500_ctrls), | 2572 | .num_controls = ARRAY_SIZE(ab8500_ctrls), |
| 2562 | .dapm_widgets = ab8500_dapm_widgets, | 2573 | .dapm_widgets = ab8500_dapm_widgets, |
| @@ -2581,15 +2592,6 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev) | |||
| 2581 | drvdata->anc_status = ANC_UNCONFIGURED; | 2592 | drvdata->anc_status = ANC_UNCONFIGURED; |
| 2582 | dev_set_drvdata(&pdev->dev, drvdata); | 2593 | dev_set_drvdata(&pdev->dev, drvdata); |
| 2583 | 2594 | ||
| 2584 | drvdata->regmap = devm_regmap_init(&pdev->dev, NULL, &pdev->dev, | ||
| 2585 | &ab8500_codec_regmap); | ||
| 2586 | if (IS_ERR(drvdata->regmap)) { | ||
| 2587 | status = PTR_ERR(drvdata->regmap); | ||
| 2588 | dev_err(&pdev->dev, "%s: Failed to allocate regmap: %d\n", | ||
| 2589 | __func__, status); | ||
| 2590 | return status; | ||
| 2591 | } | ||
| 2592 | |||
| 2593 | dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__); | 2595 | dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__); |
| 2594 | status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver, | 2596 | status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver, |
| 2595 | ab8500_codec_dai, | 2597 | ab8500_codec_dai, |
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index 6f05b17d1965..fea991031be1 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c | |||
| @@ -1529,6 +1529,8 @@ static void arizona_enable_fll(struct arizona_fll *fll, | |||
| 1529 | try_wait_for_completion(&fll->ok); | 1529 | try_wait_for_completion(&fll->ok); |
| 1530 | 1530 | ||
| 1531 | regmap_update_bits(arizona->regmap, fll->base + 1, | 1531 | regmap_update_bits(arizona->regmap, fll->base + 1, |
| 1532 | ARIZONA_FLL1_FREERUN, 0); | ||
| 1533 | regmap_update_bits(arizona->regmap, fll->base + 1, | ||
| 1532 | ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA); | 1534 | ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA); |
| 1533 | if (use_sync) | 1535 | if (use_sync) |
| 1534 | regmap_update_bits(arizona->regmap, fll->base + 0x11, | 1536 | regmap_update_bits(arizona->regmap, fll->base + 0x11, |
| @@ -1546,6 +1548,8 @@ static void arizona_disable_fll(struct arizona_fll *fll) | |||
| 1546 | struct arizona *arizona = fll->arizona; | 1548 | struct arizona *arizona = fll->arizona; |
| 1547 | bool change; | 1549 | bool change; |
| 1548 | 1550 | ||
| 1551 | regmap_update_bits(arizona->regmap, fll->base + 1, | ||
| 1552 | ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN); | ||
| 1549 | regmap_update_bits_check(arizona->regmap, fll->base + 1, | 1553 | regmap_update_bits_check(arizona->regmap, fll->base + 1, |
| 1550 | ARIZONA_FLL1_ENA, 0, &change); | 1554 | ARIZONA_FLL1_ENA, 0, &change); |
| 1551 | regmap_update_bits(arizona->regmap, fll->base + 0x11, | 1555 | regmap_update_bits(arizona->regmap, fll->base + 0x11, |
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index f2d1094424b9..c3c7396a6181 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c | |||
| @@ -37,6 +37,47 @@ struct wm5110_priv { | |||
| 37 | struct arizona_fll fll[2]; | 37 | struct arizona_fll fll[2]; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | static const struct reg_default wm5110_sysclk_revd_patch[] = { | ||
| 41 | { 0x3093, 0x1001 }, | ||
| 42 | { 0x30E3, 0x1301 }, | ||
| 43 | { 0x3133, 0x1201 }, | ||
| 44 | { 0x3183, 0x1501 }, | ||
| 45 | { 0x31D3, 0x1401 }, | ||
| 46 | }; | ||
| 47 | |||
| 48 | static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w, | ||
| 49 | struct snd_kcontrol *kcontrol, int event) | ||
| 50 | { | ||
| 51 | struct snd_soc_codec *codec = w->codec; | ||
| 52 | struct arizona | ||
