mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 13:11:45 +00:00
Merge branch 'fix/hda' into topic/hda
This commit is contained in:
commit
ffd344444f
@ -3,6 +3,8 @@
|
||||
Required properties:
|
||||
- compatible : "fsl,sgtl5000".
|
||||
|
||||
- reg : the I2C address of the device
|
||||
|
||||
Example:
|
||||
|
||||
codec: sgtl5000@0a {
|
||||
|
@ -475,7 +475,7 @@ static int load_firmware(struct echoaudio *chip)
|
||||
const struct firmware *fw;
|
||||
int box_type, err;
|
||||
|
||||
if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page))
|
||||
if (snd_BUG_ON(!chip->comm_page))
|
||||
return -EPERM;
|
||||
|
||||
/* See if the ASIC is present and working - only if the DSP is already loaded */
|
||||
|
@ -5497,10 +5497,6 @@ int snd_hda_suspend(struct hda_bus *bus)
|
||||
list_for_each_entry(codec, &bus->codec_list, list) {
|
||||
if (hda_codec_is_power_on(codec))
|
||||
hda_call_codec_suspend(codec);
|
||||
else /* forcibly change the power to D3 even if not used */
|
||||
hda_set_power_state(codec,
|
||||
codec->afg ? codec->afg : codec->mfg,
|
||||
AC_PWRST_D3);
|
||||
if (codec->patch_ops.post_suspend)
|
||||
codec->patch_ops.post_suspend(codec);
|
||||
}
|
||||
|
@ -2351,6 +2351,17 @@ static void azx_power_notify(struct hda_bus *bus)
|
||||
* power management
|
||||
*/
|
||||
|
||||
static int snd_hda_codecs_inuse(struct hda_bus *bus)
|
||||
{
|
||||
struct hda_codec *codec;
|
||||
|
||||
list_for_each_entry(codec, &bus->codec_list, list) {
|
||||
if (snd_hda_codec_needs_resume(codec))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int azx_suspend(struct pci_dev *pci, pm_message_t state)
|
||||
{
|
||||
struct snd_card *card = pci_get_drvdata(pci);
|
||||
@ -2397,7 +2408,8 @@ static int azx_resume(struct pci_dev *pci)
|
||||
return -EIO;
|
||||
azx_init_pci(chip);
|
||||
|
||||
azx_init_chip(chip, 1);
|
||||
if (snd_hda_codecs_inuse(chip->bus))
|
||||
azx_init_chip(chip, 1);
|
||||
|
||||
snd_hda_resume(chip->bus);
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||
|
@ -5381,6 +5381,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
|
||||
ALC882_FIXUP_ACER_ASPIRE_4930G),
|
||||
SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
|
||||
SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
|
||||
ALC882_FIXUP_ACER_ASPIRE_4930G),
|
||||
SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
|
||||
SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
|
||||
SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
|
||||
@ -5414,6 +5416,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF),
|
||||
|
||||
SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
|
||||
SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
|
||||
SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
|
||||
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD),
|
||||
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
|
||||
@ -5614,13 +5617,13 @@ static int patch_alc262(struct hda_codec *codec)
|
||||
snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
|
||||
}
|
||||
#endif
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
alc_fix_pll_init(codec, 0x20, 0x0a, 10);
|
||||
|
||||
alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups);
|
||||
alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
|
||||
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
/* automatic parse from the BIOS config */
|
||||
err = alc262_parse_auto_config(codec);
|
||||
if (err < 0)
|
||||
@ -6083,6 +6086,7 @@ static const struct alc_fixup alc269_fixups[] = {
|
||||
|
||||
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
|
||||
SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
|
||||
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
|
||||
@ -6222,8 +6226,6 @@ static int patch_alc269(struct hda_codec *codec)
|
||||
|
||||
spec->mixer_nid = 0x0b;
|
||||
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
err = alc_codec_rename_from_preset(codec);
|
||||
if (err < 0)
|
||||
goto error;
|
||||
@ -6256,6 +6258,8 @@ static int patch_alc269(struct hda_codec *codec)
|
||||
alc269_fixup_tbl, alc269_fixups);
|
||||
alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
|
||||
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
/* automatic parse from the BIOS config */
|
||||
err = alc269_parse_auto_config(codec);
|
||||
if (err < 0)
|
||||
@ -6831,8 +6835,6 @@ static int patch_alc662(struct hda_codec *codec)
|
||||
/* handle multiple HPs as is */
|
||||
spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
|
||||
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
alc_fix_pll_init(codec, 0x20, 0x04, 15);
|
||||
|
||||
err = alc_codec_rename_from_preset(codec);
|
||||
@ -6849,6 +6851,9 @@ static int patch_alc662(struct hda_codec *codec)
|
||||
alc_pick_fixup(codec, alc662_fixup_models,
|
||||
alc662_fixup_tbl, alc662_fixups);
|
||||
alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
|
||||
|
||||
alc_auto_parse_customize_define(codec);
|
||||
|
||||
/* automatic parse from the BIOS config */
|
||||
err = alc662_parse_auto_config(codec);
|
||||
if (err < 0)
|
||||
|
@ -5170,6 +5170,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
|
||||
strcpy(hw->name, "HDSP hwdep interface");
|
||||
|
||||
hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
|
||||
hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
|
||||
.platform_name = "bfin-i2s-pcm-audio",
|
||||
.codec_name = "ssm2602.0-001b",
|
||||
.ops = &bf5xx_ssm2602_ops,
|
||||
.dai_fmt = BF5XX_SSM2602_DAIFMT,
|
||||
},
|
||||
{
|
||||
.name = "ssm2602",
|
||||
@ -108,6 +109,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
|
||||
.platform_name = "bfin-i2s-pcm-audio",
|
||||
.codec_name = "ssm2602.0-001b",
|
||||
.ops = &bf5xx_ssm2602_ops,
|
||||
.dai_fmt = BF5XX_SSM2602_DAIFMT,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -929,6 +929,8 @@ static int cs42l73_set_mclk(struct snd_soc_dai *dai, unsigned int freq)
|
||||
|
||||
/* MCLKX -> MCLK */
|
||||
mclkx_coeff = cs42l73_get_mclkx_coeff(freq);
|
||||
if (mclkx_coeff < 0)
|
||||
return mclkx_coeff;
|
||||
|
||||
mclk = cs42l73_mclkx_coeffs[mclkx_coeff].mclkx /
|
||||
cs42l73_mclkx_coeffs[mclkx_coeff].ratio;
|
||||
|
@ -472,7 +472,7 @@ static int tlv320aic23_set_dai_sysclk(struct snd_soc_dai *codec_dai,
|
||||
static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0xff7f;
|
||||
u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0x17f;
|
||||
|
||||
switch (level) {
|
||||
case SND_SOC_BIAS_ON:
|
||||
@ -491,7 +491,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
|
||||
case SND_SOC_BIAS_OFF:
|
||||
/* everything off, dac mute, inactive */
|
||||
snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0);
|
||||
snd_soc_write(codec, TLV320AIC23_PWR, 0xffff);
|
||||
snd_soc_write(codec, TLV320AIC23_PWR, 0x1ff);
|
||||
break;
|
||||
}
|
||||
codec->dapm.bias_level = level;
|
||||
|
@ -60,7 +60,7 @@ struct wm8350_jack_data {
|
||||
};
|
||||
|
||||
struct wm8350_data {
|
||||
struct snd_soc_codec codec;
|
||||
struct wm8350 *wm8350;
|
||||
struct wm8350_output out1;
|
||||
struct wm8350_output out2;
|
||||
struct wm8350_jack_data hpl;
|
||||
@ -1309,7 +1309,7 @@ static void wm8350_hp_work(struct wm8350_data *priv,
|
||||
struct wm8350_jack_data *jack,
|
||||
u16 mask)
|
||||
{
|
||||
struct wm8350 *wm8350 = priv->codec.control_data;
|
||||
struct wm8350 *wm8350 = priv->wm8350;
|
||||
u16 reg;
|
||||
int report;
|
||||
|
||||
@ -1342,7 +1342,7 @@ static void wm8350_hpr_work(struct work_struct *work)
|
||||
static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
|
||||
{
|
||||
struct wm8350_data *priv = data;
|
||||
struct wm8350 *wm8350 = priv->codec.control_data;
|
||||
struct wm8350 *wm8350 = priv->wm8350;
|
||||
struct wm8350_jack_data *jack = NULL;
|
||||
|
||||
switch (irq - wm8350->irq_base) {
|
||||
@ -1427,7 +1427,7 @@ EXPORT_SYMBOL_GPL(wm8350_hp_jack_detect);
|
||||
static irqreturn_t wm8350_mic_handler(int irq, void *data)
|
||||
{
|
||||
struct wm8350_data *priv = data;
|
||||
struct wm8350 *wm8350 = priv->codec.control_data;
|
||||
struct wm8350 *wm8350 = priv->wm8350;
|
||||
u16 reg;
|
||||
int report = 0;
|
||||
|
||||
@ -1536,6 +1536,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
|
||||
return -ENOMEM;
|
||||
snd_soc_codec_set_drvdata(codec, priv);
|
||||
|
||||
priv->wm8350 = wm8350;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
|
||||
priv->supplies[i].supply = supply_names[i];
|
||||
|
||||
@ -1544,7 +1546,6 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
wm8350->codec.codec = codec;
|
||||
codec->control_data = wm8350;
|
||||
|
||||
/* Put the codec into reset if it wasn't already */
|
||||
|
@ -1000,6 +1000,204 @@ static void wm8994_update_class_w(struct snd_soc_codec *codec)
|
||||
}
|
||||
}
|
||||
|
||||
static int aif1clk_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8994 *control = codec->control_data;
|
||||
int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
|
||||
int dac;
|
||||
int adc;
|
||||
int val;
|
||||
|
||||
switch (control->type) {
|
||||
case WM8994:
|
||||
case WM8958:
|
||||
mask |= WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1);
|
||||
if ((val & WM8994_AIF1ADCL_SRC) &&
|
||||
(val & WM8994_AIF1ADCR_SRC))
|
||||
adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA;
|
||||
else if (!(val & WM8994_AIF1ADCL_SRC) &&
|
||||
!(val & WM8994_AIF1ADCR_SRC))
|
||||
adc = WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
|
||||
else
|
||||
adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA |
|
||||
WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
|
||||
|
||||
val = snd_soc_read(codec, WM8994_AIF1_CONTROL_2);
|
||||
if ((val & WM8994_AIF1DACL_SRC) &&
|
||||
(val & WM8994_AIF1DACR_SRC))
|
||||
dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA;
|
||||
else if (!(val & WM8994_AIF1DACL_SRC) &&
|
||||
!(val & WM8994_AIF1DACR_SRC))
|
||||
dac = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
|
||||
else
|
||||
dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA |
|
||||
WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
|
||||
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
|
||||
mask, adc);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
mask, dac);
|
||||
snd_soc_update_bits(codec, WM8994_CLOCKING_1,
|
||||
WM8994_AIF1DSPCLK_ENA |
|
||||
WM8994_SYSDSPCLK_ENA,
|
||||
WM8994_AIF1DSPCLK_ENA |
|
||||
WM8994_SYSDSPCLK_ENA);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, mask,
|
||||
WM8994_AIF1ADC1R_ENA |
|
||||
WM8994_AIF1ADC1L_ENA |
|
||||
WM8994_AIF1ADC2R_ENA |
|
||||
WM8994_AIF1ADC2L_ENA);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, mask,
|
||||
WM8994_AIF1DAC1R_ENA |
|
||||
WM8994_AIF1DAC1L_ENA |
|
||||
WM8994_AIF1DAC2R_ENA |
|
||||
WM8994_AIF1DAC2L_ENA);
|
||||
break;
|
||||
|
||||
case SND_SOC_DAPM_PRE_PMD:
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
mask, 0);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
|
||||
mask, 0);
|
||||
|
||||
val = snd_soc_read(codec, WM8994_CLOCKING_1);
|
||||
if (val & WM8994_AIF2DSPCLK_ENA)
|
||||
val = WM8994_SYSDSPCLK_ENA;
|
||||
else
|
||||
val = 0;
|
||||
snd_soc_update_bits(codec, WM8994_CLOCKING_1,
|
||||
WM8994_SYSDSPCLK_ENA |
|
||||
WM8994_AIF1DSPCLK_ENA, val);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aif2clk_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
int dac;
|
||||
int adc;
|
||||
int val;
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
val = snd_soc_read(codec, WM8994_AIF2_CONTROL_1);
|
||||
if ((val & WM8994_AIF2ADCL_SRC) &&
|
||||
(val & WM8994_AIF2ADCR_SRC))
|
||||
adc = WM8994_AIF2ADCR_ENA;
|
||||
else if (!(val & WM8994_AIF2ADCL_SRC) &&
|
||||
!(val & WM8994_AIF2ADCR_SRC))
|
||||
adc = WM8994_AIF2ADCL_ENA;
|
||||
else
|
||||
adc = WM8994_AIF2ADCL_ENA | WM8994_AIF2ADCR_ENA;
|
||||
|
||||
|
||||
val = snd_soc_read(codec, WM8994_AIF2_CONTROL_2);
|
||||
if ((val & WM8994_AIF2DACL_SRC) &&
|
||||
(val & WM8994_AIF2DACR_SRC))
|
||||
dac = WM8994_AIF2DACR_ENA;
|
||||
else if (!(val & WM8994_AIF2DACL_SRC) &&
|
||||
!(val & WM8994_AIF2DACR_SRC))
|
||||
dac = WM8994_AIF2DACL_ENA;
|
||||
else
|
||||
dac = WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA;
|
||||
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
|
||||
WM8994_AIF2ADCL_ENA |
|
||||
WM8994_AIF2ADCR_ENA, adc);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
WM8994_AIF2DACL_ENA |
|
||||
WM8994_AIF2DACR_ENA, dac);
|
||||
snd_soc_update_bits(codec, WM8994_CLOCKING_1,
|
||||
WM8994_AIF2DSPCLK_ENA |
|
||||
WM8994_SYSDSPCLK_ENA,
|
||||
WM8994_AIF2DSPCLK_ENA |
|
||||
WM8994_SYSDSPCLK_ENA);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
|
||||
WM8994_AIF2ADCL_ENA |
|
||||
WM8994_AIF2ADCR_ENA,
|
||||
WM8994_AIF2ADCL_ENA |
|
||||
WM8994_AIF2ADCR_ENA);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
WM8994_AIF2DACL_ENA |
|
||||
WM8994_AIF2DACR_ENA,
|
||||
WM8994_AIF2DACL_ENA |
|
||||
WM8994_AIF2DACR_ENA);
|
||||
break;
|
||||
|
||||
case SND_SOC_DAPM_PRE_PMD:
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
WM8994_AIF2DACL_ENA |
|
||||
WM8994_AIF2DACR_ENA, 0);
|
||||
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
|
||||
WM8994_AIF2ADCL_ENA |
|
||||
WM8994_AIF2ADCR_ENA, 0);
|
||||
|
||||
val = snd_soc_read(codec, WM8994_CLOCKING_1);
|
||||
if (val & WM8994_AIF1DSPCLK_ENA)
|
||||
val = WM8994_SYSDSPCLK_ENA;
|
||||
else
|
||||
val = 0;
|
||||
snd_soc_update_bits(codec, WM8994_CLOCKING_1,
|
||||
WM8994_SYSDSPCLK_ENA |
|
||||
WM8994_AIF2DSPCLK_ENA, val);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aif1clk_late_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
wm8994->aif1clk_enable = 1;
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
wm8994->aif1clk_disable = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aif2clk_late_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
wm8994->aif2clk_enable = 1;
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
wm8994->aif2clk_disable = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int late_enable_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
@ -1009,12 +1207,14 @@ static int late_enable_ev(struct snd_soc_dapm_widget *w,
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
if (wm8994->aif1clk_enable) {
|
||||
aif1clk_ev(w, kcontrol, event);
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
|
||||
WM8994_AIF1CLK_ENA_MASK,
|
||||
WM8994_AIF1CLK_ENA);
|
||||
wm8994->aif1clk_enable = 0;
|
||||
}
|
||||
if (wm8994->aif2clk_enable) {
|
||||
aif2clk_ev(w, kcontrol, event);
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
|
||||
WM8994_AIF2CLK_ENA_MASK,
|
||||
WM8994_AIF2CLK_ENA);
|
||||
@ -1040,11 +1240,13 @@ static int late_disable_ev(struct snd_soc_dapm_widget *w,
|
||||
if (wm8994->aif1clk_disable) {
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
|
||||
WM8994_AIF1CLK_ENA_MASK, 0);
|
||||
aif1clk_ev(w, kcontrol, event);
|
||||
wm8994->aif1clk_disable = 0;
|
||||
}
|
||||
if (wm8994->aif2clk_disable) {
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
|
||||
WM8994_AIF2CLK_ENA_MASK, 0);
|
||||
aif2clk_ev(w, kcontrol, event);
|
||||
wm8994->aif2clk_disable = 0;
|
||||
}
|
||||
break;
|
||||
@ -1053,42 +1255,6 @@ static int late_disable_ev(struct snd_soc_dapm_widget *w,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aif1clk_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
wm8994->aif1clk_enable = 1;
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
wm8994->aif1clk_disable = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aif2clk_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = w->codec;
|
||||
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
wm8994->aif2clk_enable = 1;
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
wm8994->aif2clk_disable = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int adc_mux_ev(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
@ -1385,9 +1551,9 @@ static const struct snd_kcontrol_new aif2dacr_src_mux =
|
||||
SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
|
||||
|
||||
static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = {
|
||||
SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev,
|
||||
SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_late_ev,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev,
|
||||
SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_late_ev,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
|
||||
@ -1416,8 +1582,10 @@ SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev)
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = {
|
||||
SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0,
|
||||
left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)),
|
||||
@ -1470,30 +1638,30 @@ SND_SOC_DAPM_SUPPLY("VMID", SND_SOC_NOPM, 0, 0, vmid_event,
|
||||
SND_SOC_DAPM_SUPPLY("CLK_SYS", SND_SOC_NOPM, 0, 0, clk_sys_event,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
|
||||
SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM, 3, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("DSP2CLK", SND_SOC_NOPM, 2, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("DSPINTCLK", SND_SOC_NOPM, 1, 0, NULL, 0),
|
||||
|
||||
SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL,
|
||||
0, WM8994_POWER_MANAGEMENT_4, 9, 0),
|
||||
0, SND_SOC_NOPM, 9, 0),
|
||||
SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL,
|
||||
0, WM8994_POWER_MANAGEMENT_4, 8, 0),
|
||||
0, SND_SOC_NOPM, 8, 0),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 9, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 8, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL,
|
||||
0, WM8994_POWER_MANAGEMENT_4, 11, 0),
|
||||
0, SND_SOC_NOPM, 11, 0),
|
||||
SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL,
|
||||
0, WM8994_POWER_MANAGEMENT_4, 10, 0),
|
||||
0, SND_SOC_NOPM, 10, 0),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 11, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF1DAC2R", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 10, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 10, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_MIXER("AIF1ADC1L Mixer", SND_SOC_NOPM, 0, 0,
|
||||
@ -1520,14 +1688,14 @@ SND_SOC_DAPM_MIXER("DAC1R Mixer", SND_SOC_NOPM, 0, 0,
|
||||
dac1r_mix, ARRAY_SIZE(dac1r_mix)),
|
||||
|
||||
SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_4, 13, 0),
|
||||
SND_SOC_NOPM, 13, 0),
|
||||
SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_4, 12, 0),
|
||||
SND_SOC_NOPM, 12, 0),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF2DACL", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 13, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 13, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0,
|
||||
WM8994_POWER_MANAGEMENT_5, 12, 0, wm8958_aif_ev,
|
||||
SND_SOC_NOPM, 12, 0, wm8958_aif_ev,
|
||||
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
|
||||
|
||||
SND_SOC_DAPM_AIF_IN("AIF1DACDAT", NULL, 0, SND_SOC_NOPM, 0, 0),
|
||||
|
@ -1035,7 +1035,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
|
||||
int val;
|
||||
int mask, val;
|
||||
|
||||
switch (level) {
|
||||
case SND_SOC_BIAS_STANDBY:
|
||||
@ -1047,6 +1047,13 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
|
||||
case SND_SOC_BIAS_ON:
|
||||
/* Turn off any unneded single ended outputs */
|
||||
val = 0;
|
||||
mask = 0;
|
||||
|
||||
if (hubs->lineout1_se)
|
||||
mask |= WM8993_LINEOUT1N_ENA | WM8993_LINEOUT1P_ENA;
|
||||
|
||||
if (hubs->lineout2_se)
|
||||
mask |= WM8993_LINEOUT2N_ENA | WM8993_LINEOUT2P_ENA;
|
||||
|
||||
if (hubs->lineout1_se && hubs->lineout1n_ena)
|
||||
val |= WM8993_LINEOUT1N_ENA;
|
||||
@ -1061,11 +1068,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
|
||||
val |= WM8993_LINEOUT2P_ENA;
|
||||
|
||||
snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3,
|
||||
WM8993_LINEOUT1N_ENA |
|
||||
WM8993_LINEOUT1P_ENA |
|
||||
WM8993_LINEOUT2N_ENA |
|
||||
WM8993_LINEOUT2P_ENA,
|
||||
val);
|
||||
mask, val);
|
||||
|
||||
/* Remove the input clamps */
|
||||
snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
|
||||
|
@ -401,6 +401,10 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
}
|
||||
|
||||
out:
|
||||
/* free preallocated buffers in case of error */
|
||||
if (ret)
|
||||
omap_pcm_free_dma_buffers(pcm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
|
||||
|
||||
static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev)
|
||||
{
|
||||
return snd_soc_register_dai(&pdev->dev, &s3c2412_i2s_dai);
|
||||
return s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
|
||||
}
|
||||
|
||||
static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev)
|
||||
|
@ -1001,11 +1001,10 @@ static void fsi_dma_do_tasklet(unsigned long data)
|
||||
sg_dma_address(&sg) = buf;
|
||||
sg_dma_len(&sg) = len;
|
||||
|
||||
desc = chan->device->device_prep_slave_sg(chan, &sg, 1, dir,
|
||||
DMA_PREP_INTERRUPT |
|
||||
DMA_CTRL_ACK);
|
||||
desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir,
|
||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||
if (!desc) {
|
||||
dev_err(dai->dev, "device_prep_slave_sg() fail\n");
|
||||
dev_err(dai->dev, "dmaengine_prep_slave_sg() fail\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3119,6 +3119,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
|
||||
GFP_KERNEL);
|
||||
if (card->rtd == NULL)
|
||||
return -ENOMEM;
|
||||
card->num_rtd = 0;
|
||||
card->rtd_aux = &card->rtd[card->num_links];
|
||||
|
||||
for (i = 0; i < card->num_links; i++)
|
||||
@ -3630,10 +3631,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
||||
int i, ret;
|
||||
|
||||
num_routes = of_property_count_strings(np, propname);
|
||||
if (num_routes & 1) {
|
||||
if (num_routes < 0 || num_routes & 1) {
|
||||
dev_err(card->dev,
|
||||
"Property '%s's length is not even\n",
|
||||
propname);
|
||||
"Property '%s' does not exist or its length is not even\n",
|
||||
propname);
|
||||
return -EINVAL;
|
||||
}
|
||||
num_routes /= 2;
|
||||
|
@ -67,6 +67,7 @@ static int dapm_up_seq[] = {
|
||||
[snd_soc_dapm_out_drv] = 10,
|
||||
[snd_soc_dapm_hp] = 10,
|
||||
[snd_soc_dapm_spk] = 10,
|
||||
[snd_soc_dapm_line] = 10,
|
||||
[snd_soc_dapm_post] = 11,
|
||||
};
|
||||
|
||||
@ -75,6 +76,7 @@ static int dapm_down_seq[] = {
|
||||
[snd_soc_dapm_adc] = 1,
|
||||
[snd_soc_dapm_hp] = 2,
|
||||
[snd_soc_dapm_spk] = 2,
|
||||
[snd_soc_dapm_line] = 2,
|
||||
[snd_soc_dapm_out_drv] = 2,
|
||||
[snd_soc_dapm_pga] = 4,
|
||||
[snd_soc_dapm_mixer_named_ctl] = 5,
|
||||
|
Loading…
Reference in New Issue
Block a user