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: 9417821 X-Patchwork-Delegate: sboyd@codeaurora.org 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 2516160459 for ; Tue, 8 Nov 2016 17:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1732C28977 for ; Tue, 8 Nov 2016 17:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AD3329032; Tue, 8 Nov 2016 17:25:07 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B965528977 for ; Tue, 8 Nov 2016 17:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754047AbcKHRYv (ORCPT ); Tue, 8 Nov 2016 12:24:51 -0500 Received: from up.free-electrons.com ([163.172.77.33]:53337 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933447AbcKHRYA (ORCPT ); Tue, 8 Nov 2016 12:24:00 -0500 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org 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: Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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;