From patchwork Thu Jun 15 00:49:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9787707 X-Patchwork-Delegate: geert@linux-m68k.org 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 76AB560384 for ; Thu, 15 Jun 2017 00:49:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A3AB28472 for ; Thu, 15 Jun 2017 00:49:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DFAB2849E; Thu, 15 Jun 2017 00:49:34 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A35E528472 for ; Thu, 15 Jun 2017 00:49:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750770AbdFOAtd (ORCPT ); Wed, 14 Jun 2017 20:49:33 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:53195 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750768AbdFOAtb (ORCPT ); Wed, 14 Jun 2017 20:49:31 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 15 Jun 2017 09:49:30 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 25F3F646E5; Thu, 15 Jun 2017 09:49:30 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.39,341,1493650800"; d="scan'208";a="246636485" Received: from mail-hk2apc01lp0216.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.216]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2017 09:49:29 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NnxRrwrQ8Bc8otMMiWmNBCXCKesLxtNBZb2hvB6Tuys=; b=on5ND0LnRecYapAPhJEhyKTfLJ4CpMAhohRH3RWkaKdljQL/3TzyYUtChIwG7IEfXvCBPkGDuZ9SBAYWz9c6DBuKYjxzH5E2wO3wAmYpIj6iczAPG0qPUbSR+O+CM/umNDtAjHGaL9wl+ngzsj2dShZlA2hjkQCaTbQuujrIA2o= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by KL1PR0601MB1879.apcprd06.prod.outlook.com (2603:1096:802:8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 15 Jun 2017 00:49:27 +0000 Message-ID: <87lgoum65n.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/4] ASoC: rsnd: rename "slots" related variable User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Simon , In-Reply-To: <87mv9am66o.wl%kuninori.morimoto.gx@renesas.com> References: <87mv9am66o.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 15 Jun 2017 00:49:27 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: PS1PR0601CA0106.apcprd06.prod.outlook.com (2603:1096:803:1::32) To KL1PR0601MB1879.apcprd06.prod.outlook.com (2603:1096:802:8::15) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB1879: X-MS-Office365-Filtering-Correlation-Id: b159608d-e631-4b98-34a1-08d4b388607c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:KL1PR0601MB1879; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1879; 3:m6e9pmPYlyCjaZhx6vshXPGkykbnQGKjsJtce90gr6XYVCGToTH5lU4zivLBqeh89C8FWd94C9kNPIezkt/TUUOCqjnjyp5lXMJWTss1xPpaaC2yFUqVX0OIyEAmPmTYsARg2qPMNG7E0War04xD29ZvFqFeqULDppcbou5B2IwXhhGT5VdvbxRQ70sR7a2tKikdxJ8YTQPo+kI83XSLpMm51792HJXHFcTTb0beqWOy2EXvnBvHIdo1P2Vq4CAw734yfQkglK22MWy1O0fia1QH+L60/XBr5VlCLMMij57FnTf18mgfOah3KiBRqVIlZsTbPxF+uQNO44a3QMjTifDwGrxK1UkBcuXcZoDTfXM=; 25:FfeD+duoqGltufBiqGw6rMBpvw0Mdkd6vudMaBMOEUEUIN4d/6QKFDbIjUkXmxaI25jp2cG9dyuB61ylTBfMKOgumPkyK3B5OewzFQCaQfFxApRdYfv70ctYVXRPkrBnkssEBOZkHlOzjqseq6BVKY4qITcRw0QTK6WstZjTl+Au/ljk5wVMwCDdSHac9fbMb9vC7U4sWbOyNIYm+EdIOQ8d98a/eNWm+j8msx0DLXmBNXLAaeF+AFv1L5o2iZNOtLrGjyxywi+p6+PWq5oizlngqwDSkDgF4Yd3jRjZSToeoK4ESm0y5cxFxgPX96VeJ/oTb+2YWa/IbfC9ch7wYZ3ccWZ5lLwi482ghPLVetK6z2dlEGXIx98gHnkTR9HL5DgOAWYja+jHn78MjKWaJCwqeJkj7IWDwgu0SQ8QKlaRll2K+eNmERJ6gGQOafMyOI18SPrVIpfuqbv9wCbkMfsz/NQauvHNs9WiIS+R3hg= X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1879; 31:UKTxEQcdLG4aZg11EWQQXSlA0ZhQ6B0U6iV2aEOwk+l6eEGlfGdkGW/1zL7I9vD/UWVTDD6hDJcp9h+gGmUycS76DMmo4YESIOQr3fls2zoYk5NRvjuUi4k7oON83ZyfcuZEjJSMTJ5qNVRth1NjrPnz6+at3/jtRa6QRH2hm+5ApELYdjMaPGIaoJk0jV2rqO0cusq3afz1XCMX/cm7YdThQcXsyGBp67GQYoGrwDsT3leJOrofHnxkRIqbsZdE; 20:jb5bMHXKzeq7SnwExNz2ZErLOGp2bCQl+jt0j4IBPSys2cWe3P2rKqz1IT/llybB9dvy6KcQHTKAau61D3RwwRL4uWVXMdbqD1sMjWE7ZOiv6Q6mJ6gPI2Hw+Xcmvt1AIX7/Jy1tSVTKmmVmflPH/5MfFznvZ5Q4jxb2XNxBsKp+Lk2LjCNtTK/uCF1c157mnZPCJ/gOH7zWRrO6r82mONV9aaRudPupuvd9PYsSmF/PfKDHDg8iF4Eq1Ft7ehWYGNfYAZfyeTbcM3O2C7FnqS34XllgCIFzNOUBfsDC8aLUofaaUggwUl/rGJtsaxB0NhveBtfnErueqP/QeqXj1vM3jMvaYE+EC3WpveO9sDPGiIiFSocCt/V/yAF+Q6r4vcTHh8VdpVi1vOCmIhPR+gThyw+toAFHvJe0jhkHKna/z7Hb7QUe08EXJ28pgnpxCpw1hBwwCOIw8tYHwI5Vb2pFTXr4MIbY+FoJ9JQ5zd1+agovUtNrZbAvDv4xT5Fv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1PR0601MB1879; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1PR0601MB1879; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR0601MB1879; 4:ZqeEjjsc4G2VrwjgfG9JM8I4AeXp00BlDtxmiooB?= =?us-ascii?Q?9FqMe6UaqqhedxX9tkW4wEcIEOOikZE5qPvb7xzYawNiK6M4Y9DEKsQzI7LY?= =?us-ascii?Q?LY/mlfiBofcVkqjmjUzZtK8alibLnltyEvD7YvyqryEJO6JAI6RT5n3lMKWS?= =?us-ascii?Q?n3kw/9E4E3R7QipOpJtHE40xejfVZl4FODNhyF9DgnDJE+LgyQXbb5teDQuG?= =?us-ascii?Q?YX2zYyU4suzKtA57gdpqCSy5XrllaeaXEP/SBnDp/Iz8S5s0V+LCKoIuBCC1?= =?us-ascii?Q?QrABNoDrvZivK5JfFZwKAyv0uFn7jYLys+orwVUri5lcjAmH12a/cX5sok43?= =?us-ascii?Q?dXaUKUNUjUtJnpSyJMFMIULfJyzlyqqu+lfAhxp4ZZsQcZK7GKBLu54yebaf?= =?us-ascii?Q?S46oH4f5F5tZNaNyxWkQUKcsMTN8D+inOUkQVQ78Q6kXfbqAgKBR/RqAvsFY?= =?us-ascii?Q?QkNJDcj8Sgt6u8bZmFr8bEQbwy0Ss8YiAmSR/mpzeA9chZRFaKvqK1l+oc3K?= =?us-ascii?Q?EUHEq1scn00lp2nxwLrXLV4MFSR7Mfn5L17OTg9+2Hm0fchOAjfuZPsuU82d?= =?us-ascii?Q?jgCs07YPem/I/bF9GDlB5F/s+nP1JAoXQcvh1JSerCIQl27/HvOn2NkeM1S/?= =?us-ascii?Q?/M6UU9dIKNiqmIpwy9BrTL+nuuLhr5+A5n6XxH3MOpPSbcMUxHc93ZM5q4px?= =?us-ascii?Q?qTkApuTjeT8sbhDDjyRDyDYPYkupO9Bo7DeE3BhdmAEYiJaET1n7OT4p+wE2?= =?us-ascii?Q?ipI0heKHTXJcpuCX6BnxnhivloYknirajn99a4HGm6Hy+cDxsJHqrlZqc631?= =?us-ascii?Q?t5s+/RMzXtv/XxeeCTYCGOTPc2KNbESyxK93rv4pUGuNF5ZUNwtRXoDvutMI?= =?us-ascii?Q?1NKH2Y13qtAMqLLMo8tCybEzunQp2aKO2CBVnPXQ8MXGLf93uCrHa3ajIRXD?= =?us-ascii?Q?FOkMiM3KQMKf9uVabaIwpk+EeTmNtXgxahA7e7DeeUzoPfh9Zs1Sp/EXQYdW?= =?us-ascii?Q?KNwUUa4D+Qv7YWG3neG1WmNMfmlxXN/aOO36V2C82NDCu+9S24iSriKaGCG1?= =?us-ascii?Q?+PiDiIBqf+MS2WgTYQK7wdGVX1GYtmfWbGMK7Q2mL2IuLyMppJ0JccnIeJvw?= =?us-ascii?Q?cQuN0v94n7+xTCMC1qwgUxeGKfSGQNj+PuX3G10C7kleYB+Eh7mIxA=3D=3D?= X-Forefront-PRVS: 0339F89554 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(50466002)(8676002)(50986999)(76176999)(54356999)(478600001)(81166006)(6486002)(33646002)(86362001)(46406003)(23726003)(3846002)(6116002)(4001350100001)(110136004)(4326008)(25786009)(38730400002)(66066001)(47776003)(2906002)(6916009)(2950100002)(36756003)(7736002)(305945005)(54906002)(53416004)(83506001)(53936002)(5660300001)(42186005)(189998001)(16060500001)(309714004); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1879; H:morimoto-PC.renesas.com; FPR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QC7Fkr5rv6Q+ZzzCCvVTVOq8LEPm3DPHsfCw8Y/oi2N6e/cWeK7B6Jd4sRChThdNF2iPFTfsnMEZiX36gcOXpZFJ3qctj4yU+6RSgojx5+NIyinZ0+XOOsbLpMhE6Qih1H56juxo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 00:49:27.3165 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1879 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current Renesas sound driver has slots and slots_num in struct rsnd_dai, but these are very un-understandable naming (It had named from TDM slots). In this driver, the "slots" means total usable channels, and "stot_num" means SSI lane number if Multi SSI was used. To more understandable code, this patch renames "slots" to "max_channels", and "slots_num" to "ssi_lane", and replaces related functions name. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama --- sound/soc/sh/rcar/core.c | 53 ++++++++++++++++++++++++------------------------ sound/soc/sh/rcar/dvc.c | 7 ++++--- sound/soc/sh/rcar/rsnd.h | 23 ++++++++++++++------- sound/soc/sh/rcar/ssi.c | 3 ++- 4 files changed, 49 insertions(+), 37 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 1b536d1..9b9e898 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -203,27 +203,6 @@ int rsnd_io_is_working(struct rsnd_dai_stream *io) return !!io->substream; } -void rsnd_set_slot(struct rsnd_dai *rdai, - int slots, int num) -{ - rdai->slots = slots; - rdai->slots_num = num; -} - -int rsnd_get_slot(struct rsnd_dai_stream *io) -{ - struct rsnd_dai *rdai = rsnd_io_to_rdai(io); - - return rdai->slots; -} - -int rsnd_get_slot_num(struct rsnd_dai_stream *io) -{ - struct rsnd_dai *rdai = rsnd_io_to_rdai(io); - - return rdai->slots_num; -} - int rsnd_runtime_channel_original(struct rsnd_dai_stream *io) { struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); @@ -248,13 +227,14 @@ int rsnd_runtime_channel_after_ctu(struct rsnd_dai_stream *io) int rsnd_runtime_channel_for_ssi(struct rsnd_dai_stream *io) { + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); int chan = rsnd_io_is_play(io) ? rsnd_runtime_channel_after_ctu(io) : rsnd_runtime_channel_original(io); /* Use Multi SSI */ if (rsnd_runtime_is_ssi_multi(io)) - chan /= rsnd_get_slot_num(io); + chan /= rsnd_rdai_ssi_lane_get(rdai); /* TDM Extend Mode needs 8ch */ if (chan == 6) @@ -265,12 +245,13 @@ int rsnd_runtime_channel_for_ssi(struct rsnd_dai_stream *io) int rsnd_runtime_is_ssi_multi(struct rsnd_dai_stream *io) { - int slots = rsnd_get_slot_num(io); + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); + int lane = rsnd_rdai_ssi_lane_get(rdai); int chan = rsnd_io_is_play(io) ? rsnd_runtime_channel_after_ctu(io) : rsnd_runtime_channel_original(io); - return (chan >= 6) && (slots > 1); + return (chan > 2) && (lane > 1); } int rsnd_runtime_is_ssi_tdm(struct rsnd_dai_stream *io) @@ -549,6 +530,24 @@ static void rsnd_dai_disconnect(struct rsnd_mod *mod, io->mod[type] = NULL; } +int rsnd_rdai_channels_ctrl(struct rsnd_dai *rdai, + int max_channels) +{ + if (max_channels > 0) + rdai->max_channels = max_channels; + + return rdai->max_channels; +} + +int rsnd_rdai_ssi_lane_ctrl(struct rsnd_dai *rdai, + int ssi_lane) +{ + if (ssi_lane > 0) + rdai->ssi_lane = ssi_lane; + + return rdai->ssi_lane; +} + struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id) { if ((id < 0) || (id >= rsnd_rdai_nr(priv))) @@ -726,7 +725,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, switch (slots) { case 6: /* TDM Extend Mode */ - rsnd_set_slot(rdai, slots, 1); + rsnd_rdai_channels_set(rdai, slots); + rsnd_rdai_ssi_lane_set(rdai, 1); break; default: dev_err(dev, "unsupported TDM slots (%d)\n", slots); @@ -879,7 +879,8 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv, rdai->playback.rdai = rdai; rdai->capture.rdai = rdai; - rsnd_set_slot(rdai, 2, 1); /* default */ + rsnd_rdai_channels_set(rdai, 2); /* default 2ch */ + rsnd_rdai_ssi_lane_set(rdai, 1); /* default 1lane */ for (io_i = 0;; io_i++) { playback = of_parse_phandle(dai_np, "playback", io_i); diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 75af6e7..99d2d94 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -249,8 +249,9 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, struct snd_soc_pcm_runtime *rtd) { struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); int is_play = rsnd_io_is_play(io); - int slots = rsnd_get_slot(io); + int channels = rsnd_rdai_channels_get(rdai); int ret; /* Volume */ @@ -259,7 +260,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, "DVC Out Playback Volume" : "DVC In Capture Volume", rsnd_kctrl_accept_anytime, rsnd_dvc_volume_update, - &dvc->volume, slots, + &dvc->volume, channels, 0x00800000 - 1); if (ret < 0) return ret; @@ -270,7 +271,7 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, "DVC Out Mute Switch" : "DVC In Mute Switch", rsnd_kctrl_accept_anytime, rsnd_dvc_volume_update, - &dvc->mute, slots, + &dvc->mute, channels, 1); if (ret < 0) return ret; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ac4d50d..47162bd 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -399,11 +399,6 @@ void rsnd_parse_connect_common(struct rsnd_dai *rdai, struct device_node *playback, struct device_node *capture); -void rsnd_set_slot(struct rsnd_dai *rdai, - int slots, int slots_total); -int rsnd_get_slot(struct rsnd_dai_stream *io); -int rsnd_get_slot_num(struct rsnd_dai_stream *io); - int rsnd_runtime_channel_original(struct rsnd_dai_stream *io); int rsnd_runtime_channel_after_ctu(struct rsnd_dai_stream *io); int rsnd_runtime_channel_for_ssi(struct rsnd_dai_stream *io); @@ -455,8 +450,8 @@ struct rsnd_dai { struct rsnd_dai_stream capture; struct rsnd_priv *priv; - int slots; - int slots_num; + int max_channels; /* 2ch - 16ch */ + int ssi_lane; /* 1lane - 4lane */ unsigned int clk_master:1; unsigned int bit_clk_inv:1; @@ -476,6 +471,20 @@ struct rsnd_dai { struct rsnd_dai *rsnd_rdai_get(struct rsnd_priv *priv, int id); +#define rsnd_rdai_channels_set(rdai, max_channels) \ + rsnd_rdai_channels_ctrl(rdai, max_channels) +#define rsnd_rdai_channels_get(rdai) \ + rsnd_rdai_channels_ctrl(rdai, 0) +int rsnd_rdai_channels_ctrl(struct rsnd_dai *rdai, + int max_channels); + +#define rsnd_rdai_ssi_lane_set(rdai, ssi_lane) \ + rsnd_rdai_ssi_lane_ctrl(rdai, ssi_lane) +#define rsnd_rdai_ssi_lane_get(rdai) \ + rsnd_rdai_ssi_lane_ctrl(rdai, 0) +int rsnd_rdai_ssi_lane_ctrl(struct rsnd_dai *rdai, + int ssi_lane); + void rsnd_dai_period_elapsed(struct rsnd_dai_stream *io); int rsnd_dai_connect(struct rsnd_mod *mod, struct rsnd_dai_stream *io, diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index f7df3b5..6450095 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -897,7 +897,8 @@ static void rsnd_ssi_connect(struct rsnd_mod *mod, type = types[i]; if (!rsnd_io_to_mod(io, type)) { rsnd_dai_connect(mod, io, type); - rsnd_set_slot(rdai, 2 * (i + 1), (i + 1)); + rsnd_rdai_channels_set(rdai, (i + 1) * 2); + rsnd_rdai_ssi_lane_set(rdai, (i + 1)); return; } }