mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
audio: fix eARC same source hang [1/1]
PD#SWPL-233434 Problem: eARC disconnect and reconnect, eARC doesn't consume data, but same source is still on. Solution: when entry ARC/eARC/disconnected statue, set force mode, keep it consume data. when trigger is called, disable force mode. Verify: t6x Change-Id: Ia77fa6c545eaa209054149b4a7e9e71f478b92e7 Signed-off-by: jian zhou <jian.zhou@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
69b46f6454
commit
83a51bbdf9
@@ -931,10 +931,8 @@ static void earctx_update_attend_event(struct earc *p_earc,
|
||||
}
|
||||
}
|
||||
|
||||
if (p_earc->tx_dmac_clk_on &&
|
||||
p_earc->tx_arc_status != ATNDTYP_DISCNCT &&
|
||||
!p_earc->tx_reset_hpd)
|
||||
earctx_dmac_force_mode(p_earc->tx_dmac_map, false);
|
||||
if (p_earc->tx_dmac_clk_on)
|
||||
earctx_dmac_force_mode(p_earc->tx_dmac_map, is_earc, true);
|
||||
spin_unlock_irqrestore(&p_earc->tx_lock, flags);
|
||||
|
||||
if (send) {
|
||||
@@ -2371,7 +2369,7 @@ static void earctx_set_earc_mode(struct earc *p_earc, bool earc_mode, bool tinym
|
||||
/* switch to force mode for consume data when switch earc mode */
|
||||
spin_lock_irqsave(&p_earc->tx_lock, flags);
|
||||
if (p_earc->tx_dmac_clk_on)
|
||||
earctx_dmac_force_mode(p_earc->tx_dmac_map, true);
|
||||
earctx_dmac_force_mode(p_earc->tx_dmac_map, false, true);
|
||||
spin_unlock_irqrestore(&p_earc->tx_lock, flags);
|
||||
|
||||
#if (defined CONFIG_AMLOGIC_MEDIA_TVIN_HDMI ||\
|
||||
|
||||
@@ -1625,6 +1625,21 @@ static void earctx_channel_sync_start(struct regmap *dmac_map, bool statrt)
|
||||
}
|
||||
}
|
||||
|
||||
void earctx_dmac_force_mode(struct regmap *dmac_map, bool is_earc, bool enable)
|
||||
{
|
||||
pr_info("set earc tx force mode is_earc %d, enable %d\n", is_earc, enable);
|
||||
|
||||
/* 0xe for arc mode, 0x3 for earc mode */
|
||||
if (enable) {
|
||||
if (is_earc)
|
||||
mmio_write(dmac_map, EARCTX_DMAC_TOP_CTRL0, 0x3);
|
||||
else
|
||||
mmio_write(dmac_map, EARCTX_DMAC_TOP_CTRL0, 0xe);
|
||||
} else {
|
||||
mmio_write(dmac_map, EARCTX_DMAC_TOP_CTRL0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void earctx_enable(struct regmap *top_map,
|
||||
struct regmap *cmdc_map,
|
||||
struct regmap *dmac_map,
|
||||
@@ -1668,6 +1683,8 @@ void earctx_enable(struct regmap *top_map,
|
||||
val << offset);
|
||||
}
|
||||
|
||||
earctx_dmac_force_mode(dmac_map, false, false);
|
||||
|
||||
/* first biphase work clear, and then start
|
||||
* only for earc
|
||||
*/
|
||||
@@ -2208,16 +2225,6 @@ void earctx_dmac_mute_and_hold_bus(struct regmap *dmac_map, bool enable)
|
||||
|
||||
}
|
||||
|
||||
void earctx_dmac_force_mode(struct regmap *dmac_map, bool enable)
|
||||
{
|
||||
pr_info("set earc tx force mode %d\n", enable);
|
||||
/* force arc mode as earc mode will consume data faster */
|
||||
if (enable)
|
||||
mmio_write(dmac_map, EARCTX_DMAC_TOP_CTRL0, 0xe);
|
||||
else
|
||||
mmio_write(dmac_map, EARCTX_DMAC_TOP_CTRL0, 0);
|
||||
}
|
||||
|
||||
int earcrx_get_sample_rate(struct regmap *dmac_map)
|
||||
{
|
||||
unsigned int val;
|
||||
|
||||
@@ -361,7 +361,7 @@ u8 earcrx_cmdc_get_rx_stat_bits(struct regmap *cmdc_map);
|
||||
u8 earcrx_cmdc_get_tx_stat_bits(struct regmap *cmdc_map);
|
||||
void earctx_cmdc_earc_mode(struct regmap *cmdc_map, bool enable);
|
||||
void earctx_dmac_mute_and_hold_bus(struct regmap *dmac_map, bool enable);
|
||||
void earctx_dmac_force_mode(struct regmap *dmac_map, bool enable);
|
||||
void earctx_dmac_force_mode(struct regmap *dmac_map, bool is_earc, bool enable);
|
||||
int earcrx_get_sample_rate(struct regmap *dmac_map);
|
||||
void earcrx_err_correction_force_mode(struct regmap *dmac_map, bool enable);
|
||||
void earcrx_efuse_trim_set(struct regmap *rx_top_map);
|
||||
|
||||
Reference in New Issue
Block a user