From: Lanttor <lanttor.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: i2c adapter scan device issue
Date: Wed, 25 Nov 2009 12:18:05 +0800 [thread overview]
Message-ID: <4B0CAFFD.7030603@freescale.com> (raw)
Hi,
I have a confused problem as follows:
I instantiate a i2c device with function i2c_register_board_info();
This function pre-declare the I2C devices which live on this bus and the
call of it
is before the real i2c bus driver loaded.
In i2c_register_board_info(),
__i2c_first_dynamic_bus_num = busnum +1;
My i2c bus driver use i2c_add_adapter() to register adapter, In
i2c_add_adapter(),
res = idr_get_new_above(&i2c_adapter_idr, adapter,
__i2c_first_dynamic_bus_num , &id);
adapter->nr = id;
That means if I pass busnum 0 to i2c_register_board_info(), but my i2c
adapter will get
busnum 1 and so it can't scan pre-declared i2c devices.
In fact, I only have one i2c adapter.
It seems I can't use i2c_add_adapter(), instead of using
i2c_add_numbered_adapter, right?
Best Regards,
Lanttor
next reply other threads:[~2009-11-25 4:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 4:18 Lanttor [this message]
[not found] ` <4B0CAFFD.7030603-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-11-25 8:12 ` i2c adapter scan device issue Jean Delvare
[not found] ` <20091125091218.518d47af-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-11-25 8:42 ` Lanttor
[not found] ` <4B0CEDDA.2000909-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-11-25 8:53 ` 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=4B0CAFFD.7030603@freescale.com \
--to=lanttor.guo-kzfg59tc24xl57midrcfdg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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