From patchwork Mon Apr 22 06:14:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10910697 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 EE13113B5 for ; Mon, 22 Apr 2019 06:15:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB00028249 for ; Mon, 22 Apr 2019 06:15:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9DD228389; Mon, 22 Apr 2019 06:15:13 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MISSING_HEADERS,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB9FA28249 for ; Mon, 22 Apr 2019 06:15:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 77D62848; Mon, 22 Apr 2019 08:14:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 77D62848 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1555913710; bh=HADTFTm3uOFYqL9AuzrQeaergeS99eGWUTnD/F8MBc0=; h=From:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=XoSqss8FnqfaOde0nY/p5Nxhiln2jTCedJF+b4MQDe3fyK5/b12Rm5hoI8EvpcCqJ W+wKAPv3TKBMNI6WF1d7zVxltv27Pk2QUC8O3huK8Q1sQrFMLvPevQhoRxZ8oRta7c 5eh60p4xbRUHfllBu/omTwc1ueUhocTu75tbIJXI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C700EF896CC; Mon, 22 Apr 2019 08:14:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 633BEF896DF; Mon, 22 Apr 2019 08:14:17 +0200 (CEST) Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-co1nam05on0631.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe50::631]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8405AF80730 for ; Mon, 22 Apr 2019 08:14:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8405AF80730 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="gSxqH5Wn" 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:X-MS-Exchange-SenderADCheck; bh=dPWh08xBs3gR8q1bg3iKfSiiRsmxZYe/ytiK/H2IejM=; b=gSxqH5Wnqhkubj3PrV55a12TXiMo8yrITmjyL02PYDQEuiI0jRGesGjpwCeI5ZmBk14XrCPiDxDrIk4FccfOs21h4q+L2affIIrGsrO0zTiOg1zpxk0CVZBFp/aRdTcHVrRSQg8Cot1PAJgGoLvIhiYfiGcD8cGfiF/bs5GCBzU= Received: from MN2PR12MB2878.namprd12.prod.outlook.com (20.179.80.143) by MN2PR12MB3069.namprd12.prod.outlook.com (20.178.241.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Mon, 22 Apr 2019 06:14:07 +0000 Received: from MN2PR12MB2878.namprd12.prod.outlook.com ([fe80::c5a0:395e:b9c6:4e5a]) by MN2PR12MB2878.namprd12.prod.outlook.com ([fe80::c5a0:395e:b9c6:4e5a%6]) with mapi id 15.20.1813.017; Mon, 22 Apr 2019 06:14:07 +0000 From: "Agrawal, Akshu" Thread-Topic: [PATCH] ASoC: DA7219: Fix failure in hw_params by not letting set_rate error out Thread-Index: AQHU+NKXxx2OJXUZeEu60aoSrd+M3A== Date: Mon, 22 Apr 2019 06:14:07 +0000 Message-ID: <20190422061334.4243-1-akshu.agrawal@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR01CA0150.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::20) To MN2PR12MB2878.namprd12.prod.outlook.com (2603:10b6:208:aa::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [165.204.156.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4c500031-3daf-4f6b-3c93-08d6c6e9b9e1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600141)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MN2PR12MB3069; x-ms-traffictypediagnostic: MN2PR12MB3069: x-microsoft-antispam-prvs: x-forefront-prvs: 00159D1518 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(396003)(346002)(376002)(189003)(199004)(68736007)(478600001)(6512007)(4326008)(2906002)(14454004)(109986005)(66446008)(73956011)(64756008)(36756003)(25786009)(6116002)(72206003)(102836004)(66946007)(52116002)(66556008)(66476007)(256004)(71200400001)(71190400001)(53936002)(6506007)(386003)(6486002)(86362001)(5660300002)(66066001)(316002)(186003)(81166006)(81156014)(8676002)(486006)(26005)(6436002)(99286004)(50226002)(7736002)(8936002)(54906003)(97736004)(3846002)(59246006)(1076003)(476003)(2616005)(1671002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3069; H:MN2PR12MB2878.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 1KrobSzDhTHKZqSOvgg4RZ0PE4I4dXtGfBMh6WnuO3DPaDEywu5E96I1cLYWv6VAYkhA7bF8oIzS+/TV19VjoGD4S3CjzMsVj1LPoPYjmKQ/XWN6PiZ7fruhqn3NgQWfgBfsuIvzl7s/GtVTCWp/yyOqTaYZGYmuV40ql4jTm4FGh9WhKE7nYljQ5cIFbA4476l6Npj1HvfnTfj9jBDTYpsko0Z9wZh8DdmJ1QaLLixqJlF7l01K7e/1x7XcYgh1977ETekdSiB2w4aPtAFGraTUFogXoAKfgtRw4PCVLhLSOBX7pptJcXMBoazppw3x4HxxIqere149/GqEhSwYzcWDOn8insUrAIp4efviw6vU9Bsk381ofkLS6o3N6tdOyBCiaZu1Hwyy7V6L+/bV5/GaQds8AyaqmtJFnC2QF4c= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c500031-3daf-4f6b-3c93-08d6c6e9b9e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2019 06:14:07.3683 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3069 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Support Opensource , open list , Takashi Iwai , Liam Girdwood , "djkurtz@chromium.org" , "Agrawal, Akshu" , Mark Brown , "Deucher, Alexander" , "Adam.Thomson.Opensource@diasemi.com" Subject: [alsa-devel] [PATCH] ASoC: DA7219: Fix failure in hw_params by not letting set_rate error out X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP We need to set minimum bclk 64x of wclk as this is hw constraint in one of the component used. Since, clk_set_rate and clk is enabled in machine driver the clk_set_rate in hw_params of da7219 fails and errors out and when it tries to override the value. In cases like these not only clk_set_rate of da7219 codec should fail and not override the value but also should not error out. Signed-off-by: Akshu Agrawal --- sound/soc/codecs/da7219.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 5f5fa3416af3..a041dbf442af 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -1621,13 +1621,7 @@ static int da7219_hw_params(struct snd_pcm_substream *substream, if (bclk) { bclk_rate = frame_size * sr; - ret = clk_set_rate(bclk, bclk_rate); - if (ret) { - dev_err(component->dev, - "Failed to set BCLK rate %lu: %d\n", - bclk_rate, ret); - return ret; - } + clk_set_rate(bclk, bclk_rate); } else { ret = da7219_set_bclks_per_wclk(component, frame_size); if (ret) {