qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tim Sander <tim@krieglstein.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] i2c-tiny-usb noob question
Date: Tue, 17 Nov 2015 15:47:18 +0100	[thread overview]
Message-ID: <4500481.yHUsKNiHKz@dabox> (raw)
In-Reply-To: <564B35CD.9080905@redhat.com>

Hi Paolo

Thanks for your reply.

Am Dienstag, 17. November 2015, 15:12:29 schrieb Paolo Bonzini:
> On 17/11/2015 14:45, Tim Sander wrote:
> > I just gave it a try and now i have a device which is detected by linux
> > and
> > allows simple reads (without i2c backend though). But unfortunatly i am
> > currently stuck as i don't know how the address is transmitted to the
> > device?
> Do you mean how it is transmitted to the i2c-tiny-usb device by the
> driver?  The only way to find out is to read a datasheet or the driver
> code.  Or do you mean something else?
Yes, i meant that. Probably i should elaborate a little of what i found out so 
far (without beeing to aquainted with USB low level stuff):
* i2c-tiny-usb is a low speed device
* low speed devices use at maximum 8 bytes ?
* i2c-tiny-usb has no transport endpoints, just a usb control
* I would expect that the statement:
       DPRINTF("%x %x %x %x %x %x %x %x %x %x %x\n", value, request, length,
       data[0], data[1], data[2], data[3], data[4], data[5], data[6],data[7]);
would print out the address somewhere. 
* doing an access with different addresses (i2cget 0 0x50 vs. i2cget 0 0x51) 
gives the same debug output. So the address data must be hidden somewhere 
else? Probably USBPacket?

So my question could be refined where else in the qemu data structures, the 
address might still be hidden? (Or what in my assumptions is wrong so that i 
don't see the address.)

I had been looking at the sources of i2c-tiny-usb and the linux driver. I 
haven't got though all the layers of the linux infrastructure and i also could 
not map the input i see to the code in the usb dongle so far...

Best regards
Tim

PS: The debug output of the code looks like that:
i2cget -y 0 0x57

usb-i2c-tiny: got control c101, value 0
usb-i2c-tiny: USBPacket: p->iov->iov_base: 55da32596b78 pid: 2d stream: 0 
parameter: 0 status: 0 actual_length: 0
usb-i2c-tiny: usb_desc_handle_control return value: -1 status: 0
usb-i2c-tiny: got functionality read c101, value 0
usb-i2c-tiny: got control c107, value 1
usb-i2c-tiny: USBPacket: p->iov->iov_base: 55da32596b78 pid: 2d stream: 0 
parameter: 0 status: 0 actual_length: 0
usb-i2c-tiny: usb_desc_handle_control return value: -1 status: 0
usb-i2c-tiny: read access usb-i2c-tiny: 1 c107 1 1 0 ff 8e 2d 0 30 0
usb-i2c-tiny: got control c103, value 0
usb-i2c-tiny: USBPacket: p->iov->iov_base: 55da32596b78 pid: 2d stream: 0 
parameter: 0 status: 0 actual_length: 0
usb-i2c-tiny: usb_desc_handle_control return value: -1 status: 0
usb-i2c-tiny: unknown call:
usb-i2c-tiny: 0 c103 1 8 0 ff 8e 2d 0 30 0

0x08   <-output of i2cget

  reply	other threads:[~2015-11-17 14:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 13:45 [Qemu-devel] i2c-tiny-usb noob question Tim Sander
2015-11-17 14:12 ` Paolo Bonzini
2015-11-17 14:47   ` Tim Sander [this message]
2015-11-17 14:54   ` Tim Sander
2015-11-17 16:25   ` Tim Sander
2015-11-17 17:20     ` Paolo Bonzini

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=4500481.yHUsKNiHKz@dabox \
    --to=tim@krieglstein.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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).