Message ID | 20181026144344.27778-3-jagan@amarulasolutions.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A81B014BD for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 26 Oct 2018 14:46:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A7D22B226 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 26 Oct 2018 14:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8FC2C1BE; Fri, 26 Oct 2018 14:46:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF5682B226 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 26 Oct 2018 14:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tBJqYj1vAsKEN9SmtYCmf5hsl415LpdR95FuPe2Ywt4=; b=BKUHf5eoHz4eF4 0S1xmiQSIa4gzrkO7mQUYbnXik2H6TR6ZbNmk2NJVrGzj+J3EwckZd3KXjkNMeXfZbthRu++5Uney 0nHakUVY8mLbQlRccVE0+rZIKNSYXurOgpOJ/q+eDChpMqg9DDhs9L5Qz83C5T4GXJz6SDSjaUKv4 ePSUub8eaauAZ+kexSo0fVqpY05ttRimUOQWDg7Ux0AAVc/JAlmwDBO413fjv6Kl5UVfShBZJfn3e C+pO1+qkZLMvLBI4XapSmW1hE99Ab+eXeXYio0U1yqr/3yk8/OtK3G42IrFAVCFGqTGa1hPVdsRIZ s8IaNtPkteHmObQb7yFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3N9-0002jY-Hb; Fri, 26 Oct 2018 14:45:59 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Lm-0000p9-JX for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:44:43 +0000 Received: by mail-pg1-x544.google.com with SMTP id i4-v6so635300pgq.9 for <linux-arm-kernel@lists.infradead.org>; Fri, 26 Oct 2018 07:44:24 -0700 (PDT) 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; bh=ZqT7S7ccSlN0Z4oiBOZYnQBnDGQDeTm2f/tIRaoUEO4=; b=IwQkeVkXMNjUbqG8HwSVKIlFeG2UDJLGlpb32wDzc5jnDs0TKyi8UfQ8Otm3LgsIyn YhgeEihQGExInby1uQLx0bNRQbdAc18wdR1WUphI5NzDUErZJL62BKY36F1lQ9OobsBJ c539CFIjvY1RMhiGduAsTT6tjYoNdJJB4F29I= 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; bh=ZqT7S7ccSlN0Z4oiBOZYnQBnDGQDeTm2f/tIRaoUEO4=; b=FdQYCEQZjdjnC8EF1RbFNTbKBb4MYvYD/kOuGGCO2xVzVEoZNJI/xXOkkoIDMQ/lKH 6a4M2Vhj/Axj11YAhtNtGsL5hu8XBywNPBtWb1nWgx4n4lKQJf8HbHhB/7BZVHxX/Dpv nWMkb0QQXVkkAmDnBt6gYftWXGUwhwszAZAZrRqaUzGPICTa4nNzOVv4nrMKrefBR+za wwnbmL2zWXQjn4r3gL+RQHZ+P/kF/wqV6kV4ApDT9Ll+mLUmRrgvc6rC1+FSIdpjehY5 /6sRzkiNNmFTLmbktfWZidxhLcRlsLIW0WqrnXzVw7+7KH0GKSLb2msqeiQCiDx5bSvb ip5w== X-Gm-Message-State: AGRZ1gIm+3sfyUIQOT1yc6J7ipgFYHO3846oX5zhseg2Q2bvJwgRnKGv C3XVef2CLjTVKUMbPD/A8kagMA== X-Google-Smtp-Source: AJdET5dwXUrFOyiMpZ7HyN1IfRqpZo8uWMppQAsUlS9mUf0ioXHLoBiT2n/c/xkE2UhLRT+xsEUqxg== X-Received: by 2002:a63:b218:: with SMTP id x24mr3606180pge.223.1540565063890; Fri, 26 Oct 2018 07:44:23 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:23 -0700 (PDT) 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 Subject: [PATCH v3 02/25] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Date: Fri, 26 Oct 2018 20:13:21 +0530 Message-Id: <20181026144344.27778-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074434_694510_AEF542C9 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Jagan Teki <jagan@amarulasolutions.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
drm/sun4i: Allwinner A64 MIPI-DSI support
|
expand
|
diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index 841840e35e61..d17539dc88dd 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -125,6 +125,13 @@ 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) { + rate = nkm->min_rate; + if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) + rate /= nkm->fixed_post_div; + return 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; };