Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2905617ybh; Mon, 5 Aug 2019 08:43:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwrE8dIhOIYS6TdUqeyYFr6PDha2p7llP54yIx+JoEH7OGfD6dB1cEXWq72XMicZxWvx4C X-Received: by 2002:a17:902:bd94:: with SMTP id q20mr135017941pls.307.1565019817212; Mon, 05 Aug 2019 08:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565019817; cv=none; d=google.com; s=arc-20160816; b=z5JHRf/x0CKewGNHQMmrGQXQMCt4ozbuotxM8h6CfXUVbXjrC+0Wxnj0ZUnenfddj6 DKyfz3gZV9BJSLEwbXpt/d1e12KzK4hKGloWHulZuQbEu6GjDy/N5WG1BBMv1c60S5gl oqoJRotkR0UWKZvOhAhwufMwGrx5Hveu7Z9jwbMO9quK0IMPH8oL3fBYsF9YQft4qhjf duAxHhvp5XfgZtfgYDMQE5EwwCTxycdubzJLRQj0BwWrbuoIxy0J3oKAs8FopfnYwueM 39U3SS3QfKQdwqpODi54BSKfUUTIH/B826vrIKxgHLF4alYWUckBRPfENHH6YidTcgdo +/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=AtOcpJpXKAqLOT0x2MtompdfUMs9fCHSuI7HgAVfG4Q=; b=BmRC2tZCy8t3y6UBDbO3hyzds5wdW6tRUKxeXCm7HflMP5+dihySd0+8fh9C1nVLOh eRBGbDvz2pf6+8w7euivFA/PgL9geqx/uk87LDLkyK8w7pi4skKQ8wkax9BQimNJn0zX eD2s0kBtWpgqUrRPkmqP4jWGlpohTyV+hUr9mFFgvgTDalCMu6huaQitoqAeu0efWMZR /wq5y9jOgGUQbZ1Mw1bKAAmmGeiTvbcrMYKIkNf1KBQS1WyMMgNgFSx64zFPv8SoBloj 7NZQshKRmEg/Es0NOzt/FeHv3HuZtqkAZWLZHqz/RaWnV8YaRz/VHQ/OeTkzzJ0Gq/2T Bwhg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si39811688plk.388.2019.08.05.08.43.21; Mon, 05 Aug 2019 08:43:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728988AbfHEPlW (ORCPT + 99 others); Mon, 5 Aug 2019 11:41:22 -0400 Received: from mga01.intel.com ([192.55.52.88]:36573 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728868AbfHEPlW (ORCPT ); Mon, 5 Aug 2019 11:41:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 08:41:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,350,1559545200"; d="scan'208";a="164686579" Received: from nupurjai-mobl.amr.corp.intel.com (HELO [10.251.149.179]) ([10.251.149.179]) by orsmga007.jf.intel.com with ESMTP; 05 Aug 2019 08:41:20 -0700 Subject: Re: [alsa-devel] [RFC PATCH 26/40] soundwire: cadence_master: fix divider setting in clock register To: Sanyog Kale Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Rander Wang References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-27-pierre-louis.bossart@linux.intel.com> <20190805104047.GG22437@buildpc-HP-Z230> From: Pierre-Louis Bossart Message-ID: Date: Mon, 5 Aug 2019 10:41:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190805104047.GG22437@buildpc-HP-Z230> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> @@ -988,9 +989,11 @@ int sdw_cdns_init(struct sdw_cdns *cdns) >> /* Set clock divider */ >> divider = (prop->mclk_freq / prop->max_clk_freq) - 1; >> val = cdns_readl(cdns, CDNS_MCP_CLK_CTRL0); > > reg read of CLK_CTRL0 can be removed. yes for both comments. Thanks for the review Sanyog, appreciate it. > >> - val |= divider; >> - cdns_writel(cdns, CDNS_MCP_CLK_CTRL0, val); >> - cdns_writel(cdns, CDNS_MCP_CLK_CTRL1, val); >> + >> + cdns_updatel(cdns, CDNS_MCP_CLK_CTRL0, >> + CDNS_MCP_CLK_MCLKD_MASK, divider); >> + cdns_updatel(cdns, CDNS_MCP_CLK_CTRL1, >> + CDNS_MCP_CLK_MCLKD_MASK, divider); >> >> pr_err("plb: mclk %d max_freq %d divider %d register %x\n", >> prop->mclk_freq, >> @@ -1064,8 +1067,7 @@ int cdns_bus_conf(struct sdw_bus *bus, struct sdw_bus_params *params) >> mcp_clkctrl_off = CDNS_MCP_CLK_CTRL0; >> >> mcp_clkctrl = cdns_readl(cdns, mcp_clkctrl_off); > > same as above. > >> - mcp_clkctrl |= divider; >> - cdns_writel(cdns, mcp_clkctrl_off, mcp_clkctrl); >> + cdns_updatel(cdns, mcp_clkctrl_off, CDNS_MCP_CLK_MCLKD_MASK, divider); >> >> pr_err("plb: mclk * 2 %d curr_dr_freq %d divider %d register %x\n", >> prop->mclk_freq * SDW_DOUBLE_RATE_FACTOR, >> -- >> 2.20.1 >> >