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

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

Pull sound fixes from Takashi Iwai:
 "Again it became bigger than wished, unfortunately, as this contains
  quite a few ASoC fixes that came up a bit late. It also includes yet
  more HD- and USB-audio quirks: I decided to merge them now, as those
  are for stable, and we'll need them sooner or later.

  Although the volumes are a bit high, all changes are device-specific
  (and reasonably small) fixes, so it should be safe for the late rc"

* tag 'sound-5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Fix microphone sound on Jieli webcam.
  ALSA: hda/realtek: Fixes HP Spectre x360 15-eb1xxx speakers
  ALSA: usb-audio: Provide quirk for Sennheiser GSP670 Headset
  ALSA: hda/realtek: Add quirk for Clevo PC50HS
  ALSA: usb-audio: add Schiit Hel device to quirk table
  ASoC: wm8960: Fix clock configuration on slave mode
  ASoC: cs42l42: Ensure 0dB full scale volume is used for headsets
  ASoC: soc-core: fix null-ptr-deref in snd_soc_del_component_unlocked()
  ASoC: codec: wcd938x: Add irq config support
  ASoC: DAPM: Fix missing kctl change notifications
  ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log saturation
  ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional()
  ASoC: Intel: bytcht_es8316: Use temporary variable for struct device
  ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata()
  ASoC: wcd938x: Fix jack detection issue
  ASoC: nau8824: Fix headphone vs headset, button-press detection no longer working
  ASoC: cs4341: Add SPI device ID table
  ASoC: pcm179x: Add missing entries SPI to device ID table
  ASoC: fsl_xcvr: Fix channel swap issue with ARC
  ASoC: pcm512x: Mend accesses to the I2S_1 and I2S_2 registers
parents 6da52dea 29664923
...@@ -2535,6 +2535,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { ...@@ -2535,6 +2535,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
...@@ -6405,6 +6406,44 @@ static void alc_fixup_no_int_mic(struct hda_codec *codec, ...@@ -6405,6 +6406,44 @@ static void alc_fixup_no_int_mic(struct hda_codec *codec,
} }
} }
/* GPIO1 = amplifier on/off
* GPIO3 = mic mute LED
*/
static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
static const hda_nid_t conn[] = { 0x02 };
struct alc_spec *spec = codec->spec;
static const struct hda_pintbl pincfgs[] = {
{ 0x14, 0x90170110 }, /* front/high speakers */
{ 0x17, 0x90170130 }, /* back/bass speakers */
{ }
};
//enable micmute led
alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
switch (action) {
case HDA_FIXUP_ACT_PRE_PROBE:
spec->micmute_led_polarity = 1;
/* needed for amp of back speakers */
spec->gpio_mask |= 0x01;
spec->gpio_dir |= 0x01;
snd_hda_apply_pincfgs(codec, pincfgs);
/* share DAC to have unified volume control */
snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
break;
case HDA_FIXUP_ACT_INIT:
/* need to toggle GPIO to enable the amp of back speakers */
alc_update_gpio_data(codec, 0x01, true);
msleep(100);
alc_update_gpio_data(codec, 0x01, false);
break;
}
}
static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix, int action)
{ {
...@@ -6557,6 +6596,7 @@ enum { ...@@ -6557,6 +6596,7 @@ enum {
ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
ALC280_FIXUP_HP_9480M, ALC280_FIXUP_HP_9480M,
ALC245_FIXUP_HP_X360_AMP, ALC245_FIXUP_HP_X360_AMP,
ALC285_FIXUP_HP_SPECTRE_X360_EB1,
ALC288_FIXUP_DELL_HEADSET_MODE, ALC288_FIXUP_DELL_HEADSET_MODE,
ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
ALC288_FIXUP_DELL_XPS_13, ALC288_FIXUP_DELL_XPS_13,
...@@ -8250,6 +8290,10 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -8250,6 +8290,10 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_hp_spectre_x360, .v.func = alc285_fixup_hp_spectre_x360,
}, },
[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_hp_spectre_x360_eb1
},
[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_ideapad_s740_coef, .v.func = alc285_fixup_ideapad_s740_coef,
...@@ -8584,6 +8628,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -8584,6 +8628,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
...@@ -9005,6 +9051,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { ...@@ -9005,6 +9051,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
......
...@@ -1583,6 +1583,7 @@ config SND_SOC_WCD938X_SDW ...@@ -1583,6 +1583,7 @@ config SND_SOC_WCD938X_SDW
tristate "WCD9380/WCD9385 Codec - SDW" tristate "WCD9380/WCD9385 Codec - SDW"
select SND_SOC_WCD938X select SND_SOC_WCD938X
select SND_SOC_WCD_MBHC select SND_SOC_WCD_MBHC
select REGMAP_IRQ
depends on SOUNDWIRE depends on SOUNDWIRE
select REGMAP_SOUNDWIRE select REGMAP_SOUNDWIRE
help help
......
...@@ -922,7 +922,6 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ...@@ -922,7 +922,6 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
struct snd_soc_component *component = dai->component; struct snd_soc_component *component = dai->component;
struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
unsigned int regval; unsigned int regval;
u8 fullScaleVol;
int ret; int ret;
if (mute) { if (mute) {
...@@ -993,20 +992,11 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ...@@ -993,20 +992,11 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
cs42l42->stream_use |= 1 << stream; cs42l42->stream_use |= 1 << stream;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) { if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* Read the headphone load */ /* Un-mute the headphone */
regval = snd_soc_component_read(component, CS42L42_LOAD_DET_RCSTAT);
if (((regval & CS42L42_RLA_STAT_MASK) >> CS42L42_RLA_STAT_SHIFT) ==
CS42L42_RLA_STAT_15_OHM) {
fullScaleVol = CS42L42_HP_FULL_SCALE_VOL_MASK;
} else {
fullScaleVol = 0;
}
/* Un-mute the headphone, set the full scale volume flag */
snd_soc_component_update_bits(component, CS42L42_HP_CTL, snd_soc_component_update_bits(component, CS42L42_HP_CTL,
CS42L42_HP_ANA_AMUTE_MASK | CS42L42_HP_ANA_AMUTE_MASK |
CS42L42_HP_ANA_BMUTE_MASK | CS42L42_HP_ANA_BMUTE_MASK,
CS42L42_HP_FULL_SCALE_VOL_MASK, fullScaleVol); 0);
} }
} }
......
...@@ -305,12 +305,19 @@ static int cs4341_spi_probe(struct spi_device *spi) ...@@ -305,12 +305,19 @@ static int cs4341_spi_probe(struct spi_device *spi)
return cs4341_probe(&spi->dev); return cs4341_probe(&spi->dev);
} }
static const struct spi_device_id cs4341_spi_ids[] = {
{ "cs4341a" },
{ }
};
MODULE_DEVICE_TABLE(spi, cs4341_spi_ids);
static struct spi_driver cs4341_spi_driver = { static struct spi_driver cs4341_spi_driver = {
.driver = { .driver = {
.name = "cs4341-spi", .name = "cs4341-spi",
.of_match_table = of_match_ptr(cs4341_dt_ids), .of_match_table = of_match_ptr(cs4341_dt_ids),
}, },
.probe = cs4341_spi_probe, .probe = cs4341_spi_probe,
.id_table = cs4341_spi_ids,
}; };
#endif #endif
......
...@@ -867,8 +867,8 @@ static void nau8824_jdet_work(struct work_struct *work) ...@@ -867,8 +867,8 @@ static void nau8824_jdet_work(struct work_struct *work)
struct regmap *regmap = nau8824->regmap; struct regmap *regmap = nau8824->regmap;
int adc_value, event = 0, event_mask = 0; int adc_value, event = 0, event_mask = 0;
snd_soc_dapm_enable_pin(dapm, "MICBIAS"); snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
snd_soc_dapm_enable_pin(dapm, "SAR"); snd_soc_dapm_force_enable_pin(dapm, "SAR");
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
msleep(100); msleep(100);
......
...@@ -36,6 +36,7 @@ static const struct of_device_id pcm179x_of_match[] = { ...@@ -36,6 +36,7 @@ static const struct of_device_id pcm179x_of_match[] = {
MODULE_DEVICE_TABLE(of, pcm179x_of_match); MODULE_DEVICE_TABLE(of, pcm179x_of_match);
static const struct spi_device_id pcm179x_spi_ids[] = { static const struct spi_device_id pcm179x_spi_ids[] = {
{ "pcm1792a", 0 },
{ "pcm179x", 0 }, { "pcm179x", 0 },
{ }, { },
}; };
......
...@@ -116,6 +116,8 @@ static const struct reg_default pcm512x_reg_defaults[] = { ...@@ -116,6 +116,8 @@ static const struct reg_default pcm512x_reg_defaults[] = {
{ PCM512x_FS_SPEED_MODE, 0x00 }, { PCM512x_FS_SPEED_MODE, 0x00 },
{ PCM512x_IDAC_1, 0x01 }, { PCM512x_IDAC_1, 0x01 },
{ PCM512x_IDAC_2, 0x00 }, { PCM512x_IDAC_2, 0x00 },
{ PCM512x_I2S_1, 0x02 },
{ PCM512x_I2S_2, 0x00 },
}; };
static bool pcm512x_readable(struct device *dev, unsigned int reg) static bool pcm512x_readable(struct device *dev, unsigned int reg)
......
...@@ -4144,9 +4144,9 @@ static int wcd938x_codec_set_jack(struct snd_soc_component *comp, ...@@ -4144,9 +4144,9 @@ static int wcd938x_codec_set_jack(struct snd_soc_component *comp,
{ {
struct wcd938x_priv *wcd = dev_get_drvdata(comp->dev); struct wcd938x_priv *wcd = dev_get_drvdata(comp->dev);
if (!jack) if (jack)
return wcd_mbhc_start(wcd->wcd_mbhc, &wcd->mbhc_cfg, jack); return wcd_mbhc_start(wcd->wcd_mbhc, &wcd->mbhc_cfg, jack);
else
wcd_mbhc_stop(wcd->wcd_mbhc); wcd_mbhc_stop(wcd->wcd_mbhc);
return 0; return 0;
......
...@@ -742,9 +742,16 @@ static int wm8960_configure_clocking(struct snd_soc_component *component) ...@@ -742,9 +742,16 @@ static int wm8960_configure_clocking(struct snd_soc_component *component)
int i, j, k; int i, j, k;
int ret; int ret;
if (!(iface1 & (1<<6))) { /*
dev_dbg(component->dev, * For Slave mode clocking should still be configured,
"Codec is slave mode, no need to configure clock\n"); * so this if statement should be removed, but some platform
* may not work if the sysclk is not configured, to avoid such
* compatible issue, just add '!wm8960->sysclk' condition in
* this if statement.
*/
if (!(iface1 & (1 << 6)) && !wm8960->sysclk) {
dev_warn(component->dev,
"slave mode, but proceeding with no clock configuration\n");
return 0; return 0;
} }
......
...@@ -487,8 +487,9 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream *substream, ...@@ -487,8 +487,9 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream *substream,
return ret; return ret;
} }
/* clear DPATH RESET */ /* set DPATH RESET */
m_ctl |= FSL_XCVR_EXT_CTRL_DPTH_RESET(tx); m_ctl |= FSL_XCVR_EXT_CTRL_DPTH_RESET(tx);
v_ctl |= FSL_XCVR_EXT_CTRL_DPTH_RESET(tx);
ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, m_ctl, v_ctl); ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, m_ctl, v_ctl);
if (ret < 0) { if (ret < 0) {
dev_err(dai->dev, "Error while setting EXT_CTRL: %d\n", ret); dev_err(dai->dev, "Error while setting EXT_CTRL: %d\n", ret);
...@@ -590,10 +591,6 @@ static void fsl_xcvr_shutdown(struct snd_pcm_substream *substream, ...@@ -590,10 +591,6 @@ static void fsl_xcvr_shutdown(struct snd_pcm_substream *substream,
val |= FSL_XCVR_EXT_CTRL_CMDC_RESET(tx); val |= FSL_XCVR_EXT_CTRL_CMDC_RESET(tx);
} }
/* set DPATH RESET */
mask |= FSL_XCVR_EXT_CTRL_DPTH_RESET(tx);
val |= FSL_XCVR_EXT_CTRL_DPTH_RESET(tx);
ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, mask, val); ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, mask, val);
if (ret < 0) { if (ret < 0) {
dev_err(dai->dev, "Err setting DPATH RESET: %d\n", ret); dev_err(dai->dev, "Err setting DPATH RESET: %d\n", ret);
...@@ -643,6 +640,16 @@ static int fsl_xcvr_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -643,6 +640,16 @@ static int fsl_xcvr_trigger(struct snd_pcm_substream *substream, int cmd,
dev_err(dai->dev, "Failed to enable DMA: %d\n", ret); dev_err(dai->dev, "Failed to enable DMA: %d\n", ret);
return ret; return ret;
} }
/* clear DPATH RESET */
ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
FSL_XCVR_EXT_CTRL_DPTH_RESET(tx),
0);
if (ret < 0) {
dev_err(dai->dev, "Failed to clear DPATH RESET: %d\n", ret);
return ret;
}
break; break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_SUSPEND:
......
...@@ -456,12 +456,12 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = { ...@@ -456,12 +456,12 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
static const char * const mic_name[] = { "in1", "in2" }; static const char * const mic_name[] = { "in1", "in2" };
struct snd_soc_acpi_mach *mach = dev_get_platdata(dev);
struct property_entry props[MAX_NO_PROPS] = {}; struct property_entry props[MAX_NO_PROPS] = {};
struct byt_cht_es8316_private *priv; struct byt_cht_es8316_private *priv;
const struct dmi_system_id *dmi_id; const struct dmi_system_id *dmi_id;
struct device *dev = &pdev->dev;
struct snd_soc_acpi_mach *mach;
struct fwnode_handle *fwnode; struct fwnode_handle *fwnode;
const char *platform_name; const char *platform_name;
struct acpi_device *adev; struct acpi_device *adev;
...@@ -476,7 +476,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -476,7 +476,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
mach = dev->platform_data;
/* fix index of codec dai */ /* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) { for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) {
if (!strcmp(byt_cht_es8316_dais[i].codecs->name, if (!strcmp(byt_cht_es8316_dais[i].codecs->name,
...@@ -494,7 +493,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -494,7 +493,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
put_device(&adev->dev); put_device(&adev->dev);
byt_cht_es8316_dais[dai_index].codecs->name = codec_name; byt_cht_es8316_dais[dai_index].codecs->name = codec_name;
} else { } else {
dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
return -ENXIO; return -ENXIO;
} }
...@@ -533,11 +532,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -533,11 +532,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
/* get the clock */ /* get the clock */
priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3"); priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3");
if (IS_ERR(priv->mclk)) { if (IS_ERR(priv->mclk))
ret = PTR_ERR(priv->mclk); return dev_err_probe(dev, PTR_ERR(priv->mclk), "clk_get pmc_plt_clk_3 failed\n");
dev_err(dev, "clk_get pmc_plt_clk_3 failed: %d\n", ret);
return ret;
}
/* get speaker enable GPIO */ /* get speaker enable GPIO */
codec_dev = acpi_get_first_physical_node(adev); codec_dev = acpi_get_first_physical_node(adev);
...@@ -567,23 +563,14 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -567,23 +563,14 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios); devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios);
priv->speaker_en_gpio = priv->speaker_en_gpio =
gpiod_get_index(codec_dev, "speaker-enable", 0, gpiod_get_optional(codec_dev, "speaker-enable",
/* see comment in byt_cht_es8316_resume */ /* see comment in byt_cht_es8316_resume() */
GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE); GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(priv->speaker_en_gpio)) { if (IS_ERR(priv->speaker_en_gpio)) {
ret = PTR_ERR(priv->speaker_en_gpio); ret = dev_err_probe(dev, PTR_ERR(priv->speaker_en_gpio),
switch (ret) { "get speaker GPIO failed\n");
case -ENOENT:
priv->speaker_en_gpio = NULL;
break;
default:
dev_err(dev, "get speaker GPIO failed: %d\n", ret);
fallthrough;
case -EPROBE_DEFER:
goto err_put_codec; goto err_put_codec;
} }
}
snprintf(components_string, sizeof(components_string), snprintf(components_string, sizeof(components_string),
"cfg-spk:%s cfg-mic:%s", "cfg-spk:%s cfg-mic:%s",
...@@ -597,7 +584,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -597,7 +584,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
byt_cht_es8316_card.long_name = long_name; byt_cht_es8316_card.long_name = long_name;
#endif #endif
sof_parent = snd_soc_acpi_sof_parent(&pdev->dev); sof_parent = snd_soc_acpi_sof_parent(dev);
/* set card and driver name */ /* set card and driver name */
if (sof_parent) { if (sof_parent) {
......
...@@ -2599,6 +2599,7 @@ int snd_soc_component_initialize(struct snd_soc_component *component, ...@@ -2599,6 +2599,7 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
INIT_LIST_HEAD(&component->dai_list); INIT_LIST_HEAD(&component->dai_list);
INIT_LIST_HEAD(&component->dobj_list); INIT_LIST_HEAD(&component->dobj_list);
INIT_LIST_HEAD(&component->card_list); INIT_LIST_HEAD(&component->card_list);
INIT_LIST_HEAD(&component->list);
mutex_init(&component->io_mutex); mutex_init(&component->io_mutex);
component->name = fmt_single_name(dev, &component->id); component->name = fmt_single_name(dev, &component->id);
......
...@@ -2561,6 +2561,7 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, ...@@ -2561,6 +2561,7 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
const char *pin, int status) const char *pin, int status)
{ {
struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);
int ret = 0;
dapm_assert_locked(dapm); dapm_assert_locked(dapm);
...@@ -2573,13 +2574,14 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, ...@@ -2573,13 +2574,14 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
dapm_mark_dirty(w, "pin configuration"); dapm_mark_dirty(w, "pin configuration");
dapm_widget_invalidate_input_paths(w); dapm_widget_invalidate_input_paths(w);
dapm_widget_invalidate_output_paths(w); dapm_widget_invalidate_output_paths(w);
ret = 1;
} }
w->connected = status; w->connected = status;
if (status == 0) if (status == 0)
w->force = 0; w->force = 0;
return 0; return ret;
} }
/** /**
...@@ -3583,14 +3585,15 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, ...@@ -3583,14 +3585,15 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
{ {
struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
const char *pin = (const char *)kcontrol->private_value; const char *pin = (const char *)kcontrol->private_value;
int ret;
if (ucontrol->value.integer.value[0]) if (ucontrol->value.integer.value[0])
snd_soc_dapm_enable_pin(&card->dapm, pin); ret = snd_soc_dapm_enable_pin(&card->dapm, pin);
else else
snd_soc_dapm_disable_pin(&card->dapm, pin); ret = snd_soc_dapm_disable_pin(&card->dapm, pin);
snd_soc_dapm_sync(&card->dapm); snd_soc_dapm_sync(&card->dapm);
return 0; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch); EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
...@@ -4023,7 +4026,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol, ...@@ -4023,7 +4026,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
rtd->params_select = ucontrol->value.enumerated.item[0]; rtd->params_select = ucontrol->value.enumerated.item[0];
return 0; return 1;
} }
static void static void
......
...@@ -1198,6 +1198,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, ...@@ -1198,6 +1198,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
cval->res = 1; cval->res = 1;
} }
break; break;
case USB_ID(0x1224, 0x2a25): /* Jieli Technology USB PHY 2.0 */
if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
usb_audio_info(chip,
"set resolution quirk: cval->res = 16\n");
cval->res = 16;
}
break;
} }
} }
......
...@@ -4012,6 +4012,38 @@ YAMAHA_DEVICE(0x7010, "UB99"), ...@@ -4012,6 +4012,38 @@ YAMAHA_DEVICE(0x7010, "UB99"),
} }
} }
}, },
{
/*
* Sennheiser GSP670
* Change order of interfaces loaded
*/
USB_DEVICE(0x1395, 0x0300),
.bInterfaceClass = USB_CLASS_PER_INTERFACE,
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = &(const struct snd_usb_audio_quirk[]) {
// Communication
{
.ifnum = 3,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
// Recording
{
.ifnum = 4,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
// Main
{
.ifnum = 1,
.type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = -1
}
}
}
},
#undef USB_DEVICE_VENDOR_SPEC #undef USB_DEVICE_VENDOR_SPEC
#undef USB_AUDIO_DEVICE #undef USB_AUDIO_DEVICE
...@@ -1719,6 +1719,11 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, ...@@ -1719,6 +1719,11 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
*/ */
fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX; fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX;
break; break;
case USB_ID(0x1224, 0x2a25): /* Jieli Technology USB PHY 2.0 */
/* mic works only when ep packet size is set to wMaxPacketSize */
fp->attributes |= UAC_EP_CS_ATTR_FILL_MAX;
break;
} }
} }
...@@ -1884,10 +1889,14 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { ...@@ -1884,10 +1889,14 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */ DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
QUIRK_FLAG_IGNORE_CTL_ERROR),
DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */ DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
QUIRK_FLAG_GET_SAMPLE_RATE),
/* Vendor matches */ /* Vendor matches */
VENDOR_FLG(0x045e, /* MS Lifecam */ VENDOR_FLG(0x045e, /* MS Lifecam */
......
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