Commit 041c9f71 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-fix-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes for 6.10-rc1. Most of changes are various
  device-specific fixes and quirks, while there are a few small changes
  in ALSA core timer and module / built-in fixes"

* tag 'sound-fix-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: fix mute/micmute LEDs don't work for ProBook 440/460 G11.
  ALSA: core: Enable proc module when CONFIG_MODULES=y
  ALSA: core: Fix NULL module pointer assignment at card init
  ALSA: hda/realtek: Enable headset mic of JP-IK LEAP W502 with ALC897
  ASoC: dt-bindings: stm32: Ensure compatible pattern matches whole string
  ASoC: tas2781: Fix wrong loading calibrated data sequence
  ASoC: tas2552: Add TX path for capturing AUDIO-OUT data
  ALSA: usb-audio: Fix for sampling rates support for Mbox3
  Documentation: sound: Fix trailing whitespaces
  ALSA: timer: Set lower bound of start tick time
  ASoC: codecs: ES8326: solve hp and button detect issue
  ASoC: rt5645: mic-in detection threshold modification
  ASoC: Intel: sof_sdw_rt_sdca_jack_common: Use name_prefix for `-sdca` detection
parents e292ead0 d001e978
...@@ -72,7 +72,7 @@ patternProperties: ...@@ -72,7 +72,7 @@ patternProperties:
properties: properties:
compatible: compatible:
description: Compatible for SAI sub-block A or B. description: Compatible for SAI sub-block A or B.
pattern: "st,stm32-sai-sub-[ab]" pattern: "^st,stm32-sai-sub-[ab]$"
"#sound-dai-cells": "#sound-dai-cells":
const: 0 const: 0
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier // ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
// //
// Copyright (C) 2022 - 2023 Texas Instruments Incorporated // Copyright (C) 2022 - 2024 Texas Instruments Incorporated
// https://www.ti.com // https://www.ti.com
// //
// The TAS2781 driver implements a flexible and configurable // The TAS2781 driver implements a flexible and configurable
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
// Author: Kevin Lu <kevin-lu@ti.com> // Author: Kevin Lu <kevin-lu@ti.com>
// //
#ifndef __TASDEVICE_DSP_H__ #ifndef __TAS2781_DSP_H__
#define __TASDEVICE_DSP_H__ #define __TAS2781_DSP_H__
#define MAIN_ALL_DEVICES 0x0d #define MAIN_ALL_DEVICES 0x0d
#define MAIN_DEVICE_A 0x01 #define MAIN_DEVICE_A 0x01
...@@ -180,7 +180,6 @@ void tasdevice_calbin_remove(void *context); ...@@ -180,7 +180,6 @@ void tasdevice_calbin_remove(void *context);
int tasdevice_select_tuningprm_cfg(void *context, int prm, int tasdevice_select_tuningprm_cfg(void *context, int prm,
int cfg_no, int rca_conf_no); int cfg_no, int rca_conf_no);
int tasdevice_prmg_load(void *context, int prm_no); int tasdevice_prmg_load(void *context, int prm_no);
int tasdevice_prmg_calibdata_load(void *context, int prm_no);
void tasdevice_tuning_switch(void *context, int state); void tasdevice_tuning_switch(void *context, int state);
int tas2781_load_calibration(void *context, char *file_name, int tas2781_load_calibration(void *context, char *file_name,
unsigned short i); unsigned short i);
......
...@@ -50,7 +50,7 @@ MODULE_PARM_DESC(slots, "Module names assigned to the slots."); ...@@ -50,7 +50,7 @@ MODULE_PARM_DESC(slots, "Module names assigned to the slots.");
static int module_slot_match(struct module *module, int idx) static int module_slot_match(struct module *module, int idx)
{ {
int match = 1; int match = 1;
#ifdef MODULE #ifdef CONFIG_MODULES
const char *s1, *s2; const char *s1, *s2;
if (!module || !*module->name || !slots[idx]) if (!module || !*module->name || !slots[idx])
...@@ -77,7 +77,7 @@ static int module_slot_match(struct module *module, int idx) ...@@ -77,7 +77,7 @@ static int module_slot_match(struct module *module, int idx)
if (!c1) if (!c1)
break; break;
} }
#endif /* MODULE */ #endif /* CONFIG_MODULES */
return match; return match;
} }
...@@ -311,10 +311,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent, ...@@ -311,10 +311,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
} }
card->dev = parent; card->dev = parent;
card->number = idx; card->number = idx;
#ifdef MODULE WARN_ON(IS_MODULE(CONFIG_SND) && !module);
WARN_ON(!module);
card->module = module; card->module = module;
#endif
INIT_LIST_HEAD(&card->devices); INIT_LIST_HEAD(&card->devices);
init_rwsem(&card->controls_rwsem); init_rwsem(&card->controls_rwsem);
rwlock_init(&card->ctl_files_rwlock); rwlock_init(&card->ctl_files_rwlock);
...@@ -969,7 +967,7 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer) ...@@ -969,7 +967,7 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer)
#endif #endif
#ifdef MODULE #ifdef CONFIG_MODULES
static void snd_card_module_info_read(struct snd_info_entry *entry, static void snd_card_module_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) struct snd_info_buffer *buffer)
{ {
...@@ -997,7 +995,7 @@ int __init snd_card_info_init(void) ...@@ -997,7 +995,7 @@ int __init snd_card_info_init(void)
if (snd_info_register(entry) < 0) if (snd_info_register(entry) < 0)
return -ENOMEM; /* freed in error path */ return -ENOMEM; /* freed in error path */
#ifdef MODULE #ifdef CONFIG_MODULES
entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL); entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
if (!entry) if (!entry)
return -ENOMEM; return -ENOMEM;
......
...@@ -544,6 +544,14 @@ static int snd_timer_start1(struct snd_timer_instance *timeri, ...@@ -544,6 +544,14 @@ static int snd_timer_start1(struct snd_timer_instance *timeri,
SNDRV_TIMER_IFLG_START)) SNDRV_TIMER_IFLG_START))
return -EBUSY; return -EBUSY;
/* check the actual time for the start tick;
* bail out as error if it's way too low (< 100us)
*/
if (start) {
if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000)
return -EINVAL;
}
if (start) if (start)
timeri->ticks = timeri->cticks = ticks; timeri->ticks = timeri->cticks = ticks;
else if (!timeri->cticks) else if (!timeri->cticks)
......
...@@ -10194,8 +10194,11 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -10194,8 +10194,11 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
...@@ -12028,6 +12031,7 @@ enum { ...@@ -12028,6 +12031,7 @@ enum {
ALC897_FIXUP_LENOVO_HEADSET_MODE, ALC897_FIXUP_LENOVO_HEADSET_MODE,
ALC897_FIXUP_HEADSET_MIC_PIN2, ALC897_FIXUP_HEADSET_MIC_PIN2,
ALC897_FIXUP_UNIS_H3C_X500S, ALC897_FIXUP_UNIS_H3C_X500S,
ALC897_FIXUP_HEADSET_MIC_PIN3,
}; };
static const struct hda_fixup alc662_fixups[] = { static const struct hda_fixup alc662_fixups[] = {
...@@ -12474,10 +12478,18 @@ static const struct hda_fixup alc662_fixups[] = { ...@@ -12474,10 +12478,18 @@ static const struct hda_fixup alc662_fixups[] = {
{} {}
}, },
}, },
[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
{ 0x19, 0x03a11050 }, /* use as headset mic */
{ }
},
},
}; };
static const struct snd_pci_quirk alc662_fixup_tbl[] = { static const struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
......
...@@ -829,8 +829,8 @@ static void es8326_jack_detect_handler(struct work_struct *work) ...@@ -829,8 +829,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
/* mute adc when mic path switch */ /* mute adc when mic path switch */
regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x44); regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x44);
regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66); regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66);
es8326->hp = 0;
} }
es8326->hp = 0;
regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01); regmap_update_bits(es8326->regmap, ES8326_HPDET_TYPE, 0x03, 0x01);
regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x0a); regmap_write(es8326->regmap, ES8326_SYS_BIAS, 0x0a);
regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x03); regmap_update_bits(es8326->regmap, ES8326_HP_DRIVER_REF, 0x0f, 0x03);
...@@ -981,7 +981,7 @@ static int es8326_resume(struct snd_soc_component *component) ...@@ -981,7 +981,7 @@ static int es8326_resume(struct snd_soc_component *component)
regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0); regmap_write(es8326->regmap, ES8326_ANA_LP, 0xf0);
usleep_range(10000, 15000); usleep_range(10000, 15000);
regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9); regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0xd9);
regmap_write(es8326->regmap, ES8326_ANA_MICBIAS, 0xcb); regmap_write(es8326->regmap, ES8326_ANA_MICBIAS, 0xd8);
/* set headphone default type and detect pin */ /* set headphone default type and detect pin */
regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x83); regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x83);
regmap_write(es8326->regmap, ES8326_CLK_RESAMPLE, 0x05); regmap_write(es8326->regmap, ES8326_CLK_RESAMPLE, 0x05);
...@@ -1018,7 +1018,7 @@ static int es8326_resume(struct snd_soc_component *component) ...@@ -1018,7 +1018,7 @@ static int es8326_resume(struct snd_soc_component *component)
regmap_write(es8326->regmap, ES8326_ANA_VSEL, 0x7F); regmap_write(es8326->regmap, ES8326_ANA_VSEL, 0x7F);
/* select vdda as micbias source */ /* select vdda as micbias source */
regmap_write(es8326->regmap, ES8326_VMIDLOW, 0x23); regmap_write(es8326->regmap, ES8326_VMIDLOW, 0x03);
/* set dac dsmclip = 1 */ /* set dac dsmclip = 1 */
regmap_write(es8326->regmap, ES8326_DAC_DSM, 0x08); regmap_write(es8326->regmap, ES8326_DAC_DSM, 0x08);
regmap_write(es8326->regmap, ES8326_DAC_VPPSCALE, 0x15); regmap_write(es8326->regmap, ES8326_DAC_VPPSCALE, 0x15);
......
...@@ -81,6 +81,7 @@ static const struct reg_sequence init_list[] = { ...@@ -81,6 +81,7 @@ static const struct reg_sequence init_list[] = {
static const struct reg_sequence rt5650_init_list[] = { static const struct reg_sequence rt5650_init_list[] = {
{0xf6, 0x0100}, {0xf6, 0x0100},
{RT5645_PWR_ANLG1, 0x02}, {RT5645_PWR_ANLG1, 0x02},
{RT5645_IL_CMD3, 0x0018},
}; };
static const struct reg_default rt5645_reg[] = { static const struct reg_default rt5645_reg[] = {
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
/* /*
* tas2552.c - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier * tas2552.c - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier
* *
* Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com * Copyright (C) 2014 - 2024 Texas Instruments Incorporated -
* https://www.ti.com
* *
* Author: Dan Murphy <dmurphy@ti.com> * Author: Dan Murphy <dmurphy@ti.com>
*/ */
...@@ -119,12 +120,14 @@ static const struct snd_soc_dapm_widget tas2552_dapm_widgets[] = ...@@ -119,12 +120,14 @@ static const struct snd_soc_dapm_widget tas2552_dapm_widgets[] =
&tas2552_input_mux_control), &tas2552_input_mux_control),
SND_SOC_DAPM_AIF_IN("DAC IN", "DAC Playback", 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_IN("DAC IN", "DAC Playback", 0, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_AIF_OUT("ASI OUT", "DAC Capture", 0, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC", NULL, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_DAC("DAC", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_OUT_DRV("ClassD", TAS2552_CFG_2, 7, 0, NULL, 0), SND_SOC_DAPM_OUT_DRV("ClassD", TAS2552_CFG_2, 7, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("PLL", TAS2552_CFG_2, 3, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("PLL", TAS2552_CFG_2, 3, 0, NULL, 0),
SND_SOC_DAPM_POST("Post Event", tas2552_post_event), SND_SOC_DAPM_POST("Post Event", tas2552_post_event),
SND_SOC_DAPM_OUTPUT("OUT") SND_SOC_DAPM_OUTPUT("OUT"),
SND_SOC_DAPM_INPUT("DMIC")
}; };
static const struct snd_soc_dapm_route tas2552_audio_map[] = { static const struct snd_soc_dapm_route tas2552_audio_map[] = {
...@@ -134,6 +137,7 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = { ...@@ -134,6 +137,7 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = {
{"ClassD", NULL, "Input selection"}, {"ClassD", NULL, "Input selection"},
{"OUT", NULL, "ClassD"}, {"OUT", NULL, "ClassD"},
{"ClassD", NULL, "PLL"}, {"ClassD", NULL, "PLL"},
{"ASI OUT", NULL, "DMIC"}
}; };
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -538,6 +542,13 @@ static struct snd_soc_dai_driver tas2552_dai[] = { ...@@ -538,6 +542,13 @@ static struct snd_soc_dai_driver tas2552_dai[] = {
.rates = SNDRV_PCM_RATE_8000_192000, .rates = SNDRV_PCM_RATE_8000_192000,
.formats = TAS2552_FORMATS, .formats = TAS2552_FORMATS,
}, },
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = TAS2552_FORMATS,
},
.ops = &tas2552_speaker_dai_ops, .ops = &tas2552_speaker_dai_ops,
}, },
}; };
......
...@@ -2151,6 +2151,24 @@ static int tasdevice_load_data(struct tasdevice_priv *tas_priv, ...@@ -2151,6 +2151,24 @@ static int tasdevice_load_data(struct tasdevice_priv *tas_priv,
return ret; return ret;
} }
static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i)
{
struct tasdevice_calibration *cal;
struct tasdevice_fw *cal_fmw;
cal_fmw = priv->tasdevice[i].cali_data_fmw;
/* No calibrated data for current devices, playback will go ahead. */
if (!cal_fmw)
return;
cal = cal_fmw->calibrations;
if (cal)
return;
load_calib_data(priv, &cal->dev_data);
}
int tasdevice_select_tuningprm_cfg(void *context, int prm_no, int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
int cfg_no, int rca_conf_no) int cfg_no, int rca_conf_no)
{ {
...@@ -2210,23 +2228,11 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no, ...@@ -2210,23 +2228,11 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
for (i = 0; i < tas_priv->ndev; i++) { for (i = 0; i < tas_priv->ndev; i++) {
if (tas_priv->tasdevice[i].is_loaderr == true) if (tas_priv->tasdevice[i].is_loaderr == true)
continue; continue;
else if (tas_priv->tasdevice[i].is_loaderr == false if (tas_priv->tasdevice[i].is_loaderr == false &&
&& tas_priv->tasdevice[i].is_loading == true) { tas_priv->tasdevice[i].is_loading == true)
struct tasdevice_fw *cal_fmw =
tas_priv->tasdevice[i].cali_data_fmw;
if (cal_fmw) {
struct tasdevice_calibration
*cal = cal_fmw->calibrations;
if (cal)
load_calib_data(tas_priv,
&(cal->dev_data));
}
tas_priv->tasdevice[i].cur_prog = prm_no; tas_priv->tasdevice[i].cur_prog = prm_no;
} }
} }
}
for (i = 0, status = 0; i < tas_priv->ndev; i++) { for (i = 0, status = 0; i < tas_priv->ndev; i++) {
if (cfg_no >= 0 if (cfg_no >= 0
...@@ -2245,12 +2251,16 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no, ...@@ -2245,12 +2251,16 @@ int tasdevice_select_tuningprm_cfg(void *context, int prm_no,
tasdevice_load_data(tas_priv, &(conf->dev_data)); tasdevice_load_data(tas_priv, &(conf->dev_data));
for (i = 0; i < tas_priv->ndev; i++) { for (i = 0; i < tas_priv->ndev; i++) {
if (tas_priv->tasdevice[i].is_loaderr == true) { if (tas_priv->tasdevice[i].is_loaderr == true) {
status |= 1 << (i + 4); status |= BIT(i + 4);
continue; continue;
} else if (tas_priv->tasdevice[i].is_loaderr == false }
&& tas_priv->tasdevice[i].is_loading == true)
if (tas_priv->tasdevice[i].is_loaderr == false &&
tas_priv->tasdevice[i].is_loading == true) {
tasdev_load_calibrated_data(tas_priv, i);
tas_priv->tasdevice[i].cur_conf = cfg_no; tas_priv->tasdevice[i].cur_conf = cfg_no;
} }
}
} else } else
dev_dbg(tas_priv->dev, "%s: Unneeded loading dsp conf %d\n", dev_dbg(tas_priv->dev, "%s: Unneeded loading dsp conf %d\n",
__func__, cfg_no); __func__, cfg_no);
...@@ -2308,65 +2318,6 @@ int tasdevice_prmg_load(void *context, int prm_no) ...@@ -2308,65 +2318,6 @@ int tasdevice_prmg_load(void *context, int prm_no)
} }
EXPORT_SYMBOL_NS_GPL(tasdevice_prmg_load, SND_SOC_TAS2781_FMWLIB); EXPORT_SYMBOL_NS_GPL(tasdevice_prmg_load, SND_SOC_TAS2781_FMWLIB);
int tasdevice_prmg_calibdata_load(void *context, int prm_no)
{
struct tasdevice_priv *tas_priv = (struct tasdevice_priv *) context;
struct tasdevice_fw *tas_fmw = tas_priv->fmw;
struct tasdevice_prog *program;
int prog_status = 0;
int i;
if (!tas_fmw) {
dev_err(tas_priv->dev, "%s: Firmware is NULL\n", __func__);
goto out;
}
if (prm_no >= tas_fmw->nr_programs) {
dev_err(tas_priv->dev,
"%s: prm(%d) is not in range of Programs %u\n",
__func__, prm_no, tas_fmw->nr_programs);
goto out;
}
for (i = 0, prog_status = 0; i < tas_priv->ndev; i++) {
if (prm_no >= 0 && tas_priv->tasdevice[i].cur_prog != prm_no) {
tas_priv->tasdevice[i].cur_conf = -1;
tas_priv->tasdevice[i].is_loading = true;
prog_status++;
}
tas_priv->tasdevice[i].is_loaderr = false;
}
if (prog_status) {
program = &(tas_fmw->programs[prm_no]);
tasdevice_load_data(tas_priv, &(program->dev_data));
for (i = 0; i < tas_priv->ndev; i++) {
if (tas_priv->tasdevice[i].is_loaderr == true)
continue;
else if (tas_priv->tasdevice[i].is_loaderr == false
&& tas_priv->tasdevice[i].is_loading == true) {
struct tasdevice_fw *cal_fmw =
tas_priv->tasdevice[i].cali_data_fmw;
if (cal_fmw) {
struct tasdevice_calibration *cal =
cal_fmw->calibrations;
if (cal)
load_calib_data(tas_priv,
&(cal->dev_data));
}
tas_priv->tasdevice[i].cur_prog = prm_no;
}
}
}
out:
return prog_status;
}
EXPORT_SYMBOL_NS_GPL(tasdevice_prmg_calibdata_load,
SND_SOC_TAS2781_FMWLIB);
void tasdevice_tuning_switch(void *context, int state) void tasdevice_tuning_switch(void *context, int state)
{ {
struct tasdevice_priv *tas_priv = (struct tasdevice_priv *) context; struct tasdevice_priv *tas_priv = (struct tasdevice_priv *) context;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier // ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier
// //
// Copyright (C) 2022 - 2023 Texas Instruments Incorporated // Copyright (C) 2022 - 2024 Texas Instruments Incorporated
// https://www.ti.com // https://www.ti.com
// //
// The TAS2563/TAS2781 driver implements a flexible and configurable // The TAS2563/TAS2781 driver implements a flexible and configurable
...@@ -414,7 +414,7 @@ static void tasdevice_fw_ready(const struct firmware *fmw, ...@@ -414,7 +414,7 @@ static void tasdevice_fw_ready(const struct firmware *fmw,
__func__, tas_priv->cal_binaryname[i]); __func__, tas_priv->cal_binaryname[i]);
} }
tasdevice_prmg_calibdata_load(tas_priv, 0); tasdevice_prmg_load(tas_priv, 0);
tas_priv->cur_prog = 0; tas_priv->cur_prog = 0;
out: out:
if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) { if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) {
......
...@@ -109,7 +109,7 @@ int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *d ...@@ -109,7 +109,7 @@ int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *d
return -ENOMEM; return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(need_sdca_suffix); i++) { for (i = 0; i < ARRAY_SIZE(need_sdca_suffix); i++) {
if (strstr(codec_dai->name, need_sdca_suffix[i])) { if (strstr(component->name_prefix, need_sdca_suffix[i])) {
/* Add -sdca suffix for existing UCMs */ /* Add -sdca suffix for existing UCMs */
card->components = devm_kasprintf(card->dev, GFP_KERNEL, card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s-sdca", card->components); "%s-sdca", card->components);
......
...@@ -1740,7 +1740,7 @@ static void mbox3_set_format_quirk(struct snd_usb_substream *subs, ...@@ -1740,7 +1740,7 @@ static void mbox3_set_format_quirk(struct snd_usb_substream *subs,
u32 current_rate; u32 current_rate;
// Get current rate from card and check if changing it is needed // Get current rate from card and check if changing it is needed
snd_usb_ctl_msg(subs->dev, usb_sndctrlpipe(subs->dev, 0), snd_usb_ctl_msg(subs->dev, usb_rcvctrlpipe(subs->dev, 0),
0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4); 0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4);
current_rate = le32_to_cpu(buff4); current_rate = le32_to_cpu(buff4);
dev_dbg(&subs->dev->dev, dev_dbg(&subs->dev->dev,
...@@ -1765,7 +1765,7 @@ static void mbox3_set_format_quirk(struct snd_usb_substream *subs, ...@@ -1765,7 +1765,7 @@ static void mbox3_set_format_quirk(struct snd_usb_substream *subs,
// Check whether the change was successful // Check whether the change was successful
buff4 = 0; buff4 = 0;
snd_usb_ctl_msg(subs->dev, usb_sndctrlpipe(subs->dev, 0), snd_usb_ctl_msg(subs->dev, usb_rcvctrlpipe(subs->dev, 0),
0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4); 0x01, 0x21 | USB_DIR_IN, 0x0100, 0x8101, &buff4, 4);
if (new_rate != le32_to_cpu(buff4)) if (new_rate != le32_to_cpu(buff4))
dev_warn(&subs->dev->dev, "MBOX3: Couldn't set the sample rate"); dev_warn(&subs->dev->dev, "MBOX3: Couldn't set the sample rate");
......
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