Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5883315pxb; Tue, 16 Feb 2021 09:49:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5inLPFcunqXiwoItSbW7+W9Tek+sGyVFEQbWH62OzrUS29nvQZOK3EnH1nAukb8bbuz23 X-Received: by 2002:a05:6402:d09:: with SMTP id eb9mr22437840edb.285.1613497795212; Tue, 16 Feb 2021 09:49:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613497795; cv=none; d=google.com; s=arc-20160816; b=xclUIEZ2+OLH5lvcmHXA7Q17c4hgV3RxAWNqkorAvbrbD5GtbY8AgIMWuNNKeV88iO ID8qtbVfUYDLA+JU9O4Hbnxg3H6e5xHDSzLPMBRems72Av0qCliQ0r2bhq7Do23XfbFP OgCVDZYACwNtksUeA+BrxGRfu48xfGtetob3zUfPuTp76Kx6PwJmL27+GCNRid3T1Crn fDaHzEba81XhTjk8m7lPkjvbSJEgqZP0fPgI/99fUICFkpu/kYeCfWXKF7yHGvVanUOc l2sRa4t/qWxGcVQEommNCDft44PMyDSmMyz8j+dkwAoXJ5+MeZc0wop3P5wPACp0Wy8f mRmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=UgkA+w1M4AOhCI0gIQNJr9M180UQamE7spf4xDXypkU=; b=uOCpOxHRj3bUvdgnv0OB5dzfr9cPaVxXbmqX1a5KVcHey4Fuvf4Di+3PjI+kjZEhxZ OIpwRqs/VA8hOl1LHIVuMgAuvqZjWdrXO8dlHmKpXq4NIn7BDySEw1un7tesZ56WBv7s ERWp5nerjwDypAhTrxfp483O9Ww380BxMHOyeIHeE/NN3pAuL92jtnbyo43CES4hasYD QLTtmNZXw2pl8W/yIqG7w7ROj8MhRSravQyv0Bb4IUPQakYaRLEG7kA3UGeS0Hqgs3dh mmosxWP41idk1LYRUK25xP/c/z6oVrkG3pcfuoVGCpVDHxzrRCd/lmrgj6XpPWyM34IP TGyg== ARC-Authentication-Results: i=1; mx.google.com; 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 o4si7182469ejx.315.2021.02.16.09.49.31; Tue, 16 Feb 2021 09:49:55 -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; 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 S230317AbhBPRq4 (ORCPT + 99 others); Tue, 16 Feb 2021 12:46:56 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:35499 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbhBPRnA (ORCPT ); Tue, 16 Feb 2021 12:43:00 -0500 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id B41C4200013; Tue, 16 Feb 2021 17:41:51 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Jacopo Mondi , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/16] media: i2c: max9286: Initialize remotes when bound Date: Tue, 16 Feb 2021 18:41:44 +0100 Message-Id: <20210216174146.106639-15-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216174146.106639-1-jacopo+renesas@jmondi.org> References: <20210216174146.106639-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the introduction of the .init() core subdev operation in the max9271 GMSL serializer, the max9286 deserializer needs to explicitly initialize the remote devices by calling the .init() subdev operation on each probed camera. Call the .init() subdev operation at remote bound time and toggle the reverse channel amplitude to compensate for the remote ends noise immunity threshold. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/max9286.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 7913b5f2249e..c41284de89b6 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -554,25 +554,39 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, dev_dbg(&priv->client->dev, "Bound %s pad: %u on index %u\n", subdev->name, src_pad, index); + /* + * Initialize the remote camera. Increase the channel amplitude + * to compensate for the remote noise immunity threshold. + */ + max9286_reverse_channel_setup(priv, MAX9286_REV_AMP_HIGH); + ret = v4l2_subdev_call(subdev, core, init, 0); + if (ret) { + dev_err(&priv->client->dev, + "Failed to initialize camera device %u\n", index); + return ret; + } + /* * We can only register v4l2_async_notifiers, which do not provide a * means to register a complete callback. bound_sources allows us to * identify when all remote serializers have completed their probe. */ - if (priv->bound_sources != priv->source_mask) + if (priv->bound_sources != priv->source_mask) { + /* + * If not all remotes have probed yet, restore the initial + * reverse channel amplitude to allow the next camera to probe. + */ + max9286_reverse_channel_setup(priv, priv->init_rev_chan_mv); return 0; + } /* * All enabled sources have probed and enabled their reverse control * channels: - * - * - Increase the reverse channel amplitude to compensate for the - * remote ends high threshold * - Verify all configuration links are properly detected * - Disable auto-ack as communication on the control channel are now * stable. */ - max9286_reverse_channel_setup(priv, MAX9286_REV_AMP_HIGH); max9286_check_config_link(priv, priv->source_mask); /* -- 2.30.0