From patchwork Thu Feb 15 12:49:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 128419 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1711642ljc; Thu, 15 Feb 2018 04:51:02 -0800 (PST) X-Google-Smtp-Source: AH8x225jEsLJgArwMb5ywIAY7UY4jFHwLauxmejNgQ8Tmo+kSFCs3f1iyT1PqfmQDLL79d1IrZWV X-Received: by 10.98.131.139 with SMTP id h133mr2543430pfe.155.1518699062235; Thu, 15 Feb 2018 04:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518699062; cv=none; d=google.com; s=arc-20160816; b=PhlCk/OSholdpJQTX5Ce7DtN+WQG+fQBzJ24Bzddmcu+wkCVskxcaDPZExEoORR8lL MBWKd9tKw0ksaftKnNYdhaLoy2HyZtxPPD9+QBFDrMg9WSwlCA8VliYGV4U+j5qKw5w+ MG0I81hsGqEGmgR94oZ65hrYLRFgq7GH1vleKcdYBr3XaVk7cbvPW5kehY5YbZ7/+bUk IyZrMxWRYRTNskGSGz1zZIN5Tjqqx+6OfiZM4T4zicM92brHqI7i1J0J8Ko2N6d5bPpy 7hd11Bz8mrAfE71fsp6y1fIg+3D90uzB6uXDTvqiQnfcbEQ8DpRZfr6EuHU1+3xRO4GY C9Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=bvWsoVxg0dEQ1jkqrIg/SDLP1yxyy8G507LtM9fvtp8=; b=AHPRxuLQPQppEGbpmT3+c3lwKGHiFoJ4C+3VplhqaTT0LCZFlhQLjH+UyVqAFEEnTR /b2+t4VCqUmN3KQrIgtgprh2Oey4/SJDCXSbFDUVKwkkhb5wp8jiSujTCdYNWkmUDJD0 xT4GejXbADYPirT4xEOpGRoDHQ1nXxg5irzVHHh6Rurmk1fowShEFp+6q+rOIUSEBbV9 n15uI6fllglGRRfjWZz0fXmWH+N4bTkESyuxpzWSe1Y+oFuCoNMIuzQY4Q8Xh3QEk1i6 +SipPMKy0JEBWoXsNiHFhjx2L+Fmx81RLRzLk3A21yw7mUzoF2sHV0PAapEQ+8K5co+g HAmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=xJ5h1NM9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si2411357pgu.551.2018.02.15.04.51.02; Thu, 15 Feb 2018 04:51:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=xJ5h1NM9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031392AbeBOMvA (ORCPT + 6 others); Thu, 15 Feb 2018 07:51:00 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:50156 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030843AbeBOMu6 (ORCPT ); Thu, 15 Feb 2018 07:50:58 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1FCoXjF016586; Thu, 15 Feb 2018 06:50:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518699033; bh=nO9o+CTZYPN96Bjucl1B4bwNvPkrNh6Y8Rz51aGsZWE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=xJ5h1NM94P7mz4LvEYRwauufu0wmnl0kHYXrIeOrBv6h/x8XiVZXMFPxnbgtoB6BY oms6D9j6oJqQ/1eKn/ZpjBBmCte6+ifhaeQFThMQ4ZtUY7VCNEhHr2OwAhZfpdBZZ5 Jzxaj0W8bJA2mCPL4tNDbanqZMd/Cam49CaC7XQs= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1FCoWnk012400; Thu, 15 Feb 2018 06:50:33 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 15 Feb 2018 06:50:32 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 15 Feb 2018 06:50:32 -0600 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1FCoKZF020487; Thu, 15 Feb 2018 06:50:30 -0600 From: Tero Kristo To: , , , , , CC: , , Subject: [PATCH 3/5] clk: ti: add generic support for clock latching Date: Thu, 15 Feb 2018 14:49:49 +0200 Message-ID: <1518698991-10099-4-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518698991-10099-1-git-send-email-t-kristo@ti.com> References: <1518698991-10099-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Certain clocks require latching to be done, so that the actual settings get updated on the HW that generates the clock signal. One example of such a clock is the dra76x GMAC DPLL H14 output, which requires its divider settings to be latched when updated. Signed-off-by: Tero Kristo --- drivers/clk/ti/clk.c | 14 ++++++++++++++ drivers/clk/ti/clock.h | 2 ++ 2 files changed, 16 insertions(+) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 4efa2c9..7d22e1a 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c @@ -275,6 +275,20 @@ int ti_clk_get_reg_addr(struct device_node *node, int index, return 0; } +void ti_clk_latch(struct clk_omap_reg *reg, s8 shift) +{ + u32 latch; + + if (shift < 0) + return; + + latch = 1 << shift; + + ti_clk_ll_ops->clk_rmw(latch, latch, reg); + ti_clk_ll_ops->clk_rmw(0, latch, reg); + ti_clk_ll_ops->clk_readl(reg); /* OCP barrier */ +} + /** * omap2_clk_provider_init - init master clock provider * @parent: master node diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index d9b43bf..2f8af8f 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h @@ -194,6 +194,8 @@ struct clk *ti_clk_register(struct device *dev, struct clk_hw *hw, int ti_clk_add_alias(struct device *dev, struct clk *clk, const char *con); void ti_clk_add_aliases(void); +void ti_clk_latch(struct clk_omap_reg *reg, s8 shift); + struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup); int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div,