Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions sound/soc/codecs/tas2764.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,22 @@ static bool tas2764_lost_state(struct tas2764_priv *tas2764)
* reset defaults (gain, brownout, interrupt masks, no quirk page), while the
* cache holds the restored values. ASoC ignores the resume's error, so a
* later unmute would set it active as it is. Fail the group closed, as for a
* latched fault: its supply goes off and every stream is refused.
* latched fault: its supply goes off and every stream is refused. For an amp
* driven directly by an SDZ GPIO (no shared group), drive SDZ low and keep
* regcache cache-only so the amp stays in hardware shutdown.
*/
static void tas2764_restore_failed(struct tas2764_priv *tas2764)
{
if (!tas2764_group_failed(tas2764))
tas2764_group_shutdown(tas2764, 0);
if (tas2764->sdz_group) {
if (!tas2764_group_failed(tas2764))
tas2764_group_shutdown(tas2764, 0);
return;
}
if (tas2764->sdz_gpio) {
gpiod_set_value_cansleep(tas2764->sdz_gpio, 0);
regcache_cache_only(tas2764->regmap, true);
regcache_mark_dirty(tas2764->regmap);
}
}

static int tas2764_codec_resume(struct snd_soc_component *component)
Expand All @@ -475,7 +485,7 @@ static int tas2764_codec_resume(struct snd_soc_component *component)
* (its resume_noirq, before this). s2idle keeps the line and the
* amps' registers and stays on the path below.
*/
bool power_on = tas2764->sdz_group && pm_resume_via_firmware();
bool power_on = (tas2764->sdz_group || tas2764->sdz_gpio) && pm_resume_via_firmware();
int ret;

if (!tas2764->sdz_group) {
Expand Down