Skip to content

Commit

Permalink
Merge branch 'for-linus'
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwai committed Feb 12, 2025
2 parents dd06ad9 + 174448b commit 87c1561
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3788,6 +3788,7 @@ static void alc225_init(struct hda_codec *codec)
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);

msleep(75);
alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
}
}
Expand Down
27 changes: 14 additions & 13 deletions sound/pci/hda/tas2781_hda_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
struct tasdevice_priv *tas_priv = context;
struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev);
struct hda_codec *codec = tas_priv->codec;
int i, j, ret;
int i, j, ret, val;

pm_runtime_get_sync(tas_priv->dev);
guard(mutex)(&tas_priv->codec_lock);
Expand Down Expand Up @@ -981,13 +981,16 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)

/* Perform AMP reset before firmware download. */
tas_priv->rcabin.profile_cfg_id = TAS2781_PRE_POST_RESET_CFG;
tasdevice_spi_tuning_switch(tas_priv, 0);
tas2781_spi_reset(tas_priv);
tas_priv->rcabin.profile_cfg_id = 0;
tasdevice_spi_tuning_switch(tas_priv, 1);

tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK;
ret = tasdevice_spi_prmg_load(tas_priv, 0);
ret = tasdevice_spi_dev_read(tas_priv, TAS2781_REG_CLK_CONFIG, &val);
if (ret < 0)
goto out;

if (val == TAS2781_REG_CLK_CONFIG_RESET)
ret = tasdevice_spi_prmg_load(tas_priv, 0);
if (ret < 0) {
dev_err(tas_priv->dev, "FW download failed = %d\n", ret);
goto out;
Expand All @@ -1001,7 +1004,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
* If calibrated data occurs error, dsp will still works with default
* calibrated data inside algo.
*/
tas_priv->save_calibration(tas_priv);

out:
if (fmw)
Expand Down Expand Up @@ -1160,7 +1162,8 @@ static int tas2781_runtime_suspend(struct device *dev)

guard(mutex)(&tas_hda->priv->codec_lock);

tasdevice_spi_tuning_switch(tas_hda->priv, 1);
if (tas_hda->priv->playback_started)
tasdevice_spi_tuning_switch(tas_hda->priv, 1);

tas_hda->priv->cur_book = -1;
tas_hda->priv->cur_conf = -1;
Expand All @@ -1174,7 +1177,8 @@ static int tas2781_runtime_resume(struct device *dev)

guard(mutex)(&tas_hda->priv->codec_lock);

tasdevice_spi_tuning_switch(tas_hda->priv, 0);
if (tas_hda->priv->playback_started)
tasdevice_spi_tuning_switch(tas_hda->priv, 0);

return 0;
}
Expand All @@ -1189,12 +1193,9 @@ static int tas2781_system_suspend(struct device *dev)
return ret;

/* Shutdown chip before system suspend */
tasdevice_spi_tuning_switch(tas_hda->priv, 1);
tas2781_spi_reset(tas_hda->priv);
/*
* Reset GPIO may be shared, so cannot reset here.
* However beyond this point, amps may be powered down.
*/
if (tas_hda->priv->playback_started)
tasdevice_spi_tuning_switch(tas_hda->priv, 1);

return 0;
}

Expand Down

0 comments on commit 87c1561

Please sign in to comment.