Re: Newbie: accessing i2c features through kernel functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le 31/05/2013 16:56, Anatolij Gustschin a écrit :
On Fri, 31 May 2013 11:49:41 +0200
CF <cfoissac@xxxxxxx> wrote:

I'm requesting help. I am currently successfully using i2c-dev module.
But i'm unable to drive i2c busses from kernel space as i'd do from
userspace (with the use of open, read, write, ioctl functions). I can't
logically acces glibc.

Can somebody point me how i could do from kernel space ?
you need to get the I2C adapter for your bus using i2c_get_adapter()
and then send the I2C messages by i2c_transfer().

Anatolij

It works flawlessly. I could directly drive a device attached to my i2c bus simply by wrapping i2c_tranfer() and some i2c_msg messages, thus expose w/e functions i need to propose a reduced instruction set.

I also learned how works fops structure, to retrieve the equivalent of open/read/write/ioctl 's GLIBC in kernel space. Although i don't use it for my need, quick tests worked nicely with them.

I'll perhaps dig how to work with others structures (in example i don't really see how i2c_client works), and i certainly also need to understand the differences between various algorithms.

Thank you !
--
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




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux