[PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API

Grant Likely grant.likely at secretlab.ca
Tue Apr 22 07:15:34 EST 2008


On Mon, Apr 21, 2008 at 10:41 AM, Anton Vorontsov
<avorontsov at ru.mvista.com> wrote:
> On Mon, Apr 21, 2008 at 08:58:09AM -0600, Grant Likely wrote:
>  > Its not great.  It has a boot time impact for every platform compiled
>  > into the kernel.  The problem gets worse every time another block of
>  > code uses this method.  Personally I prefer platform code calling it
>  > explicitly.
>  >
>  > Making it an of_platform device would also eliminate that problem, but
>  > you'd need a method to synchronize the driver with its users.
>  >
>  > I'm not going to raise a big stink about it, but the issue should not
>  > be ignored.
>
>  Heh.. how QE GPIO is different from FSL GTM then? Should I call
>  fsl_gtm_init() from the board file too? For the every board? I do
>  believe that years later someone will show up with something like this:
>
>
>   From: J. Random Hacker
>   Subject: [POWERPC] cleanup board initialization code
>
>   This patch removes vast amount of machine_arch_initcall()s that were
>   used to solely initialize some hardware, like this:
>
>   qe_add_gpio_chips();
>   fsl_gtm_init();
>   fsl_spi_init();

Or have a soc-level helper function for calling them for you; but yes.

And, no, we shouldn't have a vast array of individual initcalls
because the platform code shouldn't be that large.  As much as
possible, multiple boards should be supported by the same platform
code.  I argue that most boards using the same SoC should use the same
platform code. (see platforms/52xx/mpc5200_simple.c)

Individual calls has the added advantage that if a board port needs
those functions to *not* be called (for whatever reason) then it has
the ability to not call them.

It is for the same reason that the platform code is responsible for
calling of_platform_bus_probe() instead of it being an initcall; it
give the platform code control over the device registrations.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list