From patchwork Mon Apr 30 09:23:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10371239 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 61CC86032A for ; Mon, 30 Apr 2018 09:25:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A81B289F8 for ; Mon, 30 Apr 2018 09:25:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B571289FC; Mon, 30 Apr 2018 09:25:49 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID 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 80257289F8 for ; Mon, 30 Apr 2018 09:25:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3DC8F267035; Mon, 30 Apr 2018 11:25:29 +0200 (CEST) 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 29233267230; Mon, 30 Apr 2018 11:25:27 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0085.outbound.protection.outlook.com [104.47.36.85]) by alsa0.perex.cz (Postfix) with ESMTP id 0A2A7266EBC for ; Mon, 30 Apr 2018 11:25:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=spNBi30iXpNSQPlsBA3BScxo5TwWKbg2NYe726Ai0OE=; b=OvIPoWgbzEHkpndT97kIaPXHPdw6HEcBinS4QR5TXL2buPQL3KACyNMl8smW8ksrm+hK97B1GjAdU2LOwZM68U4vULor79awMKo9J65iTfAPcs7XXEkBcIgS6Fxbao5dVjgFcqSavbjXuymemu4dqkgMYVBCnC6etOnCu1q07p8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.mshome.net (202.56.249.162) by DM5PR12MB2359.namprd12.prod.outlook.com (2603:10b6:4:b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.23; Mon, 30 Apr 2018 09:25:16 +0000 From: Akshu Agrawal To: Date: Mon, 30 Apr 2018 17:23:22 +0800 Message-Id: <1525080203-18947-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0099.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::15) To DM5PR12MB2359.namprd12.prod.outlook.com (2603:10b6:4:b4::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2359; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2359; 3:ebul0DylhSQR1Z9I0PK+r6r1wEdqck0kl1a84E6mllqCooaM08LcJikV6TBOFXiSLAfGl4bWe6EWvIRaY0V78U7nDpWqOFqWje8v0z6tP3AjVxb8LWd91TaV69TEKMF/zn09cFFZk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XCoHHBy5LhBKSlRDsHaUs0YCMbQ+DbWuzuaz78kEYxX/WLubet54OQitlPXCLQgbx0JHXzJ/fLsJIk26bAKTztTAr1tSnVFDSda4lTHHlQtBA3L/LLwoTgUcuJ7F+EunWyBpfe/qmgkd8Cs9dAhhdsYtTU9xjWgxi2sK0cXOz9PzZaH/nd7y21/D3dQXreVYV7erzu52jpqju; 4:thk2IUXEVK+q7d2vopa3Q4bKUSVsTdEUcOoXebPuextGEafC054AsWoVP/X1Go8YHO2HLp99TfhNpdTGxLJ46TX0PTi31XxEZOKi5dM1m+62lfsSoTr6ptThR4mKDy8ggG+R4YCsWHgoIhtR1j5B1bxxwaqxgNkP9ujsC3QUlxlaVoWpZlE5bLo4rnoajwIHRlvks84NNERTc4b4yYL+w0ioNuL5iaUr1kk4vCTEBtNUcN7CEB6HlO7Ojtu2hmjaSdfwrrBN5xKsOJb3IeMe+y3MWh81zy43JCQJn6rFWfb6nO1RQHe+1tHP5BE6+DvS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR12MB2359; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2359; X-Forefront-PRVS: 0658BAF71F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(366004)(346002)(39860400002)(376002)(199004)(189003)(81156014)(72206003)(51416003)(52116002)(6486002)(97736004)(81166006)(478600001)(106356001)(486006)(186003)(5660300001)(25786009)(36756003)(59450400001)(47776003)(8936002)(50466002)(386003)(48376002)(39060400002)(6506007)(8676002)(1671002)(66066001)(69596002)(16586007)(3846002)(54906003)(53416004)(2906002)(16526019)(68736007)(6512007)(6116002)(53936002)(109986005)(316002)(26005)(44832011)(105586002)(7736002)(476003)(86362001)(2616005)(50226002)(305945005)(6666003)(4326008)(956004)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB2359; H:akshu-HP-EliteBook-745-G2.mshome.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB2359; 23:8pm/BJ3vRg/QPR0ZgwiZUt6TPWc+9E2PWQ1xxNqot?= =?us-ascii?Q?sghF+QtVi+Dy1Ee7FXWIE7h/GlYqOHEe/AlX8PGOigjcfrsNVM4QWWT+b3kL?= =?us-ascii?Q?sjrLLx5g0k3W0MkUH69LoE7nfnrmF0AjqpK0l/dky3adhxig/hqmAd+Bce8W?= =?us-ascii?Q?xjVGfW2TvxGLQdxgwg3qO9zRkQYvHJOS3ThXkIlmhHfFUKS1wAC/HMWQmQdn?= =?us-ascii?Q?GDv7hS88hvoB/dT5S2OF1+1BXrENdCLN8nN7ZNd0URPrVnGBw2nN5sy9Asf8?= =?us-ascii?Q?j6FhJdAEYOiyxclndU0OVivtN9eOOsu1zSohIUTfrG6T+OLPq4/YkE4tWeze?= =?us-ascii?Q?k90zbHluJoqFm60NszT4Qy+daUTYSM3AoDoz86q9Ee7ZVSv7UKnS2Kzk3MwG?= =?us-ascii?Q?yQjD3TaH6XDJAIuKAhmLYcYD99Sv86VLTQQNWXfLK65TGIemMXoAhaucSCAJ?= =?us-ascii?Q?fwuG+KRy8QtvUlP97S4L5LmvEsd2LAMNIogyNboSv9Nu9KVEuX+MikYD2U9r?= =?us-ascii?Q?VCbafpdVDuCA5w1kuqlNJPF+8oEJtgeQR6P7UCd5r35FaWXPaZbF8mfomq0o?= =?us-ascii?Q?TDDSxKt/xDqCILwEOzTXuUoz5AIDnstnrMwvY1UQyTJkoiSK98LSrD/2nc+1?= =?us-ascii?Q?o9IAEUJA/tmlmxOgy6pyXodEKm0Qbn7zkNYgPjpaH455MEmFcVPlDbULA2B2?= =?us-ascii?Q?NpuafMRoVIAT3QzqdkGfJwmm9FEzlCbkYkQzhqrlTLPIRC2w4iJcF2AqZaY6?= =?us-ascii?Q?4hViRAxWy5nK4iVHWpG1csc4SMUoaljKnk6CmVrkuwrpzNj+wox7cYddMn8U?= =?us-ascii?Q?Klh3NxTKHcBffbmlc/Ozda2mgJ2wKU7nHYM2qOm++/eRjJiUx4XmA81cQdH1?= =?us-ascii?Q?lH3ymVcpp8nn+N/9dgW3HKe1MqSGxIOIIvMOqKq8pTjckM1escFch+9hV8TX?= =?us-ascii?Q?niUmcHgWB54Dt6N5/tPo+i+T0uCDI0adAMbcfHoqRcgpH6V4GkpjqBcWpihA?= =?us-ascii?Q?zZf8izBJ6gb5zBPuTDI6JvwyFVLu4hitAWw1lAno6o1OlKD+OiwmZlLCa+AT?= =?us-ascii?Q?hJZ2jW4qgTV6qbwseFOod3h07+pyb2RxZrSFaFD+NX7Z3JvAlBkJDxvhil2m?= =?us-ascii?Q?4pfu47Mo0HyusQfbDdri1lzD9KZogoVwaFHXsMcqcZb0cX2Q+GOsec1lRhuE?= =?us-ascii?Q?FBV8QSnfj0PA8soLrfYYfz50y05d+f8P99VQlhu5L39yXnJGvyXyqlpQxK5B?= =?us-ascii?Q?tnPnY9HrAV9bCEFJqaLjuql9unLUEuO+BUgG3mRxEm+rhZjVokZNvuMWoXGz?= =?us-ascii?Q?TiI8JcyWBL5BefcCb+5kl8=3D?= X-Microsoft-Antispam-Message-Info: iJuP0qXNQboMKKcetBn/aLGktLakzXXtsEm+YU9sOrqwlDFeC9huXGdVrLtJcXSFoMGoO87hsr5ITfG0xlK+yzgJPtdRbVSmQA6K+WXJru8vx8BRERH14CQI5ZhtBpS21QdCElStabemBZirGkTh5blkarM0eAY7PjDc9QRHYoqpJXD4Y/mMwR7CQc0R8/GK X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2359; 6:UdmIKqtFQ/66fNyQUZofACu4iP2d3QE13Vaz+Yqhg4fHCTZZEDRSJQmXOodWSwjY6fGKx0Ojhy89MKxZeyAx+Thb7AJBJ6fqWi8/7kM9h5PdIEkIzn8gI4wpeNP/RpS5WcNHYupBBl61Tbo0O+f1brfa43juvKAPVicYs5F3/cl20keZPzv6U9v1JtcuJ6tqo67U8xpffkQi3BmHzSlggQceFyHAXd70IT4tt+1HQP4gyr46YuZBk60qx6JfV3VQ2+yHhnxnNKaciR8eGzcuBt7k902PaquanHjk+KaEM1dicN3v2oLKOLkmt14DNiK6AKyHLPGeGcEkEaVjKu6pjC6axiafItHossA2fmF1kY63jn671znpNSPcph2L0QuLxdi4pdbXBzJQJDzrAYsRqiVYc9rL8b9QZOhDBoOZZqqT+xNfosMdZarYS7qCyt12DHt8+5RORag6p7rmXtNt+A==; 5:mo+A+VJB96rnL+uwfgbDlIbd4fNy/tQccnlCfsZNZhnm1QN0WlvZW4b9ZE9ctbLdLG2xPOn6cRHuxttkH2CLhadXfgdMSSZ9goNVwnRBq4hMYrMY0Tra796rVSrSmXM41+M0j7KXdMQ13gKN8ygIFYWPZm/5ob52NVQbhYn9OB0=; 24:jkM4CMZ1wFzu4fcLaDAkoDgBxH5m61JfqKg7vvmXdcvEksRparclGpK8dGzw3Eu4T2QWr4azFaRQ1SsQmZBzxQRxe9WB4tG+kHvZjnJcNNg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2359; 7:dBmInY1tOzqXdK0qxtMyrpPqquyBgdy83TQzYo5vM2JmNgeBY1+Y08Fx5QSfpcrhU3WCmcovcf5y0t9sKo8AJaGW2Pry46t/nCZL54Jv1fos+n5zjg2tuFbLFfoo4zlC2qenVAeSt3Sv1xqZMdzj6Kjix+Ce1n3VTrOJosbwUuzG64bkUJbsU5f8gIPJkB6AMD5wjhXoStRsqFM0XrqqGNwT9cRSwMpHLVNoo6+Jopg/NnVp0K2B7yMNe4+JTJwo; 20:QDlg/FTxt/CkVJ2/9py7CbZAfJoe42b3W4iOsxFV79yV/jgR/zDvPzgeY6oVa/+parN/spZjDpxVAuTxnti6DoH3AmS87bKYWdrVQOwIzPYL8fC+CfnfWdUSUwI8UDIsOpqGpESAR/b+7pBIOk1m1dnEH4CzzmEvM8KTVnAfhCJxxR/8hPIvSDIqcGg+iJjS41E3iwWu45l0iSbhuBBJxys4jYpmisIOu8ML0/8BH8HOnuwC4cgOvF4E+eAO3bKW X-MS-Office365-Filtering-Correlation-Id: 3685fcec-1263-4269-5ef5-08d5ae7c4b26 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2018 09:25:16.9182 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3685fcec-1263-4269-5ef5-08d5ae7c4b26 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2359 Cc: "moderated list:SOUND" , Support Opensource , Liam Girdwood , open list , Takashi Iwai , djkurtz@chromium.org, Mark Brown , Alexander.Deucher@amd.com, Adam.Thomson.Opensource@diasemi.com, akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH v2] ASoC: da7219: read fmw property to get mclk for non-dts systems 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 Non-dts based systems can use ACPI DSDT to pass on the mclk to da7219. This enables da7219 mclk to be linked to system clock. Enable/Disable of the mclk is already handled in the codec so platform drivers don't have to explicitly do handling of mclk. Signed-off-by: Akshu Agrawal --- v2: Fixed kbuild error include/sound/da7219.h | 2 ++ sound/soc/codecs/da7219.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/sound/da7219.h b/include/sound/da7219.h index 1bfcb16..df7ddf4 100644 --- a/include/sound/da7219.h +++ b/include/sound/da7219.h @@ -38,6 +38,8 @@ struct da7219_pdata { const char *dai_clks_name; + const char *mclk_name; + /* Mic */ enum da7219_micbias_voltage micbias_lvl; enum da7219_mic_amp_in_sel mic_amp_in_sel; diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 980a6a8..aed68a4 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct snd_soc_component *compone dev_warn(dev, "Using default clk name: %s\n", pdata->dai_clks_name); + device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name); + if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0) pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32); else @@ -1905,7 +1907,10 @@ static int da7219_probe(struct snd_soc_component *component) da7219_handle_pdata(component); /* Check if MCLK provided */ - da7219->mclk = devm_clk_get(component->dev, "mclk"); + if (da7219->pdata->mclk_name) + da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name); + if (!da7219->mclk) + da7219->mclk = devm_clk_get(component->dev, "mclk"); if (IS_ERR(da7219->mclk)) { if (PTR_ERR(da7219->mclk) != -ENOENT) { ret = PTR_ERR(da7219->mclk);