From patchwork Thu Jun 20 15:00:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11006941 X-Patchwork-Delegate: neil.armstrong@linaro.org 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 1B82C14BB for ; Thu, 20 Jun 2019 15:02:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BCF22880A for ; Thu, 20 Jun 2019 15:02:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3FF6287B5; Thu, 20 Jun 2019 15:02:54 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A8188287D2 for ; Thu, 20 Jun 2019 15:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jUA2HnTbIR8loP0SpSPPgWY25HWDQpKDDNlg4gxBpuY=; b=ip0FHaSUBu+Ywz RR2+QcEN/WED2blf3J1UZVd2mIOENJEQZ2t2OGMpkpJamJbVlb7hP934TeBWukkMCBNNYZUMoFhkY XW6mIcHMa/WPUhmEHqhrFNhYkdBF4w/opp7mPH78KK5bgX+7+piS89K30zwz/XXqddxNuFipHt4ju UiRXJIwBZAXCHlOo72Dp1PSqL2BXoTejbPIyGBVux1u54TCGLfoGe4bTmCzcye6yK7QJpgIDNCO4R dZnhULd3ta0ewKi3JdTdiA1Hz0tN/TJd9iI9FFdYlwR8ASPeIUyMlWua6nglLzH+HR6J4tw2PF9Oh 73wTBeLTyY3wYJungoZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdyaU-0004fR-3h; Thu, 20 Jun 2019 15:02:54 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdyY4-0003Cl-V3 for linux-amlogic@lists.infradead.org; Thu, 20 Jun 2019 15:00:27 +0000 Received: by mail-wm1-x341.google.com with SMTP id x15so3392077wmj.3 for ; Thu, 20 Jun 2019 08:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QF6xtFv2zQ8ZUqjO9Cs7FIQcWQGqk9AuakROnInyaSE=; b=nSkCypdicbMvzFde8ADW9XsWBHulHw3kmRE8NVsSDhiNU9QV9y34VQOdlTCfxpb+sw X+G3BrQTyvHKj7eQwbrTOepLT7WcjxFVj3A5M89EbKEa9Axioltwu5qzvF9jTkZ8edEN Q4Mv0UdlWa6iOfYosGgzfWMkKj04C3u5usJyfcuEUJWvXRSl8+P3pKsmM3bAyuVPVeD2 kxXfFRjwB47pasGLL+C+A5Qa3ZetS84bsJOjMy1giV4UjPZX6uZubJnzIIv4x86hxMUp 3TIBs5eImSfag7zw6MSXwlV0hnojcV3godzRrRFFRaH5+Voy92CeN5TMVbfUTwHPTiO9 DNGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QF6xtFv2zQ8ZUqjO9Cs7FIQcWQGqk9AuakROnInyaSE=; b=aOtad0S17XtygpDP4wnxlGYWVvf/DOy3U9clcOHOCGqKucHPsDFdZ9aqFrD/JiafYG aR3HzKSdRvfjAYZce3Rks2y67E6T/tpmiiIGh3XpDFsjs+uSmgezRXzmSLHQD2asSX/k gDpCVVhn5xTFP8WXGWx9KBfkURqubSkM4zvO30kgD7HYuq4WG8S9TkARs+EspmLOD81/ 0vHlIdZPn2UmhgPbf1A0dnXz+XEXLKLEiEiK/dKzGso9/o2Ug19oFA0s/E2bUcZnyupe 0lybRjuKjHnkqVNgofOLbf2fSB5wl6DZ+MLuurA+OW5vXY8Noq1SnRLvBA9rUTaWVutr wVVg== X-Gm-Message-State: APjAAAX0RfY+Ncl8aG76oHcoVAGQjs3CsTBpLRXtv/tr7SdAJbqlv+5L 6doCrnWMmBM7YS6ns8NmSXu9Qg== X-Google-Smtp-Source: APXvYqzjmqHVz8xwAG831JB73JOZR/BWWaiZvTceHova+YlkcqDqCYo2mGzLMMF5bUKcnzoT/ZYDHg== X-Received: by 2002:a1c:3c8a:: with SMTP id j132mr52731wma.172.1561042823556; Thu, 20 Jun 2019 08:00:23 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o126sm6802520wmo.1.2019.06.20.08.00.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jun 2019 08:00:22 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com, khilman@baylibre.com Subject: [RFC/RFT 03/14] clk: meson: regmap: export regmap_div ops functions Date: Thu, 20 Jun 2019 17:00:02 +0200 Message-Id: <20190620150013.13462-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190620150013.13462-1-narmstrong@baylibre.com> References: <20190620150013.13462-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_080024_998659_69424FEB X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , martin.blumenstingl@googlemail.com, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The G12A CPU Clock Postmux divider needs a custom div_set_rate() call. Export the clk_regmap_div_round_rate() and clk_regmap_div_recalc_rate() to be able to override the default clk_regmap_div_set_rate() callback. Signed-off-by: Neil Armstrong --- drivers/clk/meson/clk-regmap.c | 10 ++++++---- drivers/clk/meson/clk-regmap.h | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/meson/clk-regmap.c index dcd1757cc5df..26c8c74a8cf0 100644 --- a/drivers/clk/meson/clk-regmap.c +++ b/drivers/clk/meson/clk-regmap.c @@ -56,8 +56,8 @@ const struct clk_ops clk_regmap_gate_ro_ops = { }; EXPORT_SYMBOL_GPL(clk_regmap_gate_ro_ops); -static unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw, - unsigned long prate) +unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw, + unsigned long prate) { struct clk_regmap *clk = to_clk_regmap(hw); struct clk_regmap_div_data *div = clk_get_regmap_div_data(clk); @@ -74,9 +74,10 @@ static unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw, return divider_recalc_rate(hw, prate, val, div->table, div->flags, div->width); } +EXPORT_SYMBOL_GPL(clk_regmap_div_recalc_rate); -static long clk_regmap_div_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +long clk_regmap_div_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) { struct clk_regmap *clk = to_clk_regmap(hw); struct clk_regmap_div_data *div = clk_get_regmap_div_data(clk); @@ -100,6 +101,7 @@ static long clk_regmap_div_round_rate(struct clk_hw *hw, unsigned long rate, return divider_round_rate(hw, rate, prate, div->table, div->width, div->flags); } +EXPORT_SYMBOL_GPL(clk_regmap_div_round_rate); static int clk_regmap_div_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) diff --git a/drivers/clk/meson/clk-regmap.h b/drivers/clk/meson/clk-regmap.h index 1dd0abe3ba91..d22b83fb9bad 100644 --- a/drivers/clk/meson/clk-regmap.h +++ b/drivers/clk/meson/clk-regmap.h @@ -78,6 +78,11 @@ clk_get_regmap_div_data(struct clk_regmap *clk) return (struct clk_regmap_div_data *)clk->data; } +unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw, + unsigned long prate); +long clk_regmap_div_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate); + extern const struct clk_ops clk_regmap_divider_ops; extern const struct clk_ops clk_regmap_divider_ro_ops;