I´m on the quest to control an additional i2c slave attached to the imager port .
48hrs later it seems that I completly underestimated the necessary effort and overestimated the available documentation.
Using montavista kernel and studying some already existent drivers for video stuff - I found the
i2c_driver_add - routine which calls the i2c_client_attach routine via supplied function pointer (and i2c slave addr)
After that - using i2c_transfer or whatever should work out.
Finally I discovered that this works well with my code and already embedded slaves like 0x18 and so on.
So there should be the need to register my (new) slave address somewhere - because on using my slave address - the i2c controller addesses 0x7c (instead of proper address) , gets a NACK and I got segmentation faults and lots of other ugly things (I don´t get the point here that adresses are filtered and the stuff crashes anyway). (problem replicates in user and kernel space). So the error handling is curious at that point.
Browsing around - there are "i2c_board_info" structures and things like "i2c_new_device" things - but they come in a different init style like:
i2c_add_driver
i2c_get_adapter
i2c_new_device
i2c_put_adapter
which is somewhat different to the above mentioned method used in some of the video encoder supported drivers.
Well, it would be great if you could give me some advice how this mission is intended to work out on the actual montavista kernel thing with dm 365 bsp.
I tried this from user space using ioctl - as well as form an external self-built loadable kernel module.
And everything´s fine if I use slave address 0x18 for example.- so I think my code is fine.
rgds.