public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Michael Jones <mjones@linear.com>
To: ecos-devel@ecos.sourceware.org
Subject: Potential I2C API Enhancement
Date: Mon, 21 Jan 2013 15:08:00 -0000	[thread overview]
Message-ID: <8B8E915D-930A-4929-BD45-4FEC71DC8462@linear.com> (raw)

While working with the I2C interface using Kinetis to write a SMBus/PMBus layer over it, I could not implement a probe.

PMBus developers typically probe the bus looking for slaves by sending an address and using ACK/NACK to determine presence.

The only way one can probe with the current I2C API is to send at least one data byte, so that the return is an indicator of success or failure. However, this is a dangerous way to probe, because it might have side effects.

Sometimes people probe with Addr+Read, but most use Addr+Write, because that avoids a potential ARA response.

I am looking for ideas how best to deal with this problem. Potential solutions:

1) Use a target specific API
2) Add to existing API, like i2c_slave_present(...
3) Add new API/Package

In my opinion, choice 2 would be the best because it is target independent, and least confusing.

The practical impact is people developing SMBus/PMBus tend to use Cortex M. There are a small number of targets (5) in the dev tree. So perhaps it is still possible to add to the I2C API?

Thoughts?

Mike


             reply	other threads:[~2013-01-21 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 15:08 Michael Jones [this message]
2013-01-21 17:09 ` Michael Jones
2013-01-21 17:29   ` Tomas Frydrych
2013-01-21 19:53     ` Michael Jones

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=8B8E915D-930A-4929-BD45-4FEC71DC8462@linear.com \
    --to=mjones@linear.com \
    --cc=ecos-devel@ecos.sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).