Commit 2ddaa676 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/rt5665', 'asoc/fix/simple',...

Merge remote-tracking branches 'asoc/fix/rt5665', 'asoc/fix/simple', 'asoc/fix/sti' and 'asoc/fix/sun8i' into asoc-linus
...@@ -113,8 +113,8 @@ sound: sound { ...@@ -113,8 +113,8 @@ sound: sound {
simple-audio-card,mclk-fs = <512>; simple-audio-card,mclk-fs = <512>;
simple-audio-card,aux-devs = <&codec_analog>; simple-audio-card,aux-devs = <&codec_analog>;
simple-audio-card,routing = simple-audio-card,routing =
"Left DAC", "Digital Left DAC", "Left DAC", "AIF1 Slot 0 Left",
"Right DAC", "Digital Right DAC"; "Right DAC", "AIF1 Slot 0 Right";
status = "disabled"; status = "disabled";
simple-audio-card,cpu { simple-audio-card,cpu {
......
...@@ -1241,7 +1241,7 @@ static irqreturn_t rt5665_irq(int irq, void *data) ...@@ -1241,7 +1241,7 @@ static irqreturn_t rt5665_irq(int irq, void *data)
static void rt5665_jd_check_handler(struct work_struct *work) static void rt5665_jd_check_handler(struct work_struct *work)
{ {
struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv, struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv,
calibrate_work.work); jd_check_work.work);
if (snd_soc_read(rt5665->codec, RT5665_AJD1_CTRL) & 0x0010) { if (snd_soc_read(rt5665->codec, RT5665_AJD1_CTRL) & 0x0010) {
/* jack out */ /* jack out */
...@@ -2252,7 +2252,7 @@ static const char * const rt5665_if2_1_adc_in_src[] = { ...@@ -2252,7 +2252,7 @@ static const char * const rt5665_if2_1_adc_in_src[] = {
static const SOC_ENUM_SINGLE_DECL( static const SOC_ENUM_SINGLE_DECL(
rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA, rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA,
RT5665_IF3_ADC_IN_SFT, rt5665_if2_1_adc_in_src); RT5665_IF2_1_ADC_IN_SFT, rt5665_if2_1_adc_in_src);
static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux = static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux =
SOC_DAPM_ENUM("IF2_1 ADC IN Source", rt5665_if2_1_adc_in_enum); SOC_DAPM_ENUM("IF2_1 ADC IN Source", rt5665_if2_1_adc_in_enum);
...@@ -3178,6 +3178,9 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = { ...@@ -3178,6 +3178,9 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
{"DAC Mono Right Filter", NULL, "DAC Mono R ASRC", is_using_asrc}, {"DAC Mono Right Filter", NULL, "DAC Mono R ASRC", is_using_asrc},
{"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc}, {"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc},
{"DAC Stereo2 Filter", NULL, "DAC STO2 ASRC", is_using_asrc}, {"DAC Stereo2 Filter", NULL, "DAC STO2 ASRC", is_using_asrc},
{"I2S1 ASRC", NULL, "CLKDET"},
{"I2S2 ASRC", NULL, "CLKDET"},
{"I2S3 ASRC", NULL, "CLKDET"},
/*Vref*/ /*Vref*/
{"Mic Det Power", NULL, "Vref2"}, {"Mic Det Power", NULL, "Vref2"},
...@@ -3912,6 +3915,7 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = { ...@@ -3912,6 +3915,7 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
{"Mono MIX", "MONOVOL Switch", "MONOVOL"}, {"Mono MIX", "MONOVOL Switch", "MONOVOL"},
{"Mono Amp", NULL, "Mono MIX"}, {"Mono Amp", NULL, "Mono MIX"},
{"Mono Amp", NULL, "Vref2"}, {"Mono Amp", NULL, "Vref2"},
{"Mono Amp", NULL, "Vref3"},
{"Mono Amp", NULL, "CLKDET SYS"}, {"Mono Amp", NULL, "CLKDET SYS"},
{"Mono Amp", NULL, "CLKDET MONO"}, {"Mono Amp", NULL, "CLKDET MONO"},
{"Mono Playback", "Switch", "Mono Amp"}, {"Mono Playback", "Switch", "Mono Amp"},
...@@ -4798,7 +4802,7 @@ static int rt5665_i2c_probe(struct i2c_client *i2c, ...@@ -4798,7 +4802,7 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
/* Enhance performance*/ /* Enhance performance*/
regmap_update_bits(rt5665->regmap, RT5665_PWR_ANLG_1, regmap_update_bits(rt5665->regmap, RT5665_PWR_ANLG_1,
RT5665_HP_DRIVER_MASK | RT5665_LDO1_DVO_MASK, RT5665_HP_DRIVER_MASK | RT5665_LDO1_DVO_MASK,
RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_09); RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_12);
INIT_DELAYED_WORK(&rt5665->jack_detect_work, INIT_DELAYED_WORK(&rt5665->jack_detect_work,
rt5665_jack_detect_handler); rt5665_jack_detect_handler);
......
...@@ -1106,7 +1106,7 @@ ...@@ -1106,7 +1106,7 @@
#define RT5665_HP_DRIVER_MASK (0x3 << 2) #define RT5665_HP_DRIVER_MASK (0x3 << 2)
#define RT5665_HP_DRIVER_1X (0x0 << 2) #define RT5665_HP_DRIVER_1X (0x0 << 2)
#define RT5665_HP_DRIVER_3X (0x1 << 2) #define RT5665_HP_DRIVER_3X (0x1 << 2)
#define RT5665_HP_DRIVER_5X (0x2 << 2) #define RT5665_HP_DRIVER_5X (0x3 << 2)
#define RT5665_LDO1_DVO_MASK (0x3) #define RT5665_LDO1_DVO_MASK (0x3)
#define RT5665_LDO1_DVO_09 (0x0) #define RT5665_LDO1_DVO_09 (0x0)
#define RT5665_LDO1_DVO_10 (0x1) #define RT5665_LDO1_DVO_10 (0x1)
......
...@@ -115,6 +115,7 @@ int asoc_simple_card_parse_clk(struct device *dev, ...@@ -115,6 +115,7 @@ int asoc_simple_card_parse_clk(struct device *dev,
clk = devm_get_clk_from_child(dev, node, NULL); clk = devm_get_clk_from_child(dev, node, NULL);
if (!IS_ERR(clk)) { if (!IS_ERR(clk)) {
simple_dai->sysclk = clk_get_rate(clk); simple_dai->sysclk = clk_get_rate(clk);
simple_dai->clk = clk;
} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
simple_dai->sysclk = val; simple_dai->sysclk = val;
} else { } else {
......
...@@ -349,6 +349,8 @@ static int uni_reader_startup(struct snd_pcm_substream *substream, ...@@ -349,6 +349,8 @@ static int uni_reader_startup(struct snd_pcm_substream *substream,
struct uniperif *reader = priv->dai_data.uni; struct uniperif *reader = priv->dai_data.uni;
int ret; int ret;
reader->substream = substream;
if (!UNIPERIF_TYPE_IS_TDM(reader)) if (!UNIPERIF_TYPE_IS_TDM(reader))
return 0; return 0;
...@@ -378,6 +380,7 @@ static void uni_reader_shutdown(struct snd_pcm_substream *substream, ...@@ -378,6 +380,7 @@ static void uni_reader_shutdown(struct snd_pcm_substream *substream,
/* Stop the reader */ /* Stop the reader */
uni_reader_stop(reader); uni_reader_stop(reader);
} }
reader->substream = NULL;
} }
static const struct snd_soc_dai_ops uni_reader_dai_ops = { static const struct snd_soc_dai_ops uni_reader_dai_ops = {
......
...@@ -259,25 +259,20 @@ static int sun8i_codec_hw_params(struct snd_pcm_substream *substream, ...@@ -259,25 +259,20 @@ static int sun8i_codec_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static const struct snd_kcontrol_new sun8i_output_left_mixer_controls[] = { static const struct snd_kcontrol_new sun8i_dac_mixer_controls[] = {
SOC_DAPM_SINGLE("LSlot 0", SUN8I_DAC_MXR_SRC, SOC_DAPM_DOUBLE("AIF1 Slot 0 Digital DAC Playback Switch",
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L, 1, 0), SUN8I_DAC_MXR_SRC,
SOC_DAPM_SINGLE("LSlot 1", SUN8I_DAC_MXR_SRC, SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L, 1, 0),
SOC_DAPM_SINGLE("DACL", SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL, 1, 0),
SOC_DAPM_SINGLE("ADCL", SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL, 1, 0),
};
static const struct snd_kcontrol_new sun8i_output_right_mixer_controls[] = {
SOC_DAPM_SINGLE("RSlot 0", SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0), SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0),
SOC_DAPM_SINGLE("RSlot 1", SUN8I_DAC_MXR_SRC, SOC_DAPM_DOUBLE("AIF1 Slot 1 Digital DAC Playback Switch",
SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L,
SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0), SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0),
SOC_DAPM_SINGLE("DACR", SUN8I_DAC_MXR_SRC, SOC_DAPM_DOUBLE("AIF2 Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL,
SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0), SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0),
SOC_DAPM_SINGLE("ADCR", SUN8I_DAC_MXR_SRC, SOC_DAPM_DOUBLE("ADC Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC,
SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL,
SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0), SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0),
}; };
...@@ -286,19 +281,21 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = { ...@@ -286,19 +281,21 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("DAC", SUN8I_DAC_DIG_CTRL, SUN8I_DAC_DIG_CTRL_ENDA, SND_SOC_DAPM_SUPPLY("DAC", SUN8I_DAC_DIG_CTRL, SUN8I_DAC_DIG_CTRL_ENDA,
0, NULL, 0), 0, NULL, 0),
/* Analog DAC */ /* Analog DAC AIF */
SND_SOC_DAPM_DAC("Digital Left DAC", "Playback", SUN8I_AIF1_DACDAT_CTRL, SND_SOC_DAPM_AIF_IN("AIF1 Slot 0 Left", "Playback", 0,
SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0L_ENA, 0), SUN8I_AIF1_DACDAT_CTRL,
SND_SOC_DAPM_DAC("Digital Right DAC", "Playback", SUN8I_AIF1_DACDAT_CTRL, SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0L_ENA, 0),
SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0), SND_SOC_DAPM_AIF_IN("AIF1 Slot 0 Right", "Playback", 0,
SUN8I_AIF1_DACDAT_CTRL,
SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0),
/* DAC Mixers */ /* DAC Mixers */
SND_SOC_DAPM_MIXER("Left DAC Mixer", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Left Digital DAC Mixer", SND_SOC_NOPM, 0, 0,
sun8i_output_left_mixer_controls, sun8i_dac_mixer_controls,
ARRAY_SIZE(sun8i_output_left_mixer_controls)), ARRAY_SIZE(sun8i_dac_mixer_controls)),
SND_SOC_DAPM_MIXER("Right DAC Mixer", SND_SOC_NOPM, 0, 0, SND_SOC_DAPM_MIXER("Right Digital DAC Mixer", SND_SOC_NOPM, 0, 0,
sun8i_output_right_mixer_controls, sun8i_dac_mixer_controls,
ARRAY_SIZE(sun8i_output_right_mixer_controls)), ARRAY_SIZE(sun8i_dac_mixer_controls)),
/* Clocks */ /* Clocks */
SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA, SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA,
...@@ -321,8 +318,6 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = { ...@@ -321,8 +318,6 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = {
SUN8I_MOD_RST_CTL_AIF1, 0, NULL, 0), SUN8I_MOD_RST_CTL_AIF1, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("RST DAC", SUN8I_MOD_RST_CTL, SND_SOC_DAPM_SUPPLY("RST DAC", SUN8I_MOD_RST_CTL,
SUN8I_MOD_RST_CTL_DAC, 0, NULL, 0), SUN8I_MOD_RST_CTL_DAC, 0, NULL, 0),
SND_SOC_DAPM_OUTPUT("HP"),
}; };
static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = {
...@@ -338,16 +333,14 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { ...@@ -338,16 +333,14 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = {
{ "DAC", NULL, "MODCLK DAC" }, { "DAC", NULL, "MODCLK DAC" },
/* DAC Routes */ /* DAC Routes */
{ "Digital Left DAC", NULL, "DAC" }, { "AIF1 Slot 0 Right", NULL, "DAC" },
{ "Digital Right DAC", NULL, "DAC" }, { "AIF1 Slot 0 Left", NULL, "DAC" },
/* DAC Mixer Routes */ /* DAC Mixer Routes */
{ "Left DAC Mixer", "LSlot 0", "Digital Left DAC"}, { "Left Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch",
{ "Right DAC Mixer", "RSlot 0", "Digital Right DAC"}, "AIF1 Slot 0 Left"},
{ "Right Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch",
/* End of route : HP out */ "AIF1 Slot 0 Right"},
{ "HP", NULL, "Left DAC Mixer" },
{ "HP", NULL, "Right DAC Mixer" },
}; };
static struct snd_soc_dai_ops sun8i_codec_dai_ops = { static struct snd_soc_dai_ops sun8i_codec_dai_ops = {
......
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