linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@transmode.se>
To: "'Scott Wood'" <scottwood@freescale.com>
Cc: 'linuxppc-dev Development' <linuxppc-dev@ozlabs.org>
Subject: RE: MPC8321, ethernet and i2c problems after upgrade from 2.6.25 to 2.6.27
Date: Mon, 13 Oct 2008 20:57:15 +0200	[thread overview]
Message-ID: <02f501c92d65$828b64d0$87a22e70$@Tjernlund@transmode.se> (raw)
In-Reply-To: <48F393EB.6000100@freescale.com>

> -----Original Message-----
> From: Scott Wood [mailto:scottwood@freescale.com]
> Sent: den 13 oktober 2008 20:31
> To: joakim.tjernlund@transmode.se
> Cc: 'linuxppc-dev Development'
> Subject: Re: MPC8321, ethernet and i2c problems after upgrade from 2.6.25 to 2.6.27
> 
> Joakim Tjernlund wrote:
> > On Mon, 2008-10-13 at 11:31 -0500, Scott Wood wrote:
> >> i2c-mpc.c now registers as a dynamically-numbered bus; you need to either
> >> use the device tree, or call i2c_new_device().
> >
> > Thanks, but is this really so? Reading include/linux/i2c.h makes me
> > wonder if not the i2c_register_board_info() should still work.
> 
> Why?  Note that the "add-on" versus "mainboard" distinction in the
> comment is just an example; the actual distinction is
> dynamically-numbered versus statically-numbered.  Since the controller
> itself is probed from the device tree, there's no good way of statically
> assigning a bus number to it.

Because all the kernel comments I can see still implies that this should work
and because this was the only way in earlier releases to add an i2c device.

> 
> > Calling i2c_new_device() from an initcall() procedure does not
> > seem easy/possible, you need the adapter to do that. Maybe I just
> > missing something obvious?
> 
> The obvious and easy way is to just use the device tree.
> 
> If that isn't possible (such as due to device trees embedded in existing
> firmware), you can find the adapter device as a child of the of_device.

Possible yes, safe no. As is now I cannot use 2.6.27 on my current u-boot. 
and that may cause trouble in the field.

I always had the impression that OF was an optional add on, but now it seems
that it is mandatory for i2c?
 
> Finding the of_device from the device_node may be difficult, though.
> We could have i2c-mpc set node->data to the of_device (or maybe the
> adapter struct), or maybe should add an of_device member of device_node
> that gets filled in by of_platform?

hmm, no easy way out then? I need a way to do this from my board code without
adding new stuff to the driver. A hack that only works in 2.6.27 will do.

 Jocke

  reply	other threads:[~2008-10-13 18:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 12:01 MPC8321, ethernet and i2c problems after upgrade from 2.6.25 to 2.6.27 Joakim Tjernlund
2008-10-13 15:49 ` Joakim Tjernlund
2008-10-13 16:31 ` Scott Wood
2008-10-13 17:14   ` Joakim Tjernlund
2008-10-13 18:31     ` Scott Wood
2008-10-13 18:57       ` Joakim Tjernlund [this message]
2008-10-13 19:03         ` Scott Wood
2008-10-14  7:55           ` Joakim Tjernlund
2008-10-14 15:27             ` Scott Wood
2008-10-14 16:45               ` Joakim Tjernlund

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='02f501c92d65$828b64d0$87a22e70$@Tjernlund@transmode.se' \
    --to=joakim.tjernlund@transmode.se \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.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;
as well as URLs for NNTP newsgroup(s).