From patchwork Sun Sep 3 12:44:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9936293 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 E57096038C for ; Sun, 3 Sep 2017 12:44:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE4F3285EB for ; Sun, 3 Sep 2017 12:44:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0A7F285ED; Sun, 3 Sep 2017 12:44:42 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no 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 89D62285EB for ; Sun, 3 Sep 2017 12:44:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A41DF266E42; Sun, 3 Sep 2017 14:44:23 +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 ED0D6266E55; Sun, 3 Sep 2017 14:44:21 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0065.outbound.protection.outlook.com [104.47.2.65]) by alsa0.perex.cz (Postfix) with ESMTP id C35B1266DCC for ; Sun, 3 Sep 2017 14:44:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VNuBOr45nVXSLvKRSVoBoEOOUw9jOO2i3a4e+LpGjNI=; b=nDF7MfR/o5A+x4dNsoRDiBMKrlOsoZ8L+V7yK/B02LxeASMqpGgOkV++VvHXsXAniNFHr2PTrfqvSq94y6TDPkUVZ5mW8mMv8OFLa+79ayuuf6lpgXbwN2A5Dxmn3mUG+dPTNMAYwtZeH6NN3h6LPrySsAQcVMW1pacTcYpzczw= Received: from AM5PR0401MB2627.eurprd04.prod.outlook.com (10.169.245.142) by AM5PR0401MB2547.eurprd04.prod.outlook.com (10.169.245.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Sun, 3 Sep 2017 12:44:17 +0000 Received: from AM5PR0401MB2627.eurprd04.prod.outlook.com ([fe80::1c76:52f:c23f:6d9a]) by AM5PR0401MB2627.eurprd04.prod.outlook.com ([fe80::1c76:52f:c23f:6d9a%17]) with mapi id 15.20.0013.018; Sun, 3 Sep 2017 12:44:17 +0000 From: Fabio Estevam To: Lukasz Majewski , Timur Tabi , Nicolin Chen , Xiubo Li , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "festevam@gmail.com" Thread-Topic: [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq Thread-Index: AQHTJKSVXFVmuAoOjUWBRV9ZMdYcM6KjGx1U Date: Sun, 3 Sep 2017 12:44:17 +0000 Message-ID: References: <1504436701-20700-1-git-send-email-lukma@denx.de> In-Reply-To: <1504436701-20700-1-git-send-email-lukma@denx.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=fabio.estevam@nxp.com; x-originating-ip: [187.180.183.184] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0401MB2547; 6:Ai5mTdj2Orj71x+cGKSDH+0pb8PH5M7dnAvzuqB73Fm2l6Evzvu3bc+sL+/GYEES88JxO25edjXFl5saePIv+BsAeoEJsRlmbjwo7ZeoJtC6Mde+3Q6fOUZxy+5hmQWjjesws/ivAW9vg26HyGSzVXhsB9Hp0d2cC58UoV3uLEHtETsU67gC5g0bdQey8lHnxS7jzsH+E7it9yhR6NZvgcfCj0ijku8Caa+dONYdHlDbWfcGOIGZnDswA0pHEAcvQwaCutywj2xYoSfTsFbdAlFncCBOQZOc6Z7z6dzp6gazuS0MAHAwlx4liYPB6p2sAroSKcdQw+OvqEHiCdrTog==; 5:hNlrqVFQHvav5aw3n63jnB8lqDTW5/wn1GB1DcdGLBlquva6bl3YpLy0T0PRtHI3LCQJ2m3RcTeDKkU8NSm3A7TI6aBKJnon3XKpffog8Wh+FKRJqIzuyYbNCRHSwIehObTZdx7qV/KAorrrsoewGg==; 24:sNrFWuP3p8yqENPx56zLxoMYSCVdO6KwtT4YTb6+5C3S9/icLaP+Db09kslPdO6BD9kcLHQ4CIu/aoomw5GZfqT3qT+yyqFhkV99DUXvsn8=; 7:DCvEDpe1k6RS7qRo0L897ziRUH1Gz1uXaEG8q0JerAYag3wmBSkFq3d2sYDXQOB3yOlZ3C00a+cEd+g2xcTbsK/foerpzGTYCaAp4RVg1WGJdCCTDanhauUMetihC1e+d/6DeUszawsYC+xodT91lbtKbq/lUZYTd1NTBFiAiBDyG88m+h6m6RDpGnUgZOMzK26jqfNtq7aYz2uui5nMdAadr9aBZ/qfTdYUJvR1U2Q= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 5d9b7821-c159-4b3b-cb01-08d4f2c97d78 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM5PR0401MB2547; x-ms-traffictypediagnostic: AM5PR0401MB2547: x-exchange-antispam-report-test: UriScan:(158342451672863)(9452136761055)(65623756079841); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0401MB2547; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0401MB2547; x-forefront-prvs: 041963B986 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(199003)(377454003)(189002)(25786009)(101416001)(6506006)(189998001)(2900100001)(3846002)(102836003)(6116002)(76176999)(54356999)(50986999)(2501003)(14454004)(53546010)(53936002)(5250100002)(229853002)(66066001)(6436002)(8676002)(3280700002)(3660700001)(81166006)(74316002)(68736007)(81156014)(7696004)(7736002)(39060400002)(2950100002)(33656002)(6246003)(97736004)(2906002)(478600001)(9686003)(54896002)(99286003)(105586002)(4326008)(5660300001)(54906002)(55016002)(8936002)(106356001)(86362001)(7416002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2547; H:AM5PR0401MB2627.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2017 12:44:17.1624 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2547 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [alsa-devel] [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq 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 [Sorry for the top-posting] The driver currently has: /* * Hardware limitation: The bclk rate must be * never greater than 1/5 IPG clock rate */ if (freq * 5 > clk_get_rate(ssi_private->clk)) { dev_err(cpu_dai->dev, "bitclk > ipgclk/5\n"); return -EINVAL; } Isn't this properly taking care of the clock restriction? Reviewed-by: Fabio Estevam diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 173cb84..1186fa9 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -809,6 +809,8 @@ static int fsl_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, unsigned int freq, int dir) { struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai); + if (clk_get_rate(ssi_private->clk) == freq) + return 0; ssi_private->bitclk_freq = freq;