Return-Path: Received: from mail-bn3nam01on0104.outbound.protection.outlook.com ([104.47.33.104]:36491 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934170AbeCCWeM (ORCPT ); Sat, 3 Mar 2018 17:34:12 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Chen-Yu Tsai , Maxime Ripard , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 109/219] clk: sunxi-ng: a33: Add offset and minimum value for DDR1 PLL N factor Date: Sat, 3 Mar 2018 22:28:59 +0000 Message-ID: <20180303222716.26640-109-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Chen-Yu Tsai [ Upstream commit 68f37d862403e8f95337b2eca90af15d0b8cd5d7 ] The DDR1 PLL on the A33 is an oddball amongst the A33 CCU clocks. It is a clock multiplier, with the effective multiplier in the range of 12 ~ 255 and no offset between the multiplier value and the value programmed into the register. Implement the zero offset and minimum value of 12 for this clock. Fixes: d05c748bd730 ("clk: sunxi-ng: Add A33 CCU support") Signed-off-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c b/drivers/clk/sunxi-ng/cc= u-sun8i-a33.c index e1dc4e5b34e1..bdbaf26f551f 100644 --- a/drivers/clk/sunxi-ng/ccu-sun8i-a33.c +++ b/drivers/clk/sunxi-ng/ccu-sun8i-a33.c @@ -159,13 +159,17 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_de_clk, "= pll-de", BIT(28), /* lock */ CLK_SET_RATE_UNGATE); =20 -/* TODO: Fix N */ -static SUNXI_CCU_N_WITH_GATE_LOCK(pll_ddr1_clk, "pll-ddr1", - "osc24M", 0x04c, - 8, 6, /* N */ - BIT(31), /* gate */ - BIT(28), /* lock */ - CLK_SET_RATE_UNGATE); +static struct ccu_mult pll_ddr1_clk =3D { + .enable =3D BIT(31), + .lock =3D BIT(28), + .mult =3D _SUNXI_CCU_MULT_OFFSET_MIN_MAX(8, 6, 0, 12, 0), + .common =3D { + .reg =3D 0x04c, + .hw.init =3D CLK_HW_INIT("pll-ddr1", "osc24M", + &ccu_mult_ops, + CLK_SET_RATE_UNGATE), + }, +}; =20 static const char * const cpux_parents[] =3D { "osc32k", "osc24M", "pll-cpux" , "pll-cpux" }; --=20 2.14.1