Commit ee71a70e authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-v3.13-5' of...

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.
parents b8362e70 9a5c543d
...@@ -126,8 +126,6 @@ struct ab8500_codec_drvdata_dbg { ...@@ -126,8 +126,6 @@ struct ab8500_codec_drvdata_dbg {
/* Private data for AB8500 device-driver */ /* Private data for AB8500 device-driver */
struct ab8500_codec_drvdata { struct ab8500_codec_drvdata {
struct regmap *regmap;
/* Sidetone */ /* Sidetone */
long *sid_fir_values; long *sid_fir_values;
enum sid_state sid_status; enum sid_state sid_status;
...@@ -168,34 +166,48 @@ static inline const char *amic_type_str(enum amic_type type) ...@@ -168,34 +166,48 @@ static inline const char *amic_type_str(enum amic_type type)
*/ */
/* Read a register from the audio-bank of AB8500 */ /* Read a register from the audio-bank of AB8500 */
static int ab8500_codec_read_reg(void *context, unsigned int reg, static unsigned int ab8500_codec_read_reg(struct snd_soc_codec *codec,
unsigned int *value) unsigned int reg)
{ {
struct device *dev = context;
int status; int status;
unsigned int value = 0;
u8 value8; u8 value8;
status = abx500_get_register_interruptible(dev, AB8500_AUDIO, status = abx500_get_register_interruptible(codec->dev, AB8500_AUDIO,
reg, &value8); reg, &value8);
*value = (unsigned int)value8; if (status < 0) {
dev_err(codec->dev,
"%s: ERROR: Register (0x%02x:0x%02x) read failed (%d).\n",
__func__, (u8)AB8500_AUDIO, (u8)reg, status);
} else {
dev_dbg(codec->dev,
"%s: Read 0x%02x from register 0x%02x:0x%02x\n",
__func__, value8, (u8)AB8500_AUDIO, (u8)reg);
value = (unsigned int)value8;
}
return status; return value;
} }
/* Write to a register in the audio-bank of AB8500 */ /* Write to a register in the audio-bank of AB8500 */
static int ab8500_codec_write_reg(void *context, unsigned int reg, static int ab8500_codec_write_reg(struct snd_soc_codec *codec,
unsigned int value) unsigned int reg, unsigned int value)
{ {
struct device *dev = context; int status;
return abx500_set_register_interruptible(dev, AB8500_AUDIO, status = abx500_set_register_interruptible(codec->dev, AB8500_AUDIO,
reg, value); reg, value);
} if (status < 0)
dev_err(codec->dev,
"%s: ERROR: Register (%02x:%02x) write failed (%d).\n",
__func__, (u8)AB8500_AUDIO, (u8)reg, status);
else
dev_dbg(codec->dev,
"%s: Wrote 0x%02x into register %02x:%02x\n",
__func__, (u8)value, (u8)AB8500_AUDIO, (u8)reg);
static const struct regmap_config ab8500_codec_regmap = { return status;
.reg_read = ab8500_codec_read_reg, }
.reg_write = ab8500_codec_write_reg,
};
/* /*
* Controls - DAPM * Controls - DAPM
...@@ -2473,13 +2485,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) ...@@ -2473,13 +2485,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
dev_dbg(dev, "%s: Enter.\n", __func__); dev_dbg(dev, "%s: Enter.\n", __func__);
snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
/* Setup AB8500 according to board-settings */ /* Setup AB8500 according to board-settings */
pdata = dev_get_platdata(dev->parent); pdata = dev_get_platdata(dev->parent);
codec->control_data = drvdata->regmap;
if (np) { if (np) {
if (!pdata) if (!pdata)
pdata = devm_kzalloc(dev, pdata = devm_kzalloc(dev,
...@@ -2557,6 +2565,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) ...@@ -2557,6 +2565,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
static struct snd_soc_codec_driver ab8500_codec_driver = { static struct snd_soc_codec_driver ab8500_codec_driver = {
.probe = ab8500_codec_probe, .probe = ab8500_codec_probe,
.read = ab8500_codec_read_reg,
.write = ab8500_codec_write_reg,
.reg_word_size = sizeof(u8),
.controls = ab8500_ctrls, .controls = ab8500_ctrls,
.num_controls = ARRAY_SIZE(ab8500_ctrls), .num_controls = ARRAY_SIZE(ab8500_ctrls),
.dapm_widgets = ab8500_dapm_widgets, .dapm_widgets = ab8500_dapm_widgets,
...@@ -2581,15 +2592,6 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev) ...@@ -2581,15 +2592,6 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev)
drvdata->anc_status = ANC_UNCONFIGURED; drvdata->anc_status = ANC_UNCONFIGURED;
dev_set_drvdata(&pdev->dev, drvdata); dev_set_drvdata(&pdev->dev, drvdata);
drvdata->regmap = devm_regmap_init(&pdev->dev, NULL, &pdev->dev,
&ab8500_codec_regmap);
if (IS_ERR(drvdata->regmap)) {
status = PTR_ERR(drvdata->regmap);
dev_err(&pdev->dev, "%s: Failed to allocate regmap: %d\n",
__func__, status);
return status;
}
dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__); dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__);
status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver, status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver,
ab8500_codec_dai, ab8500_codec_dai,
......
...@@ -1528,6 +1528,8 @@ static void arizona_enable_fll(struct arizona_fll *fll, ...@@ -1528,6 +1528,8 @@ static void arizona_enable_fll(struct arizona_fll *fll,
/* Clear any pending completions */ /* Clear any pending completions */
try_wait_for_completion(&fll->ok); try_wait_for_completion(&fll->ok);
regmap_update_bits(arizona->regmap, fll->base + 1,
ARIZONA_FLL1_FREERUN, 0);
regmap_update_bits(arizona->regmap, fll->base + 1, regmap_update_bits(arizona->regmap, fll->base + 1,
ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA); ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
if (use_sync) if (use_sync)
...@@ -1546,6 +1548,8 @@ static void arizona_disable_fll(struct arizona_fll *fll) ...@@ -1546,6 +1548,8 @@ static void arizona_disable_fll(struct arizona_fll *fll)
struct arizona *arizona = fll->arizona; struct arizona *arizona = fll->arizona;
bool change; bool change;
regmap_update_bits(arizona->regmap, fll->base + 1,
ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN);
regmap_update_bits_check(arizona->regmap, fll->base + 1, regmap_update_bits_check(arizona->regmap, fll->base + 1,
ARIZONA_FLL1_ENA, 0, &change); ARIZONA_FLL1_ENA, 0, &change);
regmap_update_bits(arizona->regmap, fll->base + 0x11, regmap_update_bits(arizona->regmap, fll->base + 0x11,
......
...@@ -37,6 +37,47 @@ struct wm5110_priv { ...@@ -37,6 +37,47 @@ struct wm5110_priv {
struct arizona_fll fll[2]; struct arizona_fll fll[2];
}; };
static const struct reg_default wm5110_sysclk_revd_patch[] = {
{ 0x3093, 0x1001 },
{ 0x30E3, 0x1301 },
{ 0x3133, 0x1201 },
{ 0x3183, 0x1501 },
{ 0x31D3, 0x1401 },
};
static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = w->codec;
struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
struct regmap *regmap = codec->control_data;
const struct reg_default *patch = NULL;
int i, patch_size;
switch (arizona->rev) {
case 3:
patch = wm5110_sysclk_revd_patch;
patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch);
break;
default:
return 0;
}
switch (event) {
case SND_SOC_DAPM_POST_PMU:
if (patch)
for (i = 0; i < patch_size; i++)
regmap_write(regmap, patch[i].reg,
patch[i].def);
break;
default:
break;
}
return 0;
}
static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
...@@ -400,7 +441,7 @@ static const struct snd_kcontrol_new wm5110_aec_loopback_mux = ...@@ -400,7 +441,7 @@ static const struct snd_kcontrol_new wm5110_aec_loopback_mux =
static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = { static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
0, NULL, 0), 0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1, SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0), ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK, SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
......
...@@ -200,9 +200,8 @@ static void rsnd_dma_do_work(struct work_struct *work) ...@@ -200,9 +200,8 @@ static void rsnd_dma_do_work(struct work_struct *work)
return; return;
} }
dma_async_issue_pending(dma->chan);
} }
dma_async_issue_pending(dma->chan);
} }
int rsnd_dma_available(struct rsnd_dma *dma) int rsnd_dma_available(struct rsnd_dma *dma)
...@@ -288,15 +287,13 @@ int rsnd_dai_connect(struct rsnd_dai *rdai, ...@@ -288,15 +287,13 @@ int rsnd_dai_connect(struct rsnd_dai *rdai,
struct rsnd_mod *mod, struct rsnd_mod *mod,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
{ {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod); if (!mod)
struct device *dev = rsnd_priv_to_dev(priv);
if (!mod) {
dev_err(dev, "NULL mod\n");
return -EIO; return -EIO;
}
if (!list_empty(&mod->list)) { if (!list_empty(&mod->list)) {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);
dev_err(dev, "%s%d is not empty\n", dev_err(dev, "%s%d is not empty\n",
rsnd_mod_name(mod), rsnd_mod_name(mod),
rsnd_mod_id(mod)); rsnd_mod_id(mod));
......
...@@ -68,7 +68,7 @@ static int rsnd_scu_set_route(struct rsnd_priv *priv, ...@@ -68,7 +68,7 @@ static int rsnd_scu_set_route(struct rsnd_priv *priv,
return 0; return 0;
id = rsnd_mod_id(mod); id = rsnd_mod_id(mod);
if (id < 0 || id > ARRAY_SIZE(routes)) if (id < 0 || id >= ARRAY_SIZE(routes))
return -EIO; return -EIO;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment