public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	arm@kernel.org, Russell King <linux@arm.linux.org.uk>,
	devicetree@vger.kernel.org, Kumar Gala <galak@codeaurora.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 2/3] ARM: dts: uniphier: add ProXstream2 Vodka board support
Date: Fri, 16 Oct 2015 11:18:04 +0200	[thread overview]
Message-ID: <9943173.h49fNtDsEp@wuerfel> (raw)
In-Reply-To: <CAK7LNATzgOZp542rd-92YXDxux2DrAOH_mkzk8NjimQ3afrCCg@mail.gmail.com>

On Friday 16 October 2015 14:24:30 Masahiro Yamada wrote:
> 
> No, it is not a typo, but intentional.
> 
> 
> i2c0 - i2c3 are connected to the pads of the SoC package.
> On the other hand, i2c-4 - i2c-6 are connected to
> internal devices inside the SoC package.
> 
> i2c-4 - i2c-6 are always connected to the same hardware
> devices and always used for the same purpose.
> 
> 
> My expected scenario is:
> 
> [1] i2c0 - i2c3 are connected to the on-board devices
>     depending on board variants.
>     On some boards, their status is "okay" and
>     on some boards, their status is "disabled".
> 
> [2] i2c4 - i2c6 are always used to communicate
>     with in-package devices.  The status is always "okay".

I think you are getting confused because the data sheet uses
the same names as the kernel, but they are really different
things.

How about boards that have i2c connectors that are labeled
differently?

We want the aliases to match whatever is written on the
board normally, to make it easier for users.

> [3] Some user-land applications may want to have access
>      through the same character devices,
>       /dev/i2c4, /dev/i2c5, /dev/i2c6

That user space would however only work on boards with the
same SoC, which is not a safe assumption to make. Either
it should be specific to just one board which has a known
set of buses, or it should be done in a way that works
across SoC generations of families.

Ideally the devices on the internal buses would have an
in-kernel driver that exports a high-level API to avoid this
problem. What devices are these?

> If your way is adopted,
> the real hardware "i2c4" might be aligned to /dev/i2c1 on some boards,
> and /dev/i2c2 on others, etc.

Right, I think that is how it should be. You could also make
the chip's i2c4 always link to user space /dev/i2c0 if you
want to keep those stable, but as I said that is still not
a good (software) system design.

	Arnd

  reply	other threads:[~2015-10-16  9:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15  9:05 [PATCH 0/3] ARM: dts: uniphier: DTS updates for UniPhier SoCs for Linux 4.14-rc1 Masahiro Yamada
2015-10-15  9:05 ` [PATCH 1/3] ARM: dts: uniphier: change the external bus address mapping Masahiro Yamada
2015-10-15  9:05 ` [PATCH 2/3] ARM: dts: uniphier: add ProXstream2 Vodka board support Masahiro Yamada
2015-10-15 15:17   ` Arnd Bergmann
2015-10-16  5:24     ` Masahiro Yamada
2015-10-16  9:18       ` Arnd Bergmann [this message]
2015-10-16  9:50         ` Masahiro Yamada
2015-10-21  8:49           ` Masahiro Yamada
2015-10-23 20:10             ` Arnd Bergmann
2015-10-15  9:05 ` [PATCH 3/3] ARM: dts: uniphier: add ProXstream2 Gentil " Masahiro Yamada
2015-10-15 15:18 ` [PATCH 0/3] ARM: dts: uniphier: DTS updates for UniPhier SoCs for Linux 4.14-rc1 Arnd Bergmann

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=9943173.h49fNtDsEp@wuerfel \
    --to=arnd@arndb.de \
    --cc=arm@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /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