From patchwork Thu Nov 8 01:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10673361 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 5C74815E9 for ; Thu, 8 Nov 2018 01:59:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BB102D1A7 for ; Thu, 8 Nov 2018 01:59:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D41F2D1AD; Thu, 8 Nov 2018 01:59:54 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 A0BB92D1A7 for ; Thu, 8 Nov 2018 01:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728549AbeKHLcz (ORCPT ); Thu, 8 Nov 2018 06:32:55 -0500 Received: from mail-sg2apc01on0109.outbound.protection.outlook.com ([104.47.125.109]:11680 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728527AbeKHLcz (ORCPT ); Thu, 8 Nov 2018 06:32:55 -0500 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:X-MS-Exchange-SenderADCheck; bh=He0AHuF1TZiVugOqdinm3sc8YSQ9hw2+GRzS8nD0FqU=; b=RVwjyfJZ+j18UdyK/af43qxAEaIFJ2yM642Y0NXjrgMBYlAScix0bxKmaQwX4pszR+cxzueoXKERU1LqFNSZNJZGIecXe8tVdXeBM7nTAvbcxDjuzgZ/G8dFuZUcuTpeq5A3rdJ7j1JY4byl3sk7TRmOoQEpQ9gUUaW3ll460XI= Received: from morimoto-PC.renesas.com (211.11.155.130) by TY2PR01MB3322.jpnprd01.prod.outlook.com (2603:1096:404:da::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Thu, 8 Nov 2018 01:59:39 +0000 Message-ID: <87bm70e3rc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/4] arm64: renesas: ulcb-kf: add pcm3168 sound codec User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Simon Cc: Magnus , linux-renesas-soc@vger.kernel.org, Jiada Wang In-Reply-To: <87in18e3um.wl-kuninori.morimoto.gx@renesas.com> References: <87in18e3um.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 8 Nov 2018 01:59:39 +0000 X-Originating-IP: [211.11.155.130] X-ClientProxiedBy: TY2PR06CA0011.apcprd06.prod.outlook.com (2603:1096:404:42::23) To TY2PR01MB3322.jpnprd01.prod.outlook.com (2603:1096:404:da::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83704d84-69c3-4252-b747-08d6451dd7ef X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:TY2PR01MB3322; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB3322;3:69FKJuus0fktk4AsZMPxnV0AOV/3to/4Y0qB/6x697dKIRTa89PK78cbhpJqsbSOhcylINdGSlqdCyckLWS1G79JZNaNbSTJNZDY34xoTJxyd+QlKOsLGIl71Uk6KRrrKBa/oJBrcqVLiOqxbaC/SuY7g4yp5fybQK800nmFhL8Vew6dZoS0sQXDnxlHHq4lgI0/rgQ2ftyMSHUW51h5D6YytKasjCWCMDW25S0lvKtjlfmYTIduFn6QL8bwGtfN;25:fnFoXCWrAAkNMx3PpBa78yWLq88WPG0P0XtssxQBt5HZ+81jSnEKxPPSFddoHUVvVuxVPQwb/ATqBSdbEjMcPkFTk0CXKb4R7wqVlWkMRxDnGmVN8nXUwia5pvudoPEWbI73p4YsVCRTvLwSBh1WWKwlpP7CdbMyyuTeScOvq5/0gpieBVpXIcgZrR4n+gqKbWw2EK59ut/ed/Xmg2nxXKzjtESwCs1bRiGSKNu067LdwmGJWXN4WO9Gtf+xBPP5iP8CqIiBWdL6XqtZAV5veIUXixJk+rBLWk+rvkkXtkxrib6+2G8OCsPbDxarjLHU7elCcaG9TgJ5jTMNu7FtBw==;31:KCcdwYgER/OxybJxtdxeDUMKWqh1Z1Yj8NlSqOdjcddiRcbs/qvjpdcPzs5ll4SnOntPZi+DKhmZuEINC5K3V4QuN8jmgpJezj+cfPokBgPSbKiX7priH587nILUG9BtYlbHanWTnC3AQSjBHsqvcoGOTGAbIH/9WYOgP+as4ypLW6CGO2tUf9iB4cRlHfdNRaY/bDvSxViH1zaDLmU3SX2d+qf1I+zVFRvDsjxKdDY= X-MS-TrafficTypeDiagnostic: TY2PR01MB3322: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB3322;20:77ip6llsZ/7JZLT2t1evALY+TFwt5bcl4tRitshnaPM/P9scSrxL6u8sZNNkRbLySmcroHIkSnRIktIuAMtwNCbI9Y5LRbk2AyPz2Nq2hRVp1jomJI/HhW5+yG2j1709nKAg2rNJdLZO7ZP7PDlG4i2J4uk8nPmtZEU+9ICIsXgeQDyyVyw5bWatQB17OCLdY5DMTJCHEOiEcvjLkV+sIBJQvSbTm2sJCU316UJPVODUvqwditTlTuYFvIBvFezKjfIPiPpLcZRWvcAuSyMA3rd8lCenFeQqrvATl+62/O5pHyFD7NKo7ZqMWJimnfKO+M2TtLWDAT9fgEd/IXcshwvCG61r/pcL/ncSDT8+Vw8CGkMNfr2nh5N7RUVymqXgcp/lfYtSUv58OXcT08cqcoUuziqyoGRR3IuV8kZbMRTVFnNICoa1t5HZJwy2ytwShMvmoQa//mIhbJlnl1SVe5BLqVbnqMYkErGREcnUtALKwlatQCwVHRgCam+R7cNg;4:ovxGCEHq9076qBmsJf8oVjtwBlOqfzj/9bMzZupAvtWdkqhJANRR9CV9xpSRc7+rIKDWZa83mkaMKgvfaAmJcVoVaKrf4wtyyB/3tequexD9+0r1sDAVkuPfWXyGeHnZa7SRWbivgn5XyQYHDpNgb1Q7ZYcGI08iB7Ivq6OVCBZFBgbDUxfk1eOK8Ck1fqa9QPU+Zn6H7ttW6FkCdyBx/VOxnwbgIjZimVOZBr1ywIWEEiqoiMCUskGY6nUEGcepLUwUXQONgMSRV0w94r+Fpg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231382)(944501410)(52105095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:TY2PR01MB3322;BCL:0;PCL:0;RULEID:;SRVR:TY2PR01MB3322; X-Forefront-PRVS: 0850800A29 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(396003)(366004)(136003)(346002)(189003)(199004)(23726003)(26005)(58126008)(36756003)(69596002)(97736004)(6486002)(6116002)(53936002)(8936002)(3846002)(16526019)(68736007)(86362001)(2906002)(50466002)(6916009)(386003)(186003)(25786009)(5660300001)(478600001)(7696005)(52116002)(76176011)(4326008)(8676002)(81166006)(7736002)(47776003)(66066001)(305945005)(486006)(81156014)(39060400002)(11346002)(956004)(54906003)(106356001)(105586002)(476003)(53416004)(16586007)(316002)(2616005)(446003)(21314003)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:TY2PR01MB3322;H:morimoto-PC.renesas.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB3322;23:2Y/5fPmYfSe53NXrOMp2E0fSjOP97YO2xgp7NEeeBYzdMrURpZhRezFgrN+aBCU5KBYtPU9AP5UJuBH9A2XiAI2QQF7Vuk1TYZzshDTbr5GVxNUal+wU8LlGqmuTce5la5EfEe30l9xT0h3l2L4aeY5o9Y3uXbMdKXQt64fna87CgK0CSvu01R1+z/2LcrcReNNMrs9eHQmDufj5InrlC07Jy1yYzBYkcuDZwT8laJ/kzqd9nYei3tGTMaKddeRUdCTD0okeyaRJwZSDDVtBWmvg1slm4QLw3Nv4JoC+PbKfvciW50GMw3Vtj5u2YbNdJwfCVLldcpFiYwqAWdHKnUjYGiG7VOyrH+46suz+A+9l+Fk/s+Wcaqtlw8KhIew58qEUf0vaHcro89WMY1Aymt1p1WgkeO+BYwrbUhF2NPXMm6jpSKqwquemHGsYn9AKBqElS9xePxi64A/wafLj5MfBhheksqeKntg5f0lsQgYdGJuJ3V5cuueC6FvcHUWcJ+psDpf2Nw1sDbX4/e5X23mVJJ7rQUal6Bda6lBejEAvm2YTgXJYT8h9SX0CgC2WdnZIalVHA8/SyCxui4oCR75X2s5XG3tl9nBQqOwL2vMqR8gaxcN9CSJ9nInylwLtz/aqt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Z+swfFHIg8dqbWZJ8BtL5qlyJVeg+CWuixF/pg1rETbS7jE/nXTDXWOa5S5WxbRa5Ky+5l8CoWnkefdP2+gKRC7h3gmANIP08guGoMopPUi3Nf0kiNxeGkx+KkTtohJWm3tRt5LPk5Xvs/SK7Dnu4/5LCnxlccpko+4fMaLRN8Wp4UZht+bRjZtQSj2Uc70mUJp77vWuH/HPavqt6cgygW12E1GcuSb0Bemt5Y4rymckKO4XSeu27z3YJcgXfDnm78BMOywLHkW9vjsctdQpmq7IihBr3SCvESi29jAa/z73TYyuYOwBnIRqZHCzfG+4PKyGVCoScvGJ9m9S/mhman/DGqpxdegW4MygbZz6CqVGv8AJ6noNEebTxA16a72kXWHpLeL59ndUfGHtP7UxO1i1ZU4ngjruRRYq9JzlVWR9zCOQ==;5:4Xqg1WhelOpsFNGPq9huAI5dUK+o6nHOEpEloIilf1vrzp8Jxjzof1VrXh1HWDZRoJR+CpVBtRs1F2LGZl/8kJ+a670vImGDQfqaqbyGCd8ebhPhUmAEvTpXlV8o3NVV/4a1X0X+u4Z/IhxbeAFtGOBBlc+KQt/qV8Z13cGAgU4=;7:JS/O4YYQcWuqEeQYXYeyZ4W7DJsZt8S+ssfRMh1mxV/NakViJa699UrXq6Y0/SrbPzVSkiUwOJ04TAn9fiJBPYRi5W568QpzeGER2aZzDd5efud9xNu8ZkOWzVmLVkRn87G4dzkxnB1wQIIf6PhBUA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB3322;20:L82zcpd0y+j8tHNKjlEuNrKFB0JQUUE8HB8x8YPDGLp+OITbOVP8AFUrP4tqdlZT+a5mz/kvyeBfAgRZ2ANipyfcTQoeLIOzIjpcgBLWMugtuuknElX/xIM1UQAryBkoT9w6I25RMJTfX/hS8uCPJGgOJQ6EfY2ETKq9vkYiZb0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2018 01:59:39.8058 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83704d84-69c3-4252-b747-08d6451dd7ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB3322 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 KingFisher has pcm3168 sound codec. This patch enables it. Because pcm3168 can't handle symmetric channel on playback/ capture, we need to handle it as different DAI. Signed-off-by: Kuninori Morimoto --- arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 151 +++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi index 1b316d79..fdd625d 100644 --- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi +++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi @@ -6,11 +6,50 @@ * Copyright (C) 2017 Cogent Embedded, Inc. */ +/* + * SSI-PCM3168A + * aplay -D plughw:0,2 xxx.wav + * arecord -D plughw:0,3 xxx.wav + */ + / { aliases { serial1 = &hscif0; serial2 = &scif1; }; + + clk8snd: clk8snd { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; + + clksnd: clksnd { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <22579200>; + }; + + clksndsel: clksndsel { + #clock-cells = <0>; + compatible = "gpio-mux-clock"; + clocks = <&clk8snd>, <&clksnd>; + select-gpios = <&gpio_exp_75 13 GPIO_ACTIVE_HIGH>; + }; + + snd_3p3v: regulator-snd_3p3v { + compatible = "regulator-fixed"; + regulator-name = "snd-3.3v"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + snd_vcc5v: regulator-snd_vcc5v { + compatible = "regulator-fixed"; + regulator-name = "snd-vcc5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; }; &can0 { @@ -44,6 +83,7 @@ }; &i2c2 { + /* U11 */ gpio_exp_74: gpio@74 { compatible = "ti,tca9539"; reg = <0x74>; @@ -53,6 +93,13 @@ interrupt-parent = <&gpio6>; interrupts = <8 IRQ_TYPE_EDGE_FALLING>; + audio_out_off { + gpio-hog; + gpios = <0 GPIO_ACTIVE_HIGH>; /* P00 */ + output-high; + line-name = "Audio_Out_OFF"; + }; + hub_pwen { gpio-hog; gpios = <6 GPIO_ACTIVE_HIGH>; @@ -80,8 +127,16 @@ output-high; line-name = "OTG EXTLPn"; }; + + snd_rst { + gpio-hog; + gpios = <15 GPIO_ACTIVE_HIGH>; /* P17 */ + output-high; + line-name = "SND_RST"; + }; }; + /* U5 */ gpio_exp_75: gpio@75 { compatible = "ti,tca9539"; reg = <0x75>; @@ -98,6 +153,49 @@ #size-cells = <0>; reg = <0x71>; reset-gpios = <&gpio5 3 GPIO_ACTIVE_LOW>; + + /* Audio_SDA, Audio_SCL */ + i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + + pcm3168a: audio-codec@44 { + #sound-dai-cells = <0>; + compatible = "ti,pcm3168a"; + reg = <0x44>; + clocks = <&clksndsel>; + clock-names = "scki"; + + VDD1-supply = <&snd_3p3v>; + VDD2-supply = <&snd_3p3v>; + VCCAD1-supply = <&snd_vcc5v>; + VCCAD2-supply = <&snd_vcc5v>; + VCCDA1-supply = <&snd_vcc5v>; + VCCDA2-supply = <&snd_vcc5v>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pcm3168a_endpoint_p: endpoint { + remote-endpoint = <&rsnd_endpoint2>; + clocks = <&clksndsel>; + mclk-fs = <512>; + }; + }; + port@1 { + reg = <1>; + pcm3168a_endpoint_c: endpoint { + remote-endpoint = <&rsnd_endpoint3>; + clocks = <&clksndsel>; + mclk-fs = <512>; + }; + }; + }; + }; + }; }; }; @@ -173,6 +271,11 @@ groups = "usb0"; function = "usb0"; }; + + sound_pcm_pins: sound-pcm { + groups = "ssi349_ctrl", "ssi3_data", "ssi4_data"; + function = "ssi"; + }; }; &scif1 { @@ -193,3 +296,51 @@ &xhci0 { status = "okay"; }; + +&sound_card { + dais = <&rsnd_port0 /* ak4613 */ + &rsnd_port1 /* HDMI0 */ + &rsnd_port2 /* pcm3168a playback */ + &rsnd_port3 /* pcm3168a capture */ + >; +}; + +&rcar_sound { + pinctrl-0 = <&sound_pins + &sound_clk_pins + &sound_pcm_pins>; + + ports { + /* rsnd_port0/1 are on salvator-common */ + rsnd_port2: port@2 { + reg = <2>; + rsnd_endpoint2: endpoint { + remote-endpoint = <&pcm3168a_endpoint_p>; + + dai-format = "i2s"; + bitclock-master = <&rsnd_endpoint2>; + frame-master = <&rsnd_endpoint2>; + dai-tdm-slot-num = <8>; + + playback = <&ssi3>; + }; + }; + rsnd_port3: port@3 { + reg = <3>; + rsnd_endpoint3: endpoint { + remote-endpoint = <&pcm3168a_endpoint_c>; + + dai-format = "i2s"; + bitclock-master = <&rsnd_endpoint3>; + frame-master = <&rsnd_endpoint3>; + dai-tdm-slot-num = <6>; + + capture = <&ssi4>; + }; + }; + }; +}; + +&ssi4 { + shared-pin; +};