Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1682792ybe; Tue, 3 Sep 2019 01:49:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu6ENP6oiojOsqmRHUPVZfiBvGNzFUPQmR64XQb2Kv5Phg0ohJo+NJIAgSA518LWZn7/9J X-Received: by 2002:a17:90a:8c94:: with SMTP id b20mr16868796pjo.127.1567500593105; Tue, 03 Sep 2019 01:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567500593; cv=none; d=google.com; s=arc-20160816; b=UiKYbbgwIDq/ECkL4DWdvLsyrl9ZrEax+D5B5AckdzttXzr0BzaR6yH4LkrYMWe2E0 NxUDF+nKgjt+8KqjflNgdzxuRX+4fOmvxO9PkjJaGODh8ZWY5AdtGjQq/+vEXHQpIKZE 0XDxow8szQMmbM0iNIRXYKwRtn3FnJUqWoKgzjPsIioxUQLfxJYM+YtB03j7zv8GA8CI +6yK22OUE8FDxttv2GV1noleqrdl6x/OYVbOMn1zBSNYGlfCgeREw1MPmacUKviMzdyU UwsZYb2VP4qv3UdPizJV3q8LzSisw94nSv+9zneIV5OpjzG7mbUWjgLBK8wbKVd2KiRH WA0g== 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=CrBoUiohHhoxWXlbLMciYJg4TGOmwHLm69FShiYM7LE=; b=lHaUPTcJg6YLKXsqLJTts0sv5rh4NaKF3CiwOMsMcMasEiOnrVjGltyXK+LsUFnzdY JRByprT92+Oz77bISvwCXE19Txn3lPRzbHK3boKGJz3WAPcHsBUzNgx1AxistWhQZcJO PuOzJ5oVy9HFKnxrNpR/i2sA3izAkKQ1FcDc7TPlT9bNUE4Yv+/5vULUXIsPpKww9SV1 +fRHqNJ+UgGZqUjlIDXn6hut718joOHtb3sv5h9ESZC3FGW0reTHPLMi2cSCHVEiUg/r giNuyO7wKos8H7nGmmCuwvhhMk/FyCDtRzSH5UjET2yalUIjmfdbB4AI2xgH7N0XYW75 56nw== 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 1si14401578pli.374.2019.09.03.01.49.37; Tue, 03 Sep 2019 01:49:53 -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; 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 S1728198AbfICIsr (ORCPT + 99 others); Tue, 3 Sep 2019 04:48:47 -0400 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:46233 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfICIsq (ORCPT ); Tue, 3 Sep 2019 04:48:46 -0400 Received: from [109.168.11.45] (port=41926 helo=[192.168.101.73]) by hostingweb31.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1i54UU-002hxn-8d; Tue, 03 Sep 2019 10:48:42 +0200 Subject: Re: [RFC,v2 2/6] i2c: add I2C Address Translator (ATR) support To: Wolfram Sang Cc: linux-media@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Sakari Ailus , Hans Verkuil , Laurent Pinchart , Kieran Bingham , Jacopo Mondi , Vladimir Zapolskiy , Peter Rosin References: <20190723203723.11730-1-luca@lucaceresoli.net> <20190723203723.11730-3-luca@lucaceresoli.net> <20190902204208.GA7253@kunai> From: Luca Ceresoli Message-ID: <8482d1e2-b1d9-3da5-5b1f-b7e492a87368@lucaceresoli.net> Date: Tue, 3 Sep 2019 10:48:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190902204208.GA7253@kunai> Content-Type: text/plain; charset=windows-1252 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 - hostingweb31.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: hostingweb31.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hostingweb31.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 Wolfram, On 02/09/19 22:42, Wolfram Sang wrote: > Hi Luca, > >> + * Topology: >> + * >> + * Slave X @ 0x10 >> + * .-----. | >> + * .-----. | |---+---- B >> + * | CPU |--A--| ATR | >> + * `-----' | |---+---- C >> + * `-----' | >> + * Slave Y @ 0x10 >> + * >> + * Alias table: >> + * >> + * Client Alias >> + * ------------- >> + * X 0x20 >> + * Y 0x30 > > Great that you already provided docs for this driver! > > One huge drawback for me is the attach/detach callbacks. One year ago, I > removed a similar callback from the I2C core ("[PATCH 0/2] i2c: remove > deprecated attach_adapter callback") because some drivers did a lot of > crazy things there. It took years to remove all that. Oh dear, I was completely unaware, apologies! :-) > What I could imagine here: the adapter (B and C each in the picture > above) gets a flag like NEEDS_ATR before registering to the core. The > flag means all clients on that bus will have their address translated. > The core will figure out a free alias when a device is registered. We > can then have an ATR specific callback with the original and translated > address as arguments, so one can setup the HW as needed. Do you mean moving the alias selection code from i2c-atr.c to the i2c core? And the rest of the ATR core too? > Do you think that would work? Yes. -- Luca