PS: The i2c_smbus_write is called at the device's probe. -----Original Message----- From: khamouma [mailto:ayman.khamouma@xxxxxx] Sent: Tuesday, March 24, 2009 11:28 AM To: 'linux-i2c@xxxxxxxxxxxxxxx' Subject: I2c message at init time 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); -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html