linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i2c access from kernel
@ 2014-08-14  4:11 Ran Shalit
       [not found] ` <CAJ2oMhK_pz4uM5BipEmajtQT1Q-BvVX0+-98ceb5nbPBuqKq3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ran Shalit @ 2014-08-14  4:11 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

Hello,

In userspace we can access any bus very simple, but from kernel it
seems very complex doing simple access to a bus.
The first argument to i2c_transfer is pointer to struct i2c_adapter,
which is very complex struct to fill !!

Isn't there a simpler way to access a bus (for example i2c-2) from kernel?

If I know, for example, the exact bus number, is there some way I can
get the i2c_adapter pointer to that bus ?

Thanks, Ran

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

* Re: i2c access from kernel
       [not found] ` <CAJ2oMhK_pz4uM5BipEmajtQT1Q-BvVX0+-98ceb5nbPBuqKq3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-08-14  9:35   ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2014-08-14  9:35 UTC (permalink / raw)
  To: Ran Shalit; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

Hi,

> The first argument to i2c_transfer is pointer to struct i2c_adapter,
> which is very complex struct to fill !!

You should never fill it yourself. This is the job of the i2c-core.

> If I know, for example, the exact bus number, is there some way I can
> get the i2c_adapter pointer to that bus ?

i2c_get_adapter(bus_number);

Regards,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-08-14  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14  4:11 i2c access from kernel Ran Shalit
     [not found] ` <CAJ2oMhK_pz4uM5BipEmajtQT1Q-BvVX0+-98ceb5nbPBuqKq3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-14  9:35   ` Wolfram Sang

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).