All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Sealey <matt@genesi-usa.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Jean Delvare <khali@linux-fr.org>,
	i2c@lm-sensors.org, linuxppc-dev@ozlabs.org
Subject: Re: [i2c] [PATCH 3/5] powerpc: Document device nodes for I2C devices.
Date: Sat, 19 May 2007 01:04:40 +0100	[thread overview]
Message-ID: <464E3F18.5010700@genesi-usa.com> (raw)
In-Reply-To: <6F8D3143-423D-45FA-9F40-00BF770831F2@kernel.crashing.org>


Kumar Gala wrote:
> On May 18, 2007, at 11:35 AM, Scott Wood wrote:
> 
>> device tree isn't worthwhile for i2c devices, why is it worthwhile  
>> for soc devices?  It seems to me that non-probable chips like i2c  
>> devices are precisely the kind of thing that the device tree is  
>> useful for.
> 
> I dont believe anyone has ever said that platform devices have to be  
> in the device tree.  We've been putting them their because we are  
> going to act as the registry for the devices.  The number of devices  
> on all the various Freescale/AMCC/IBM PPC SoCs is likely a very small  
> number compared to all I2C devices.
> 
> For I2C specifically we already have both a dynamic way (kernel cmd  
> line) and static (i2c_board_info) to specify the i2c devices, why do  
> we need yet another?

Linux doesn't but it might be nice to specify this kind of thing in a
way that other operating systems might or may support.

Essentially I think since there are a lot of ways to support I2C
(including bitbanging a GPIO pair), the only real way to support it
is to do something like;

i2c@blah {
	name = "i2c"
	compatible = "mpc52xx-i2c,someother-i2c"
	regs = "address:range"
}

The PURPOSE of this node is not to describe how the i2c controller
works, but to advertise it's presence and AUTHORIZE it's use. If a
node is not in the device tree, a driver author should probably
think twice about using it, especially on chips where pin muxing
is the modus operandii.

If it's in the device tree, then the chances of it being a wildly
crazy type of device external to the board design is probably very
low. If you have an SPI controller on - for example - an MPC52xx
chip, there are only 2 or 3 ways to have it implemented. Either
the inbuilt SPI, a PSC-based SPI, or perhaps using a bunch of GPIOs
to mimic an SPI interface very closely. The same applies to i2c.

You're not ever going to be able to specify in the device tree
exactly how to handle a driver, encompassing both implementation,
bugs in revisions, quirks of board design, but you can specify
for a driver a very accurate, very educated guess on it (any
quirks, bugs or implementation differences would be board/chip
specific, and are easily derived from the other device nodes
like the cpu node, soc node, and so on)

To carry on from the previous paragraph, with that in mind, if
it is an external device (perhaps bridged through another
chip or bus) it will be a child of the external bus. This also
gives a big clue about it's operation. If it is USB, or PCI,
or i2c based device, it will be marked with vendor/device/subsystem
ids or even an i2c slave address. Also very, very big clues.

(the only way you can accurately do all of the above and take
out all of the guesswork, is provide the driver in the firmware.
U-Boot and FDT's, you can forget it!)

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

  parent reply	other threads:[~2007-05-19  0:04 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 14:38 [PATCH 3/5] powerpc: Document device nodes for I2C devices Scott Wood
2007-05-17 16:12 ` Kumar Gala
2007-05-17 16:17   ` Scott Wood
2007-05-17 16:39     ` Kumar Gala
2007-05-17 16:47       ` Scott Wood
2007-05-17 17:21         ` Kumar Gala
2007-05-17 18:29           ` Scott Wood
2007-05-18 15:15           ` [i2c] " Jean Delvare
2007-05-18 16:24             ` Kumar Gala
2007-05-18 16:35               ` Scott Wood
2007-05-18 17:10                 ` Kumar Gala
2007-05-18 17:17                   ` Scott Wood
2007-05-18 17:33                     ` Kumar Gala
2007-05-18 17:55                       ` Scott Wood
2007-05-20 11:53                         ` Jean Delvare
2007-05-21 14:57                           ` Scott Wood
2007-05-19  0:04                   ` Matt Sealey [this message]
2007-05-19  0:17                     ` Segher Boessenkool
2007-05-19 13:41                       ` Matt Sealey
2007-05-19 16:25                         ` Segher Boessenkool
2007-05-20 14:53                           ` Matt Sealey
2007-05-20 15:48                             ` Segher Boessenkool
2007-05-27  9:48                               ` Matt Sealey
2007-05-20 11:42                   ` Jean Delvare
2007-05-18 20:07             ` Segher Boessenkool
2007-05-17 19:18 ` Segher Boessenkool
2007-05-17 19:32   ` Scott Wood
2007-05-17 19:44     ` Segher Boessenkool
2007-05-17 21:15       ` Scott Wood
2007-05-18 15:27     ` [i2c] " Jean Delvare
2007-05-18 15:58       ` Scott Wood
2007-05-18 16:29         ` Kumar Gala
2007-05-18 16:31         ` Jean Delvare
2007-05-18 16:56           ` Kumar Gala
2007-05-18 19:00           ` David Brownell
2007-05-18 15:19   ` Jean Delvare

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=464E3F18.5010700@genesi-usa.com \
    --to=matt@genesi-usa.com \
    --cc=galak@kernel.crashing.org \
    --cc=i2c@lm-sensors.org \
    --cc=khali@linux-fr.org \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.