Received: by 10.213.65.68 with SMTP id h4csp14022imn; Mon, 19 Mar 2018 17:55:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELsy5JbSCAGSQQ+Uw5zMhZyO7/AVfhczHtu3QhSG1iuRFXE1Fp6lKDWUlvpY0W4r5nOKh4Iy X-Received: by 2002:a17:902:5845:: with SMTP id f5-v6mr14735646plj.164.1521507346768; Mon, 19 Mar 2018 17:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521507346; cv=none; d=google.com; s=arc-20160816; b=z+8srTKRutajv54HqLmXMuY5hJUTWkpjDNA/KuwrXP3MRIzinExQP4QX/iuqKNTNy/ RgPtTGnyC/w5IuVbtslhppRfIZ7jn8SbQ+z5XtV7GDDP+9o3BJpzw4MGHqS+gQ9LtcAm E8uEveCgP83voqGfAgfEcPTHCo7qh8qLndOL0SKB31kct+Oc4csMT/kJu3JpTlZyjCw5 yFMiA65GWEqTbe7gad2dz2/vkxdtIW85+Xyqri5g5BW8D+a57Pg7V8fl881fXkeviJai py8gqDdJz9lBhKpFSp7FIJHKblmLN5isPIjBDYIxpAIeUFufeRrCT7vmB9UZidCVJgK1 DRaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nzWCiPfi+kBEZCcAxheY9G0eIVn+sDejiv4kULv1dRE=; b=xvhNgYkWv+mUA2jBa53OJs5cQW4/8qlEJ94G9DI1yG4efTbOqPvMumN+xkisQy9ERQ wxe9PnfWwusRk4jw2Ilrs/qcQt/5FTpSFnxCO6oyEKXn9SLeVELjdZuVIJ/Do/79fDMQ SioZ6aCHuRgfEiaCrRYzli5wYd1+KmCh1T9N2LLIVIrSPpygXRPWMUnDHA9mR+yIzHes GpDargjrjSI5I5x0sZpALXkWSqxByrgkqlmQucboquTPwg+dQYvKoFb4JLp7hoM0u+9G GbRt9EUKnIqTIxOdlqNEstHoIx/0EP68IXp2CbAM/q9Fap9A4ChjviZREutJdz99/73j YRgA== 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 34-v6si455849plp.252.2018.03.19.17.55.32; Mon, 19 Mar 2018 17:55:46 -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; 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 S969648AbeCSSYW (ORCPT + 99 others); Mon, 19 Mar 2018 14:24:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49862 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969631AbeCSSYS (ORCPT ); Mon, 19 Mar 2018 14:24:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3A3A2F46; Mon, 19 Mar 2018 18:24:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Maxime Ripard , Sasha Levin Subject: [PATCH 4.9 106/241] clk: sunxi-ng: a33: Add offset and minimum value for DDR1 PLL N factor Date: Mon, 19 Mar 2018 19:06:11 +0100 Message-Id: <20180319180755.581634748@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) --- 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( BIT(28), /* lock */ CLK_SET_RATE_UNGATE); -/* 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 = { + .enable = BIT(31), + .lock = BIT(28), + .mult = _SUNXI_CCU_MULT_OFFSET_MIN_MAX(8, 6, 0, 12, 0), + .common = { + .reg = 0x04c, + .hw.init = CLK_HW_INIT("pll-ddr1", "osc24M", + &ccu_mult_ops, + CLK_SET_RATE_UNGATE), + }, +}; static const char * const cpux_parents[] = { "osc32k", "osc24M", "pll-cpux" , "pll-cpux" };