From d494585914017ba1d57890121a5372a466cac8b7 Mon Sep 17 00:00:00 2001 From: Nanxin Qin Date: Wed, 28 Mar 2018 15:30:54 +0800 Subject: [PATCH] media: fixes an issue that playback audio cause crash. PD#161244: modify the short address of aiu fifo regs to match g12a. Change-Id: Idfe935c1710d5a0f091a7796138a56f78fdfe7b4 Signed-off-by: Nanxin Qin --- .../media/common/arch/registers/register_ops.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media/common/arch/registers/register_ops.c b/drivers/amlogic/media/common/arch/registers/register_ops.c index 3711d44..d22c80d 100644 --- a/drivers/amlogic/media/common/arch/registers/register_ops.c +++ b/drivers/amlogic/media/common/arch/registers/register_ops.c @@ -27,8 +27,9 @@ #include #include #include - #include +#include +#include static struct chip_register_ops *amports_ops[BUS_MAX]; @@ -58,6 +59,14 @@ int codec_reg_read(u32 bus_type, unsigned int reg) ops->r_cnt++; CODEC_OPS_START(bus_type, reg, ops->r_cnt); + + /* the AIU fifo short address has been changed on g12a */ + if (get_cpu_type() >= MESON_CPU_MAJOR_ID_G12A) + if (bus_type == IO_AIU_BUS && + reg >= AIU_AIFIFO_CTRL && + reg <= AIU_MEM_AIFIFO_MEM_CTL) + reg -= 0x80; + if (ops && ops->read) return ops->read(ops->ext_offset + reg); CODEC_OPS_ERROR(bus_type, reg, ops->r_cnt); @@ -71,6 +80,14 @@ void codec_reg_write(u32 bus_type, unsigned int reg, unsigned int val) ops->w_cnt++; CODEC_OPS_START(bus_type, reg, ops->w_cnt); + + /* the AIU fifo short address has been changed on g12a */ + if (get_cpu_type() >= MESON_CPU_MAJOR_ID_G12A) + if (bus_type == IO_AIU_BUS && + reg >= AIU_AIFIFO_CTRL && + reg <= AIU_MEM_AIFIFO_MEM_CTL) + reg -= 0x80; + if (ops && ops->write) return ops->write(ops->ext_offset + reg, val); CODEC_OPS_ERROR(bus_type, reg, ops->w_cnt); -- 2.7.4