From patchwork Thu Mar 10 05:29:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8554021 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 971D6C0553 for ; Thu, 10 Mar 2016 05:29:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E4DA202B8 for ; Thu, 10 Mar 2016 05:29:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F80B202E5 for ; Thu, 10 Mar 2016 05:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965379AbcCJF32 (ORCPT ); Thu, 10 Mar 2016 00:29:28 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:59379 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965378AbcCJF31 (ORCPT ); Thu, 10 Mar 2016 00:29:27 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 10 Mar 2016 14:29:25 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 0D1FC4B584; Thu, 10 Mar 2016 14:29:25 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id F24208002E; Thu, 10 Mar 2016 14:29:24 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id EA5788002D; Thu, 10 Mar 2016 14:29:24 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id QAG24253; Thu, 10 Mar 2016 14:29:24 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="206081980" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 Mar 2016 14:29:23 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1CK7EsJZIOY09KyGEqJQEWFg899gZgFRtnov+jza+mQ=; b=TLWem8FrZCtjItIYyeMu5FSwLLL1UFedAAtzLDDV8EvdNRKUJ+R59OGO+OlmjbSxVLPt+enZhhbTJ9WcJf6gOI0iZflCuEBLirltAkewC5cPdmWnROby7Gbr6Fg7cdQdwxJw18fVelPgdPzz7IlKBN6VmqgMxRYWc6E91CMVlDg= 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 HKXPR06MB1015.apcprd06.prod.outlook.com (10.161.180.156) with Microsoft SMTP Server (TLS) id 15.1.415.20; Thu, 10 Mar 2016 05:29:21 +0000 Message-ID: <87oaamvrae.wl%kuninori.morimoto.gx@renesas.com> In-Reply-To: <87twkfusgl.wl%kuninori.morimoto.gx@renesas.com> References: <87si2ab3tz.wl%kuninori.morimoto.gx@renesas.com> <87fuw8bc4q.wl%kuninori.morimoto.gx@renesas.com> <878u20atwr.wl%kuninori.morimoto.gx@renesas.com> <87twkfusgl.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] ASoC: rsnd: add simplified module explanation User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , , Hisao Munakata , OSD2 ML , TAKAHIKO GOMI , Masato Sakuraba , YOSHIYUKI ITO , Gaku Inami MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 10 Mar 2016 05:29:21 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0039.apcprd06.prod.outlook.com (25.164.91.49) To HKXPR06MB1015.apcprd06.prod.outlook.com (25.161.180.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1015; 2:0gDSFVucnnrz5FKq0lE5pm4bnN5R6EXuitMVRYI7zVf+vgCtnXSGQb1W/mxhkoEi9PBHgZwNgZwdut5vYYKVmtHehOEUVZGoI0J3rDV3hHPzIs43E8jWW7y3368tXqF/i6vpaiEEUTgx/4yhuub8Sw==; 3:mqq68xh27vypEVXvhRqMpB4iSfhhmDCdtCoe42Xg3SKX/9bdOLYe17uBlwg/SSLkBdQBAY6StyIJo14GtIDPMjaA36yzXB2tl4PzJM6sNOG/c7N+2LI9rsPbPvPVXP/B; 25:kxmIWrxWhtLXj6yBaLAmRRsgO20VmewxtnNh0Y6R+l3uBlEb9eVyFTEf/no4Lh0iGF114buMeCN3HV8y0sG23UNiQgMB34Sbgx5kyfdgX0m4n5OytJfFmqHv4kRpsqzXp1oJgdPnIwX+py4F3llyqGH2KwiXgdGc6mcAIRhzeim7b+6hhCFXTDXP+E0NfK5uAqJnDf5zTaU3cEsTa1FVepZEHrCrXMLSBsEsdZjqAFPMw4z9ck1Sodev4Evo/vwSgvT2tmvcv/qNUuz5sHwFYS2F5fqYeLILdPj763D4Ij6uBdgscePnj2iqtPOUPyxL1n4VXZKtsLt+CI/B77sHrQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1015; X-MS-Office365-Filtering-Correlation-Id: 84edaece-1426-4b88-1b48-08d348a4eff2 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1015; 20:NjIkTS84oLyFyznmkiWk4/pxVacQJKZwyHJFLYYbQvjCpmYJ3ny95cIZaiE2aYVSKol5qAaqEtEWqrLpJwoaYzYshYG/2EMPrs/qrYdod7Lj1ZssZly7aqd+UTuNX2UXV9BR6KnjWV9NrXWU5h1Yr19TPFthD5UP0dRJz/LZOZyaLD8oGgZu7335jOJH7ySWxHiPV4tsFti6vjBg8NjwvlbAa9HaB78q7b1LS8diyWYmW5jhRi/B5Y+dPuZmmSp28gi3DOenrLBF44CqgHw1mYxDk/wBtULjM8LRRX7Zi8XwqBHwGE3O8ItFyWE0hG5E2Y0orl0WmZDpzJhpBRNDpmeXFY1kJhc/BWp+Sj4WgrRR3ebMQG0XvDHsceEHuENU+4NYU8wq/bymAHFpNmPZOth+CD/eR/d+7uCx6UeQpmwn5E6h01TlaFW03WhCWAWps06CxlgYp3M8ORM4Dwli2J+01oa0QgRjMWjBbvZO6bIoxlhf1nL+utT0wDylWM8t; 4:jx22H0D+326998DJy0KfZadg8PupZSV0Zg2Rq1ozEq7qvJiXHfX1o+eueA9a0mB0+r/QfF+ejetpzQYnq1PmgxVILrUvZO5xpiF5drQU6cHVRDRndu41z22LehvAa/Zb/styi4xOjzPBwmtJBks75ctGi6SHJDwEAwtvaoJOrik22yqQ7cg7M9VSgEwGfS4v9RJyBKMLi/8P2i/CIJfQMLWzwJLSxXfyhXZbRKB9Y65b6xewF6MPoyi2B03wzo9hevy86HPUOsOq5wvr/CXSq8vSZqeUYkb2wAMw2QfAMKF2ZmuaRvn7Gm7ae2H9RUoYtQpV2twnjmj09FOAJjjbQuogp1LV6YCAnPxIWjWxM+9OhD8R2BwzcuaRiBgNWBHt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:HKXPR06MB1015; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1015; X-Forefront-PRVS: 08770259B4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(86362001)(66066001)(81166005)(575784001)(2950100001)(50466002)(36756003)(53416004)(47776003)(50986999)(92566002)(4001430100002)(110136002)(189998001)(107886002)(54356999)(76176999)(77096005)(23726003)(4326007)(2906002)(5008740100001)(83506001)(19580395003)(33646002)(46406003)(5004730100002)(586003)(229853001)(93886004)(3846002)(6116002)(19580405001)(1096002)(42186005)(2004002)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1015; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1015; 23:e38QNqeKGQAmzLaMWRKhk/C1BgsckDCkKwCmHXxeT?= =?us-ascii?Q?THuIWyFAaDkEVP6WG0F0Wp3Dv7Wv5SLFXPobPoAw6hVK2jYvjaVKAF2d8/Cn?= =?us-ascii?Q?dcxxUu8WtKyunojXHs7XWpQht3WJWlL/cNu8Jg/D4mTsIiUNFtkF/o5cHBAU?= =?us-ascii?Q?Vy4R6US8anofojvKijMx9sXjmckIZwu6zB+DtCK81AzZkxmDJxsAcl4b4s6P?= =?us-ascii?Q?GqQDzolaVRXPVV8qNt6abwFZhITg/BhQFBnSK7hCiseOTommmy263XIgAslU?= =?us-ascii?Q?ZOiDpJhzvGc8x9u+sRyJ7bjqLLcUXs4ExrxuGIUB+t1ESrCnUPZzK7I0nZ/4?= =?us-ascii?Q?rj5gEbdhbmLrwIuYhdnzz9GtmVNPx2aeV7NRNgz7b9wKpHZ91aGUAreKKRaK?= =?us-ascii?Q?j6Or1VTQ40s3qVtJgnBE8huVhOgbaMAHlc6a3PsF+vBSzL1FeC/NCE83enRV?= =?us-ascii?Q?VMPFX0/j/oTXx97fQNM0XudN+Kp0b5ww9bUeOvtptwXXXgnUJ4i94iMuTWqj?= =?us-ascii?Q?mXA/QTAXf3l2DlaZLq/OPOT5OFN8+MmhCtwRll6HCIj+XjfWhsvCx5T2SA+L?= =?us-ascii?Q?DieUOMJqU6aU3S6eTLvAmojtGD0Qv7f7h/8CCA2u4CuSXwNCT+pnJ8EL9Vxf?= =?us-ascii?Q?uAIB7eqlvzD+hj0RLLhO/NZtdSJ0o4YgDMuL5FtYy+BGm6q3t/MSQlpwZvfj?= =?us-ascii?Q?tD7ggFhKbd6AyTrh3px7qdGPd5GoiSSkuOibqw1uMewCGPEM2Mnpy0yDJlWA?= =?us-ascii?Q?9OBGKiNCD3FIMsr42iKEmD7HicLRUmA0Q7uhTNH9C65dspMyNldBKeGqnk0i?= =?us-ascii?Q?PjEpZ6ug+fhAptRpR/X17fsb9zPpmhT0QXGGANAy2B1Agy/ewW8xitnnQFNr?= =?us-ascii?Q?Ayu0MlHwJ6hRx6/f7J+l6cyKIYtHJiYoM5ZANZBtkSt9X7+t/dv/7VLdxDDL?= =?us-ascii?Q?oUTtEvjO4C3TZTYBdFipDijALZ7vtcu4TSEAgIYy/PqxkdPS8Db63SjA2/cR?= =?us-ascii?Q?UMIbj3ygzIknJmVTHArxykQXaIw+2+OiVD4rlozbyRCz+WFL5qcxblefC/H9?= =?us-ascii?Q?cC5a3q3AJrvUWIarwpjnY+XaAs5?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1015; 5:OmrJ/tovW2opxIbMh/UDJo/5WLfUDkWS1vQbw/lpuzA6w43iR2Wr9ir5u834IXcEQz3EV6NcHvva4EhtkI2/RWtTIwm3hJeqxB3nYxhkVjXdmBMR0dotlhhZrOc7dtE4E5FC4Z1ooJ4WXBQsmi3hmg==; 24:Fju+vhnKKDluNB+pTqmTUsNpYe0DgEjWyhPrKM3n+YnEC+SJjk2Oob1GX5yccKDcEdKq3mQNlSxEhUEgqB2HlUEv2RrjORlcWiqmjVHaIps=; 20:wqy6zqOzxhn7kMhWOmabrtVvWqRjQ7zrcEBHl48D8qCVV4X1qCw9rGb9NWv5dxpBooGd/aDrtNmF2477N05pWPs8317Zj+imVrr8q34d7iTMxrCzsgryCwM8rBxykjguD2VbQRNFiBo1hlijm+LEFbUxJqG3bbR6YjoVibaVAUc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2016 05:29:21.7454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1015 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Renesas sound driver user needs to read its datasheet when create DT. But it is difficult to understand, because it has many modules (SRC/CTU/MIX/DVC/SSIU/SSI/AudioDMAC/AudioDMACperiperi), and many features (Asynchronous/Synchronous mode on SRC, CTU matrix, DVC volume settings feature, Multi-SSI/TDM-SSI, etc). This patch adds simplified explanation to help setting/understanding. Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/sound/renesas,rsnd.txt | 340 +++++++++++++++++++++ sound/soc/sh/rcar/dvc.c | 23 ++ 2 files changed, 363 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index 8ee0fa9..c7b29df 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -1,6 +1,337 @@ Renesas R-Car sound +============================================= +* Modules +============================================= + +Renesas R-Car sound is constructed from below modules +(for Gen2 or later) + + SCU : Sampling Rate Converter Unit + - SRC : Sampling Rate Converter + - CMD + - CTU : Channel Transfer Unit + - MIX : Mixer + - DVC : Digital Volume and Mute Function + SSIU : Serial Sound Interface Unit + SSI : Serial Sound Interface + +See detail of each module's channels, connection, limitation on datasheet + +============================================= +* Multi channel +============================================= + +Multi channel is supported by Multi-SSI, or TDM-SSI. + + Multi-SSI : 6ch case, you can use stereo x 3 SSI + TDM-SSI : 6ch case, you can use TDM + +============================================= +* Enable/Disable each modules +============================================= + +See datasheet to check SRC/CTU/MIX/DVC connect-limitation. +DT controls enabling/disabling module. +${LINUX}/arch/arm/boot/dts/r8a7790-lager.dts can be good example. +This is example of + +Playback: [MEM] -> [SRC2] -> [DVC0] -> [SSIU0/SSI0] -> [codec] +Capture: [MEM] <- [DVC1] <- [SRC3] <- [SSIU1/SSI1] <- [codec] + + &rcar_sound { + ... + rcar_sound,dai { + dai0 { + playback = <&ssi0 &src2 &dvc0>; + capture = <&ssi1 &src3 &dvc1>; + }; + }; + }; + +You can use below. +${LINUX}/arch/arm/boot/dts/r8a7790.dts can be good example. + + &src0 &ctu00 &mix0 &dvc0 &ssi0 + &src1 &ctu01 &mix1 &dvc1 &ssi1 + &src2 &ctu02 &ssi2 + &src3 &ctu03 &ssi3 + &src4 &ssi4 + &src5 &ctu10 &ssi5 + &src6 &ctu11 &ssi6 + &src7 &ctu12 &ssi7 + &src8 &ctu13 &ssi8 + &src9 &ssi9 + +============================================= +* SRC (Sampling Rate Converter) +============================================= + + [xx]Hz [yy]Hz + ------> [SRC] ------> + +SRC can convert [xx]Hz to [yy]Hz. Then, it has below 2 modes + + Asynchronous mode: input data / output data are based on different clocks. + you can use this mode on Playback / Capture + Synchronous mode: input data / output data are based on same clocks. + This mode will be used if system doesn't have its input clock, + for example digital TV case. + you can use this mode on Playback + +------------------ +** Asynchronous mode +------------------ + +You need to use "renesas,rsrc-card" sound card for it. +example) + + sound { + compatible = "renesas,rsrc-card"; + ... + /* + * SRC Asynchronous mode setting + * Playback: + * All input data will be converted to 48kHz + * Capture: + * Inputed 48kHz data will be converted to + * system specified Hz + */ + convert-rate = <48000>; + ... + cpu { + sound-dai = <&rcar_sound>; + }; + codec { + ... + }; + }; + +------------------ +** Synchronous mode +------------------ + + > amixer set "SRC Out Rate" on + > aplay xxxx.wav + > amixer set "SRC Out Rate" 48000 + > amixer set "SRC Out Rate" 44100 + +============================================= +* CTU (Channel Transfer Unit) +============================================= + + [xx]ch [yy]ch + ------> [CTU] --------> + +CTU can convert [xx]ch to [yy]ch, or exchange outputed channel. +CTU conversion needs matrix settings. +For more detail information, see below + + Renesas R-Car datasheet + - Sampling Rate Converter Unit (SCU) + - SCU Operation + - CMD Block + - Functional Blocks in CMD + + Renesas R-Car datasheet + - Sampling Rate Converter Unit (SCU) + - Register Description + - CTUn Scale Value exx Register (CTUn_SVxxR) + + ${LINUX}/sound/soc/sh/rcar/ctu.c + - comment of header + +You need to use "renesas,rsrc-card" sound card for it. +example) + + sound { + compatible = "renesas,rsrc-card"; + ... + /* + * CTU setting + * All input data will be converted to 2ch + * as output data + */ + convert-channels = <2>; + ... + cpu { + sound-dai = <&rcar_sound>; + }; + codec { + ... + }; + }; + +Ex) Exchange output channel + Input -> Output + 1ch -> 0ch + 0ch -> 1ch + + example of using matrix + output 0ch = (input 0ch x 0) + (input 1ch x 1) + output 1ch = (input 0ch x 1) + (input 1ch x 0) + + amixer set "CTU Reset" on + amixer set "CTU Pass" 9,10 + amixer set "CTU SV0" 0,4194304 + amixer set "CTU SV1" 4194304,0 + + example of changing connection + amixer set "CTU Reset" on + amixer set "CTU Pass" 2,1 + +============================================= +* MIX (Mixer) +============================================= + +MIX merges 2 sounds path. You can see 2 sound interface on system, +and these sounds will be merged by MIX. + + aplay -D plughw:0,0 xxxx.wav & + aplay -D plughw:0,1 yyyy.wav + +You need to use "renesas,rsrc-card" sound card for it. +Ex) + [MEM] -> [SRC1] -> [CTU02] -+-> [MIX0] -> [DVC0] -> [SSI0] + | + [MEM] -> [SRC2] -> [CTU03] -+ + + sound { + compatible = "renesas,rsrc-card"; + ... + cpu@0 { + sound-dai = <&rcar_sound 0>; + }; + cpu@1 { + sound-dai = <&rcar_sound 1>; + }; + codec { + ... + }; + }; + + &rcar_sound { + ... + rcar_sound,dai { + dai0 { + playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>; + }; + dai1 { + playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>; + }; + }; + }; + +============================================= +* DVC (Digital Volume and Mute Function) +============================================= + +DVC controls Playback/Capture volume. + +Playback Volume + amixer set "DVC Out" 100% + +Capture Volume + amixer set "DVC In" 100% + +Playback Mute + amixer set "DVC Out Mute" on + +Capture Mute + amixer set "DVC In Mute" on + +Volume Ramp + amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps" + amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps" + amixer set "DVC Out Ramp" on + aplay xxx.wav & + amixer set "DVC Out" 80% // Volume Down + amixer set "DVC Out" 100% // Volume Up + +============================================= +* SSIU (Serial Sound Interface Unit) +============================================= + +There is no DT settings for SSIU, because SSIU will be automatically +selected via SSI. +SSIU can avoid some under/over run error, because it has some buffer. +But you can't use it if SSI was PIO mode. +In DMA mode, you can select not to use SSIU by using "no-busif" on DT. + + &ssi0 { + no-busif; + }; + +============================================= +* SSI (Serial Sound Interface) +============================================= + +** PIO mode + +You can use PIO mode which is for connection check by using. +Note: The system will drop non-SSI modules in PIO mode +even though if DT is selecting other modules. + + &ssi0 { + pio-transfer + }; + +** DMA mode without SSIU + +You can use DMA without SSIU. +Note: under/over run, or noise are likely to occur + + &ssi0 { + no-busif; + }; + +** PIN sharing + +Each SSI can share WS pin. It is based on platform. +This is example if SSI1 want to share WS pin with SSI0 + + &ssi1 { + shared-pin; + }; + +** Multi-SSI + +You can use Multi-SSI. +This is example of SSI0/SSI1/SSI2 (= for 6ch) + + &rcar_sound { + ... + rcar_sound,dai { + dai0 { + playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; + }; + }; + }; + +** TDM-SSI + +You can use TDM with SSI. +This is example of TDM 6ch. +Driver can automatically switches TDM <-> stereo mode in this case. + + rsnd_tdm: sound { + compatible = "simple-audio-card"; + ... + simple-audio-card,cpu { + /* system can use TDM 6ch */ + dai-tdm-slot-num = <6>; + sound-dai = <&rcar_sound>; + }; + simple-audio-card,codec { + ... + }; + }; + + +============================================= Required properties: +============================================= + - compatible : "renesas,rcar_sound-", fallbacks "renesas,rcar_sound-gen1" if generation1, and "renesas,rcar_sound-gen2" if generation2 @@ -64,7 +395,10 @@ DAI subnode properties: - playback : list of playback modules - capture : list of capture modules + +============================================= Example: +============================================= rcar_sound: sound@ec500000 { #sound-dai-cells = <1>; @@ -250,7 +584,9 @@ rcar_sound: sound@ec500000 { }; }; +============================================= Example: simple sound card +============================================= rsnd_ak4643: sound { compatible = "simple-audio-card"; @@ -290,7 +626,9 @@ Example: simple sound card shared-pin; }; +============================================= Example: simple sound card for TDM +============================================= rsnd_tdm: sound { compatible = "simple-audio-card"; @@ -309,7 +647,9 @@ Example: simple sound card for TDM }; }; +============================================= Example: simple sound card for Multi channel +============================================= &rcar_sound { pinctrl-0 = <&sound_pins &sound_clk_pins>; diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 93b11e1..02d971f 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -8,6 +8,29 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * Playback Volume + * amixer set "DVC Out" 100% + * + * Capture Volume + * amixer set "DVC In" 100% + * + * Playback Mute + * amixer set "DVC Out Mute" on + * + * Capture Mute + * amixer set "DVC In Mute" on + * + * Volume Ramp + * amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps" + * amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps" + * amixer set "DVC Out Ramp" on + * aplay xxx.wav & + * amixer set "DVC Out" 80% // Volume Down + * amixer set "DVC Out" 100% // Volume Up + */ + #include "rsnd.h" #define RSND_DVC_NAME_SIZE 16