Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp3715914ooa; Mon, 13 Aug 2018 17:02:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPySt2IaH9sc39WkjgLvg6MNcCkOMXg+oNKWUTb6uHrnd4nU12P7tlSLTYumD38txiOzROnY X-Received: by 2002:a17:902:9302:: with SMTP id bc2-v6mr18331216plb.280.1534204945115; Mon, 13 Aug 2018 17:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534204945; cv=none; d=google.com; s=arc-20160816; b=tfYYI+UbDgKkzy1eQpmgvsT0Hl9ZqJrARBoe38ZaGGzD3seYbF4zjkKYTxhlE1VDYq CcpMY4ZvO8WYbcWLmoDTfkLmoXKzchT2BPr/fqy/oX8J81s2Wd9X4zQFUCiqbzCe8sY8 hIgHQTvjOSDFZ91M7Mn6GBeZDzvhygYpPLJ9EOT0uuqqVVgKPk2ul3fOuvdNP9fgn3Q+ s0DCtow+ebgh/tF8+XtIPDnmmu7dUNnvk/5B99GN+X9SPF9DF7Tp/DM6Jijoqzp7NOA9 GefInsCACc79/SmkhPE6jR50Ofyi2pCbsu3CdQwV5mg2CQTccOFzc9hwnBx9gXreVyXN aZBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=y+XrAfhKxp1ox/BFHL9TNgkKEoS4DCzOvSBaT2D2yNQ=; b=ZLGPaCBjMlLBtNcBFm2coK41zKZT80Gf77MiSNURzJ6ekJVFE6hhOcoGeThQAYZ2mQ mfYAaSbHQUfTBasJ5fQw3QoPV+YeiFkXLvUWHWT90CDiqmktQ0pAPatnnHyu20rIYQOm XgywwQu+CdHrCOFZ6mXzTWtJay6l68RXgxxhacvAc8q+V7VT9o6N989LkvUEj1+bC6Xp LXzz7X/HYjpJ3/nZu9wNkcKb4RWAoje51qS79EpvzThgpvgrgmgnXhKnZjZPCc4QtFG1 q+5ENHO1UfVV0Wx1yW29EYpFbtohZ4wHzkfi13lVDK5teQH6KQmGuxUTRHRbblC3Wzi+ 5oJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1ALE0oZb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 95-v6si18189278pld.486.2018.08.13.17.02.09; Mon, 13 Aug 2018 17:02:25 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=1ALE0oZb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732177AbeHNBcg (ORCPT + 99 others); Mon, 13 Aug 2018 21:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:50230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbeHNBcf (ORCPT ); Mon, 13 Aug 2018 21:32:35 -0400 Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B209121756; Mon, 13 Aug 2018 22:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534200497; bh=y+XrAfhKxp1ox/BFHL9TNgkKEoS4DCzOvSBaT2D2yNQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=1ALE0oZbfBUIVdTSBzvxUJqxrXNzy+1JAttDfkW44nwNcyh/wzDnzr28vooDVnili Y7qZGETGx2FCCtDW+dJB2mkvPVvYNteIGE9eaHl0HCc6bo5HqTvCkWz3IKFnhiYVAy DHScVkr5IZ2hCeOqgIETcmFtAxtK506OmRsYFDUo= Received: by mail-qt0-f176.google.com with SMTP id f18-v6so19252706qtp.10; Mon, 13 Aug 2018 15:48:17 -0700 (PDT) X-Gm-Message-State: AOUpUlGwe5Xt05T7m2ewd/B2sF9FyszyBHSeQAi21dBMpgCydGXN6FvX LC7AAYjon0z65ixmbeu8DyFUj8V7rh98Eoe/ow== X-Received: by 2002:ac8:29a4:: with SMTP id 33-v6mr19570899qts.354.1534200496948; Mon, 13 Aug 2018 15:48:16 -0700 (PDT) MIME-Version: 1.0 References: <20180809192944.7371-1-kieran.bingham@ideasonboard.com> <20180813174544.GA11379@rob-hp-laptop> In-Reply-To: From: Rob Herring Date: Mon, 13 Aug 2018 16:48:05 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] dt-bindings: media: adv748x: Document re-mappable addresses To: Kieran Bingham Cc: Laurent Pinchart , Mauro Carvalho Chehab , Mark Rutland , Hans Verkuil , Linux Media Mailing List , "open list:MEDIA DRIVERS FOR RENESAS - FCP" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 13, 2018 at 1:17 PM Kieran Bingham wrote: > > Hi Rob, > > On 13/08/18 18:45, Rob Herring wrote: > > On Thu, Aug 09, 2018 at 08:29:44PM +0100, Kieran Bingham wrote: > >> The ADV748x supports configurable slave addresses for its I2C pages. > >> Document the page names, and provide an example for setting each of the > >> pages explicitly. > > > > It would be good to say why you need this. > > In fact - I should probably have added a fixes tag here, which would > have added more context: > > Fixes: 67537fe960e5 ("media: i2c: adv748x: Add support for > i2c_new_secondary_device") That doesn't really explain things from a DT perspective. > Should I repost with this fixes tag? > Or can it be collected with the RB tag? I'll leave that to Hans. > > The only use I can think of > > is if there are other devices on the bus and you need to make sure the > > addresses don't conflict. > > Yes, precisely. This driver has 'slave pages' which are created and > mapped by the driver. The device has default addresses which are used by > the driver - but it's very easy for these to conflict with other devices > on the same I2C bus. > > Because the mappings are simply a software construct, we have a means to > specify the desired mappings through DT at the board level - which > allows the boards to ensure that conflicts do not appear. > > > > Arguably, that information could be figured out without this in DT. > > How so ? > > Scanning the bus is error prone, and dependant upon driver state (and > presence), and we have no means currently of requesting 'free/unused' > addresses from the I2C core framework. True. But assuming all devices are in DT, then you just need to scan the child nodes of the bus and get a map of the used addresses. Though if you had 2 or more devices like this, then you'd need to maintain s/w allocated addresses too. It could all be maintained with a bitmap which you initialize with addresses in DT. Rob