Message ID | 20181113111633.20189-3-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBL7FVLPQKGQERWRWVJY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id B7D082E0834 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 13 Nov 2018 12:17:04 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id 190-v6sf10086473pfd.7 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 13 Nov 2018 03:17:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542107823; cv=pass; d=google.com; s=arc-20160816; b=IiRo9pR2d8scU/5vRSEYEMFABsdxnRyWZo8bwKNkVux4PAESddoMNnSBIT9ruub06G b0kXIRDpSeB6WW8U4qrtN3nBj97d0XLJ3VmvMsybTy54DndzTS1mRpp41egeYbKsWIYQ GuLcag/oMsb+L1fSNy6mzBVh0N5jVrcgDIBUbJRsTfND6BLQKDSkh+GBEeIfm+KLqIe2 AIAAJWkJv+BEqo9b7hvQ2Yzw0wqXhAWIQBMjupD4reW8OYVbbxXXCifaiTg+7YA3dUex PrnoT1lFFm1ZI+a+fzmnb2/Doat9PTC8gocuc2o0B/rW3mgTBLkalQIH8OnlTNLaf9x2 W4Iw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yqEP2BzZ2jXeAZHhd1kTnxj7Hp6aFHA67iUShP1YZAg=; b=gUAEmJutXCPBfWPXOGlRd6g0+ElEGdS90UtBOgMhG9I+NQFAIkqveGQ4NshkZn0GBN tGwVyv/XraaFDZO48dTWWOcOCnCTjmxlXoUib8cqiOwFnUbSHh2rvC1u4AmlCgr9Mr1Z 7JysVWX0ITKNHAQHBdjq4h3nwcOsP/W6nSbYZZeJwoa3FFPnOTL8LwmisrmDmZowEUhX GalG4O55J7QsYh850nxPMYVaa4lLknc7KhCLESE8wcTBXFqIBRb0ATVzJIlZQZHIwXC6 QuqU3Fk0QwomOnJodTkE9ZYcAWDxv8HRM/kqsh3BFiynnqo3lf84oX/VyfzZWiiF4hu2 rQBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CT5tzK3F; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yqEP2BzZ2jXeAZHhd1kTnxj7Hp6aFHA67iUShP1YZAg=; b=pFZNrfuZFb4BJ9kqq5eILidrf3Xqe3YPHfCMgigolARd0gla1fp02FsJfp9+GLqgQV KGu1BuQpoV9ItijK24oHbPGYYSyO+uHv+D4eLJ9GV0ysTneBd5xZGGtHW7SdrpJiEbgM IbXTkh8VNrelH0ufuYY7xw5GbWZH3eNsqcs1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=yqEP2BzZ2jXeAZHhd1kTnxj7Hp6aFHA67iUShP1YZAg=; b=NG/uB8w6+ju3jax26L9W54S+fOx4RAvRvNL4Cj8vQrSgOLMCChP+ufRAEL5TK3atyk GM+GtDglo/vO+sovER/2sH1RGXCouY0j8zfQac837JGNqVpNI+voWEixSuklRJYgqhN8 xz0DL6XZpjsctQ+C/Dv6J8C7zfIfXUu2LVBftMcn+GUr/HQEi0x4trmBXhC/Dx0DZ2US UH+uMqIk8d+BL4qZNCjPtFC5io5PHYViGG1EwROV/uUzzwG6ilS4uMoeTw1Qha35XipB kFxKuxm3egj117x+nKez1ePI/XQp9PmVhyIHqJ3Maw2MoGkQB0azboKrMg31v5Rs26cJ XVIQ== X-Gm-Message-State: AGRZ1gIhogPVVwJ0ico4gDemRl/cGzcI/aJSKSGxLbqQut3c97BAl0WX eWl9jkD+/ewY6n4FDtAb4oVatiDA X-Google-Smtp-Source: AJdET5dO4FFOUeGUhpc8HGb0m/ahMF5qrfYVEfY2oTF5U2O+bBCOP8D9etTu6gBItJq2QrVIgsDzAA== X-Received: by 2002:a62:f803:: with SMTP id d3-v6mr1320624pfh.88.1542107823453; Tue, 13 Nov 2018 03:17:03 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9687:: with SMTP id n7-v6ls4305180plp.10.gmail; Tue, 13 Nov 2018 03:17:03 -0800 (PST) X-Received: by 2002:a17:902:d206:: with SMTP id t6mr4727522ply.193.1542107823140; Tue, 13 Nov 2018 03:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107823; cv=none; d=google.com; s=arc-20160816; b=VpQx/+R7jQh2Ur6Kns1HmZrZeNItP35ikfTJTuakmQryuyvA6LETxy41E5N2T6YPzA NROIUHZkxHoiFzo4xr73sYJRc/edLh6hgKZRmvsgwIR0gwu2qviWTeDltvhfcPNLvhnq EcO6YHybxAh+G7LeWCoIGV6aalYKsMlUZTs91vVaMeZxcI8tNqWYF1/SMFNWOhkFzO1p 4ikUiBCfCY7iRVw/rYJ1FBvNq3NcELABI8lN3cvtpuNa30iHgH7uSDgc2v3+5gIArvo5 B1lUW98+8EYzCeSKCyNffV/4QvwcHKMiIwzkKM3YZBLOMa6FH20UcRcoL6wXCu9jvFN0 rQ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yqEP2BzZ2jXeAZHhd1kTnxj7Hp6aFHA67iUShP1YZAg=; b=wD2UGW2Ut1AbK8ofRg2aHCt2oDEF22nAe0hY2f3qFHNFgutb0zGxCM4Whf2swcGP7a STu9yHbChcVpIEzfa1h0MSCm0K6zoJfS+mhWObiQXpobdiYNsQ7FN7MblO7odHT+Hflu Jn8DPa42l+Lrzr0ShW0RcxA/3tnyaGG/b6XTAqfvzcse4QZMW/j7bPB253/HleIk69A2 9NBDaHb1h8VjGiLcOPEMAynNHyVO4RToom0sVLkrgd2mirezaAdikqbWKJ1eKz9/Utwx I22n/fd6DPdvYntprfDfcTt8OdZjKX4f0vzA44rFAvluteK003a3NtBiJrGF1amXlmel 6qdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CT5tzK3F; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s17-v6sor24133901pfi.2.2018.11.13.03.17.03 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 13 Nov 2018 03:17:03 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:1709:: with SMTP id 9mr3422529pfx.249.1542107822825; Tue, 13 Nov 2018 03:17:02 -0800 (PST) Received: from localhost.localdomain ([2401:4900:3670:3f11:bc71:2ef7:4a39:e260]) by smtp.gmail.com with ESMTPSA id 27-v6sm28531377pfm.36.2018.11.13.03.16.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 03:17:02 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, Icenowy Zheng <icenowy@aosc.io>, Jernej Skrabec <jernej.skrabec@siol.net>, Vasily Khoruzhick <anarsoul@gmail.com>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, linux-clk@vger.kernel.org, Michael Trimarchi <michael@amarulasolutions.com>, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Cc: Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v4 02/26] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Date: Tue, 13 Nov 2018 16:46:09 +0530 Message-Id: <20181113111633.20189-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181113111633.20189-1-jagan@amarulasolutions.com> References: <20181113111633.20189-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CT5tzK3F; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index 841840e35e61..6b5ad990f802 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -125,6 +125,9 @@ static unsigned long ccu_nkm_round_rate(struct ccu_mux_internal *mux, if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) rate *= nkm->fixed_post_div; + if (rate < nkm->min_rate) + return nkm->min_rate; + ccu_nkm_find_best(*parent_rate, rate, &_nkm); rate = *parent_rate * _nkm.n * _nkm.k / _nkm.m; diff --git a/drivers/clk/sunxi-ng/ccu_nkm.h b/drivers/clk/sunxi-ng/ccu_nkm.h index cc6efb70a102..ff5bd00f429f 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.h +++ b/drivers/clk/sunxi-ng/ccu_nkm.h @@ -35,6 +35,7 @@ struct ccu_nkm { struct ccu_mux_internal mux; unsigned int fixed_post_div; + unsigned int min_rate; struct ccu_common common; };