mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
asoc: codec: wcd934x: enable auto recovery when port overflows
Sometimes audio is mute while capturing from dmics connected to wcd934x codec. Observed slimbus slave port overflows in non working scenario. Enable auto recovery from overflows on the slim slave port. Change-Id: Iad18b80ea13432478fb8a8e1f07bdc354a7106b3
This commit is contained in:
parent
bc4424fa22
commit
5759d8e289
2 changed files with 22 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -153,6 +153,8 @@ static const struct snd_kcontrol_new name##_mux = \
|
|||
|
||||
#define WCD934X_DIG_CORE_COLLAPSE_TIMER_MS (5 * 1000)
|
||||
|
||||
#define ENABLE_FIFO_OVERRUN_AUTO_RECOVERY_BIT 0x1
|
||||
|
||||
enum {
|
||||
POWER_COLLAPSE,
|
||||
POWER_RESUME,
|
||||
|
|
@ -1561,6 +1563,14 @@ static void tavil_codec_enable_slim_port_intr(
|
|||
val = wcd9xxx_interface_reg_read(
|
||||
tavil_p->wcd9xxx, reg);
|
||||
}
|
||||
/* Enable auto recovery from slim port overflow on port_num */
|
||||
reg = WCD934X_SLIM_PGD_PORT_TX_OR_UR_CFG_0 + port_num;
|
||||
val = wcd9xxx_interface_reg_read(tavil_p->wcd9xxx, reg);
|
||||
if(!(val & (1 << ENABLE_FIFO_OVERRUN_AUTO_RECOVERY_BIT))) {
|
||||
val = val | (1 << ENABLE_FIFO_OVERRUN_AUTO_RECOVERY_BIT);
|
||||
wcd9xxx_interface_reg_write(tavil_p->wcd9xxx, reg, val);
|
||||
val = wcd9xxx_interface_reg_read(tavil_p->wcd9xxx, reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10018,6 +10028,15 @@ static irqreturn_t tavil_slimbus_irq(int irq, void *data)
|
|||
WARN(!cleared,
|
||||
"Couldn't find slimbus %s port %d for closing\n",
|
||||
(tx ? "TX" : "RX"), port_id);
|
||||
|
||||
/* Enable auto recovery from slim port overflow on port_num */
|
||||
reg = WCD934X_SLIM_PGD_PORT_TX_OR_UR_CFG_0 + port_id;
|
||||
val = wcd9xxx_interface_reg_read(tavil->wcd9xxx, reg);
|
||||
if((val & (1 << ENABLE_FIFO_OVERRUN_AUTO_RECOVERY_BIT))) {
|
||||
val = val ^ (1 << ENABLE_FIFO_OVERRUN_AUTO_RECOVERY_BIT);
|
||||
wcd9xxx_interface_reg_write(tavil->wcd9xxx, reg, val);
|
||||
val = wcd9xxx_interface_reg_read(tavil->wcd9xxx, reg);
|
||||
}
|
||||
}
|
||||
wcd9xxx_interface_reg_write(tavil->wcd9xxx,
|
||||
WCD934X_SLIM_PGD_PORT_INT_CLR_RX_0 +
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _WCD934X_REGISTERS_H
|
||||
|
|
@ -1836,5 +1837,6 @@ enum {
|
|||
#define WCD934X_SLIM_PGD_PORT_INT_CLR_TX_1 (0x3B)
|
||||
#define WCD934X_SLIM_PGD_PORT_INT_RX_SOURCE0 (0x60)
|
||||
#define WCD934X_SLIM_PGD_PORT_INT_TX_SOURCE0 (0x70)
|
||||
#define WCD934X_SLIM_PGD_PORT_TX_OR_UR_CFG_0 (0x1F0)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue