public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Ayman KHAMOUMA <ayman.khamouma-qxv4g6HH51o@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: I2c message at init time
Date: Tue, 24 Mar 2009 11:27:59 +0100	[thread overview]
Message-ID: <000201c9ac6b$34a95300$2d3f81a4@par.st.com> (raw)
In-Reply-To: <20090311122257.7c7805f0-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

Hi everybody,

I'm coming back here for a new problem...
I can't find out how to send i2c messages at init time (setup.c)
I need to send some commands via i2c in order to make my hdd work
I tried to write it as an i2c driver at init time, but it doesn't seem to
work (smbus_write_byte_data returns -1... But it works in my "normal"
modules)

Any idea ?
Here is what I'm doing:

static int __init device_init(void)
{
    unsigned        sysconf;
    int         ret;
    struct stpio_pin *pin;

    stx7100_configure_sata();
    stx7100_configure_pwm(&pwm_private_info);
    stx7100_configure_ssc(&ssc_private_info);
    stx7100_configure_usb();
    stx7100_configure_lirc(&lirc_scd);
    stx7100_configure_pata(3, 1, IRL0_IRQ);



    //vpp_pio = stpio_request_set_pin(2, 7, "flash_VPP", STPIO_OUT, 0);

    phy_reset_pin = stpio_request_set_pin(3, 7, "ste100p_reset",
                          STPIO_OUT, 1);
    stx7100_configure_ethernet(0, 0, 0);

    ret = platform_add_devices(mtv7109_devices,
ARRAY_SIZE(mtv7109_devices));

	//this is the driver I added:
    i2c_add_driver(&i2c_MTV7109PioExp_driver);
    
    
    pin = stpio_request_pin(2,5, "ATAPWR", STPIO_OUT);
    
/* reset ATAPI pin */

    stpio_set_pin(pin, 1);
    udelay(10);
    stpio_set_pin(pin, 0);
    udelay(10);
    stpio_set_pin(pin, 1);
    udelay(10);
    stpio_free_pin(pin);

    //ret = platform_add_devices(mtv7109_devices,
ARRAY_SIZE(mtv7109_devices));

    //i2c_add_driver(&i2c_MTV7109PioExp_driver);
    return ret;
}

device_initcall(device_init);

  parent reply	other threads:[~2009-03-24 10:27 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]     ` <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
2009-03-24 10:27               ` Ayman KHAMOUMA [this message]
     [not found]                 ` <000201c9ac6b$34a95300$2d3f81a4-J7BnVcvkGbbQT0dZR+AlfA@public.gmane.org>
2009-03-24 15:52                   ` I2c message at init time Jean Delvare
     [not found]                     ` <20090324165227.0d97454c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-03-24 15:58                       ` Ayman KHAMOUMA
     [not found]     ` <fd6b62c10903102327u426a4262meeabe2c581d7107b@mail.gmail.com>
     [not found]       ` <fd6b62c10903102327u426a4262meeabe2c581d7107b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-11  9:15         ` Need help on selecting one (and only one) i2c bus 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
  -- strict thread matches above, loose matches on Subject: below --
2009-03-24 10:29 I2c message at init time 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='000201c9ac6b$34a95300$2d3f81a4@par.st.com' \
    --to=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