public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Nick Teen <xpage_de-LWAfsSFWpa4@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: i2c_smbus_write_block_data does not send all bytes?!
Date: Tue, 15 Jul 2008 09:47:53 +0200	[thread overview]
Message-ID: <20080715094753.475708cd@hyperion.delvare> (raw)
In-Reply-To: <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>

Hi Nick,

On Tue, 15 Jul 2008 07:29:56 +0000 (GMT), Nick Teen wrote:
> > You probably want to use i2c_smbus_write_i2c_block_data instead. With
> > i2c_smbus_write_block_data, the first data byte isn't real data,
> > instead in indicates how many bytes follow until the end of the block.
> > It should result in "5D W 11 33 44" in your case though, not sure why
> > you get "5D W 11 03 33" instead.
> 
> i'm aware of the length field and i2c_smbus_write_i2c_block_data doesn't
> work, too. Now i get: 5D W 11 44
> 
> unsigned char values[3];
> int reg = 0x11;
> values[0] = 0x33;
> values[1] = 0x44;
> i2c_smbus_write_i2c_block_data(fd, reg, 2, values);
> 
> If i change the third parameter (length) to 1 I get the 0x33.

Ah, you're in user-space, using i2c-dev? You should have told us so.

> I've no idea! :-(

I don't remember any similar problem, so no idea either. I can only
suspect that your bus driver is doing something wrong. So please give
us the detail of your setup:

* Which version of i2c-dev.h are you using?
* What architecture are you working on?
* Which kernel version are you using?
* What i2c bus driver are you using?
* How do you know for sure what actually goes on the bus?

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-07-15  7:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15  7:29 i2c_smbus_write_block_data does not send all bytes?! Nick Teen
     [not found] ` <180252.53613.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15  7:47   ` Jean Delvare [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-15  8:29 Nick Teen
     [not found] ` <884255.29098.qm-WOTGQye7mknGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 10:57   ` Jean Delvare
     [not found]     ` <20080715125702.48c9569b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 12:22       ` Nick Teen
     [not found]         ` <952972.59634.qm-WQsacCdWWGLGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 12:32           ` Jean Delvare
     [not found]             ` <20080715143258.2bef9c1e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 13:02               ` Nick Teen
     [not found]                 ` <732644.12112.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 13:13                   ` Jean Delvare
     [not found]                     ` <785052.52325.qm@web27604.mail.ukl.yahoo.com>
     [not found]                       ` <785052.52325.qm-qWTMlLQujKzGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 16:52                         ` Jean Delvare
     [not found]                           ` <20080715185223.7f2f39aa-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 17:28                             ` Nick Teen
     [not found]                               ` <968764.38783.qm-fkCdBXra523GRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-15 17:52                                 ` Jean Delvare
2008-07-14 20:32 Nick Teen
     [not found] ` <247321.99325.qm-SFSZVIN0dfnGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2008-07-14 20:54   ` 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=20080715094753.475708cd@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=xpage_de-LWAfsSFWpa4@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