From patchwork Sun Apr 24 21:08:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8921761 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6C2CBF29F for ; Sun, 24 Apr 2016 21:11:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBD08201C7 for ; Sun, 24 Apr 2016 21:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA38820259 for ; Sun, 24 Apr 2016 21:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753287AbcDXVKZ (ORCPT ); Sun, 24 Apr 2016 17:10:25 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33128 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbcDXVKS (ORCPT ); Sun, 24 Apr 2016 17:10:18 -0400 Received: by mail-wm0-f66.google.com with SMTP id r12so17687915wme.0 for ; Sun, 24 Apr 2016 14:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AqHkV+XU9pvapnRFQcJZX5xno//B9woIKBetBHG3Yzw=; b=psFMDMa48LkwsvAU6eal5RxMdopJRO3QGy+A7RwVOPUTKXBrsFd18YHPZi3UZEQOEs 5Bq993lnlj3e6H+l9JQSYGXQPRCqPm3boqSL1pbDkRMex1chG4G93Qfo+IYsTVgvS11Q 7d6Fnf95zMnKwfGdloyD17Ejh+froKzJYqlcL4VyjXQg4WQl0Lh5c2eSLKwSKF5bE0Xo ls6346Tv4/f2obWbQjyGKgDeEnuj26jqsf5bQxdWt52vpwNIA5qnfYG45lalkYt34c2f DDofoW0RgDfIqKd7puuPpMiGWu8S0kT/XnnvmJxd9tlwh1KQVkvpkyJ1Iz9A0dSkj9gf 8mDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AqHkV+XU9pvapnRFQcJZX5xno//B9woIKBetBHG3Yzw=; b=hKcjfDmiX+jTZJ6L8e8XecEbFCvZCvzoSJkAR1l1MNDFv2dFiXVz7hv0vJ1V93rp26 63cxdg458SPH8EtsHsyaMXevbTd8ca7sggPAI5ZMqtZLkBeT7r1RSu49nGoKsnCkmzy9 /4G18jALChmmuF6IFNHrY1+ewYNVir9ueuB0aXhKSo8mgOU9WLjbzKpAkA+vT2MGZM3G JhQNwQlK2lHIEmkaGDzNLBuBVZJM+Kg/UXD9WvX32dYm02F8yKOxU/Mqw5U+78H2dxp7 xlf5SU8rlIKUhY8joziyp1OpH5jD3cEslgKxfBfqiqdSz4BLSFMifDxkhocg8xEjM2El Y2dw== X-Gm-Message-State: AOPr4FWd+t1mvNZ5Ofy4rMGSxmwFBTTffL2nmg3Ev0iN2zgfH3q4xP7dkD8F+tL34gQnjg== X-Received: by 10.28.29.195 with SMTP id d186mr3937241wmd.27.1461532217356; Sun, 24 Apr 2016 14:10:17 -0700 (PDT) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b2sm15440182wmb.9.2016.04.24.14.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 14:10:16 -0700 (PDT) From: Ivaylo Dimitrov To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org Subject: [RFC PATCH 04/24] smiapp-pll: Take existing divisor into account in minimum divisor check Date: Mon, 25 Apr 2016 00:08:04 +0300 Message-Id: <1461532104-24032-5-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> References: <20160420081427.GZ32125@valkosipuli.retiisi.org.uk> <1461532104-24032-1-git-send-email-ivo.g.dimitrov.75@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sakari Ailus Required added multiplier (and divisor) calculation did not take into account the existing divisor when checking the values against the minimum divisor. Do just that. Signed-off-by: Sakari Ailus Acked-by: Pavel Machek --- drivers/media/i2c/smiapp-pll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c index e3348db..5ad1edb 100644 --- a/drivers/media/i2c/smiapp-pll.c +++ b/drivers/media/i2c/smiapp-pll.c @@ -227,7 +227,8 @@ static int __smiapp_pll_calculate( more_mul_factor = lcm(div, pll->pre_pll_clk_div) / div; dev_dbg(dev, "more_mul_factor: %u\n", more_mul_factor); - more_mul_factor = lcm(more_mul_factor, op_limits->min_sys_clk_div); + more_mul_factor = lcm(more_mul_factor, + DIV_ROUND_UP(op_limits->min_sys_clk_div, div)); dev_dbg(dev, "more_mul_factor: min_op_sys_clk_div: %d\n", more_mul_factor); i = roundup(more_mul_min, more_mul_factor);