From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Ayman KHAMOUMA <ayman.khamouma-qxv4g6HH51o@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Need help on selecting one (and only one) i2c bus
Date: Wed, 11 Mar 2009 20:09:49 +0100 [thread overview]
Message-ID: <20090311200949.45ba0dde@hyperion.delvare> (raw)
In-Reply-To: <001301c9a269$ab95d940$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
Hi Ayman,
On Wed, 11 Mar 2009 17:51:48 +0100, Ayman KHAMOUMA wrote:
> It's me again...
>
> In I2c.h I found:
>
> /* Mainboard arch_initcall() code should register all its I2C devices.
> * This is done at arch_initcall time, before declaring any i2c adapters.
> * Modules for add-on boards must use other calls.
> */
>
> extern int
> i2c_register_board_info(int busnum, struct i2c_board_info const *info,
> unsigned n);
>
> I guess I have to call this function near the arch_initcall().
> I greped my folder for arch_initcall() but couldn't figure out witch file to
> use...
> Any idea ?
I'm not much into embedded architectures, and I suspect it depends on
the architecture. Looking at the latest kernel tree I see this function
is called only in machine or platform initialization files, for example:
arch/arm/mach-pxa/cm-x300.c: i2c_register_board_info(0, cm_x300_gpio_ext_info,
arch/arm/mach-rpc/riscpc.c: i2c_register_board_info(0, &i2c_rtc, 1);
arch/arm/mach-s3c6410/mach-smdk6410.c: i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
arch/arm/mach-s3c6410/mach-smdk6410.c: i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
arch/arm/plat-omap/i2c.c: err = i2c_register_board_info(bus_id, info, len);
arch/arm/mach-s3c2440/mach-osiris.c: i2c_register_board_info(0, osiris_i2c_devs,
arch/arm/mach-s3c2440/mach-anubis.c: i2c_register_board_info(0, anubis_i2c_devs,
arch/arm/mach-ep93xx/core.c: i2c_register_board_info(0, devices, num);
I can't tell more without knowing which architecture and machine or
platform you're working on. And maybe the question would be better
asked to someone who is familiar with the architecture in question.
> Another thing, what would be the equivalent of
> MODULE_DEVICE_TABLE(i2c, example_idtable);
> As you said, the i2c_device_id structure doesn't exist in this kernel...
There is no equivalent, just omit this part.
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
next prev parent reply other threads:[~2009-03-11 19:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-09 14:52 Need help on selecting one (and only one) i2c bus Ayman KHAMOUMA
[not found] ` <000001c9a0c6$bf92af80$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
2009-03-10 15:30 ` Jean Delvare
[not found] ` <fd6b62c10903102327u426a4262meeabe2c581d7107b@mail.gmail.com>
[not found] ` <fd6b62c10903102327u426a4262meeabe2c581d7107b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-11 9:15 ` Jean Delvare
[not found] ` <20090311101513.271f5464-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-11 9:47 ` Daniel Mack
[not found] ` <fd6b62c10903110319w1eebd2ebs4b83e7d1247f1678@mail.gmail.com>
[not found] ` <fd6b62c10903110319w1eebd2ebs4b83e7d1247f1678-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-11 10:40 ` Daniel Mack
[not found] ` <20090310163044.571e4aff-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-10 15:58 ` Ayman KHAMOUMA
2009-03-10 16:03 ` Ayman KHAMOUMA
2009-03-11 10:55 ` Ayman KHAMOUMA
[not found] ` <000301c9a237$e6d3c8f0$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
2009-03-11 11:22 ` Jean Delvare
[not found] ` <20090311122257.7c7805f0-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-11 11:44 ` Ayman KHAMOUMA
2009-03-11 16:51 ` Ayman KHAMOUMA
[not found] ` <001301c9a269$ab95d940$b23e81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
2009-03-11 19:09 ` Jean Delvare [this message]
2009-03-24 10:27 ` I2c message at init time Ayman KHAMOUMA
[not found] ` <000201c9ac6b$34a95300$2d3f81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
2009-03-24 15:52 ` Jean Delvare
[not found] ` <20090324165227.0d97454c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-24 15:58 ` Ayman KHAMOUMA
-- strict thread matches above, loose matches on Subject: below --
2009-03-09 10:58 Need help on selecting one (and only one) i2c bus Ayman KHAMOUMA
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=20090311200949.45ba0dde@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=ayman.khamouma-qxv4g6HH51o@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