* arch_initcall time
@ 2008-02-18 18:28 Sean MacLennan
2008-02-18 18:31 ` Grant Likely
0 siblings, 1 reply; 5+ messages in thread
From: Sean MacLennan @ 2008-02-18 18:28 UTC (permalink / raw)
To: LinuxPPC-dev
I need to call i2c_register_board_info for the new i2c style ad7414
driver. This needs to be called at arch initcall time. Currently I just
do this:
static int __init warp_arch_init(void)
{
i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
return 0;
}
arch_initcall(warp_arch_init);
It works, but is there a "better" place to put this? None of the other
powerpc platforms make this call and I want to get it right, so that
others don't blindly follow my example ;)
I kept the name vague rather than specific in case more drivers need to
be setup this way in the future.
Cheers,
Sean
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: arch_initcall time
2008-02-18 18:28 arch_initcall time Sean MacLennan
@ 2008-02-18 18:31 ` Grant Likely
2008-02-18 18:32 ` Grant Likely
0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2008-02-18 18:31 UTC (permalink / raw)
To: Sean MacLennan; +Cc: LinuxPPC-dev
On Feb 18, 2008 11:28 AM, Sean MacLennan <smaclennan@pikatech.com> wrote:
> I need to call i2c_register_board_info for the new i2c style ad7414
> driver. This needs to be called at arch initcall time. Currently I just
> do this:
>
> static int __init warp_arch_init(void)
> {
> i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
> return 0;
> }
> arch_initcall(warp_arch_init);
Yes, this is the right thing to do, but use machine_arch_initcall()
instead so that it doesn't get called if it is not your board.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: arch_initcall time
2008-02-18 18:31 ` Grant Likely
@ 2008-02-18 18:32 ` Grant Likely
2008-02-18 18:42 ` Olof Johansson
0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2008-02-18 18:32 UTC (permalink / raw)
To: Sean MacLennan; +Cc: LinuxPPC-dev
On Feb 18, 2008 11:31 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Feb 18, 2008 11:28 AM, Sean MacLennan <smaclennan@pikatech.com> wrote:
> > I need to call i2c_register_board_info for the new i2c style ad7414
> > driver. This needs to be called at arch initcall time. Currently I just
> > do this:
> >
> > static int __init warp_arch_init(void)
> > {
> > i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
> > return 0;
> > }
> > arch_initcall(warp_arch_init);
>
> Yes, this is the right thing to do, but use machine_arch_initcall()
> instead so that it doesn't get called if it is not your board.
That being said, I believe there is infrastructure to handle the
creation of your i2c board info from the device tree. Your i2c board
info should not be hard coded.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: arch_initcall time
2008-02-18 18:32 ` Grant Likely
@ 2008-02-18 18:42 ` Olof Johansson
2008-02-18 18:49 ` Josh Boyer
0 siblings, 1 reply; 5+ messages in thread
From: Olof Johansson @ 2008-02-18 18:42 UTC (permalink / raw)
To: Grant Likely; +Cc: LinuxPPC-dev, Sean MacLennan
On Mon, Feb 18, 2008 at 11:32:14AM -0700, Grant Likely wrote:
> On Feb 18, 2008 11:31 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Feb 18, 2008 11:28 AM, Sean MacLennan <smaclennan@pikatech.com> wrote:
> > > I need to call i2c_register_board_info for the new i2c style ad7414
> > > driver. This needs to be called at arch initcall time. Currently I just
> > > do this:
> > >
> > > static int __init warp_arch_init(void)
> > > {
> > > i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
> > > return 0;
> > > }
> > > arch_initcall(warp_arch_init);
> >
> > Yes, this is the right thing to do, but use machine_arch_initcall()
> > instead so that it doesn't get called if it is not your board.
>
> That being said, I believe there is infrastructure to handle the
> creation of your i2c board info from the device tree. Your i2c board
> info should not be hard coded.
Jon Smirl's patches? Not yet, unfortunately. It didn't make .25, but
maybe for .26.
(I will need to do it specifically on my platform, like fsl_soc already
does, as a stopgap until then).
-Olof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: arch_initcall time
2008-02-18 18:42 ` Olof Johansson
@ 2008-02-18 18:49 ` Josh Boyer
0 siblings, 0 replies; 5+ messages in thread
From: Josh Boyer @ 2008-02-18 18:49 UTC (permalink / raw)
To: Olof Johansson; +Cc: LinuxPPC-dev, Sean MacLennan
On Mon, 18 Feb 2008 12:42:40 -0600
Olof Johansson <olof@lixom.net> wrote:
> On Mon, Feb 18, 2008 at 11:32:14AM -0700, Grant Likely wrote:
> > On Feb 18, 2008 11:31 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > > On Feb 18, 2008 11:28 AM, Sean MacLennan <smaclennan@pikatech.com> wrote:
> > > > I need to call i2c_register_board_info for the new i2c style ad7414
> > > > driver. This needs to be called at arch initcall time. Currently I just
> > > > do this:
> > > >
> > > > static int __init warp_arch_init(void)
> > > > {
> > > > i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
> > > > return 0;
> > > > }
> > > > arch_initcall(warp_arch_init);
> > >
> > > Yes, this is the right thing to do, but use machine_arch_initcall()
> > > instead so that it doesn't get called if it is not your board.
> >
> > That being said, I believe there is infrastructure to handle the
> > creation of your i2c board info from the device tree. Your i2c board
> > info should not be hard coded.
>
> Jon Smirl's patches? Not yet, unfortunately. It didn't make .25, but
> maybe for .26.
>
> (I will need to do it specifically on my platform, like fsl_soc already
> does, as a stopgap until then).
That, and Sean is still working on getting the iic device-tree-compliant driver through as
well :)
josh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-02-18 18:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-18 18:28 arch_initcall time Sean MacLennan
2008-02-18 18:31 ` Grant Likely
2008-02-18 18:32 ` Grant Likely
2008-02-18 18:42 ` Olof Johansson
2008-02-18 18:49 ` Josh Boyer
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).