From 591b409bee1d5e94722e334ae9008b55e938d8cb Mon Sep 17 00:00:00 2001 From: guoyf2 Date: Tue, 19 Feb 2019 13:15:42 +0800 Subject: [PATCH] Add NXP rpc_send delay time for 8937/8940 NXP smartPA new algorithm for 8937/8940 need to set rpc_send delay time to 5ms. Change-Id: I79ec1c1493f8b32f562bbc7e8a78f64e62e3ef6a Signed-off-by: guoyf2 Reviewed-on: https://gerrit.mot.com/1310382 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Seungyoon Lee Submit-Approved: Jira Key Reviewed-by: Yunfei Guo --- sound/soc/codecs/tfa98xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tfa98xx.c b/sound/soc/codecs/tfa98xx.c index a4d6b6c3722c..7c3cf40e2632 100644 --- a/sound/soc/codecs/tfa98xx.c +++ b/sound/soc/codecs/tfa98xx.c @@ -73,6 +73,8 @@ static nxpTfaContainer_t *tfa98xx_container = NULL; static int tfa98xx_kmsg_regs = 0; static int tfa98xx_ftrace_regs = 0; +static uint32_t tfa98xx_rpc_send_delay = 0; + static char *fw_name = "tfa98xx.cnt"; module_param(fw_name, charp, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(fw_name, "TFA98xx DSP firmware (container file) name."); @@ -863,7 +865,7 @@ static ssize_t tfa98xx_dbgfs_rpc_send(struct file *file, pr_err("[0x%x] dsp_msg error: %d\n", i2c->addr, err); } - mdelay(2); + mdelay(tfa98xx_rpc_send_delay); mutex_unlock(&tfa98xx->dsp_lock); @@ -3131,6 +3133,8 @@ static int tfa98xx_ext_reset(struct tfa98xx *tfa98xx) static int tfa98xx_parse_dt(struct device *dev, struct tfa98xx *tfa98xx, struct device_node *np) { + int ret = 0; + tfa98xx->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0); if (tfa98xx->reset_gpio < 0) dev_dbg(dev, "No reset GPIO provided, will not HW reset device\n"); @@ -3139,6 +3143,12 @@ static int tfa98xx_parse_dt(struct device *dev, struct tfa98xx *tfa98xx, if (tfa98xx->irq_gpio < 0) dev_dbg(dev, "No IRQ GPIO provided.\n"); + ret = of_property_read_u32(np, "rpc-send-delay", &tfa98xx_rpc_send_delay); + if (ret < 0) { + dev_dbg(dev, "No rpc-send-delay provided. Set to default\n"); + tfa98xx_rpc_send_delay = 2; + } + return 0; }