From patchwork Tue Nov 8 17:23:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 9417843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 04B2960459 for ; Tue, 8 Nov 2016 17:26:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA66B286D7 for ; Tue, 8 Nov 2016 17:26:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF431286F7; Tue, 8 Nov 2016 17:26:52 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 98C9E286D7 for ; Tue, 8 Nov 2016 17:26:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4A9I-0004IQ-3V; Tue, 08 Nov 2016 17:25:28 +0000 Received: from up.free-electrons.com ([163.172.77.33] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4A86-0002bB-U4 for linux-arm-kernel@lists.infradead.org; Tue, 08 Nov 2016 17:24:17 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 9560920CEA; Tue, 8 Nov 2016 18:23:53 +0100 (CET) Received: from localhost (LFbn-1-2281-83.w90-76.abo.wanadoo.fr [90.76.98.83]) by mail.free-electrons.com (Postfix) with ESMTPSA id 690AF20D9A; Tue, 8 Nov 2016 18:23:25 +0100 (CET) From: Maxime Ripard To: Mike Turquette , Stephen Boyd , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 5/10] clk: sunxi-ng: Implement multiplier maximum Date: Tue, 8 Nov 2016 18:23:09 +0100 Message-Id: <1d12cf2cb0a7364f17691705f3bd018eddc51202.1478625788.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161108_092415_425196_8E6318B7 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Maxime Ripard --- drivers/clk/sunxi-ng/ccu_mult.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu_mult.h b/drivers/clk/sunxi-ng/ccu_mult.h index 84839641dfdf..524acddfcb2e 100644 --- a/drivers/clk/sunxi-ng/ccu_mult.h +++ b/drivers/clk/sunxi-ng/ccu_mult.h @@ -10,24 +10,26 @@ struct ccu_mult_internal { u8 shift; u8 width; u8 min; + u8 max; }; -#define _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, _offset, _min) \ +#define _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, _min, _max) \ { \ .min = _min, \ + .max = _max, \ .offset = _offset, \ .shift = _shift, \ .width = _width, \ } #define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, 1, _min) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, 0) #define _SUNXI_CCU_MULT_OFFSET(_shift, _width, _offset) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, _offset, 1) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, 1, 0) #define _SUNXI_CCU_MULT(_shift, _width) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, 1, 1) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, 1, 0) struct ccu_mult { u32 enable;