From patchwork Fri Mar 29 07:16:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shunli Wang X-Patchwork-Id: 10876511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6AD7C14DE for ; Fri, 29 Mar 2019 07:17:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B4B928E7C for ; Fri, 29 Mar 2019 07:17:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C2B228EC3; Fri, 29 Mar 2019 07:17:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 26EF628E7C for ; Fri, 29 Mar 2019 07:17:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9346385D; Fri, 29 Mar 2019 08:16:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9346385D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553843869; bh=KWibzhwACukt03gwoX0d4gh00cK2OsN8GTfrvQ4l+Ik=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bbpI9RX1l73Qt9qw7/q19GXWL+SaerCVsj6aPauLC10a5rU98SrhAEl6MMcaz03yB BFa7RIMW95jsTw56FZgEt15lRo3Rl2K6EOAX+HnedYJfIiLsf01XAzgXayqKuWEpzP pQ3d1oXIUlxhoJ48k4IY+RuQo+Vd/RgHP51UiSjs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 01A2FF8961A; Fri, 29 Mar 2019 08:16:59 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97CFBF89636; Fri, 29 Mar 2019 08:16:57 +0100 (CET) Received: from mailgw01.mediatek.com (unknown [210.61.82.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 31D86F8071D for ; Fri, 29 Mar 2019 08:16:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31D86F8071D X-UUID: e9265f1c667c4f649b2d9e8f7a3ef7dd-20190329 X-UUID: e9265f1c667c4f649b2d9e8f7a3ef7dd-20190329 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1743563175; Fri, 29 Mar 2019 15:16:42 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 29 Mar 2019 15:16:41 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 29 Mar 2019 15:16:41 +0800 From: Shunli Wang To: Date: Fri, 29 Mar 2019 15:16:37 +0800 Message-ID: <1553843797-15481-2-git-send-email-shunli.wang@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1553843797-15481-1-git-send-email-shunli.wang@mediatek.com> References: <1553843797-15481-1-git-send-email-shunli.wang@mediatek.com> MIME-Version: 1.0 X-MTK: N Cc: alsa-devel@alsa-project.org, srv_heupstream@mediatek.com, garlic.tseng@mediatek.com, jiaxin.yu@mediatek.com, tzungbi@google.com, linux-mediatek@lists.infradead.org, shunli.wang@mediatek.com, kaichieh.chuang@mediatek.com Subject: [alsa-devel] [PATCH] ASoC: Mediatek: MT8183: add I2S2 control path from UL2 and UL3 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch add the control path from UL2 or UL3 to I2S2. The patch is based on broonie tree "for-next" branch. Signed-off-by: Shunli Wang --- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 40 +++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c index 43be51b..a751645 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -291,11 +291,15 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) static const struct snd_kcontrol_new memif_ul1_ch1_mix[] = { SOC_DAPM_SINGLE_AUTODISABLE("ADDA_UL_CH1", AFE_CONN21, I_ADDA_UL_CH1, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S0_CH1", AFE_CONN21, + I_I2S0_CH1, 1, 0), }; static const struct snd_kcontrol_new memif_ul1_ch2_mix[] = { SOC_DAPM_SINGLE_AUTODISABLE("ADDA_UL_CH2", AFE_CONN22, I_ADDA_UL_CH2, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S0_CH2", AFE_CONN21, + I_I2S0_CH2, 1, 0), }; static const struct snd_kcontrol_new memif_ul2_ch1_mix[] = { @@ -307,6 +311,8 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) I_DL2_CH1, 1, 0), SOC_DAPM_SINGLE_AUTODISABLE("DL3_CH1", AFE_CONN5, I_DL3_CH1, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S2_CH1", AFE_CONN5, + I_I2S2_CH1, 1, 0), }; static const struct snd_kcontrol_new memif_ul2_ch2_mix[] = { @@ -318,16 +324,22 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) I_DL2_CH2, 1, 0), SOC_DAPM_SINGLE_AUTODISABLE("DL3_CH2", AFE_CONN6, I_DL3_CH2, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S2_CH2", AFE_CONN6, + I_I2S2_CH2, 1, 0), }; static const struct snd_kcontrol_new memif_ul3_ch1_mix[] = { SOC_DAPM_SINGLE_AUTODISABLE("ADDA_UL_CH1", AFE_CONN32, I_ADDA_UL_CH1, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S2_CH1", AFE_CONN32, + I_I2S2_CH1, 1, 0), }; static const struct snd_kcontrol_new memif_ul3_ch2_mix[] = { SOC_DAPM_SINGLE_AUTODISABLE("ADDA_UL_CH2", AFE_CONN33, I_ADDA_UL_CH2, 1, 0), + SOC_DAPM_SINGLE_AUTODISABLE("I2S2_CH2", AFE_CONN33, + I_I2S2_CH2, 1, 0), }; static const struct snd_kcontrol_new memif_ul4_ch1_mix[] = { @@ -380,16 +392,22 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) {"UL1", NULL, "UL1_CH2"}, {"UL1_CH1", "ADDA_UL_CH1", "ADDA Capture"}, {"UL1_CH2", "ADDA_UL_CH2", "ADDA Capture"}, + {"UL1_CH1", "I2S0_CH1", "I2S0"}, + {"UL1_CH2", "I2S0_CH2", "I2S0"}, {"UL2", NULL, "UL2_CH1"}, {"UL2", NULL, "UL2_CH2"}, {"UL2_CH1", "ADDA_UL_CH1", "ADDA Capture"}, {"UL2_CH2", "ADDA_UL_CH2", "ADDA Capture"}, + {"UL2_CH1", "I2S2_CH1", "I2S2"}, + {"UL2_CH2", "I2S2_CH2", "I2S2"}, {"UL3", NULL, "UL3_CH1"}, {"UL3", NULL, "UL3_CH2"}, {"UL3_CH1", "ADDA_UL_CH1", "ADDA Capture"}, {"UL3_CH2", "ADDA_UL_CH2", "ADDA Capture"}, + {"UL3_CH1", "I2S2_CH1", "I2S2"}, + {"UL3_CH2", "I2S2_CH2", "I2S2"}, {"UL4", NULL, "UL4_CH1"}, {"UL4", NULL, "UL4_CH2"}, @@ -421,7 +439,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = DL1_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_DL2] = { .name = "DL2", @@ -438,7 +458,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = DL2_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_DL3] = { .name = "DL3", @@ -455,7 +477,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = DL3_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_VUL2] = { .name = "VUL2", @@ -472,7 +496,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = VUL2_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_AWB] = { .name = "AWB", @@ -489,7 +515,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = AWB_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_AWB2] = { .name = "AWB2", @@ -506,7 +534,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = AWB2_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_VUL12] = { .name = "VUL12", @@ -523,7 +553,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = VUL12_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_MOD_DAI] = { .name = "MOD_DAI", @@ -540,7 +572,9 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = MOD_DAI_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, [MT8183_MEMIF_HDMI] = { .name = "HDMI", @@ -553,10 +587,13 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .mono_reg = -1, .mono_shift = -1, .enable_reg = -1, /* control in tdm for sync start */ + .enable_shift = -1, .hd_reg = AFE_MEMIF_HD_MODE, .hd_shift = HDMI_HD_SFT, .agent_disable_reg = -1, + .agent_disable_shift = -1, .msb_reg = -1, + .msb_shift = -1, }, }; @@ -671,6 +708,7 @@ static int mt8183_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) .irq_cnt_shift = 0, .irq_cnt_maskbit = 0x3ffff, .irq_fs_reg = -1, + .irq_fs_shift = -1, .irq_fs_maskbit = -1, .irq_en_reg = AFE_IRQ_MCU_CON0, .irq_en_shift = IRQ8_MCU_ON_SFT, @@ -1119,7 +1157,7 @@ static int mt8183_afe_pcm_dev_probe(struct platform_device *pdev) /* request irq */ irq_id = platform_get_irq(pdev, 0); if (!irq_id) { - dev_err(dev, "%pOFn no irq found\n", dev->of_node); + dev_err(dev, "%s no irq found\n", dev->of_node->name); return -ENXIO; } ret = devm_request_irq(dev, irq_id, mt8183_afe_irq_handler,