linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andre Draszik <kernel@andred.net>
To: linuxppc-embedded@ozlabs.org
Subject: Re: IIC troubles w/ ppc4xx (STB04)
Date: Sun, 16 Apr 2006 08:55:40 +0200	[thread overview]
Message-ID: <4441EA6C.7010706@andred.net> (raw)
In-Reply-To: <20060416055702.GB20416@gate.ebshome.net>

Eugene Surovegin wrote:
> On Sun, Apr 16, 2006 at 07:33:45AM +0200, Andre Draszik wrote:
>> I see :) So if that doesn't work, what is the preferred way of testing
>> for existence of a device in a kernel module? Should I just
>> unconditionally i2c_client_register() a static struct and then
>> i2c_master_send() to see if it works?
> 
> There is no generic reliable way to detect that some i2c device exists 
> on the bus. Even if smbus_quick worked it cannot guarantee that 
> device you found is actually device you are expected - same i2c 
> address can be used by different devices.

I know, I really meant the linux side of this, i.e. if there was maybe
something I missed till now. But doesn't seem so ;)

> Frankly, I never saw this as a problem in embedded world, because 
> most of the time you have a custom built kernel for your particular 
> board or family of the boards, and you already know what devices might 
> be there, so just trying to access those devices from whatever 
> drivers and/or user-space applications you wrote is sufficient. In 
> fact, I never needed i2c "probing" in any of almost dozen different 
> embedded projects I wrote firmware/Linux board support for.

Sure, normally you know which devices are there. I am just playing
around with two boards I have here and am adding/removing parts as I
like ;) Therefore, for the moment, I wanted my driver to be as flexible
as possible, so I thought i'd use some probing and do it the preferred
way w/o hardcoding anything. At least that's what I thought the
preferred way to be...


Thanks!
Andre'

      reply	other threads:[~2006-04-16  6:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-16  1:41 IIC troubles w/ ppc4xx (STB04) Andre Draszik
2006-04-16  3:09 ` Eugene Surovegin
2006-04-16  5:33   ` Andre Draszik
2006-04-16  5:57     ` Eugene Surovegin
2006-04-16  6:55       ` Andre Draszik [this message]

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=4441EA6C.7010706@andred.net \
    --to=kernel@andred.net \
    --cc=linuxppc-embedded@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 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).