Merge remote-tracking branch 'asoc/for-5.11' into asoc-linus
This commit is contained in:
commit
3b9b1490e0
|
@ -1264,12 +1264,12 @@ static int cpcap_voice_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
if (direction == SNDRV_PCM_STREAM_CAPTURE) {
|
||||
mask = 0x0000;
|
||||
mask |= CPCAP_BIT_MIC1_RX_TIMESLOT0;
|
||||
mask |= CPCAP_BIT_MIC1_RX_TIMESLOT1;
|
||||
mask |= CPCAP_BIT_MIC1_RX_TIMESLOT2;
|
||||
mask |= CPCAP_BIT_MIC2_TIMESLOT0;
|
||||
mask |= CPCAP_BIT_MIC2_TIMESLOT1;
|
||||
mask |= CPCAP_BIT_MIC2_TIMESLOT2;
|
||||
mask |= BIT(CPCAP_BIT_MIC1_RX_TIMESLOT0);
|
||||
mask |= BIT(CPCAP_BIT_MIC1_RX_TIMESLOT1);
|
||||
mask |= BIT(CPCAP_BIT_MIC1_RX_TIMESLOT2);
|
||||
mask |= BIT(CPCAP_BIT_MIC2_TIMESLOT0);
|
||||
mask |= BIT(CPCAP_BIT_MIC2_TIMESLOT1);
|
||||
mask |= BIT(CPCAP_BIT_MIC2_TIMESLOT2);
|
||||
val = 0x0000;
|
||||
if (channels >= 2)
|
||||
val = BIT(CPCAP_BIT_MIC1_RX_TIMESLOT0);
|
||||
|
|
|
@ -190,7 +190,7 @@ static int max98373_feedback_get(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
}
|
||||
|
||||
return snd_soc_put_volsw(kcontrol, ucontrol);
|
||||
return snd_soc_get_volsw(kcontrol, ucontrol);
|
||||
}
|
||||
|
||||
static const struct snd_kcontrol_new max98373_snd_controls[] = {
|
||||
|
|
|
@ -273,6 +273,9 @@ static void rt5682_i2c_shutdown(struct i2c_client *client)
|
|||
{
|
||||
struct rt5682_priv *rt5682 = i2c_get_clientdata(client);
|
||||
|
||||
cancel_delayed_work_sync(&rt5682->jack_detect_work);
|
||||
cancel_delayed_work_sync(&rt5682->jd_check_work);
|
||||
|
||||
rt5682_reset(rt5682);
|
||||
}
|
||||
|
||||
|
|
|
@ -703,7 +703,7 @@ static int rt5682_sdw_remove(struct sdw_slave *slave)
|
|||
struct rt5682_priv *rt5682 = dev_get_drvdata(&slave->dev);
|
||||
|
||||
if (rt5682 && rt5682->hw_init)
|
||||
cancel_delayed_work(&rt5682->jack_detect_work);
|
||||
cancel_delayed_work_sync(&rt5682->jack_detect_work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -721,6 +721,8 @@ static int __maybe_unused rt5682_dev_suspend(struct device *dev)
|
|||
if (!rt5682->hw_init)
|
||||
return 0;
|
||||
|
||||
cancel_delayed_work_sync(&rt5682->jack_detect_work);
|
||||
|
||||
regcache_cache_only(rt5682->regmap, true);
|
||||
regcache_mark_dirty(rt5682->regmap);
|
||||
|
||||
|
|
|
@ -2906,6 +2906,9 @@ static int rt5682_suspend(struct snd_soc_component *component)
|
|||
{
|
||||
struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
|
||||
|
||||
if (rt5682->is_sdw)
|
||||
return 0;
|
||||
|
||||
regcache_cache_only(rt5682->regmap, true);
|
||||
regcache_mark_dirty(rt5682->regmap);
|
||||
return 0;
|
||||
|
@ -2915,6 +2918,9 @@ static int rt5682_resume(struct snd_soc_component *component)
|
|||
{
|
||||
struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component);
|
||||
|
||||
if (rt5682->is_sdw)
|
||||
return 0;
|
||||
|
||||
regcache_cache_only(rt5682->regmap, false);
|
||||
regcache_sync(rt5682->regmap);
|
||||
|
||||
|
|
|
@ -462,8 +462,8 @@ static int rt700_sdw_remove(struct sdw_slave *slave)
|
|||
struct rt700_priv *rt700 = dev_get_drvdata(&slave->dev);
|
||||
|
||||
if (rt700 && rt700->hw_init) {
|
||||
cancel_delayed_work(&rt700->jack_detect_work);
|
||||
cancel_delayed_work(&rt700->jack_btn_check_work);
|
||||
cancel_delayed_work_sync(&rt700->jack_detect_work);
|
||||
cancel_delayed_work_sync(&rt700->jack_btn_check_work);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -463,8 +463,8 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
|
|||
struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
|
||||
|
||||
if (rt711 && rt711->hw_init) {
|
||||
cancel_delayed_work(&rt711->jack_detect_work);
|
||||
cancel_delayed_work(&rt711->jack_btn_check_work);
|
||||
cancel_delayed_work_sync(&rt711->jack_detect_work);
|
||||
cancel_delayed_work_sync(&rt711->jack_btn_check_work);
|
||||
cancel_work_sync(&rt711->calibration_work);
|
||||
}
|
||||
|
||||
|
|
|
@ -640,6 +640,7 @@ static struct regmap_config wsa881x_regmap_config = {
|
|||
.val_bits = 8,
|
||||
.cache_type = REGCACHE_RBTREE,
|
||||
.reg_defaults = wsa881x_defaults,
|
||||
.max_register = WSA881X_SPKR_STATUS3,
|
||||
.num_reg_defaults = ARRAY_SIZE(wsa881x_defaults),
|
||||
.volatile_reg = wsa881x_volatile_register,
|
||||
.readable_reg = wsa881x_readable_register,
|
||||
|
|
|
@ -54,7 +54,8 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
|||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A32")
|
||||
},
|
||||
.driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
|
||||
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
||||
SOF_RT711_JD_SRC_JD2 |
|
||||
SOF_RT715_DAI_ID_FIX |
|
||||
SOF_SDW_FOUR_SPK),
|
||||
},
|
||||
|
@ -64,7 +65,8 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
|||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3E")
|
||||
},
|
||||
.driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
|
||||
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
||||
SOF_RT711_JD_SRC_JD2 |
|
||||
SOF_RT715_DAI_ID_FIX),
|
||||
},
|
||||
{
|
||||
|
@ -73,7 +75,8 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
|||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
|
||||
},
|
||||
.driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
|
||||
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
||||
SOF_RT711_JD_SRC_JD2 |
|
||||
SOF_RT715_DAI_ID_FIX |
|
||||
SOF_SDW_FOUR_SPK),
|
||||
},
|
||||
|
|
|
@ -358,14 +358,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
|
|||
.link_mask = 0x7,
|
||||
.links = tgl_sdw_rt711_link1_rt1308_link2_rt715_link0,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt715-rt711-rt1308-mono.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0xF, /* 4 active links required */
|
||||
.links = tgl_3_in_1_default,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
|
||||
},
|
||||
{
|
||||
|
@ -377,35 +375,30 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
|
|||
.link_mask = 0xF,
|
||||
.links = tgl_3_in_1_mono_amp,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0xF, /* 4 active links required */
|
||||
.links = tgl_3_in_1_sdca,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt711-rt1316-rt714.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
|
||||
.links = tgl_rvp,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */
|
||||
.links = tgl_chromebook_base,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-sdw-max98373-rt5682.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0x1, /* this will only enable rt5682 for now */
|
||||
.links = tgl_chromebook_base,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_fw_filename = "sof-tgl.ri",
|
||||
.sof_tplg_filename = "sof-tgl-rt5682.tplg",
|
||||
},
|
||||
{},
|
||||
|
|
|
@ -250,7 +250,7 @@ static struct lpass_variant apq8016_data = {
|
|||
.micmode = REG_FIELD_ID(0x1000, 4, 7, 4, 0x1000),
|
||||
.micmono = REG_FIELD_ID(0x1000, 3, 3, 4, 0x1000),
|
||||
.wssrc = REG_FIELD_ID(0x1000, 2, 2, 4, 0x1000),
|
||||
.bitwidth = REG_FIELD_ID(0x1000, 0, 0, 4, 0x1000),
|
||||
.bitwidth = REG_FIELD_ID(0x1000, 0, 1, 4, 0x1000),
|
||||
|
||||
.rdma_dyncclk = REG_FIELD_ID(0x8400, 12, 12, 2, 0x1000),
|
||||
.rdma_bursten = REG_FIELD_ID(0x8400, 11, 11, 2, 0x1000),
|
||||
|
|
|
@ -286,16 +286,12 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
|
|||
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
|
||||
ret);
|
||||
|
||||
if (drvdata->bit_clk_state[id] == LPAIF_BIT_CLK_DISABLE) {
|
||||
ret = clk_enable(drvdata->mi2s_bit_clk[id]);
|
||||
if (ret) {
|
||||
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
|
||||
clk_disable(drvdata->mi2s_osr_clk[id]);
|
||||
return ret;
|
||||
}
|
||||
drvdata->bit_clk_state[id] = LPAIF_BIT_CLK_ENABLE;
|
||||
ret = clk_enable(drvdata->mi2s_bit_clk[id]);
|
||||
if (ret) {
|
||||
dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret);
|
||||
clk_disable(drvdata->mi2s_osr_clk[id]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
|
@ -310,10 +306,9 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
|
|||
if (ret)
|
||||
dev_err(dai->dev, "error writing to i2sctl reg: %d\n",
|
||||
ret);
|
||||
if (drvdata->bit_clk_state[id] == LPAIF_BIT_CLK_ENABLE) {
|
||||
clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
|
||||
drvdata->bit_clk_state[id] = LPAIF_BIT_CLK_DISABLE;
|
||||
}
|
||||
|
||||
clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -599,7 +594,7 @@ static bool lpass_hdmi_regmap_writeable(struct device *dev, unsigned int reg)
|
|||
return true;
|
||||
}
|
||||
|
||||
for (i = 0; i < v->rdma_channels; ++i) {
|
||||
for (i = 0; i < v->hdmi_rdma_channels; ++i) {
|
||||
if (reg == LPAIF_HDMI_RDMACTL_REG(v, i))
|
||||
return true;
|
||||
if (reg == LPAIF_HDMI_RDMABASE_REG(v, i))
|
||||
|
@ -645,7 +640,7 @@ static bool lpass_hdmi_regmap_readable(struct device *dev, unsigned int reg)
|
|||
if (reg == LPASS_HDMITX_APP_IRQSTAT_REG(v))
|
||||
return true;
|
||||
|
||||
for (i = 0; i < v->rdma_channels; ++i) {
|
||||
for (i = 0; i < v->hdmi_rdma_channels; ++i) {
|
||||
if (reg == LPAIF_HDMI_RDMACTL_REG(v, i))
|
||||
return true;
|
||||
if (reg == LPAIF_HDMI_RDMABASE_REG(v, i))
|
||||
|
@ -672,7 +667,7 @@ static bool lpass_hdmi_regmap_volatile(struct device *dev, unsigned int reg)
|
|||
if (reg == LPASS_HDMI_TX_LEGACY_ADDR(v))
|
||||
return true;
|
||||
|
||||
for (i = 0; i < v->rdma_channels; ++i) {
|
||||
for (i = 0; i < v->hdmi_rdma_channels; ++i) {
|
||||
if (reg == LPAIF_HDMI_RDMACURR_REG(v, i))
|
||||
return true;
|
||||
}
|
||||
|
@ -822,7 +817,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant,
|
||||
variant->hdmi_rdma_channels);
|
||||
variant->hdmi_rdma_channels - 1);
|
||||
drvdata->hdmiif_map = devm_regmap_init_mmio(dev, drvdata->hdmiif,
|
||||
&lpass_hdmi_regmap_config);
|
||||
if (IS_ERR(drvdata->hdmiif_map)) {
|
||||
|
@ -866,7 +861,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
|
|||
PTR_ERR(drvdata->mi2s_bit_clk[dai_id]));
|
||||
return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]);
|
||||
}
|
||||
drvdata->bit_clk_state[dai_id] = LPAIF_BIT_CLK_DISABLE;
|
||||
}
|
||||
|
||||
/* Allocation for i2sctl regmap fields */
|
||||
|
|
|
@ -60,9 +60,6 @@
|
|||
#define LPAIF_I2SCTL_BITWIDTH_24 1
|
||||
#define LPAIF_I2SCTL_BITWIDTH_32 2
|
||||
|
||||
#define LPAIF_BIT_CLK_DISABLE 0
|
||||
#define LPAIF_BIT_CLK_ENABLE 1
|
||||
|
||||
#define LPAIF_I2SCTL_RESET_STATE 0x003C0004
|
||||
#define LPAIF_DMACTL_RESET_STATE 0x00200000
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ static struct lpass_variant sc7180_data = {
|
|||
.rdma_channels = 5,
|
||||
.hdmi_rdma_reg_base = 0x64000,
|
||||
.hdmi_rdma_reg_stride = 0x1000,
|
||||
.hdmi_rdma_channels = 3,
|
||||
.hdmi_rdma_channels = 4,
|
||||
.dmactl_audif_start = 1,
|
||||
.wrdma_reg_base = 0x18000,
|
||||
.wrdma_reg_stride = 0x1000,
|
||||
|
|
|
@ -68,7 +68,6 @@ struct lpass_data {
|
|||
unsigned int mi2s_playback_sd_mode[LPASS_MAX_MI2S_PORTS];
|
||||
unsigned int mi2s_capture_sd_mode[LPASS_MAX_MI2S_PORTS];
|
||||
int hdmi_port_enable;
|
||||
int bit_clk_state[LPASS_MAX_MI2S_PORTS];
|
||||
|
||||
/* low-power audio interface (LPAIF) registers */
|
||||
void __iomem *lpaif;
|
||||
|
|
|
@ -169,7 +169,7 @@ static inline u32 siu_read32(u32 __iomem *addr)
|
|||
#define SIU_BRGBSEL (0x108 / sizeof(u32))
|
||||
#define SIU_BRRB (0x10c / sizeof(u32))
|
||||
|
||||
extern struct snd_soc_component_driver siu_component;
|
||||
extern const struct snd_soc_component_driver siu_component;
|
||||
extern struct siu_info *siu_i2s_data;
|
||||
|
||||
int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card);
|
||||
|
|
|
@ -543,7 +543,7 @@ static void siu_pcm_free(struct snd_soc_component *component,
|
|||
dev_dbg(pcm->card->dev, "%s\n", __func__);
|
||||
}
|
||||
|
||||
struct const snd_soc_component_driver siu_component = {
|
||||
const struct snd_soc_component_driver siu_component = {
|
||||
.name = DRV_NAME,
|
||||
.open = siu_pcm_open,
|
||||
.close = siu_pcm_close,
|
||||
|
|
|
@ -352,7 +352,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
|
|||
char *string;
|
||||
int ret;
|
||||
|
||||
string = kzalloc(count, GFP_KERNEL);
|
||||
string = kzalloc(count+1, GFP_KERNEL);
|
||||
if (!string)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -802,11 +802,15 @@ int hda_dsp_runtime_idle(struct snd_sof_dev *sdev)
|
|||
|
||||
int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev)
|
||||
{
|
||||
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
|
||||
const struct sof_dsp_power_state target_state = {
|
||||
.state = SOF_DSP_PM_D3,
|
||||
};
|
||||
int ret;
|
||||
|
||||
/* cancel any attempt for DSP D0I3 */
|
||||
cancel_delayed_work_sync(&hda->d0i3_work);
|
||||
|
||||
/* stop hda controller and power dsp off */
|
||||
ret = hda_suspend(sdev, true);
|
||||
if (ret < 0)
|
||||
|
|
|
@ -1173,7 +1173,10 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
|
|||
mach->mach_params.links = mach->links;
|
||||
mach->mach_params.link_mask = mach->link_mask;
|
||||
mach->mach_params.platform = dev_name(sdev->dev);
|
||||
pdata->fw_filename = mach->sof_fw_filename;
|
||||
if (mach->sof_fw_filename)
|
||||
pdata->fw_filename = mach->sof_fw_filename;
|
||||
else
|
||||
pdata->fw_filename = pdata->desc->default_fw_filename;
|
||||
pdata->tplg_filename = mach->sof_tplg_filename;
|
||||
} else {
|
||||
dev_info(sdev->dev,
|
||||
|
|
|
@ -731,6 +731,8 @@ int snd_sof_load_firmware_raw(struct snd_sof_dev *sdev)
|
|||
if (ret < 0) {
|
||||
dev_err(sdev->dev, "error: request firmware %s failed err: %d\n",
|
||||
fw_filename, ret);
|
||||
dev_err(sdev->dev,
|
||||
"you may need to download the firmware from https://github.com/thesofproject/sof-bin/\n");
|
||||
goto err;
|
||||
} else {
|
||||
dev_dbg(sdev->dev, "request_firmware %s successful\n",
|
||||
|
|
|
@ -707,7 +707,12 @@ int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_pa
|
|||
}
|
||||
break;
|
||||
case SOF_DAI_INTEL_ALH:
|
||||
/* do nothing for ALH dai_link */
|
||||
/*
|
||||
* Dai could run with different channel count compared with
|
||||
* front end, so get dai channel count from topology
|
||||
*/
|
||||
channels->min = dai->dai_config->alh.channels;
|
||||
channels->max = dai->dai_config->alh.channels;
|
||||
break;
|
||||
case SOF_DAI_IMX_ESAI:
|
||||
rate->min = dai->dai_config->esai.fsync_rate;
|
||||
|
|
|
@ -65,6 +65,13 @@ static const struct dmi_system_id community_key_platforms[] = {
|
|||
DMI_MATCH(DMI_BOARD_NAME, "UP-APL01"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.ident = "Up Extreme",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "UP-WHL01"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.ident = "Google Chromebooks",
|
||||
.matches = {
|
||||
|
|
|
@ -1073,7 +1073,7 @@ static int sof_control_load_volume(struct snd_soc_component *scomp,
|
|||
scontrol->cmd = SOF_CTRL_CMD_VOLUME;
|
||||
|
||||
/* extract tlv data */
|
||||
if (get_tlv_data(kc->tlv.p, tlv) < 0) {
|
||||
if (!kc->tlv.p || get_tlv_data(kc->tlv.p, tlv) < 0) {
|
||||
dev_err(scomp->dev, "error: invalid TLV data\n");
|
||||
ret = -EINVAL;
|
||||
goto out_free;
|
||||
|
@ -3740,6 +3740,8 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
|
|||
if (ret < 0) {
|
||||
dev_err(scomp->dev, "error: tplg request firmware %s failed err: %d\n",
|
||||
file, ret);
|
||||
dev_err(scomp->dev,
|
||||
"you may need to download the firmware from https://github.com/thesofproject/sof-bin/\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue