From patchwork Thu Jul 13 11:12:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9838227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30E46602D8 for ; Thu, 13 Jul 2017 11:12:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2113F28680 for ; Thu, 13 Jul 2017 11:12:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15CE5286D3; Thu, 13 Jul 2017 11:12:39 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9AB028680 for ; Thu, 13 Jul 2017 11:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbdGMLM1 (ORCPT ); Thu, 13 Jul 2017 07:12:27 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49351 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdGMLM0 (ORCPT ); Thu, 13 Jul 2017 07:12:26 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id EE44482413; Thu, 13 Jul 2017 13:12:24 +0200 (CEST) Date: Thu, 13 Jul 2017 13:12:24 +0200 From: Pavel Machek To: Sakari Ailus Cc: Sebastian Reichel , Sakari Ailus , linux-media@vger.kernel.org Subject: Re: [PATCH 7/8] omap3isp: Check for valid port in endpoints Message-ID: <20170713111224.GG1363@amd> References: <20170705230019.5461-1-sakari.ailus@linux.intel.com> <20170705230019.5461-8-sakari.ailus@linux.intel.com> <20170706111149.ws6olipu7ph4tcyd@earth> <20170707130432.g4di5a3he2bf5baw@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170707130432.g4di5a3he2bf5baw@valkosipuli.retiisi.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > > On Thu, Jul 06, 2017 at 02:00:18AM +0300, Sakari Ailus wrote: > > > Check that we do have a valid port in an endpoint, return an error if not. > > > > > > Signed-off-by: Sakari Ailus > > > > Reviewed-by: Sebastian Reichel > > Thanks for the reviews, Sebastian and Pavel! > > I'll send a pull request on these for 4.14 once we have -rc1 in the media > tree. I can update my patches when updated ccp2 branch is ready. And actually, I'd quite like to get rest of support ready for 4.14, too. I believe we are close enough. I re-checked, and it seems to work w/o the "smiapp-pll: Take existing divisor into account in minimum divisor check" patch; so with "omap3isp: add CSI1 support" plus the other ccp2 patches, plus dts changes, we should be ok. Best regards, Pavel commit eba2751794239780efb256ce7079294a4d4c6e74 Author: Pavel Date: Mon Feb 13 21:18:27 2017 +0100 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 Signed-off-by: Ivaylo Dimitrov Signed-off-by: Pavel Machek diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c index 771db56..0ada972 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);