linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: CF <cfoissac-GANU6spQydw@public.gmane.org>
To: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
Cc: "linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Newbie: accessing i2c features through kernel functions
Date: Sun, 02 Jun 2013 23:38:12 +0200	[thread overview]
Message-ID: <51ABBB44.4010403@free.fr> (raw)
In-Reply-To: <20130531165620.52a79500@crub>

Le 31/05/2013 16:56, Anatolij Gustschin a écrit :
> On Fri, 31 May 2013 11:49:41 +0200
> CF <cfoissac-GANU6spQydw@public.gmane.org> 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 !

      parent reply	other threads:[~2013-06-02 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  9:07 License for the libi2c Mihai Buha
     [not found] ` <1369818463.42609.YahooMailNeo-KCWTPBDN160R8UyDmTZ/NZEhsgyP+Z75VpNB7YpNyf8@public.gmane.org>
2013-05-31  9:49   ` Newbie: accessing i2c features through kernel functions CF
     [not found]     ` <51A87235.2060702-GANU6spQydw@public.gmane.org>
2013-05-31 14:56       ` Anatolij Gustschin
2013-05-31 20:47         ` CF
2013-06-02 21:38         ` CF [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51ABBB44.4010403@free.fr \
    --to=cfoissac-ganu6spqydw@public.gmane.org \
    --cc=agust-ynQEQJNshbs@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).