Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424856AbdDUTWW (ORCPT ); Fri, 21 Apr 2017 15:22:22 -0400 Received: from mail-cys01nam02on0056.outbound.protection.outlook.com ([104.47.37.56]:26658 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1424842AbdDUTWS (ORCPT ); Fri, 21 Apr 2017 15:22:18 -0400 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=ADLINKtech.com; From: Jens Rottmann Subject: [PATCH] streamline TLV320AIC23 drivers To: Rob Herring , Mark Rutland , Jaroslav Kysela , Takashi Iwai CC: , , , Liam Girdwood , Mark Brown Message-ID: Date: Fri, 21 Apr 2017 21:22:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [5.158.151.28] X-ClientProxiedBy: AM3PR05CA0153.eurprd05.prod.outlook.com (10.161.139.31) To BLUPR0501MB2051.namprd05.prod.outlook.com (10.164.23.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25fbff11-48c2-4a9b-721a-08d488ebb8dd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BLUPR0501MB2051; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0501MB2051;3:LS5ToteW644mWOmhQ6VurhYmVQ4kC+PwXWa7Uf0TYIjbBljZbhR8PHLX1GPAbmZbx3VSSMvx3anaNwBAQkqqdvGM/s4iop0lOULBpoGceW49U5AOJ4ZJpAMUgSnj+hW/Dh9oOpp6/0/M8yYjimxfNlCTrqFbEN1jjfADDGWU884CWe2GylCx3Uwg7KqQDc/CtpRVO2R3a2uy7eW9OhkJAswT5PjA7T8KHVfwpc1j00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5fmt7x71U+qIbQqB1M+yYb23mj42MaRUujANQePLOTS9LBxX80q5RGLOmqzy50PLxcPZ4Eo/cXLRZyT3kt3R3WDFYTj63PEOJPzwiZATN8Ivsz8iYtdAywJyLl3C7K6UkfSJK7Vd4usCacb+WnFI96glMOcUNGzgFL0XIr4HxHfGn9XGrh+ybpFwb+1W7ZOEhwETkwWUVUPqsZ3s8dVFbwezpNVwfPBMv+O6QveTsyB9KKrf3tbuDWT47akRBnd7ENxG9bFcMIwbyutyx438+t2w9FKK9+7bgWl9cD9+lYHDEcPJCsksFHJUjwDoxRH+OTiojyXU5+58B/NAIU01Sh8fY2bLVQ0KRaiAsJxtM6ky0GHrMwzvuZxe3fJaUTyuUB+v72pWJsNEC/f638gOubaZJP/9vxVfsUmH+6uC7OCfYXpq0g5iHojLNu2mSEK1NwZhQI8SjpicbykEhCUO9UnksVQlw665qeKKtqA8TWoMwLr6MKHElo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:BLUPR0501MB2051;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB2051; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0501MB2051;4:uqOFkmZ+5w7VJAHXv8IYbzTfGVbPITkjzU5lM2d+ht/wAhV9vE8F6RCHLETMDuqswzL3lOvnYtyOg3E91m88i+bdDmnYKV7CBUFWFxTWqDiya5CD4f6bYFxiLgjGlIzTeW9oLhzo2iC0bpWhBnjfPmYMI8SHHQFoBWY00ZiDBnv8M9mEF4v7FK4foS1iNTIoUBgCyVTq9psng+0WY9GoeMwAQ0bwHRdYRBWDvFNQDb/B1AXmWYyxyWf1Jb2mxnvmD6+tM0PqLOdzb2omqDe9z9KRbwWekJUFbutSZJBHl4OpAXCAFJbqJdBbMBecwTAtYXYJ+MPSmszOR6pw9ywTryxjWAzW2WaDjYjR2EP3zBt/dPNqO+k+MLoVZjAzEYcgXKZiuuSs6uLHdv/+MJsjcq8qMhzNDqeEbM/Ji63OL0eQ0u4Nty06R4XmHiMBSmJ3fGy7mOtQtR5Z7skKKtygwrb78YmvQXtMc9Q1fnIR/BaLaXg5LAKvNKivP9Up4b4SnCeJ+MybAvzKZ3hxQpsmnQgwKf+1QL6ojsqSC4RipjDLQgMf173Z5ZuB2y5sM2XNSsvEYgbYRVwka6lXI8aPJHpvQOyzFd3cetQ8QXMKwTfcCaoK7lcHxLq+SwuFszooeoAmT3CZg87W5Hx7Wc8vFpuq8xOwf+rbwQPl3KfHFO+e0Y93pIVLPxsMiYLPYfeqmzjBWbA87DkoO34CYqvQGA== X-Forefront-PRVS: 02843AA9E0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(50986999)(230700001)(54356999)(2906002)(77096006)(3846002)(6486002)(38730400002)(64126003)(31686004)(71446004)(90366009)(5660300001)(6116002)(53936002)(4326008)(36756003)(66066001)(47776003)(189998001)(54906002)(117156002)(42186005)(4001350100001)(83506001)(25786009)(23676002)(305945005)(6666003)(86362001)(7736002)(33646002)(31696002)(81166006)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0501MB2051;H:[192.168.49.182];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA1MDFNQjIwNTE7MjM6djJpNzFwVUtaTWJGNHdLOEdZeHk2NXpF?= =?utf-8?B?Z3ludUNaMDdnOVhkSVdwYlJuT01uMWtZUXRLUEw0d0IwSy82UEVQTzBkM2hx?= =?utf-8?B?bGI5dkdCZU1jODVodThXL2dqS3ZLRU5GTElRMS9xdXFXbTlwem9mQ0twcit6?= =?utf-8?B?bTVYU0FV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OgBUoTyyv/TICVL2i2n07fABBMg3vXwQYn4W49FhItXQjYyjU8nY6m8kuaRGmFtAK+cwqNp5jhp7LX287KQOfnJYL1CG1UHX0P3l7w==;24:Qe5POS0r8u5fJERziDnSuErjIi8oPdRXQnIJK+x7kkqDIGieZAUlE4NOg9BjLr+ceInzR33yedOPt0DO5Ijd1Qun5iRAU3Xcfuc3AQsY/7k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR0501MB2051;7:Ue8GlZW8gusvfS2yB2/nxDuFZx2mbU9Kh5NuhpjrD1qW/uxJHL43Dxs75/I8N8yv/LMeSTauRcR/lpgVjNSU/bHHmZGeMFYVL820ftHByDoiiDGoaCDvtkflfOglIfXG4zw6ljQoAMXejcpybFXikp/wzFXmhPlVLyXgtmCt4pTPR3PDItKP2l/SroQE8pNErtWw1QbXjcBQuotw6XlTGHePyOOiXTuRa3TiC/2CRWphI+/+PsxUzuIKbuyZI+67Uz2vhttSDJwVMY/xWzlmkSy/BTOn/uUt7grE1LptxE/k9FUtyKqdfXZFIYytkO8Wq+3yWs+BjDmqxWrz20I59Q== X-OriginatorOrg: adlinktech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2017 19:22:15.5315 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB2051 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5237 Lines: 145 The iMX-TLV320AIC23 driver isn't from Freescale, but from a company named Eukrea Electromatique, originally for their own boards. From the code I get the impression it is a bit older, its DT options use a differing naming scheme. Patch it up a bit: - Remove Eukrea naming, i.MX is from Freescale, TLV320AIC23 is from TI, driver was written by Eukrea, but it's DT capable, so it's not exclusive: - Kconfig option title - 'model' option - driver 'compatible' string - Other options just have changed over time, this driver remaining (one of) the last with the old semantics: - 'audio-codec' option (also moved from ssi node) - 'mux-int/ext-port' options - All options stay backwards compatible, the DT binding documents new and old names. CONFIG variable and files have not been renamed, though, so no need to change old defconfigs. Signed-off-by: Jens Rottmann --- --- a/Documentation/devicetree/bindings/sound/eukrea-tlv320.txt +++ b/Documentation/devicetree/bindings/sound/eukrea-tlv320.txt @@ -1,16 +1,23 @@ -Audio complex for Eukrea boards with tlv320aic23 codec. +Audio complex for Freescale i.MX boards with TI TLV320AIC23 I2S codecs, +like those from Eukrea Electromatique. Required properties: - - compatible : "eukrea,asoc-tlv320" + - compatible : "fsl,imx-audio-tlv320aic23" or + "eukrea,asoc-tlv320" (deprecated) - - eukrea,model : The user-visible name of this sound complex. + - model : The user-visible name of this sound complex. + - eukrea,model : Dito, deprecated. - ssi-controller : The phandle of the SSI controller. - - fsl,mux-int-port : The internal port of the i.MX audio muxer (AUDMUX). + - mux-int-port : The internal port of the i.MX audio muxer (AUDMUX). + - fsl,mux-int-port : Dito, deprecated. - - fsl,mux-ext-port : The external port of the i.MX audio muxer. + - mux-ext-port : The external port of the i.MX audio muxer. + - fsl,mux-ext-port : Dito, deprecated. + + - audio-codec : The phandle of the audio codec. Note: The AUDMUX port numbering should start at 1, which is consistent with hardware manual. @@ -18,9 +25,10 @@ hardware manual. Example: sound { - compatible = "eukrea,asoc-tlv320"; - eukrea,model = "imx51-eukrea-tlv320aic23"; + compatible = "fsl,imx-audio-tlv320aic23"; + model = "imx51-eukrea-tlv320aic23"; ssi-controller = <&ssi2>; - fsl,mux-int-port = <2>; - fsl,mux-ext-port = <3>; + mux-int-port = <2>; + mux-ext-port = <3>; + audio-codec = <&codec>; }; --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -220,7 +220,7 @@ config SND_SOC_PHYCORE_AC97 and phyCARD boards in AC97 mode config SND_SOC_EUKREA_TLV320 - tristate "Eukrea TLV320" + tristate "SoC Audio support for i.MX boards with TLV320AIC23" depends on ARCH_MXC && I2C select SND_SOC_TLV320AIC23_I2C select SND_SOC_IMX_AUDMUX --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c @@ -92,11 +92,13 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) eukrea_tlv320.dev = &pdev->dev; if (np) { - ret = snd_soc_of_parse_card_name(&eukrea_tlv320, - "eukrea,model"); + ret = snd_soc_of_parse_card_name(&eukrea_tlv320, "model"); + if (ret) /* backwards compatible */ + ret = snd_soc_of_parse_card_name(&eukrea_tlv320, + "eukrea,model"); if (ret) { dev_err(&pdev->dev, - "eukrea,model node missing or invalid.\n"); + "model node missing or invalid.\n"); goto err; } @@ -109,22 +111,28 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) goto err; } - codec_np = of_parse_phandle(ssi_np, "codec-handle", 0); + codec_np = of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); + if (!codec_np) /* backwards compatible */ + codec_np = of_parse_phandle(ssi_np, "codec-handle", 0); if (codec_np) eukrea_tlv320_dai.codec_of_node = codec_np; else - dev_err(&pdev->dev, "codec-handle node missing or invalid.\n"); + dev_err(&pdev->dev, "audio-codec node missing or invalid.\n"); - ret = of_property_read_u32(np, "fsl,mux-int-port", &int_port); + ret = of_property_read_u32(np, "mux-int-port", &int_port); + if (ret) /* backwards compatible */ + ret = of_property_read_u32(np, "fsl,mux-int-port", &int_port); if (ret) { dev_err(&pdev->dev, - "fsl,mux-int-port node missing or invalid.\n"); + "mux-int-port node missing or invalid.\n"); return ret; } - ret = of_property_read_u32(np, "fsl,mux-ext-port", &ext_port); + ret = of_property_read_u32(np, "mux-ext-port", &ext_port); + if (ret) /* backwards compatible */ + ret = of_property_read_u32(np, "fsl,mux-ext-port", &ext_port); if (ret) { dev_err(&pdev->dev, - "fsl,mux-ext-port node missing or invalid.\n"); + "mux-ext-port node missing or invalid.\n"); return ret; } @@ -213,7 +221,8 @@ static int eukrea_tlv320_remove(struct platform_device *pdev) } static const struct of_device_id imx_tlv320_dt_ids[] = { - { .compatible = "eukrea,asoc-tlv320"}, + { .compatible = "eukrea,asoc-tlv320"}, /* backwards compatible */ + { .compatible = "fsl,imx-audio-tlv320aic23"}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_tlv320_dt_ids); _