LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Can't detect i2c device (http://www.linuxquestions.org/questions/linux-hardware-18/cant-detect-i2c-device-882967/)

Shum 05-27-2011 01:05 AM

Can't detect i2c device
 
I have a real time clock on my motherboard that I'd like to use. It's connected via the SMBus which is normally registered as i2c-0 during boot. I'm using this driver for it, it patches and compiles fine and registers the i2c driver during boot.

However I'm not having any luck instantiating the device. I've added the following to the code for my mainboard:
Code:

static struct i2c_board_info i2c_board_info[] __initdata = {
        {
                I2C_BOARD_INFO("rtc-isl12024", 0x57),
        },
};

... (in __init function)
        i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));

My understanding is that this registers my driver with i2c bus 0 so when the kernel creates the SMBus adapter it should probe my driver. Instead this causes the SMBus to be registered as i2c-1 and my driver never gets probed.

I've also tried registering the device from user space. Instead of calling i2c_register_board_info during boot I run
Code:

echo rtc-isl12024 0x57 > /sys/bus/i2c/devices/i2c-0/new_device
This succeeds, ie. it returns 0 and doesn't complain about a write error like it does if I give it any other address, but it still doesn't probe my driver :(.

I'm doing this on a Gentoo 2.6.33 realtime kernel.
Any ideas? What could I be doing wrong?


All times are GMT -5. The time now is 12:11 AM.