public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Wolfram Sang" <wsa@kernel.org>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Matti Vaittinen" <Matti.Vaittinen@fi.rohmeurope.com>,
	"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Peter Rosin" <peda@axentia.se>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Michael Tretter" <m.tretter@pengutronix.de>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Mike Pagano" <mpagano@gentoo.org>,
	"Krzysztof Hałasa" <khalasa@piap.pl>,
	"Marek Vasut" <marex@denx.de>,
	"Satish Nagireddy" <satish.nagireddy@getcruise.com>,
	"Luca Ceresoli" <luca@lucaceresoli.net>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v11 1/7] i2c: add I2C Address Translator (ATR) support
Date: Tue, 25 Apr 2023 12:13:47 -0500	[thread overview]
Message-ID: <20230425171347.GB1957523-robh@kernel.org> (raw)
In-Reply-To: <20230421101833.345984-2-tomi.valkeinen@ideasonboard.com>

On Fri, Apr 21, 2023 at 01:18:27PM +0300, Tomi Valkeinen wrote:
> From: Luca Ceresoli <luca@lucaceresoli.net>
> 
> An ATR is a device that looks similar to an i2c-mux: it has an I2C
> slave "upstream" port and N master "downstream" ports, and forwards
> transactions from upstream to the appropriate downstream port. But it
> is different in that the forwarded transaction has a different slave
> address. The address used on the upstream bus is called the "alias"
> and is (potentially) different from the physical slave address of the
> downstream chip.
> 
> Add a helper file (just like i2c-mux.c for a mux or switch) to allow
> implementing ATR features in a device driver. The helper takes care or
> adapter creation/destruction and translates addresses at each transaction.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  .../devicetree/bindings/i2c/i2c-atr.yaml      |  34 +
>  Documentation/i2c/i2c-address-translators.rst |  96 +++
>  Documentation/i2c/index.rst                   |   1 +
>  MAINTAINERS                                   |   8 +
>  drivers/i2c/Kconfig                           |   9 +
>  drivers/i2c/Makefile                          |   1 +
>  drivers/i2c/i2c-atr.c                         | 684 ++++++++++++++++++
>  include/linux/i2c-atr.h                       | 116 +++
>  8 files changed, 949 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-atr.yaml
>  create mode 100644 Documentation/i2c/i2c-address-translators.rst
>  create mode 100644 drivers/i2c/i2c-atr.c
>  create mode 100644 include/linux/i2c-atr.h
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-atr.yaml b/Documentation/devicetree/bindings/i2c/i2c-atr.yaml
> new file mode 100644
> index 000000000000..d7f73d98110d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-atr.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: GPL-2.0

Dual license.

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-atr.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common i2c address translator properties.

Drop hard stop.

> +
> +maintainers:
> +  - Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> +
> +description:
> +  An I2C Address Translator (ATR) is a device with an I2C slave parent
> +  ("upstream") port and N I2C master child ("downstream") ports, and
> +  forwards transactions from upstream to the appropriate downstream port
> +  with a modified slave address. The address used on the parent bus is
> +  called the "alias" and is (potentially) different from the physical
> +  slave address of the child bus. Address translation is done by the
> +  hardware.
> +
> +properties:
> +  i2c-alias-pool:
> +    $ref: /schemas/types.yaml#/definitions/uint16-array

We do support some flags in the upper 16-bits of I2C addresses. Any of 
those possibly needed here?

> +    description:
> +      I2C alias pool is a pool of I2C addresses on the main I2C bus that can be
> +      used to access the remote peripherals on the serializer's I2C bus. The
> +      addresses must be available, not used by any other peripheral. Each
> +      remote peripheral is assigned an alias from the pool, and transactions to
> +      that address will be forwarded to the remote peripheral, with the address
> +      translated to the remote peripheral's real address. This property is not
> +      needed if there are no I2C addressable remote peripherals.
> +
> +additionalProperties: true
> +...


  parent reply	other threads:[~2023-04-25 17:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 10:18 [PATCH v11 0/7] i2c-atr and FPDLink Tomi Valkeinen
2023-04-21 10:18 ` [PATCH v11 1/7] i2c: add I2C Address Translator (ATR) support Tomi Valkeinen
2023-04-24 10:31   ` Wolfram Sang
2023-04-24 10:51     ` Tomi Valkeinen
2023-04-24 11:01       ` Tomi Valkeinen
2023-04-24 11:32         ` Wolfram Sang
2023-04-24 11:39           ` Tomi Valkeinen
2023-04-24 11:43             ` Wolfram Sang
2023-04-25 17:13   ` Rob Herring [this message]
2023-04-25 19:24     ` Wolfram Sang
2023-04-21 10:18 ` [PATCH v11 2/7] dt-bindings: media: add TI DS90UB913 FPD-Link III Serializer Tomi Valkeinen
2023-04-21 10:18 ` [PATCH v11 3/7] dt-bindings: media: add TI DS90UB953 " Tomi Valkeinen
2023-04-21 10:18 ` [PATCH v11 4/7] dt-bindings: media: add TI DS90UB960 FPD-Link III Deserializer Tomi Valkeinen
2023-04-25 17:11   ` Rob Herring
2023-04-21 10:18 ` [PATCH v11 5/7] media: i2c: add DS90UB960 driver Tomi Valkeinen
2023-04-21 10:18 ` [PATCH v11 6/7] media: i2c: add DS90UB913 driver Tomi Valkeinen
2023-04-21 10:18 ` [PATCH v11 7/7] media: i2c: add DS90UB953 driver Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230425171347.GB1957523-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=Matti.Vaittinen@fi.rohmeurope.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=khalasa@piap.pl \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=luca@lucaceresoli.net \
    --cc=m.tretter@pengutronix.de \
    --cc=marex@denx.de \
    --cc=mchehab@kernel.org \
    --cc=mpagano@gentoo.org \
    --cc=peda@axentia.se \
    --cc=sakari.ailus@linux.intel.com \
    --cc=satish.nagireddy@getcruise.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox