Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1239950pxb; Sun, 21 Feb 2021 17:36:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAY5MrgHP02vXdFh5akdryjdWTRTN0q6zr+jT+sKck9M661kTnGcoIBola4h56x1wB4EIO X-Received: by 2002:a50:a086:: with SMTP id 6mr19694812edo.70.1613957764422; Sun, 21 Feb 2021 17:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613957764; cv=none; d=google.com; s=arc-20160816; b=vQ+afyPhFvHcpMpB4FJANAWHJ1ARlUoM6nBP0jOzxi1olC2jRSjNXhCyCRI4furlLY wWxLUyyEl0CSSiXCxQUyiVMWfgj1XkHfVB1X5NcE8yFtNlFqzrX4ndRI9TpituGW4iFG wy9RN6MI7EjVevvloq9/84SD6Llt1ON3FLS4qbpGHwXhBC7561nvUOzZvVremmAVie1m TWkhhezN3aQTJzwTCxKcsbKHFAxlx8JOVlJ05a7xUoR/ATCtRQ7nWUV2a+jMplIyVJEz dkroId0ZLWreg0XYaxM3GRYEGBr5izAEWqgUnIBr+U8bJa+KSw8Z2jYQ6eKW0eGJbFeW /fuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kK3iLsDOxr3zBszKM924CgQxJABw1PACkomiF7yrGE0=; b=P9cSxpW3Tjmu2uU0NVNGKhKI5JEvxeITzU715/kVFrQH4J9vcf+H/3jj7shpkHZMvs xZM81fKDPlf6KVJANfAyw24T/SGc9YS0Jrc5bB5N7oWSrB9Q9oy5+BfkiiDpA7AMndiG JpXK12gJlbatw34tCdVYA3BvDABuLAMUEwjZqPgebuAIl+oZwQwiOduYdUcLGx3iTcNd Xsn6caSUfGFB/2aYia9AGYNVD5VMtQQ5+7xWKNzjVk2Z/Y6iVxau1X1nk20erSgA9VAT Ls4A+UPhtu6gAkz3jR2z5917kRA6ImvVYVSsVD2M/sMZSnu+OnZWOAB6yxCiUp4eBU/O ziWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KqAl0Urg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si11656635edd.608.2021.02.21.17.35.41; Sun, 21 Feb 2021 17:36:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KqAl0Urg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231816AbhBVBe6 (ORCPT + 99 others); Sun, 21 Feb 2021 20:34:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231603AbhBVBeX (ORCPT ); Sun, 21 Feb 2021 20:34:23 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51235C061786; Sun, 21 Feb 2021 17:33:43 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 26E00517; Mon, 22 Feb 2021 02:33:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613957621; bh=wx/q4aKq6oZLLuL1Nx2ZFt8o5HHVbpEPzovBML6ZPsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KqAl0Urg83qLVmpcnAX79PNEt21LGr50I8ElUQsyQra82DkUYhR1Nu9JLIKTpwCyb lADckXnbS7GHTXOwAySeG/D/DDbYyS9Pw/NNLTMD8AdZvWLS4UD6JjicLUTeHexwJu KzQQMOfbRFTJRsahOl/hoiCt9TEy7O9Mg3ySfQqU= Date: Mon, 22 Feb 2021 03:33:14 +0200 From: Laurent Pinchart To: Jacopo Mondi Cc: kieran.bingham+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/16] media: i2c: max9286: Cache channel amplitude Message-ID: References: <20210216174146.106639-1-jacopo+renesas@jmondi.org> <20210216174146.106639-12-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210216174146.106639-12-jacopo+renesas@jmondi.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, Thank you for the patch. On Tue, Feb 16, 2021 at 06:41:41PM +0100, Jacopo Mondi wrote: > Cache the current channel amplitude in a driver variable > to skip updating it if the new requested value is the same > as the currently configured one. > > Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart > --- > drivers/media/i2c/max9286.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index 1f14cd817fbf..4afb5ca06448 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -164,6 +164,7 @@ struct max9286_priv { > bool mux_open; > > u32 init_rev_chan_mv; > + u32 rev_chan_mv; > > struct v4l2_ctrl_handler ctrls; > struct v4l2_ctrl *pixelrate; > @@ -340,8 +341,15 @@ static void max9286_configure_i2c(struct max9286_priv *priv, bool localack) > static void max9286_reverse_channel_setup(struct max9286_priv *priv, > unsigned int chan_amplitude) > { > + u8 chan_config; > + > + if (priv->rev_chan_mv == chan_amplitude) > + return; > + > + priv->rev_chan_mv = chan_amplitude; > + > /* Reverse channel transmission time: default to 1. */ > - u8 chan_config = MAX9286_REV_TRF(1); > + chan_config = MAX9286_REV_TRF(1); > > /* > * Reverse channel setup. > @@ -563,8 +571,7 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, > * - Disable auto-ack as communication on the control channel are now > * stable. > */ > - if (priv->init_rev_chan_mv < 170) > - max9286_reverse_channel_setup(priv, 170); > + max9286_reverse_channel_setup(priv, 170); > max9286_check_config_link(priv, priv->source_mask); > > /* -- Regards, Laurent Pinchart