[meta-freescale] how to access i2c bus on imx6q sabrelite

Thanassis Silis djnass_18 at hotmail.com
Wed Jul 24 12:58:10 PDT 2013


in the end It was my code's problem. It is different compared to i2cset.c , so I had to revise it.
Sorry about that.



> Date: Wed, 24 Jul 2013 22:27:37 +1000
> Subject: Re: [meta-freescale] how to access i2c bus on imx6q sabrelite
> From: phil at blackmoth.com.au
> To: djnass_18 at hotmail.com
> CC: meta-freescale at yoctoproject.org
> 
> On Wed, Jul 24, 2013 at 8:44 PM, Thanassis Silis <djnass_18 at hotmail.com> wrote:
> > Hi there!
> > well, I am attempting to open /dev/i2c-2 directly from my application.
> >
> > I do get a file descriptor (i2c_fd!=-1) , but then sending the same data as
> > I do from, i2cset does not yield the same result..
> 
> What is your code for sending data? There's nothing special about
> i2cset. If your code is the same then it will work. There is some
> documentation on using the i2c device at
> https://www.kernel.org/doc/Documentation/i2c/dev-interface.
> 
> >> Date: Wed, 24 Jul 2013 09:46:14 +1000
> >> Subject: Re: [meta-freescale] how to access i2c bus on imx6q sabrelite
> >> From: phil at blackmoth.com.au
> >> To: djnass_18 at hotmail.com
> >> CC: meta-freescale at yoctoproject.org
> >
> >>
> >> On Wed, Jul 24, 2013 at 2:30 AM, Thanassis Silis <djnass_18 at hotmail.com>
> >> wrote:
> >> > if, however, i try:
> >> >
> >> > i2cset 2 0x5A 0x1A 1
> >> >
> >> > it works! The "2" was a reasonable choice resembling i2c-2, but looking
> >> > into
> >> > i2cset.c (& i2cbusses.c),
> >> > it seems that the code is looking into /dev/i2c/X, where X= the number
> >> > given
> >> > in the argument).
> >> > But I have no "folder" /dev/i2c/.
> >>
> >> The code first tries /dev/i2c/2, and when that fails it tries
> >> /dev/i2c-2. You can confirm this using strace.
> >>
> >> > This is puzzling. What is more, I don't know how to access the i2c-2 bus
> >> > from my application, as
> >>
> >> Your application can do the same as i2cset.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20130724/9faa3563/attachment.html>


More information about the meta-freescale mailing list