sound: soc: vts: add VTS wakelock from N770F

This commit is contained in:
Anan Jaser 2022-06-06 01:26:39 +04:00 committed by Mustafa Gökmen
parent bcdb33a6ad
commit 8d58ae9417
No known key found for this signature in database
GPG key ID: 3204D8100CFF21ED
2 changed files with 9 additions and 3 deletions

View file

@ -42,7 +42,7 @@ extern int vts_clear_sram(struct platform_device *pdev);
* @return true if VTS is on, false on otherwise * @return true if VTS is on, false on otherwise
*/ */
extern volatile bool vts_is_on(void); extern volatile bool vts_is_on(void);
extern volatile bool vts_is_recognitionrunning(void); extern bool vts_is_recognitionrunning(void);
#else /* !CONFIG_SND_SOC_SAMSUNG_VTS */ #else /* !CONFIG_SND_SOC_SAMSUNG_VTS */
static inline int vts_acquire_sram(struct platform_device *pdev, int vts) static inline int vts_acquire_sram(struct platform_device *pdev, int vts)
{ return -ENODEV; } { return -ENODEV; }

View file

@ -615,7 +615,7 @@ volatile bool vts_is_on(void)
} }
EXPORT_SYMBOL(vts_is_on); EXPORT_SYMBOL(vts_is_on);
volatile bool vts_is_recognitionrunning(void) bool vts_is_recognitionrunning(void)
{ {
return p_vts_data && p_vts_data->running; return p_vts_data && p_vts_data->running;
} }
@ -1811,6 +1811,10 @@ static int vts_runtime_suspend(struct device *dev)
spin_unlock_irqrestore(&data->state_spinlock, flag); spin_unlock_irqrestore(&data->state_spinlock, flag);
} }
if(wake_lock_active(&data->wake_lock)) {
dev_info(dev, "vts wake locked. forced unlock\n");
wake_unlock(&data->wake_lock);
}
data->enabled = false; data->enabled = false;
data->exec_mode = VTS_OFF_MODE; data->exec_mode = VTS_OFF_MODE;
data->active_trigger = TRIGGER_SVOICE; data->active_trigger = TRIGGER_SVOICE;
@ -2508,6 +2512,8 @@ static int samsung_vts_probe(struct platform_device *pdev)
device_init_wakeup(dev, true); device_init_wakeup(dev, true);
of_platform_populate(np, NULL, NULL, dev);
/* Allocate Memory for error logging */ /* Allocate Memory for error logging */
for (i = 0; i < VTS_DUMP_LAST; i++) { for (i = 0; i < VTS_DUMP_LAST; i++) {
if (i == RUNTIME_SUSPEND_DUMP) { if (i == RUNTIME_SUSPEND_DUMP) {
@ -2556,7 +2562,7 @@ static int samsung_vts_remove(struct platform_device *pdev)
for (i = 0; i < RUNTIME_SUSPEND_DUMP; i++) { for (i = 0; i < RUNTIME_SUSPEND_DUMP; i++) {
/* Free memory for VTS firmware */ /* Free memory for VTS firmware */
kfree(data->p_dump[i].sram_fw); kfree(data->p_dump[i].sram_fw);
} }
snd_soc_unregister_component(dev); snd_soc_unregister_component(dev);
#ifdef EMULATOR #ifdef EMULATOR