From patchwork Mon Apr 9 13:59:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 133040 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp284704ljb; Mon, 9 Apr 2018 06:59:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/a7eUq2BL6GTLmBP9N7eAR2ULNMULuEh6QnBMoOnuLxGo6auLGFyj3Pk756uLzhkydPWCs X-Received: by 10.99.160.25 with SMTP id r25mr24329022pge.95.1523282375970; Mon, 09 Apr 2018 06:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523282375; cv=none; d=google.com; s=arc-20160816; b=aZbVKEjF+p8CDEtQCRM4ptyXzYZrN4wmyplbqB1qS3BHa+LXc1wRebp9A9h87EWLSO m9OonNcPl7aBYKuGlvkxUTxafRB3HU8bhgfeBR4XnqmNno4zJQcqxIJfIqDKUFg2jnbB 7IPDxvRcKwK/BI+DH/BFuOzM2Ce7Z3b3hnPahmSIltv5YVhkSxZLXJVffKYsvIzwF9Xf TUSnpfy+3k60+AjAkYHaslX+mnsYFgKbfVSLHBdiIQyt3s3vg/2yZAco52WdPblnd971 NQeyU1KTQyD61NRVBVqzU0VUdiyAdHJmqgx8vaZeFctbzmvwvIHELdwVNHl8kGnDSIOk HQ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BOAfj0iWUbatIOUZMICI87rUsfw/TA4iaHHCD15/opg=; b=Cl97CmouLIpULVmRghJirMwSdVAWobZNXZXtS6HJXCz4uKVrQHGAtANyDlQj4Le1dy B8n3d+W7gzzlxVDNEbURJp2wZo6VhA6H0YbKvjLtZrZLqBJFj7wIITiPOPu27jOEQZtx PA06iiG1W82cO1kOh6Dv885iRaIxCflo+h/IoHCDcsRBx/+Rst5W8JMCAa3ghx/kmOAe FQUoe0lPrs9lDoLzRkxttmWuX4OtpiiYhveoZF4iU4+3G1W/PrsmrR9TCMVs8U2MoN58 xt08ZFHYXiWZgERF4fqPNms6s+LWQ/FRxcm0ckUKqO5yykZt4NghdesYoh16grU8jdl5 tFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Xjy1mePr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21-v6si363630pln.749.2018.04.09.06.59.35; Mon, 09 Apr 2018 06:59:35 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Xjy1mePr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752917AbeDIN7d (ORCPT + 29 others); Mon, 9 Apr 2018 09:59:33 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:53410 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbeDIN73 (ORCPT ); Mon, 9 Apr 2018 09:59:29 -0400 Received: by mail-wm0-f67.google.com with SMTP id 66so13060471wmd.3 for ; Mon, 09 Apr 2018 06:59:28 -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; bh=BOAfj0iWUbatIOUZMICI87rUsfw/TA4iaHHCD15/opg=; b=Xjy1mePrfoTHlRLtlJ2sYelvcoYXMaQIP34kBaIrmiwFtzTPps0JihEzGn21bjkTqd T62MScT55Gi8tv7jObOIRA3ST7mHo9GGsQOw1krl/KyJcox8cLHoDocj6DV1K5HmbL54 ilz4vMD0KS1L/GBXoCQhn1mJFBjCcBjZp+2YNfy8eleGcjUPzFg4Yk5tbh/CtPPuaqc6 xFxn+2qvWgau3aSLCz1lT1lHClgUmOHZwMjjFHu2alFM25/eILcran66ks8h2qFuyktA gRXKqn/dieFqfKZ2B7DCrrGnOE3ofGA9kBMgjlqzsFQfnNWn26ZROCIfio/u4/G739mU RdBA== 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; bh=BOAfj0iWUbatIOUZMICI87rUsfw/TA4iaHHCD15/opg=; b=lvjPd8QcwRKWnRgCKciE/VOH97qTtEuyI6aT2H8W659fzzRyIUffu2/3GEfRbNMDPh FUQW/vSzv0Tc8W+WMngmsm5LtCMl33ejF6ZZdVQ7EXKpVYN0vf7yIGkfdfHtVDT2yMmy QTsIqrTjIWkm85EXM3JV9M6Vwx0yNmltIhZ2X0OMn84ojf8qllx53ehCxPOiKACKLvlU p35UFzTjOPLZkA46ri41Z5ytH4GtJ6d2wmKJDw9Z+iI5vFRvKeoGfXJX9Rp/9jerW1aR T252hM/OD6+aNuzhbnBphnYtSZ61+GPjfT+CxNxR3lzEl4MaPPYK//ELW2DJyOdEXBDy tVjA== X-Gm-Message-State: ALQs6tCDICJbEaaLtKaZozUgdTd6HmPmem3y4xPiqo6SW/5I074aAtID v2b2b+nKV09Yve5752DC25Vybw== X-Received: by 10.28.157.68 with SMTP id g65mr74478wme.31.1523282368172; Mon, 09 Apr 2018 06:59:28 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id h7sm944684wme.0.2018.04.09.06.59.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 06:59:27 -0700 (PDT) From: Jerome Brunet To: Stephen Boyd , Michael Turquette , Neil Armstrong Cc: Jerome Brunet , Kevin Hilman , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 2/2] clk: meson: honor CLK_MUX_ROUND_CLOSEST in clk_regmap Date: Mon, 9 Apr 2018 15:59:21 +0200 Message-Id: <20180409135921.5617-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180409135921.5617-1-jbrunet@baylibre.com> References: <20180409135921.5617-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using __clk_mux_determine_rate effectively ignores CLK_MUX_ROUND_CLOSEST if set the related clk_regmap mux instance. Use clk_mux_determine_rate_flags() to make sure the flag is honored. Fixes: ea11dda9e091 ("clk: meson: add regmap clocks") Signed-off-by: Jerome Brunet --- drivers/clk/meson/clk-regmap.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.14.3 diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/meson/clk-regmap.c index 3645fdb62343..ab7a3556f5b2 100644 --- a/drivers/clk/meson/clk-regmap.c +++ b/drivers/clk/meson/clk-regmap.c @@ -153,10 +153,19 @@ static int clk_regmap_mux_set_parent(struct clk_hw *hw, u8 index) val << mux->shift); } +static int clk_regmap_mux_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct clk_regmap *clk = to_clk_regmap(hw); + struct clk_regmap_mux_data *mux = clk_get_regmap_mux_data(clk); + + return clk_mux_determine_rate_flags(hw, req, mux->flags); +} + const struct clk_ops clk_regmap_mux_ops = { .get_parent = clk_regmap_mux_get_parent, .set_parent = clk_regmap_mux_set_parent, - .determine_rate = __clk_mux_determine_rate, + .determine_rate = clk_regmap_mux_determine_rate, }; EXPORT_SYMBOL_GPL(clk_regmap_mux_ops);