linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Mylene Josserand <Mylene.Josserand@navocap.com>
Cc: anish singh <anish198519851985@gmail.com>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	linux-kernel-mail <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [I2C] informations + advice about messages handling
Date: Fri, 24 May 2013 11:07:06 +0200	[thread overview]
Message-ID: <20130524110706.6052493e@endymion.delvare> (raw)
In-Reply-To: <CA78C307B8F06747967D122FC656B15398644A@SERVEUR0.nvp.local>

On Fri, 24 May 2013 10:54:11 +0200, Mylene Josserand wrote:
> Ah okay ! And if there are not SMBus compliant, what function I will
> have to use ?

i2c_transfer()

> What is it doing if I use this function and that my device is not SMbus 
> compliant ?

This would make no sense. Your device understands only specific message
formats, which should be documented in its datasheet. You have to use
exactly that in your driver. If the message format matches SMBus, you
can use the SMBus API, otherwise you must use i2c_transfer() instead.

> I have some difficulties to understand the differences 
> between SMbus and I2C :(

SMBus is a subset of I2C. With I2C you can have messages of any length
and any format, with no attached semantics. SMBus restricts the
possibilities to a few standardized messages formats with semantics. If
you'd just tell us what your device is, we would be able to tell you if
SMBus will work or if I2C will be needed.

> (...)
> In my case, I have 2 segments but if I understand, the bus will not be 
> used at the same time.

I can't comment on that without knowing the exact topology. In
particular, do you have two independent segments each with its own
controller, or are they interconnected in some way? I2C/SMBus is very
simple with basic topologies but can become difficult with complex ones.

> (...)
> Okay. So the mutex blocks the I2C bus. And is it locking the bus at the 
> beginning of a message (so when a START is send) and unlocking it after 
> the STOP ?

Yes.

> So a complete message will be sent to a same device (the one which 
> address is in the data frame) ? A device can not receive a beginning of 
> one message (so with his address) and the end of another message 
> destined to another device [because of "collision"], for example ?

No, this cannot happen.

-- 
Jean Delvare

  reply	other threads:[~2013-05-24  9:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA78C307B8F06747967D122FC656B153986448@SERVEUR0.nvp.local>
2013-05-24  7:22 ` [I2C] informations + advice about messages handling anish singh
     [not found]   ` <CAK7N6vpg6QUAKODKO2Msr4+GTASLDpA2cG1teQV3yiwt7D4SSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-24  7:44     ` Jean Delvare
2013-05-24  8:54       ` Mylene Josserand
2013-05-24  9:07         ` Jean Delvare [this message]
     [not found]           ` <20130524110706.6052493e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-05-24  9:52             ` Mylene Josserand
     [not found]               ` <CA78C307B8F06747967D122FC656B15398644B-h91saMYnf+Sy7mydlWgvtqzUEOm+Xw19@public.gmane.org>
2013-05-24 12:20                 ` Jean Delvare
2013-05-29 10:17                   ` Mylene Josserand
     [not found]       ` <20130524094407.61d0ec42-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-05-24 10:59         ` anish singh
     [not found]           ` <CAK7N6vqqG68c4vx1uBsNLF8zpSRQWwY5jERqjVYKE7NkEEzFSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-24 12:10             ` Jean Delvare

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=20130524110706.6052493e@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=Mylene.Josserand@navocap.com \
    --cc=anish198519851985@gmail.com \
    --cc=arnd@arndb.de \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).