Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3380925imu; Wed, 7 Nov 2018 09:26:13 -0800 (PST) X-Google-Smtp-Source: AJdET5cSGL57M+BowAPqdjqIjpEzFXkQsj7eJoNKsaHpGvHmK3l30eDTmEXwyeJlneQgIPB/h0FO X-Received: by 2002:a62:e707:: with SMTP id s7-v6mr1094993pfh.124.1541611573477; Wed, 07 Nov 2018 09:26:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541611573; cv=none; d=google.com; s=arc-20160816; b=kY0XedVXmKZ0lskTU/B27pBm9sIdkikVULykn8W/lqyXvaK3yhIrkccMAjpKXITucQ FvrLMNlkRgrGe/Yo56XfMB5GX1DU6mbcyG2dUicp4Df4XE8zXJSrqitD1PcV+boo4pda +2/sjHz5swJeqBZCxQ1AoRDbRvbzB9pTKfrIrumfQ/MzUYXxsfiiG6oCCT33Ti9VUts4 mAu8wxKEHQubzPclowzFv+y6WK7JXnL7Uo4xpbflq7Yiuti1fB0cDRwYwUH9zE6/xsnD Azcspou3q/PKDzH4fEVB4MiXG5cLsjxqH0PoGV7TPgmmiUT7kLIZrJ7eD5RtY/BRKzEY mdPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SlKnS87EIR6GqBuMrewwpmvH9bRkDrYPdNwO+SWWPBo=; b=cNWjjqvOpWLdUNTdapb6ctK/b3dgwMK2Zi1FeWv6JdaCNKRBoIy5kqBXwh64A6eH+Q FlR4D/T5Cqs8mu687fVi05yvV+636BcO0p1m9+8bq9kKyHyXZ30NuUchZRYrzfWy6EBO vTz9bEWTOZxrei0mcYlVdqND6IS51T52KIXA9d7Sg5BmPu4DOdlgTbmh1xoFTuKEs7Ny lQo04XnpiioTYpGWG+6ONLNcur2+g0D5exEf0s9mYbnxxfFzd2gKIJZ70qFiFzBjcW8c ooG7vUUuuCvQg63g/VsWsQq7B/TZ0F76oPoSxJgmhgs9qkgToriimn1oVjwOS2pDOf34 UiFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r199-v6si1561920pfr.105.2018.11.07.09.25.57; Wed, 07 Nov 2018 09:26:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731439AbeKHCzz (ORCPT + 99 others); Wed, 7 Nov 2018 21:55:55 -0500 Received: from srv-hp10-72.netsons.net ([94.141.22.72]:51199 "EHLO srv-hp10-72.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727576AbeKHCzy (ORCPT ); Wed, 7 Nov 2018 21:55:54 -0500 Received: from [109.168.11.45] (port=34112 helo=[192.168.101.125]) by srv-hp10.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gKRYv-00Dcff-Dj; Wed, 07 Nov 2018 18:24:17 +0100 Subject: Re: [PATCH v4 3/4] media: i2c: Add MAX9286 driver To: kieran.bingham+renesas@ideasonboard.com, Kieran Bingham , linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org Cc: devicetree@vger.kernel.org, sakari.ailus@iki.fi, =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Jacopo Mondi , Laurent Pinchart , linux-kernel@vger.kernel.org, Jacopo Mondi , Laurent Pinchart , =?UTF-8?Q?Niklas_S=c3=b6derlund?= References: <20181102154723.23662-1-kieran.bingham@ideasonboard.com> <20181102154723.23662-4-kieran.bingham@ideasonboard.com> From: Luca Ceresoli Message-ID: <898b4698-c3c3-9d38-e117-6a4274ba2ca4@lucaceresoli.net> Date: Wed, 7 Nov 2018 18:24:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca@lucaceresoli.net X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kieran, thanks for the clarification. One additional note below. On 07/11/18 16:06, Kieran Bingham wrote: > Hi Luca > > > >> kbingham: hi, I'm looking at your GMSL v4 patches >> kbingham: jmondi helped me in understanding parts of it, but I still have a question >> kbingham: are the drivers waiting for the established link before the remote chips are accessed? where? > > I'm replying here rather than spam the IRC channel with a big paste. > It's also a useful description to the probe sequence, so I've kept it > with the driver posting. > > I hope the following helps illustrate the sequences which are involved: > > max9286_probe() > - max9286_i2c_mux_close() # Disable all links > - max9286_configure_i2c # Configure early communication settings > - max9286_init(): > - regulator_enable() # Power up all cameras > - max9286_setup() # Most link setup is done here. > ... Set up v4l2/async/media-controller endpoints > - max9286_i2c_mux_init() # Start configuring cameras: > - i2c_mux_alloc() # Create our mux device > - for_each_source(dev, source) > i2c_mux_add_adapter() # This is where sensors get probed. > > So yes sensors are only communicated with once the link is brought up as > much as possible. For the records, an additional bit of explanation I got from Kieran via IRC. The fact that link is already up when the sensors are probed is due to the fact that the power regulator has a delay of *8 seconds*. This is intended, because there's an MCU on the camera modules that talks on the I2C bus during that time, and thus the drivers need to wait after it's done. This delay happens before max9286_setup() is called. > Because the sensors are i2c devices on the i2c_mux - they are not probed > until their adapters are created and added. > > At this stage the i2c-mux core framework will iterate all the devices > described by the DT for that adapter. > > As each one is probed - the i2c_mux framework will call > max9286_i2c_mux_select() and enable only the single link. > > This allows us to configure each camera independently > > (which is essential because they are all configured to the same i2c > address by default at power on) > > > Hope this helps, and feel free to ask if you have any more questions. -- Luca