linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: "Peter Hüwe" <PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: I2C Master with limited transmission sizes
Date: Sun, 17 Nov 2013 12:15:24 +0100	[thread overview]
Message-ID: <20131117111524.GB3093@katana> (raw)
In-Reply-To: <201311160438.36636.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>

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


> I'm currently writing a driver for a cheap usb-to-i2c master device, which 
> unfortunately can only write 31 bytes (+slave addr) and read 32 bytes.

Which one?

> What is the correct behavior if a user requests larger read/writes?
> Simply set i2c_msg.len to the bytes transmitted?

No!

> Or should the master try to split up the requests?

If you have control over sending start/stop bits, you could omit the
stop condition unless you transfered all of the 32 byte chunks and issue
the stop at the end.

If you can't, don't advertise I2C_FUNC_I2C, but SMBUS functions (without
the block functions again). That will work for most devices.

Hope that helps,

   Wolfram


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

  parent reply	other threads:[~2013-11-17 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16  3:38 I2C Master with limited transmission sizes Peter Hüwe
     [not found] ` <201311160438.36636.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2013-11-17 11:15   ` Wolfram Sang [this message]
2013-11-18 23:03     ` Peter Hüwe

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=20131117111524.GB3093@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=PeterHuewe-Mmb7MZpHnFY@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).