Received: by 10.192.165.148 with SMTP id m20csp3565205imm; Mon, 30 Apr 2018 02:25:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrp+1OH5tVYxA4ZcT2TMaPaK4Ktvs5BOsvnaqL5fWReIOsfE6WJA7ZUoD/iPC0EKehIV/xk X-Received: by 2002:a63:925c:: with SMTP id s28-v6mr9396617pgn.368.1525080358900; Mon, 30 Apr 2018 02:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525080358; cv=none; d=google.com; s=arc-20160816; b=wXxJlxkFj7OVqcJ4JVaVaxnTYRVXxLfcQTHxQIYs2dK3HxqEh9B+XkAqznfVwEgIbd M8+n+eNJRo04pTRjON7ApzV9tvky0pKzOc8uS9ss9NaneKpNOwcqFm1lO0q7B/X03I0V Wb9cG7c8zvfvmra1dPN+9zRPq2bCNYbuwzOZTas1FupES8RjodH9opdGYG+JikHaQsNV RQs0Kbj1wqtCMJizZBbY7TfDnMo+JmEjqQ6GpdXEEeMi2BVXPwEL4FPsUd/VLJmBDRHX gPvHc3dM6Bmn1HVxaKcHRCtHbnEF+7OYo20Y9JENu4XOMxe7k8k/Kb3NV5sQyo0RhHmd iN1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:from :dkim-signature:arc-authentication-results; bh=spNBi30iXpNSQPlsBA3BScxo5TwWKbg2NYe726Ai0OE=; b=qkxrYmERES/REDGwWYs1YBK8AYepLAAk3DBAM3zZbHkH0T6BOdd/aYUBszDvxx5PVK CTSlG08K5UWQ+Zskd5JUVFvQMMWj4HlvTjlusX6mwsFralCCD1tCgdsAwPn3oHYsiVDh UIMQgPTa/k4agAXAtP+Ph+TGBKmiCgqnZrSXDBWJCm4xY8q4NBnRNnQWU/ZGKTA0sdTP nxIM1TykIfWIIzowv7lndAvgfEbmD0UoU3O730CFtduhpxgpoQHALglLLX/58vkNTZIW Vmr5/tpH2+udUtHgw7R9X9sQBLcM0Z1yF0i/yyIMz2YpELYx1T2ijIUMEu9+Vx/LA3pH F0/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=OvIPoWgb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w68si7084134pfk.14.2018.04.30.02.25.45; Mon, 30 Apr 2018 02:25:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=OvIPoWgb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656AbeD3JZY (ORCPT + 99 others); Mon, 30 Apr 2018 05:25:24 -0400 Received: from mail-sn1nam02on0081.outbound.protection.outlook.com ([104.47.36.81]:55867 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752285AbeD3JZX (ORCPT ); Mon, 30 Apr 2018 05:25:23 -0400 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 Cc: djkurtz@chromium.org, akshu.agrawal@amd.com, Alexander.Deucher@amd.com, Adam.Thomson.Opensource@diasemi.com, Support Opensource , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org (moderated list:SOUND), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] ASoC: da7219: read fmw property to get mclk for non-dts systems 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 Content-Type: text/plain 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/zn09cFFZkj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HBy5LhBKSlRDsHaUs0YCMbQ+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-Di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Noo6+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 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 1.9.1