Commit 8cdef969 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This time we've got a larger number of updates, mainly from ASoC
  world.  The only significant LOCs found here are for Realtek codecs,
  where most of changes are quite systematic replacements.

  There are also a few fixes in ASoC core side: one is the PM call order
  fix to ensure the DPAM resume working properly.  Another is the proper
  cleanup call after freeing DAPM widgets, and the correction of the
  wrong callback set in topology API.

  The rest are a wide range of driver-specific small fixes, including
  HD-audio"

* tag 'sound-4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (35 commits)
  ALSA: hda - Add Conexant CX8200 (14f1:2008) codec entry
  ALSA: hda - Correct codec names for 14f1:50f1 and 14f1:50f3
  ALSA: hda - Skip ELD notification during system suspend
  ASoC: core: Change power state before rechecking endpoint
  ASoC: fix kernel-doc warnings in sound/soc/soc-ops.c
  ASoC: rt5645: Add dmi_system_id "Google Terra"
  ASoC: rockchip: Fix incorrect VDW value for 24 bit
  ASoC: fsl: clarify ac97 dependency
  ASoC: Intel: Skylake: fix memory leak
  ASoC: davinci-mcasp: Fix master capture only mode
  ASoC: es8328: Fix shifts for mixer switches
  ASoC: rt5645: Add dmi_system_id "Google Wizpig"
  ASoC: sti: set player private data
  ASoC: sti: rename ST proprietary DT properties
  ASoC: sti: remove wrong error message
  ASoC: Intel: Skylake: Add I2C depends for SKL machine
  ASoC: topology: fix info callback for TLV byte control
  ASoC: rt5670: fix wrong bit def for pll src
  ASoC: nau8825: add pm function
  ASoC: rt5645: Add struct dmi_system_id "Google Edgar" for Chrome OS
  ...
parents b1007e73 bcdda2ec
...@@ -398,6 +398,7 @@ int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, ...@@ -398,6 +398,7 @@ int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm,
int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num); const struct snd_soc_dapm_route *route, int num);
void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w);
void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm);
/* dapm events */ /* dapm events */
void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
......
...@@ -955,6 +955,7 @@ static int patch_conexant_auto(struct hda_codec *codec) ...@@ -955,6 +955,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
*/ */
static const struct hda_device_id snd_hda_id_conexant[] = { static const struct hda_device_id snd_hda_id_conexant[] = {
HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto),
...@@ -972,9 +973,9 @@ static const struct hda_device_id snd_hda_id_conexant[] = { ...@@ -972,9 +973,9 @@ static const struct hda_device_id snd_hda_id_conexant[] = {
HDA_CODEC_ENTRY(0x14f150ac, "CX20652", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150ac, "CX20652", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150b8, "CX20664", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150b8, "CX20664", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150b9, "CX20665", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150b9, "CX20665", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f1, "CX20721", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150f1, "CX21722", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f2, "CX20722", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150f2, "CX20722", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f3, "CX20723", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150f3, "CX21724", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f4, "CX20724", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f150f4, "CX20724", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f1510f, "CX20751/2", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f1510f, "CX20751/2", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15110, "CX20751/2", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15110, "CX20751/2", patch_conexant_auto),
......
...@@ -2352,6 +2352,12 @@ static void intel_pin_eld_notify(void *audio_ptr, int port) ...@@ -2352,6 +2352,12 @@ static void intel_pin_eld_notify(void *audio_ptr, int port)
struct hda_codec *codec = audio_ptr; struct hda_codec *codec = audio_ptr;
int pin_nid = port + 0x04; int pin_nid = port + 0x04;
/* skip notification during system suspend (but not in runtime PM);
* the state will be updated at resume
*/
if (snd_power_get_state(codec->card) != SNDRV_CTL_POWER_D0)
return;
check_presence_and_report(codec, pin_nid); check_presence_and_report(codec, pin_nid);
} }
......
...@@ -1023,24 +1023,18 @@ void arizona_init_dvfs(struct arizona_priv *priv) ...@@ -1023,24 +1023,18 @@ void arizona_init_dvfs(struct arizona_priv *priv)
} }
EXPORT_SYMBOL_GPL(arizona_init_dvfs); EXPORT_SYMBOL_GPL(arizona_init_dvfs);
static unsigned int arizona_sysclk_48k_rates[] = { static unsigned int arizona_opclk_ref_48k_rates[] = {
6144000, 6144000,
12288000, 12288000,
24576000, 24576000,
49152000, 49152000,
73728000,
98304000,
147456000,
}; };
static unsigned int arizona_sysclk_44k1_rates[] = { static unsigned int arizona_opclk_ref_44k1_rates[] = {
5644800, 5644800,
11289600, 11289600,
22579200, 22579200,
45158400, 45158400,
67737600,
90316800,
135475200,
}; };
static int arizona_set_opclk(struct snd_soc_codec *codec, unsigned int clk, static int arizona_set_opclk(struct snd_soc_codec *codec, unsigned int clk,
...@@ -1065,11 +1059,11 @@ static int arizona_set_opclk(struct snd_soc_codec *codec, unsigned int clk, ...@@ -1065,11 +1059,11 @@ static int arizona_set_opclk(struct snd_soc_codec *codec, unsigned int clk,
} }
if (refclk % 8000) if (refclk % 8000)
rates = arizona_sysclk_44k1_rates; rates = arizona_opclk_ref_44k1_rates;
else else
rates = arizona_sysclk_48k_rates; rates = arizona_opclk_ref_48k_rates;
for (ref = 0; ref < ARRAY_SIZE(arizona_sysclk_48k_rates) && for (ref = 0; ref < ARRAY_SIZE(arizona_opclk_ref_48k_rates) &&
rates[ref] <= refclk; ref++) { rates[ref] <= refclk; ref++) {
div = 1; div = 1;
while (rates[ref] / div >= freq && div < 32) { while (rates[ref] / div >= freq && div < 32) {
......
...@@ -205,18 +205,18 @@ static const struct snd_kcontrol_new es8328_right_line_controls = ...@@ -205,18 +205,18 @@ static const struct snd_kcontrol_new es8328_right_line_controls =
/* Left Mixer */ /* Left Mixer */
static const struct snd_kcontrol_new es8328_left_mixer_controls[] = { static const struct snd_kcontrol_new es8328_left_mixer_controls[] = {
SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL17, 8, 1, 0), SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL17, 7, 1, 0),
SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL17, 7, 1, 0), SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL17, 6, 1, 0),
SOC_DAPM_SINGLE("Right Playback Switch", ES8328_DACCONTROL18, 8, 1, 0), SOC_DAPM_SINGLE("Right Playback Switch", ES8328_DACCONTROL18, 7, 1, 0),
SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL18, 7, 1, 0), SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL18, 6, 1, 0),
}; };
/* Right Mixer */ /* Right Mixer */
static const struct snd_kcontrol_new es8328_right_mixer_controls[] = { static const struct snd_kcontrol_new es8328_right_mixer_controls[] = {
SOC_DAPM_SINGLE("Left Playback Switch", ES8328_DACCONTROL19, 8, 1, 0), SOC_DAPM_SINGLE("Left Playback Switch", ES8328_DACCONTROL19, 7, 1, 0),
SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL19, 7, 1, 0), SOC_DAPM_SINGLE("Left Bypass Switch", ES8328_DACCONTROL19, 6, 1, 0),
SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL20, 8, 1, 0), SOC_DAPM_SINGLE("Playback Switch", ES8328_DACCONTROL20, 7, 1, 0),
SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL20, 7, 1, 0), SOC_DAPM_SINGLE("Right Bypass Switch", ES8328_DACCONTROL20, 6, 1, 0),
}; };
static const char * const es8328_pga_sel[] = { static const char * const es8328_pga_sel[] = {
......
...@@ -1271,6 +1271,36 @@ static int nau8825_i2c_remove(struct i2c_client *client) ...@@ -1271,6 +1271,36 @@ static int nau8825_i2c_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int nau8825_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct nau8825 *nau8825 = dev_get_drvdata(dev);
disable_irq(client->irq);
regcache_cache_only(nau8825->regmap, true);
regcache_mark_dirty(nau8825->regmap);
return 0;
}
static int nau8825_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct nau8825 *nau8825 = dev_get_drvdata(dev);
regcache_cache_only(nau8825->regmap, false);
regcache_sync(nau8825->regmap);
enable_irq(client->irq);
return 0;
}
#endif
static const struct dev_pm_ops nau8825_pm = {
SET_SYSTEM_SLEEP_PM_OPS(nau8825_suspend, nau8825_resume)
};
static const struct i2c_device_id nau8825_i2c_ids[] = { static const struct i2c_device_id nau8825_i2c_ids[] = {
{ "nau8825", 0 }, { "nau8825", 0 },
{ } { }
...@@ -1297,6 +1327,7 @@ static struct i2c_driver nau8825_driver = { ...@@ -1297,6 +1327,7 @@ static struct i2c_driver nau8825_driver = {
.name = "nau8825", .name = "nau8825",
.of_match_table = of_match_ptr(nau8825_of_ids), .of_match_table = of_match_ptr(nau8825_of_ids),
.acpi_match_table = ACPI_PTR(nau8825_acpi_match), .acpi_match_table = ACPI_PTR(nau8825_acpi_match),
.pm = &nau8825_pm,
}, },
.probe = nau8825_i2c_probe, .probe = nau8825_i2c_probe,
.remove = nau8825_i2c_remove, .remove = nau8825_i2c_remove,
......
...@@ -80,8 +80,10 @@ int rl6231_calc_dmic_clk(int rate) ...@@ -80,8 +80,10 @@ int rl6231_calc_dmic_clk(int rate)
} }
for (i = 0; i < ARRAY_SIZE(div); i++) { for (i = 0; i < ARRAY_SIZE(div); i++) {
/* find divider that gives DMIC frequency below 3MHz */ if ((div[i] % 3) == 0)
if (3000000 * div[i] >= rate) continue;
/* find divider that gives DMIC frequency below 3.072MHz */
if (3072000 * div[i] >= rate)
return i; return i;
} }
......
...@@ -245,7 +245,7 @@ struct rt5645_priv { ...@@ -245,7 +245,7 @@ struct rt5645_priv {
struct snd_soc_jack *hp_jack; struct snd_soc_jack *hp_jack;
struct snd_soc_jack *mic_jack; struct snd_soc_jack *mic_jack;
struct snd_soc_jack *btn_jack; struct snd_soc_jack *btn_jack;
struct delayed_work jack_detect_work; struct delayed_work jack_detect_work, rcclock_work;
struct regulator_bulk_data supplies[ARRAY_SIZE(rt5645_supply_names)]; struct regulator_bulk_data supplies[ARRAY_SIZE(rt5645_supply_names)];
struct rt5645_eq_param_s *eq_param; struct rt5645_eq_param_s *eq_param;
...@@ -565,12 +565,33 @@ static int rt5645_hweq_put(struct snd_kcontrol *kcontrol, ...@@ -565,12 +565,33 @@ static int rt5645_hweq_put(struct snd_kcontrol *kcontrol,
.put = rt5645_hweq_put \ .put = rt5645_hweq_put \
} }
static int rt5645_spk_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
int ret;
cancel_delayed_work_sync(&rt5645->rcclock_work);
regmap_update_bits(rt5645->regmap, RT5645_MICBIAS,
RT5645_PWR_CLK25M_MASK, RT5645_PWR_CLK25M_PU);
ret = snd_soc_put_volsw(kcontrol, ucontrol);
queue_delayed_work(system_power_efficient_wq, &rt5645->rcclock_work,
msecs_to_jiffies(200));
return ret;
}
static const struct snd_kcontrol_new rt5645_snd_controls[] = { static const struct snd_kcontrol_new rt5645_snd_controls[] = {
/* Speaker Output Volume */ /* Speaker Output Volume */
SOC_DOUBLE("Speaker Channel Switch", RT5645_SPK_VOL, SOC_DOUBLE("Speaker Channel Switch", RT5645_SPK_VOL,
RT5645_VOL_L_SFT, RT5645_VOL_R_SFT, 1, 1), RT5645_VOL_L_SFT, RT5645_VOL_R_SFT, 1, 1),
SOC_DOUBLE_TLV("Speaker Playback Volume", RT5645_SPK_VOL, SOC_DOUBLE_EXT_TLV("Speaker Playback Volume", RT5645_SPK_VOL,
RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, out_vol_tlv), RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, snd_soc_get_volsw,
rt5645_spk_put_volsw, out_vol_tlv),
/* ClassD modulator Speaker Gain Ratio */ /* ClassD modulator Speaker Gain Ratio */
SOC_SINGLE_TLV("Speaker ClassD Playback Volume", RT5645_SPO_CLSD_RATIO, SOC_SINGLE_TLV("Speaker ClassD Playback Volume", RT5645_SPO_CLSD_RATIO,
...@@ -1498,7 +1519,7 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on) ...@@ -1498,7 +1519,7 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on)
regmap_write(rt5645->regmap, RT5645_PR_BASE + regmap_write(rt5645->regmap, RT5645_PR_BASE +
RT5645_MAMP_INT_REG2, 0xfc00); RT5645_MAMP_INT_REG2, 0xfc00);
snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140); snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
msleep(40); msleep(70);
rt5645->hp_on = true; rt5645->hp_on = true;
} else { } else {
/* depop parameters */ /* depop parameters */
...@@ -3122,6 +3143,15 @@ static void rt5645_jack_detect_work(struct work_struct *work) ...@@ -3122,6 +3143,15 @@ static void rt5645_jack_detect_work(struct work_struct *work)
SND_JACK_BTN_2 | SND_JACK_BTN_3); SND_JACK_BTN_2 | SND_JACK_BTN_3);
} }
static void rt5645_rcclock_work(struct work_struct *work)
{
struct rt5645_priv *rt5645 =
container_of(work, struct rt5645_priv, rcclock_work.work);
regmap_update_bits(rt5645->regmap, RT5645_MICBIAS,
RT5645_PWR_CLK25M_MASK, RT5645_PWR_CLK25M_PD);
}
static irqreturn_t rt5645_irq(int irq, void *data) static irqreturn_t rt5645_irq(int irq, void *data)
{ {
struct rt5645_priv *rt5645 = data; struct rt5645_priv *rt5645 = data;
...@@ -3348,6 +3378,27 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = { ...@@ -3348,6 +3378,27 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Reks"), DMI_MATCH(DMI_PRODUCT_NAME, "Reks"),
}, },
}, },
{
.ident = "Google Edgar",
.callback = strago_quirk_cb,
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "Edgar"),
},
},
{
.ident = "Google Wizpig",
.callback = strago_quirk_cb,
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "Wizpig"),
},
},
{
.ident = "Google Terra",
.callback = strago_quirk_cb,
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "Terra"),
},
},
{ } { }
}; };
...@@ -3587,6 +3638,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, ...@@ -3587,6 +3638,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
} }
INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work); INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work);
INIT_DELAYED_WORK(&rt5645->rcclock_work, rt5645_rcclock_work);
if (rt5645->i2c->irq) { if (rt5645->i2c->irq) {
ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq,
...@@ -3621,6 +3673,7 @@ static int rt5645_i2c_remove(struct i2c_client *i2c) ...@@ -3621,6 +3673,7 @@ static int rt5645_i2c_remove(struct i2c_client *i2c)
free_irq(i2c->irq, rt5645); free_irq(i2c->irq, rt5645);
cancel_delayed_work_sync(&rt5645->jack_detect_work); cancel_delayed_work_sync(&rt5645->jack_detect_work);
cancel_delayed_work_sync(&rt5645->rcclock_work);
snd_soc_unregister_codec(&i2c->dev); snd_soc_unregister_codec(&i2c->dev);
regulator_bulk_disable(ARRAY_SIZE(rt5645->supplies), rt5645->supplies); regulator_bulk_disable(ARRAY_SIZE(rt5645->supplies), rt5645->supplies);
......
...@@ -973,12 +973,12 @@ ...@@ -973,12 +973,12 @@
#define RT5670_SCLK_SRC_MCLK (0x0 << 14) #define RT5670_SCLK_SRC_MCLK (0x0 << 14)
#define RT5670_SCLK_SRC_PLL1 (0x1 << 14) #define RT5670_SCLK_SRC_PLL1 (0x1 << 14)
#define RT5670_SCLK_SRC_RCCLK (0x2 << 14) /* 15MHz */ #define RT5670_SCLK_SRC_RCCLK (0x2 << 14) /* 15MHz */
#define RT5670_PLL1_SRC_MASK (0x3 << 12) #define RT5670_PLL1_SRC_MASK (0x7 << 11)
#define RT5670_PLL1_SRC_SFT 12 #define RT5670_PLL1_SRC_SFT 11
#define RT5670_PLL1_SRC_MCLK (0x0 << 12) #define RT5670_PLL1_SRC_MCLK (0x0 << 11)
#define RT5670_PLL1_SRC_BCLK1 (0x1 << 12) #define RT5670_PLL1_SRC_BCLK1 (0x1 << 11)
#define RT5670_PLL1_SRC_BCLK2 (0x2 << 12) #define RT5670_PLL1_SRC_BCLK2 (0x2 << 11)
#define RT5670_PLL1_SRC_BCLK3 (0x3 << 12) #define RT5670_PLL1_SRC_BCLK3 (0x3 << 11)
#define RT5670_PLL1_PD_MASK (0x1 << 3) #define RT5670_PLL1_PD_MASK (0x1 << 3)
#define RT5670_PLL1_PD_SFT 3 #define RT5670_PLL1_PD_SFT 3
#define RT5670_PLL1_PD_1 (0x0 << 3) #define RT5670_PLL1_PD_1 (0x0 << 3)
......
...@@ -1386,90 +1386,90 @@ static const struct snd_kcontrol_new rt5677_dac_r_mix[] = { ...@@ -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, ...@@ -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[] = { ...@@ -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, ...@@ -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[] = { ...@@ -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 */
......
...@@ -681,8 +681,8 @@ static int davinci_mcasp_set_tdm_slot(struct snd_soc_dai *dai, ...@@ -681,8 +681,8 @@ static int davinci_mcasp_set_tdm_slot(struct snd_soc_dai *dai,
} }
mcasp->tdm_slots = slots; mcasp->tdm_slots = slots;
mcasp->tdm_mask[SNDRV_PCM_STREAM_PLAYBACK] = rx_mask; mcasp->tdm_mask[SNDRV_PCM_STREAM_PLAYBACK] = tx_mask;
mcasp->tdm_mask[SNDRV_PCM_STREAM_CAPTURE] = tx_mask; mcasp->tdm_mask[SNDRV_PCM_STREAM_CAPTURE] = rx_mask;
mcasp->slot_width = slot_width; mcasp->slot_width = slot_width;
return davinci_mcasp_set_ch_constraints(mcasp); return davinci_mcasp_set_ch_constraints(mcasp);
...@@ -908,6 +908,14 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, ...@@ -908,6 +908,14 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream,
mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD); mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
FSRMOD(total_slots), FSRMOD(0x1FF)); FSRMOD(total_slots), FSRMOD(0x1FF));
/*
* If McASP is set to be TX/RX synchronous and the playback is
* not running already we need to configure the TX slots in
* order to have correct FSX on the bus
*/
if (mcasp_is_synchronous(mcasp) && !mcasp->channels)
mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
FSXMOD(total_slots), FSXMOD(0x1FF));
} }
return 0; return 0;
......
...@@ -283,6 +283,8 @@ config SND_SOC_IMX_MC13783 ...@@ -283,6 +283,8 @@ config SND_SOC_IMX_MC13783
config SND_SOC_FSL_ASOC_CARD config SND_SOC_FSL_ASOC_CARD
tristate "Generic ASoC Sound Card with ASRC support" tristate "Generic ASoC Sound Card with ASRC support"
depends on OF && I2C depends on OF && I2C
# enforce SND_SOC_FSL_ASOC_CARD=m if SND_AC97_CODEC=m:
depends on SND_AC97_CODEC || SND_AC97_CODEC=n
select SND_SOC_IMX_AUDMUX select SND_SOC_IMX_AUDMUX
select SND_SOC_IMX_PCM_DMA select SND_SOC_IMX_PCM_DMA
select SND_SOC_FSL_ESAI select SND_SOC_FSL_ESAI
......
...@@ -454,7 +454,8 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -454,7 +454,8 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
* Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx. * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx.
* Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx. * Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx.
*/ */
regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, 0); regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC,
sai->synchronous[TX] ? FSL_SAI_CR2_SYNC : 0);
regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC, regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC,
sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0); sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0);
......
...@@ -144,7 +144,7 @@ config SND_SOC_INTEL_SKYLAKE ...@@ -144,7 +144,7 @@ config SND_SOC_INTEL_SKYLAKE
config SND_SOC_INTEL_SKL_RT286_MACH config SND_SOC_INTEL_SKL_RT286_MACH
tristate "ASoC Audio driver for SKL with RT286 I2S mode" tristate "ASoC Audio driver for SKL with RT286 I2S mode"
depends on X86 && ACPI depends on X86 && ACPI && I2C
select SND_SOC_INTEL_SST select SND_SOC_INTEL_SST
select SND_SOC_INTEL_SKYLAKE select SND_SOC_INTEL_SKYLAKE
select SND_SOC_RT286 select SND_SOC_RT286
......
...@@ -1240,6 +1240,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus) ...@@ -1240,6 +1240,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)
*/ */
ret = snd_soc_tplg_component_load(&platform->component, ret = snd_soc_tplg_component_load(&platform->component,
&skl_tplg_ops, fw, 0); &skl_tplg_ops, fw, 0);
release_firmware(fw);
if (ret < 0) { if (ret < 0) {
dev_err(bus->dev, "tplg component load failed%d\n", ret); dev_err(bus->dev, "tplg component load failed%d\n", ret);
return -EINVAL; return -EINVAL;
......
...@@ -280,7 +280,7 @@ static int rk_spdif_probe(struct platform_device *pdev) ...@@ -280,7 +280,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
int ret; int ret;
match = of_match_node(rk_spdif_match, np); match = of_match_node(rk_spdif_match, np);
if ((int) match->data == RK_SPDIF_RK3288) { if (match->data == (void *)RK_SPDIF_RK3288) {
struct regmap *grf; struct regmap *grf;
grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#define SPDIF_CFGR_VDW(x) (x << SPDIF_CFGR_VDW_SHIFT) #define SPDIF_CFGR_VDW(x) (x << SPDIF_CFGR_VDW_SHIFT)
#define SDPIF_CFGR_VDW_MASK (0xf << SPDIF_CFGR_VDW_SHIFT) #define SDPIF_CFGR_VDW_MASK (0xf << SPDIF_CFGR_VDW_SHIFT)
#define SPDIF_CFGR_VDW_16 SPDIF_CFGR_VDW(0x00) #define SPDIF_CFGR_VDW_16 SPDIF_CFGR_VDW(0x0)
#define SPDIF_CFGR_VDW_20 SPDIF_CFGR_VDW(0x01) #define SPDIF_CFGR_VDW_20 SPDIF_CFGR_VDW(0x1)
#define SPDIF_CFGR_VDW_24 SPDIF_CFGR_VDW(0x10) #define SPDIF_CFGR_VDW_24 SPDIF_CFGR_VDW(0x2)
/* /*
* DMACR * DMACR
......
...@@ -235,7 +235,7 @@ static int rsnd_gen2_probe(struct platform_device *pdev, ...@@ -235,7 +235,7 @@ static int rsnd_gen2_probe(struct platform_device *pdev,
RSND_GEN_S_REG(SCU_SYS_STATUS0, 0x1c8), RSND_GEN_S_REG(SCU_SYS_STATUS0, 0x1c8),
RSND_GEN_S_REG(SCU_SYS_INT_EN0, 0x1cc), RSND_GEN_S_REG(SCU_SYS_INT_EN0, 0x1cc),
RSND_GEN_S_REG(SCU_SYS_STATUS1, 0x1d0), RSND_GEN_S_REG(SCU_SYS_STATUS1, 0x1d0),
RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1c4), RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1d4),
RSND_GEN_M_REG(SRC_SWRSR, 0x200, 0x40), RSND_GEN_M_REG(SRC_SWRSR, 0x200, 0x40),
RSND_GEN_M_REG(SRC_SRCIR, 0x204, 0x40), RSND_GEN_M_REG(SRC_SRCIR, 0x204, 0x40),
RSND_GEN_M_REG(SRC_ADINR, 0x214, 0x40), RSND_GEN_M_REG(SRC_ADINR, 0x214, 0x40),
......
...@@ -923,6 +923,7 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod, ...@@ -923,6 +923,7 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod,
struct snd_soc_pcm_runtime *rtd) struct snd_soc_pcm_runtime *rtd)
{ {
struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io);
struct rsnd_src *src = rsnd_mod_to_src(mod); struct rsnd_src *src = rsnd_mod_to_src(mod);
int ret; int ret;
...@@ -936,6 +937,12 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod, ...@@ -936,6 +937,12 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod,
if (!rsnd_rdai_is_clk_master(rdai)) if (!rsnd_rdai_is_clk_master(rdai))
return 0; return 0;
/*
* SRC In doesn't work if DVC was enabled
*/
if (dvc && !rsnd_io_is_play(io))
return 0;
/* /*
* enable sync convert * enable sync convert
*/ */
......
...@@ -795,12 +795,12 @@ static void soc_resume_deferred(struct work_struct *work) ...@@ -795,12 +795,12 @@ static void soc_resume_deferred(struct work_struct *work)
dev_dbg(card->dev, "ASoC: resume work completed\n"); dev_dbg(card->dev, "ASoC: resume work completed\n");
/* userspace can access us now we are back as we were before */
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0);
/* Recheck all endpoints too, their state is affected by suspend */ /* Recheck all endpoints too, their state is affected by suspend */
dapm_mark_endpoints_dirty(card); dapm_mark_endpoints_dirty(card);
snd_soc_dapm_sync(&card->dapm); snd_soc_dapm_sync(&card->dapm);
/* userspace can access us now we are back as we were before */
snd_power_change_state(card->snd_card, SNDRV_CTL_POWER_D0);
} }
/* powers up audio subsystem after a suspend */ /* powers up audio subsystem after a suspend */
......
...@@ -2293,6 +2293,12 @@ void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w) ...@@ -2293,6 +2293,12 @@ void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w)
kfree(w); kfree(w);
} }
void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm)
{
dapm->path_sink_cache.widget = NULL;
dapm->path_source_cache.widget = NULL;
}
/* free all dapm widgets and resources */ /* free all dapm widgets and resources */
static void dapm_free_widgets(struct snd_soc_dapm_context *dapm) static void dapm_free_widgets(struct snd_soc_dapm_context *dapm)
{ {
...@@ -2303,6 +2309,7 @@ static void dapm_free_widgets(struct snd_soc_dapm_context *dapm) ...@@ -2303,6 +2309,7 @@ static void dapm_free_widgets(struct snd_soc_dapm_context *dapm)
continue; continue;
snd_soc_dapm_free_widget(w); snd_soc_dapm_free_widget(w);
} }
snd_soc_dapm_reset_cache(dapm);
} }
static struct snd_soc_dapm_widget *dapm_find_widget( static struct snd_soc_dapm_widget *dapm_find_widget(
......
...@@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_sx); ...@@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_sx);
/** /**
* snd_soc_put_volsw_sx - double mixer set callback * snd_soc_put_volsw_sx - double mixer set callback
* @kcontrol: mixer control * @kcontrol: mixer control
* @uinfo: control element information * @ucontrol: control element information
* *
* Callback to set the value of a double mixer control that spans 2 registers. * Callback to set the value of a double mixer control that spans 2 registers.
* *
......
...@@ -531,7 +531,7 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, ...@@ -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;
...@@ -1805,6 +1805,7 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm, ...@@ -1805,6 +1805,7 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
snd_soc_tplg_widget_remove(w); snd_soc_tplg_widget_remove(w);
snd_soc_dapm_free_widget(w); snd_soc_dapm_free_widget(w);
} }
snd_soc_dapm_reset_cache(dapm);
} }
EXPORT_SYMBOL_GPL(snd_soc_tplg_widget_remove_all); EXPORT_SYMBOL_GPL(snd_soc_tplg_widget_remove_all);
......
...@@ -669,6 +669,7 @@ static int uni_player_startup(struct snd_pcm_substream *substream, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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 @@ ...@@ -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 = ...@@ -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[] = { ...@@ -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[] = { ...@@ -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 = {
......
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