Commit 5259b17b authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/mtk', 'asoc/fix/rt5659',...

Merge remote-tracking branches 'asoc/fix/mtk', 'asoc/fix/rt5659', 'asoc/fix/ssm2602' and 'asoc/fix/topology' into asoc-linus
...@@ -22,7 +22,7 @@ Optionnal properties: ...@@ -22,7 +22,7 @@ Optionnal properties:
Example: Example:
sound { sound {
compatible = "rockchip,rockchip-audio-es8388"; compatible = "rockchip,rk3288-hdmi-analog";
rockchip,model = "Analog audio output"; rockchip,model = "Analog audio output";
rockchip,i2s-controller = <&i2s>; rockchip,i2s-controller = <&i2s>;
rockchip,audio-codec = <&es8388>; rockchip,audio-codec = <&es8388>;
......
...@@ -2500,9 +2500,9 @@ static const struct snd_soc_dapm_widget rt5659_dapm_widgets[] = { ...@@ -2500,9 +2500,9 @@ static const struct snd_soc_dapm_widget rt5659_dapm_widgets[] = {
RT5659_PWR_ADC_L1_BIT, 0, NULL, 0), RT5659_PWR_ADC_L1_BIT, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("ADC1 R Power", RT5659_PWR_DIG_1, SND_SOC_DAPM_SUPPLY("ADC1 R Power", RT5659_PWR_DIG_1,
RT5659_PWR_ADC_R1_BIT, 0, NULL, 0), RT5659_PWR_ADC_R1_BIT, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("ADC2 L Power", RT5659_PWR_DIG_2, SND_SOC_DAPM_SUPPLY("ADC2 L Power", RT5659_PWR_DIG_1,
RT5659_PWR_ADC_L2_BIT, 0, NULL, 0), RT5659_PWR_ADC_L2_BIT, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("ADC2 R Power", RT5659_PWR_DIG_2, SND_SOC_DAPM_SUPPLY("ADC2 R Power", RT5659_PWR_DIG_1,
RT5659_PWR_ADC_R2_BIT, 0, NULL, 0), RT5659_PWR_ADC_R2_BIT, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("ADC1 clock", SND_SOC_NOPM, 0, 0, set_adc_clk, SND_SOC_DAPM_SUPPLY("ADC1 clock", SND_SOC_NOPM, 0, 0, set_adc_clk,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
......
...@@ -1008,7 +1008,7 @@ ...@@ -1008,7 +1008,7 @@
#define RT5659_PWR_ADC_R1 (0x1 << 3) #define RT5659_PWR_ADC_R1 (0x1 << 3)
#define RT5659_PWR_ADC_R1_BIT 3 #define RT5659_PWR_ADC_R1_BIT 3
#define RT5659_PWR_ADC_L2 (0x1 << 2) #define RT5659_PWR_ADC_L2 (0x1 << 2)
#define RT5659_PWR_ADC_L2_BIT 4 #define RT5659_PWR_ADC_L2_BIT 2
#define RT5659_PWR_ADC_R2 (0x1 << 1) #define RT5659_PWR_ADC_R2 (0x1 << 1)
#define RT5659_PWR_ADC_R2_BIT 1 #define RT5659_PWR_ADC_R2_BIT 1
#define RT5659_PWR_CLS_D (0x1) #define RT5659_PWR_CLS_D (0x1)
......
...@@ -54,10 +54,17 @@ struct ssm2602_priv { ...@@ -54,10 +54,17 @@ struct ssm2602_priv {
* using 2 wire for device control, so we cache them instead. * using 2 wire for device control, so we cache them instead.
* There is no point in caching the reset register * There is no point in caching the reset register
*/ */
static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = { static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] = {
0x0097, 0x0097, 0x0079, 0x0079, { .reg = 0x00, .def = 0x0097 },
0x000a, 0x0008, 0x009f, 0x000a, { .reg = 0x01, .def = 0x0097 },
0x0000, 0x0000 { .reg = 0x02, .def = 0x0079 },
{ .reg = 0x03, .def = 0x0079 },
{ .reg = 0x04, .def = 0x000a },
{ .reg = 0x05, .def = 0x0008 },
{ .reg = 0x06, .def = 0x009f },
{ .reg = 0x07, .def = 0x000a },
{ .reg = 0x08, .def = 0x0000 },
{ .reg = 0x09, .def = 0x0000 }
}; };
...@@ -620,8 +627,8 @@ const struct regmap_config ssm2602_regmap_config = { ...@@ -620,8 +627,8 @@ const struct regmap_config ssm2602_regmap_config = {
.volatile_reg = ssm2602_register_volatile, .volatile_reg = ssm2602_register_volatile,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
.reg_defaults_raw = ssm2602_reg, .reg_defaults = ssm2602_reg,
.num_reg_defaults_raw = ARRAY_SIZE(ssm2602_reg), .num_reg_defaults = ARRAY_SIZE(ssm2602_reg),
}; };
EXPORT_SYMBOL_GPL(ssm2602_regmap_config); EXPORT_SYMBOL_GPL(ssm2602_regmap_config);
......
...@@ -155,7 +155,7 @@ static struct snd_soc_dai_link_component rk_codecs[] = { ...@@ -155,7 +155,7 @@ static struct snd_soc_dai_link_component rk_codecs[] = {
{ }, { },
{ {
.name = "hdmi-audio-codec.2.auto", .name = "hdmi-audio-codec.2.auto",
.dai_name = "hdmi-hifi.0", .dai_name = "i2s-hifi",
}, },
}; };
......
...@@ -523,6 +523,7 @@ static void remove_widget(struct snd_soc_component *comp, ...@@ -523,6 +523,7 @@ static void remove_widget(struct snd_soc_component *comp,
kfree(se->dobj.control.dtexts[j]); kfree(se->dobj.control.dtexts[j]);
kfree(se); kfree(se);
kfree(w->kcontrol_news[i].name);
} }
kfree(w->kcontrol_news); kfree(w->kcontrol_news);
} else { } else {
...@@ -540,6 +541,7 @@ static void remove_widget(struct snd_soc_component *comp, ...@@ -540,6 +541,7 @@ static void remove_widget(struct snd_soc_component *comp,
*/ */
kfree((void *)kcontrol->private_value); kfree((void *)kcontrol->private_value);
snd_ctl_remove(card, kcontrol); snd_ctl_remove(card, kcontrol);
kfree(w->kcontrol_news[i].name);
} }
kfree(w->kcontrol_news); kfree(w->kcontrol_news);
} }
...@@ -1233,7 +1235,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( ...@@ -1233,7 +1235,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
dev_dbg(tplg->dev, " adding DAPM widget mixer control %s at %d\n", dev_dbg(tplg->dev, " adding DAPM widget mixer control %s at %d\n",
mc->hdr.name, i); mc->hdr.name, i);
kc[i].name = mc->hdr.name; kc[i].name = kstrdup(mc->hdr.name, GFP_KERNEL);
if (kc[i].name == NULL)
goto err_str;
kc[i].private_value = (long)sm; kc[i].private_value = (long)sm;
kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER;
kc[i].access = mc->hdr.access; kc[i].access = mc->hdr.access;
...@@ -1278,8 +1282,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( ...@@ -1278,8 +1282,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
err_str: err_str:
kfree(sm); kfree(sm);
err: err:
for (--i; i >= 0; i--) for (--i; i >= 0; i--) {
kfree((void *)kc[i].private_value); kfree((void *)kc[i].private_value);
kfree(kc[i].name);
}
kfree(kc); kfree(kc);
return NULL; return NULL;
} }
...@@ -1310,7 +1316,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( ...@@ -1310,7 +1316,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
dev_dbg(tplg->dev, " adding DAPM widget enum control %s\n", dev_dbg(tplg->dev, " adding DAPM widget enum control %s\n",
ec->hdr.name); ec->hdr.name);
kc[i].name = ec->hdr.name; kc[i].name = kstrdup(ec->hdr.name, GFP_KERNEL);
if (kc[i].name == NULL)
goto err_se;
kc[i].private_value = (long)se; kc[i].private_value = (long)se;
kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER;
kc[i].access = ec->hdr.access; kc[i].access = ec->hdr.access;
...@@ -1386,6 +1394,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( ...@@ -1386,6 +1394,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
kfree(se->dobj.control.dtexts[j]); kfree(se->dobj.control.dtexts[j]);
kfree(se); kfree(se);
kfree(kc[i].name);
} }
err: err:
kfree(kc); kfree(kc);
...@@ -1424,7 +1433,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create( ...@@ -1424,7 +1433,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(
"ASoC: adding bytes kcontrol %s with access 0x%x\n", "ASoC: adding bytes kcontrol %s with access 0x%x\n",
be->hdr.name, be->hdr.access); be->hdr.name, be->hdr.access);
kc[i].name = be->hdr.name; kc[i].name = kstrdup(be->hdr.name, GFP_KERNEL);
if (kc[i].name == NULL)
goto err;
kc[i].private_value = (long)sbe; kc[i].private_value = (long)sbe;
kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER; kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER;
kc[i].access = be->hdr.access; kc[i].access = be->hdr.access;
...@@ -1454,8 +1465,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create( ...@@ -1454,8 +1465,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(
return kc; return kc;
err: err:
for (--i; i >= 0; i--) for (--i; i >= 0; i--) {
kfree((void *)kc[i].private_value); kfree((void *)kc[i].private_value);
kfree(kc[i].name);
}
kfree(kc); kfree(kc);
return NULL; return NULL;
......
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