linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "I2C_RDWR" ioctl returning EINVAL on Freescale mxc
@ 2009-08-14 21:09 alfred steele
       [not found] ` <528f13590908141409g4b2556e5m10aec0dc15429457-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: alfred steele @ 2009-08-14 21:09 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

Hi all,

In my userspace driver for a temp sensor on a i2c bus, i am using the
/dev interface.  When i use plain read/write syscalls , they seem to
work just fine. But when i use a combined read/write using the IOCTL
"I2C_RDWR", i get a return of invalid argument i.e EINVAL from the
kernel space i2c dev/bus driver.

int rest  = ioctl(_fd, I2C_RDWR,  trans );

So basically res gets a value<1 on execution. I am putting in the
correct slave address. i have double checked on it. What could be the
other obvious reasons? Could endian ness be an issue as well although
the userspace is really invisible and if that had been the case i
would not have got acks from the slave for a i2c scan on the bus.
i checked the kernel bus driver code for the reason, but cannot figure
out just by reading the code at this point  as i have a broken h/w.
iam using the freescale  mxc i2c bus driver on the kernel side.

Any clues?
Thanks in advance.
-Alfred.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-18  6:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-14 21:09 "I2C_RDWR" ioctl returning EINVAL on Freescale mxc alfred steele
     [not found] ` <528f13590908141409g4b2556e5m10aec0dc15429457-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-17  6:53   ` Robert Schwebel
     [not found]     ` <20090817065313.GJ31727-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-08-17 14:51       ` alfred steele
     [not found]         ` <528f13590908170751u4dcf6d8ftb865103b888225e0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-17 15:01           ` Robert Schwebel
     [not found]             ` <20090817150159.GT31727-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-08-17 21:04               ` alfred steele
     [not found]                 ` <528f13590908171404q2aa4f9aaub98a191c91bd2448-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-17 21:21                   ` Robert Schwebel
     [not found]                     ` <20090817212127.GB31727-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-08-18  3:25                       ` alfred steele
     [not found]                         ` <528f13590908172025i276dc634qd0829cfad8c8c608-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-18  6:13                           ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).