From patchwork Thu Dec 21 04:58:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 10126935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8212760390 for ; Thu, 21 Dec 2017 05:06:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 792A3299F6 for ; Thu, 21 Dec 2017 05:06:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C89F29A38; Thu, 21 Dec 2017 05:06:24 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF88299F6 for ; Thu, 21 Dec 2017 05:06:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 41969266EAD; Thu, 21 Dec 2017 05:58:44 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4CD26266EEC; Thu, 21 Dec 2017 05:58:42 +0100 (CET) Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) by alsa0.perex.cz (Postfix) with ESMTP id 9ACDB266DB1 for ; Thu, 21 Dec 2017 05:58:39 +0100 (CET) Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1eRswG-00014U-GJ from Jiada_Wang@mentor.com ; Wed, 20 Dec 2017 20:58:36 -0800 Received: from ubuntu.localdomain (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Thu, 21 Dec 2017 04:58:34 +0000 From: To: , , , , Date: Wed, 20 Dec 2017 20:58:34 -0800 Message-ID: <1513832314-29727-1-git-send-email-jiada_wang@mentor.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Cc: jiada_wang@mentor.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v1 1/1] ASoC: rsnd: ssi: Fix issue in dma data address assignment X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jiada Wang Same SSI device may be used in different dai links, by only having one dma struct in rsnd_ssi, after the first instance's dma config be initilized, the following instances can no longer configure dma, this causes issue, when their dma data address are different from the first instance. This patch by introduces two dma struct in rdai, each SSI instance in a dai link is assigned with two dma struct, to store dma configuration for playback and capture. Signed-off-by: Jiada Wang --- sound/soc/sh/rcar/rsnd.h | 2 ++ sound/soc/sh/rcar/ssi.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 57cd2bc..a26156c 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -459,6 +459,8 @@ struct rsnd_dai { unsigned int frm_clk_inv:1; unsigned int sys_delay:1; unsigned int data_alignment:1; + + struct rsnd_mod *dma[2]; }; #define rsnd_rdai_nr(priv) ((priv)->rdai_nr) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index fece1e5f..4e97065 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -66,7 +66,6 @@ struct rsnd_ssi { struct rsnd_mod mod; - struct rsnd_mod *dma; u32 flags; u32 cr_own; @@ -861,7 +860,8 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { - struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); + int is_play = rsnd_io_is_play(io); int ret; /* @@ -876,7 +876,7 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, return ret; /* SSI probe might be called many times in MUX multi path */ - ret = rsnd_dma_attach(io, mod, &ssi->dma); + ret = rsnd_dma_attach(io, mod, &rdai->dma[is_play]); return ret; }