linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Emanuele <rob-3bOSxtzXIkJzbRFIqnYvSA@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Linus Walleij
	<linus.ml.walleij-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Controlling Driver Load Order
Date: Thu, 27 May 2010 10:07:08 -0700	[thread overview]
Message-ID: <AANLkTilKUfcYsPqr5kXlONJQAFCaE8D8U9ltQybIzCPu@mail.gmail.com> (raw)
In-Reply-To: <20100527041358.GA14070-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Hi Wolfram,

I am using the i2c-gpio.c driver, not the i2c-at91 driver.  The Atmel
folks have expressed concerns over their i2c silicon and wrote a gpio
version.

Anyway, I better understand the subsys_initcall now and applied that
to the i2c-gpio and my i2c chip driver.  That worked perfectly for my
issue.  I'd be happy to return a patch of this.  Would be this the
sort of thing that would benefit from a config option?  Something
like:

#if defined(CONFIG_EARLY_i2C_GPIO)
subsys_initcall(i2c_gpio_init);
#else
module_init(i2c_gpio_init);
#endif

I appreciate your help and direction.

Thank you,

Rob

On Wed, May 26, 2010 at 9:13 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> On Wed, May 26, 2010 at 06:39:13PM -0700, Robert Emanuele wrote:
>
>> Still the framebuffer device would initialize first and it would lack
>> having the i2c chips it needs ready.  That is the order I'm trying to
>> straighten out.
>
> Understood. Our pointers were probably not precise enough, sorry. Please try
> this patch and give a Tested-by-tag if it solves your problems.
>
> From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Date: Thu, 27 May 2010 06:03:48 +0200
> Subject: [PATCH] i2c-at91: use subsys_initcall() for early initialization
>
> I2C needs to be available early, so other subsystems can access it.
>
> Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Robert Emanuele <rob-3bOSxtzXIkJzbRFIqnYvSA@public.gmane.org>
> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> ---
>
>  drivers/i2c/busses/i2c-at91.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
> index 305c075..bea5794 100644
> --- a/drivers/i2c/busses/i2c-at91.c
> +++ b/drivers/i2c/busses/i2c-at91.c
> @@ -313,13 +313,12 @@ static int __init at91_i2c_init(void)
>  {
>        return platform_driver_register(&at91_i2c_driver);
>  }
> +subsys_initcall(at91_i2c_init);
>
>  static void __exit at91_i2c_exit(void)
>  {
>        platform_driver_unregister(&at91_i2c_driver);
>  }
> -
> -module_init(at91_i2c_init);
>  module_exit(at91_i2c_exit);
>
>  MODULE_AUTHOR("Rick Bronson");
>
>
> --
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkv98YYACgkQD27XaX1/VRsvlwCffUOH2qAsWbaG2EmIf1Cl2H+I
> 8P4AoInnCS69XCfq6wIFku1hUgeT8hlG
> =vGcD
> -----END PGP SIGNATURE-----
>
>

  parent reply	other threads:[~2010-05-27 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTikzDvWakd7JW3DzTHinjS3dAlqzPx6K8V2qMDG7@mail.gmail.com>
     [not found] ` <AANLkTinkY8JYh44UOEPflBUDyQ2wat_AKShRjA3HPxrf@mail.gmail.com>
     [not found]   ` <20100526235246.GA31068@pengutronix.de>
     [not found]     ` <AANLkTikj8yGSK5Ovud_k8f6jWloojqDJmQ_H6pD_IFgM@mail.gmail.com>
2010-05-27  4:13       ` Controlling Driver Load Order Wolfram Sang
     [not found]         ` <20100527041358.GA14070-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-05-27 17:07           ` Robert Emanuele [this message]
2010-05-27 21:01             ` Wolfram Sang
2010-05-27 21:09             ` Ryan Mallon
2010-05-27 21:42               ` Wolfram Sang
     [not found]                 ` <20100527214209.GC5636-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-05-27 21:54                   ` Ryan Mallon
     [not found]                     ` <4BFEEA08.70401-7Wk5F4Od5/oYd5yxfr4S2w@public.gmane.org>
2010-05-27 22:09                       ` Wolfram Sang

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=AANLkTilKUfcYsPqr5kXlONJQAFCaE8D8U9ltQybIzCPu@mail.gmail.com \
    --to=rob-3bosxtzxikjzbrfiqnyvsa@public.gmane.org \
    --cc=linus.ml.walleij-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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;
as well as URLs for NNTP newsgroup(s).