Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760174Ab3EXJHg (ORCPT ); Fri, 24 May 2013 05:07:36 -0400 Received: from zoneX.GCU-Squad.org ([194.213.125.0]:17594 "EHLO services.gcu-squad.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760080Ab3EXJHe (ORCPT ); Fri, 24 May 2013 05:07:34 -0400 Date: Fri, 24 May 2013 11:07:06 +0200 From: Jean Delvare To: "Mylene Josserand" Cc: "anish singh" , "kernelnewbies" , "Linux I2C" , "linux-kernel-mail" , "Arnd Bergmann" , Subject: Re: [I2C] informations + advice about messages handling Message-ID: <20130524110706.6052493e@endymion.delvare> In-Reply-To: References: <20130524094407.61d0ec42@endymion.delvare> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.14; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2075 Lines: 53 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/