audio: auge: toddr irq interrupt protection for freeze mode [1/1]

PD#TV-10448

Problem:
crash when finished early supend but not entry suspend,
the system is waked up

Solution:
add toddr irq interrupt protection when entry suspend
and exit from suspend

Verify:
x301

Change-Id: I7ade7a745511bab83c70b5649b6af318163568d9
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
This commit is contained in:
Xing Wang
2019-09-25 10:24:14 +08:00
committed by Luke Go
parent 29fefb910a
commit ab2e2f9786
4 changed files with 18 additions and 0 deletions

View File

@@ -201,6 +201,19 @@ int aml_audio_unregister_toddr(struct device *dev, void *data)
return ret;
}
void audio_toddr_irq_enable(struct toddr *to, bool en)
{
if (!to || !to->in_use || to->irq < 0)
return;
mutex_lock(&ddr_mutex);
if (en)
enable_irq(to->irq);
else
disable_irq_nosync(to->irq);
mutex_unlock(&ddr_mutex);
}
static inline unsigned int
calc_toddr_address(unsigned int reg, unsigned int base)
{

View File

@@ -244,6 +244,7 @@ struct toddr *aml_audio_register_toddr(struct device *dev,
struct aml_audio_controller *actrl,
irq_handler_t handler, void *data);
int aml_audio_unregister_toddr(struct device *dev, void *data);
void audio_toddr_irq_enable(struct toddr *to, bool en);
int aml_toddr_set_buf(struct toddr *to, unsigned int start,
unsigned int end);
int aml_toddr_set_buf_startaddr(struct toddr *to, unsigned int start);

View File

@@ -763,6 +763,7 @@ static int loopback_dai_trigger(
pm_audio_set_suspend(false);
/* VAD switch to alsa buffer */
vad_update_buffer(0);
audio_toddr_irq_enable(p_loopback->tddr, true);
break;
}
@@ -790,6 +791,7 @@ static int loopback_dai_trigger(
pm_audio_is_suspend()) {
/* switch to VAD buffer */
vad_update_buffer(1);
audio_toddr_irq_enable(p_loopback->tddr, false);
break;
}

View File

@@ -944,6 +944,7 @@ static int aml_pdm_dai_trigger(
pm_audio_set_suspend(false);
/* VAD switch to alsa buffer */
vad_update_buffer(0);
audio_toddr_irq_enable(p_pdm->tddr, true);
break;
}
@@ -966,6 +967,7 @@ static int aml_pdm_dai_trigger(
&& pm_audio_is_suspend()) {
/* switch to VAD buffer */
vad_update_buffer(1);
audio_toddr_irq_enable(p_pdm->tddr, false);
break;
}
pdm_enable(0);