Merge remote-tracking branches 'asoc/fix/rt5677', 'asoc/fix/st', 'asoc/fix/sun4i-codec', 'asoc/fix/topology', 'asoc/fix/wm8960' and 'asoc/fix/wm8962' into asoc-linus
This commit is contained in:
commit
923f1cbf2e
|
@ -1386,90 +1386,90 @@ static const struct snd_kcontrol_new rt5677_dac_r_mix[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_sto1_dac_l_mix[] = {
|
static const struct snd_kcontrol_new rt5677_sto1_dac_l_mix[] = {
|
||||||
SOC_DAPM_SINGLE("ST L Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("ST L Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_ST_DAC1_L_SFT, 1, 1),
|
RT5677_M_ST_DAC1_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 L Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 L Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC1_L_STO_L_SFT, 1, 1),
|
RT5677_M_DAC1_L_STO_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 L Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 L Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC2_L_STO_L_SFT, 1, 1),
|
RT5677_M_DAC2_L_STO_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 R Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 R Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC1_R_STO_L_SFT, 1, 1),
|
RT5677_M_DAC1_R_STO_L_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_sto1_dac_r_mix[] = {
|
static const struct snd_kcontrol_new rt5677_sto1_dac_r_mix[] = {
|
||||||
SOC_DAPM_SINGLE("ST R Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("ST R Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_ST_DAC1_R_SFT, 1, 1),
|
RT5677_M_ST_DAC1_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 R Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 R Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC1_R_STO_R_SFT, 1, 1),
|
RT5677_M_DAC1_R_STO_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 R Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 R Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC2_R_STO_R_SFT, 1, 1),
|
RT5677_M_DAC2_R_STO_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 L Switch", RT5677_STO1_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 L Switch", RT5677_STO1_DAC_MIXER,
|
||||||
RT5677_M_DAC1_L_STO_R_SFT, 1, 1),
|
RT5677_M_DAC1_L_STO_R_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_mono_dac_l_mix[] = {
|
static const struct snd_kcontrol_new rt5677_mono_dac_l_mix[] = {
|
||||||
SOC_DAPM_SINGLE("ST L Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("ST L Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_ST_DAC2_L_SFT, 1, 1),
|
RT5677_M_ST_DAC2_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 L Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 L Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC1_L_MONO_L_SFT, 1, 1),
|
RT5677_M_DAC1_L_MONO_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 L Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 L Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC2_L_MONO_L_SFT, 1, 1),
|
RT5677_M_DAC2_L_MONO_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 R Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 R Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC2_R_MONO_L_SFT, 1, 1),
|
RT5677_M_DAC2_R_MONO_L_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_mono_dac_r_mix[] = {
|
static const struct snd_kcontrol_new rt5677_mono_dac_r_mix[] = {
|
||||||
SOC_DAPM_SINGLE("ST R Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("ST R Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_ST_DAC2_R_SFT, 1, 1),
|
RT5677_M_ST_DAC2_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC1 R Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC1 R Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC1_R_MONO_R_SFT, 1, 1),
|
RT5677_M_DAC1_R_MONO_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 R Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 R Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC2_R_MONO_R_SFT, 1, 1),
|
RT5677_M_DAC2_R_MONO_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC2 L Switch", RT5677_MONO_DAC_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC2 L Switch", RT5677_MONO_DAC_MIXER,
|
||||||
RT5677_M_DAC2_L_MONO_R_SFT, 1, 1),
|
RT5677_M_DAC2_L_MONO_R_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_dd1_l_mix[] = {
|
static const struct snd_kcontrol_new rt5677_dd1_l_mix[] = {
|
||||||
SOC_DAPM_SINGLE("Sto DAC Mix L Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Sto DAC Mix L Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_STO_L_DD1_L_SFT, 1, 1),
|
RT5677_M_STO_L_DD1_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("Mono DAC Mix L Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Mono DAC Mix L Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_MONO_L_DD1_L_SFT, 1, 1),
|
RT5677_M_MONO_L_DD1_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC3 L Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC3 L Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_DAC3_L_DD1_L_SFT, 1, 1),
|
RT5677_M_DAC3_L_DD1_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC3 R Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC3 R Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_DAC3_R_DD1_L_SFT, 1, 1),
|
RT5677_M_DAC3_R_DD1_L_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_dd1_r_mix[] = {
|
static const struct snd_kcontrol_new rt5677_dd1_r_mix[] = {
|
||||||
SOC_DAPM_SINGLE("Sto DAC Mix R Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Sto DAC Mix R Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_STO_R_DD1_R_SFT, 1, 1),
|
RT5677_M_STO_R_DD1_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("Mono DAC Mix R Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Mono DAC Mix R Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_MONO_R_DD1_R_SFT, 1, 1),
|
RT5677_M_MONO_R_DD1_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC3 R Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC3 R Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_DAC3_R_DD1_R_SFT, 1, 1),
|
RT5677_M_DAC3_R_DD1_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC3 L Switch", RT5677_DD1_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC3 L Switch", RT5677_DD1_MIXER,
|
||||||
RT5677_M_DAC3_L_DD1_R_SFT, 1, 1),
|
RT5677_M_DAC3_L_DD1_R_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_dd2_l_mix[] = {
|
static const struct snd_kcontrol_new rt5677_dd2_l_mix[] = {
|
||||||
SOC_DAPM_SINGLE("Sto DAC Mix L Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Sto DAC Mix L Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_STO_L_DD2_L_SFT, 1, 1),
|
RT5677_M_STO_L_DD2_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("Mono DAC Mix L Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Mono DAC Mix L Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_MONO_L_DD2_L_SFT, 1, 1),
|
RT5677_M_MONO_L_DD2_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC4 L Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC4 L Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_DAC4_L_DD2_L_SFT, 1, 1),
|
RT5677_M_DAC4_L_DD2_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC4 R Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC4 R Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_DAC4_R_DD2_L_SFT, 1, 1),
|
RT5677_M_DAC4_R_DD2_L_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_kcontrol_new rt5677_dd2_r_mix[] = {
|
static const struct snd_kcontrol_new rt5677_dd2_r_mix[] = {
|
||||||
SOC_DAPM_SINGLE("Sto DAC Mix R Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Sto DAC Mix R Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_STO_R_DD2_R_SFT, 1, 1),
|
RT5677_M_STO_R_DD2_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("Mono DAC Mix R Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("Mono DAC Mix R Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_MONO_R_DD2_R_SFT, 1, 1),
|
RT5677_M_MONO_R_DD2_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC4 R Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC4 R Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_DAC4_R_DD2_R_SFT, 1, 1),
|
RT5677_M_DAC4_R_DD2_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("DAC4 L Switch", RT5677_DD2_MIXER,
|
SOC_DAPM_SINGLE_AUTODISABLE("DAC4 L Switch", RT5677_DD2_MIXER,
|
||||||
RT5677_M_DAC4_L_DD2_R_SFT, 1, 1),
|
RT5677_M_DAC4_L_DD2_R_SFT, 1, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2596,6 +2596,21 @@ static int rt5677_vref_event(struct snd_soc_dapm_widget *w,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rt5677_filter_power_event(struct snd_soc_dapm_widget *w,
|
||||||
|
struct snd_kcontrol *kcontrol, int event)
|
||||||
|
{
|
||||||
|
switch (event) {
|
||||||
|
case SND_SOC_DAPM_POST_PMU:
|
||||||
|
msleep(50);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
|
static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
|
||||||
SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT,
|
SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT,
|
||||||
0, rt5677_set_pll1_event, SND_SOC_DAPM_PRE_PMU |
|
0, rt5677_set_pll1_event, SND_SOC_DAPM_PRE_PMU |
|
||||||
|
@ -3072,19 +3087,26 @@ static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
|
||||||
|
|
||||||
/* DAC Mixer */
|
/* DAC Mixer */
|
||||||
SND_SOC_DAPM_SUPPLY("dac stereo1 filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac stereo1 filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_S1F_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_S1F_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono2 left filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono2 left filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M2F_L_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M2F_L_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono2 right filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono2 right filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M2F_R_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M2F_R_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono3 left filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono3 left filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M3F_L_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M3F_L_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono3 right filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono3 right filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M3F_R_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M3F_R_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono4 left filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono4 left filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M4F_L_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M4F_L_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
SND_SOC_DAPM_SUPPLY("dac mono4 right filter", RT5677_PWR_DIG2,
|
SND_SOC_DAPM_SUPPLY("dac mono4 right filter", RT5677_PWR_DIG2,
|
||||||
RT5677_PWR_DAC_M4F_R_BIT, 0, NULL, 0),
|
RT5677_PWR_DAC_M4F_R_BIT, 0, rt5677_filter_power_event,
|
||||||
|
SND_SOC_DAPM_POST_PMU),
|
||||||
|
|
||||||
SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
|
SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
|
||||||
rt5677_sto1_dac_l_mix, ARRAY_SIZE(rt5677_sto1_dac_l_mix)),
|
rt5677_sto1_dac_l_mix, ARRAY_SIZE(rt5677_sto1_dac_l_mix)),
|
||||||
|
|
|
@ -229,7 +229,7 @@ SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL,
|
||||||
SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
|
SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
|
||||||
6, 1, 0),
|
6, 1, 0),
|
||||||
SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
|
SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
|
||||||
7, 1, 0),
|
7, 1, 1),
|
||||||
|
|
||||||
SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
|
SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
|
||||||
WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
|
WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
|
||||||
|
|
|
@ -365,8 +365,8 @@ static const struct reg_default wm8962_reg[] = {
|
||||||
{ 16924, 0x0059 }, /* R16924 - HDBASS_PG_1 */
|
{ 16924, 0x0059 }, /* R16924 - HDBASS_PG_1 */
|
||||||
{ 16925, 0x999A }, /* R16925 - HDBASS_PG_0 */
|
{ 16925, 0x999A }, /* R16925 - HDBASS_PG_0 */
|
||||||
|
|
||||||
{ 17048, 0x0083 }, /* R17408 - HPF_C_1 */
|
{ 17408, 0x0083 }, /* R17408 - HPF_C_1 */
|
||||||
{ 17049, 0x98AD }, /* R17409 - HPF_C_0 */
|
{ 17409, 0x98AD }, /* R17409 - HPF_C_0 */
|
||||||
|
|
||||||
{ 17920, 0x007F }, /* R17920 - ADCL_RETUNE_C1_1 */
|
{ 17920, 0x007F }, /* R17920 - ADCL_RETUNE_C1_1 */
|
||||||
{ 17921, 0xFFFF }, /* R17921 - ADCL_RETUNE_C1_0 */
|
{ 17921, 0xFFFF }, /* R17921 - ADCL_RETUNE_C1_0 */
|
||||||
|
|
|
@ -531,7 +531,7 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
|
||||||
/* TLV bytes controls need standard kcontrol info handler,
|
/* TLV bytes controls need standard kcontrol info handler,
|
||||||
* TLV callback and extended put/get handlers.
|
* TLV callback and extended put/get handlers.
|
||||||
*/
|
*/
|
||||||
k->info = snd_soc_bytes_info;
|
k->info = snd_soc_bytes_info_ext;
|
||||||
k->tlv.c = snd_soc_bytes_tlv_callback;
|
k->tlv.c = snd_soc_bytes_tlv_callback;
|
||||||
|
|
||||||
ext_ops = tplg->bytes_ext_ops;
|
ext_ops = tplg->bytes_ext_ops;
|
||||||
|
|
|
@ -669,6 +669,7 @@ static int uni_player_startup(struct snd_pcm_substream *substream,
|
||||||
{
|
{
|
||||||
struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai);
|
struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai);
|
||||||
struct uniperif *player = priv->dai_data.uni;
|
struct uniperif *player = priv->dai_data.uni;
|
||||||
|
player->substream = substream;
|
||||||
|
|
||||||
player->clk_adj = 0;
|
player->clk_adj = 0;
|
||||||
|
|
||||||
|
@ -950,6 +951,8 @@ static void uni_player_shutdown(struct snd_pcm_substream *substream,
|
||||||
if (player->state != UNIPERIF_STATE_STOPPED)
|
if (player->state != UNIPERIF_STATE_STOPPED)
|
||||||
/* Stop the player */
|
/* Stop the player */
|
||||||
uni_player_stop(player);
|
uni_player_stop(player);
|
||||||
|
|
||||||
|
player->substream = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int uni_player_parse_dt_clk_glue(struct platform_device *pdev,
|
static int uni_player_parse_dt_clk_glue(struct platform_device *pdev,
|
||||||
|
@ -989,7 +992,7 @@ static int uni_player_parse_dt(struct platform_device *pdev,
|
||||||
if (!info)
|
if (!info)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (of_property_read_u32(pnode, "version", &player->ver) ||
|
if (of_property_read_u32(pnode, "st,version", &player->ver) ||
|
||||||
player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
|
player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
|
||||||
dev_err(dev, "Unknown uniperipheral version ");
|
dev_err(dev, "Unknown uniperipheral version ");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -998,13 +1001,13 @@ static int uni_player_parse_dt(struct platform_device *pdev,
|
||||||
if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
|
||||||
info->underflow_enabled = 1;
|
info->underflow_enabled = 1;
|
||||||
|
|
||||||
if (of_property_read_u32(pnode, "uniperiph-id", &info->id)) {
|
if (of_property_read_u32(pnode, "st,uniperiph-id", &info->id)) {
|
||||||
dev_err(dev, "uniperipheral id not defined");
|
dev_err(dev, "uniperipheral id not defined");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the device mode property */
|
/* Read the device mode property */
|
||||||
if (of_property_read_string(pnode, "mode", &mode)) {
|
if (of_property_read_string(pnode, "st,mode", &mode)) {
|
||||||
dev_err(dev, "uniperipheral mode not defined");
|
dev_err(dev, "uniperipheral mode not defined");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ static int uni_reader_parse_dt(struct platform_device *pdev,
|
||||||
if (!info)
|
if (!info)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (of_property_read_u32(node, "version", &reader->ver) ||
|
if (of_property_read_u32(node, "st,version", &reader->ver) ||
|
||||||
reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
|
reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
|
||||||
dev_err(&pdev->dev, "Unknown uniperipheral version ");
|
dev_err(&pdev->dev, "Unknown uniperipheral version ");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -346,7 +346,6 @@ int uni_reader_init(struct platform_device *pdev,
|
||||||
reader->hw = &uni_reader_pcm_hw;
|
reader->hw = &uni_reader_pcm_hw;
|
||||||
reader->dai_ops = &uni_reader_dai_ops;
|
reader->dai_ops = &uni_reader_dai_ops;
|
||||||
|
|
||||||
dev_err(reader->dev, "%s: enter\n", __func__);
|
|
||||||
ret = uni_reader_parse_dt(pdev, reader);
|
ret = uni_reader_parse_dt(pdev, reader);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(reader->dev, "Failed to parse DeviceTree");
|
dev_err(reader->dev, "Failed to parse DeviceTree");
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* Copyright 2014 Emilio López <emilio@elopez.com.ar>
|
* Copyright 2014 Emilio López <emilio@elopez.com.ar>
|
||||||
* Copyright 2014 Jon Smirl <jonsmirl@gmail.com>
|
* Copyright 2014 Jon Smirl <jonsmirl@gmail.com>
|
||||||
* Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com>
|
* Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||||
|
* Copyright 2015 Adam Sampson <ats@offog.org>
|
||||||
*
|
*
|
||||||
* Based on the Allwinner SDK driver, released under the GPL.
|
* Based on the Allwinner SDK driver, released under the GPL.
|
||||||
*
|
*
|
||||||
|
@ -404,7 +405,7 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mute =
|
||||||
static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1);
|
static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1);
|
||||||
|
|
||||||
static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
|
static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
|
||||||
SOC_SINGLE_TLV("PA Volume", SUN4I_CODEC_DAC_ACTL,
|
SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,
|
||||||
SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
|
SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
|
||||||
sun4i_codec_pa_volume_scale),
|
sun4i_codec_pa_volume_scale),
|
||||||
};
|
};
|
||||||
|
@ -452,12 +453,12 @@ static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = {
|
||||||
SND_SOC_DAPM_SUPPLY("Mixer Enable", SUN4I_CODEC_DAC_ACTL,
|
SND_SOC_DAPM_SUPPLY("Mixer Enable", SUN4I_CODEC_DAC_ACTL,
|
||||||
SUN4I_CODEC_DAC_ACTL_MIXEN, 0, NULL, 0),
|
SUN4I_CODEC_DAC_ACTL_MIXEN, 0, NULL, 0),
|
||||||
|
|
||||||
/* Pre-Amplifier */
|
/* Power Amplifier */
|
||||||
SND_SOC_DAPM_MIXER("Pre-Amplifier", SUN4I_CODEC_ADC_ACTL,
|
SND_SOC_DAPM_MIXER("Power Amplifier", SUN4I_CODEC_ADC_ACTL,
|
||||||
SUN4I_CODEC_ADC_ACTL_PA_EN, 0,
|
SUN4I_CODEC_ADC_ACTL_PA_EN, 0,
|
||||||
sun4i_codec_pa_mixer_controls,
|
sun4i_codec_pa_mixer_controls,
|
||||||
ARRAY_SIZE(sun4i_codec_pa_mixer_controls)),
|
ARRAY_SIZE(sun4i_codec_pa_mixer_controls)),
|
||||||
SND_SOC_DAPM_SWITCH("Pre-Amplifier Mute", SND_SOC_NOPM, 0, 0,
|
SND_SOC_DAPM_SWITCH("Power Amplifier Mute", SND_SOC_NOPM, 0, 0,
|
||||||
&sun4i_codec_pa_mute),
|
&sun4i_codec_pa_mute),
|
||||||
|
|
||||||
SND_SOC_DAPM_OUTPUT("HP Right"),
|
SND_SOC_DAPM_OUTPUT("HP Right"),
|
||||||
|
@ -480,16 +481,16 @@ static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = {
|
||||||
{ "Left Mixer", NULL, "Mixer Enable" },
|
{ "Left Mixer", NULL, "Mixer Enable" },
|
||||||
{ "Left Mixer", "Left DAC Playback Switch", "Left DAC" },
|
{ "Left Mixer", "Left DAC Playback Switch", "Left DAC" },
|
||||||
|
|
||||||
/* Pre-Amplifier Mixer Routes */
|
/* Power Amplifier Routes */
|
||||||
{ "Pre-Amplifier", "Mixer Playback Switch", "Left Mixer" },
|
{ "Power Amplifier", "Mixer Playback Switch", "Left Mixer" },
|
||||||
{ "Pre-Amplifier", "Mixer Playback Switch", "Right Mixer" },
|
{ "Power Amplifier", "Mixer Playback Switch", "Right Mixer" },
|
||||||
{ "Pre-Amplifier", "DAC Playback Switch", "Left DAC" },
|
{ "Power Amplifier", "DAC Playback Switch", "Left DAC" },
|
||||||
{ "Pre-Amplifier", "DAC Playback Switch", "Right DAC" },
|
{ "Power Amplifier", "DAC Playback Switch", "Right DAC" },
|
||||||
|
|
||||||
/* PA -> HP path */
|
/* Headphone Output Routes */
|
||||||
{ "Pre-Amplifier Mute", "Switch", "Pre-Amplifier" },
|
{ "Power Amplifier Mute", "Switch", "Power Amplifier" },
|
||||||
{ "HP Right", NULL, "Pre-Amplifier Mute" },
|
{ "HP Right", NULL, "Power Amplifier Mute" },
|
||||||
{ "HP Left", NULL, "Pre-Amplifier Mute" },
|
{ "HP Left", NULL, "Power Amplifier Mute" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_codec_driver sun4i_codec_codec = {
|
static struct snd_soc_codec_driver sun4i_codec_codec = {
|
||||||
|
|
Loading…
Reference in New Issue