Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp3972805imc; Sun, 24 Feb 2019 18:12:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IY695ik7iqsPAsQfFV83s/a4nAw0JicrWOu6kiZvHsu9ia97pm3nPKl9z2uzmvktxdG/TFs X-Received: by 2002:a17:902:8d8e:: with SMTP id v14mr17497887plo.133.1551060732324; Sun, 24 Feb 2019 18:12:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551060732; cv=none; d=google.com; s=arc-20160816; b=ly6EVQ0+hms8IDLV67eAsmFsk7UuxOJ2f24CaVSr/zQOMkXQ3ISjmg6wDKnwX4brjs JgcArsKHgv8VWTb8WBKIXSpf2TUiLYMzcW1zyMze/AuoQKTC+ZpbEuyBXFSr8hq9kriG 8Rrwp+rlJSkW7qsdtJfFa6VzPOOJA2jU2JE2oP+gEOBOgt89sUuQvUvIetH+ZhgFhY0M 0p49n0u0ZdsTjRIV6cDt4WK+dGAsCcwnnRnxHlLCzi8NF1ZlBwsEtfWbMhaIytIxV3N+ H0J5QePsCh1geqvShS4gLwnpywRpNOE0K8SYQ9vDpiMo7GwxBUN4aAlRlXVeEz0qNUii 4a1A== 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; bh=fr1H71I8fJ1hMF2myrLGW7gMA16wzljVe5x3cSjwKSg=; b=Gv2Gr6ni1J4Vdp+jkr87IRttFlb4ggBWqxJaD2soHorrRjMFicNuNDW6nzyO8WjWa2 hBM1Lkt9Uxl15U4qXv6jPHg7/iGjDeBUQsb4HZsQxWf+LwqSya6urlWILVDgNEFjQZ8r guswchH5NG9Iikj3wTRgcXls2lbCjId5thi40NSdIGsmIfe3dgKxAiLNhWQ9aW58qY46 DE09NPnbNEq/4al38oQ1vfOiJlE5l6wt5BZdWg0eO8vWqWIXpRME+5YfHH1fJ/1XWT5d iWg4Pdp0axFBEkXw1seoy8k7jF2BizfpbCS4VjkWdKp7Cm7hZhvKg6KU2hcswNqiPHER 0XNA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si8078442pfg.5.2019.02.24.18.11.56; Sun, 24 Feb 2019 18:12:12 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728564AbfBYCJu (ORCPT + 99 others); Sun, 24 Feb 2019 21:09:50 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:35792 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727537AbfBYCJu (ORCPT ); Sun, 24 Feb 2019 21:09:50 -0500 X-UUID: f2de0da55d91489f9118de8205985c87-20190225 X-UUID: f2de0da55d91489f9118de8205985c87-20190225 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1757952975; Mon, 25 Feb 2019 10:09:36 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 25 Feb 2019 10:09:35 +0800 Received: from mszsdaap41.mediatek.inc (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 25 Feb 2019 10:09:34 +0800 From: wangyan wang To: Michael Turquette , Stephen Boyd , CK Hu CC: wangyan wang , Matthias Brugger , Philipp Zabel , David Airlie , Daniel Vetter , chunhui dai , Colin Ian King , Sean Wang , Ryder Lee , , , , , , Subject: [PATCH V6 5/8] clk: mediatek: add MUX_GATE_FLAGS_2 Date: Mon, 25 Feb 2019 10:09:09 +0800 Message-ID: <20190225020912.29120-6-wangyan.wang@mediatek.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190225020912.29120-1-wangyan.wang@mediatek.com> References: <20190225020912.29120-1-wangyan.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: chunhui dai Add MUX_GATE_FLAGS_2 for the clock which needs to set two falgs. Such as some mux need to set the flags of "CLK_MUX_ROUND_CLOSEST". Signed-off-by: chunhui dai Signed-off-by: wangyan wang --- drivers/clk/mediatek/clk-mtk.c | 2 +- drivers/clk/mediatek/clk-mtk.h | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 9c0ae4278a94..2ed996404804 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -167,7 +167,7 @@ struct clk *mtk_clk_register_composite(const struct mtk_composite *mc, mux->mask = BIT(mc->mux_width) - 1; mux->shift = mc->mux_shift; mux->lock = lock; - + mux->flags = mc->mux_flags; mux_hw = &mux->hw; mux_ops = &clk_mux_ops; diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h index f83c2bbb677e..4b88d196d52f 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -81,15 +81,13 @@ struct mtk_composite { signed char divider_shift; signed char divider_width; + u8 mux_flags; + signed char num_parents; }; -/* - * In case the rate change propagation to parent clocks is undesirable, - * this macro allows to specify the clock flags manually. - */ -#define MUX_GATE_FLAGS(_id, _name, _parents, _reg, _shift, _width, \ - _gate, _flags) { \ +#define MUX_GATE_FLAGS_2(_id, _name, _parents, _reg, _shift, \ + _width, _gate, _flags, _muxflags) { \ .id = _id, \ .name = _name, \ .mux_reg = _reg, \ @@ -101,8 +99,18 @@ struct mtk_composite { .parent_names = _parents, \ .num_parents = ARRAY_SIZE(_parents), \ .flags = _flags, \ + .mux_flags = _muxflags, \ } +/* + * In case the rate change propagation to parent clocks is undesirable, + * this macro allows to specify the clock flags manually. + */ +#define MUX_GATE_FLAGS(_id, _name, _parents, _reg, _shift, _width, \ + _gate, _flags) \ + MUX_GATE_FLAGS_2(_id, _name, _parents, _reg, \ + _shift, _width, _gate, _flags, 0) + /* * Unless necessary, all MUX_GATE clocks propagate rate changes to their * parent clock by default. -- 2.14.1