From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1741EB64DA for ; Mon, 19 Jun 2023 09:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbjFSJBV (ORCPT ); Mon, 19 Jun 2023 05:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbjFSJBN (ORCPT ); Mon, 19 Jun 2023 05:01:13 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B497FC; Mon, 19 Jun 2023 02:01:03 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1BFC6547; Mon, 19 Jun 2023 11:00:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687165227; bh=++FuKg5OCQoRLQpRm46B0DJduC3B6dQ7Oavq6P5dx/Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FdjLvWrTnc+nxExh2hxZUMsyrZISKWnSAYl2N9/GmyWduhRGZNThmezGzBfF3pydT U1mmAoy7Fg/9OtPfRkiq/4a5CkK69W68iyMLUB67Hb6qEhfzFRR8Iw9+ry+bDsOYU8 G5tQVhi5pOLhmMiVWdYiiE1XhYLtV84lSndDtaes= Message-ID: Date: Mon, 19 Jun 2023 12:00:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v14 18/18] media: i2c: ds90ub953: Support non-sync mode Content-Language: en-US To: Andy Shevchenko Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Luca Ceresoli , Matti Vaittinen , Laurent Pinchart , Sakari Ailus , Wolfram Sang , Rob Herring , Krzysztof Kozlowski , Mauro Carvalho Chehab , Peter Rosin , Liam Girdwood , Mark Brown , Michael Tretter , Hans Verkuil , Mike Pagano , =?UTF-8?Q?Krzysztof_Ha=c5=82asa?= , Marek Vasut , Satish Nagireddy References: <20230616135922.442979-1-tomi.valkeinen@ideasonboard.com> <20230616135922.442979-19-tomi.valkeinen@ideasonboard.com> From: Tomi Valkeinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/06/2023 17:47, Andy Shevchenko wrote: > On Fri, Jun 16, 2023 at 04:59:22PM +0300, Tomi Valkeinen wrote: >> Add support for FPD-Link non-sync mode with external clock. The only >> thing that needs to be added is the calculation for the clkout. > > ... > >> + switch (priv->mode) { >> + case UB953_MODE_SYNC: >> + if (priv->hw_data->is_ub971) >> + return priv->plat_data->bc_rate * 160ull; >> + else >> + return priv->plat_data->bc_rate / 2 * 160ull; > > Redundant 'else'. True, but I like the symmetry in: if (foo) return 123; else return 321; > Do I understand correctly you don't want to fallthrough because it will give > ±160 in the rate (depending if it's even or odd)? Sorry, can you clarify? Fallthrough to what? >> + case UB953_MODE_NONSYNC_EXT: >> + /* CLKIN_DIV = 1 always */ >> + return clk_get_rate(priv->clkin) * 80ull; >> + >> + default: >> /* Not supported */ >> return 0; >> } >