qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] i2c-tiny-usb noob question


From: Tim Sander
Subject: Re: [Qemu-devel] i2c-tiny-usb noob question
Date: Tue, 17 Nov 2015 15:47:18 +0100
User-agent: KMail/4.14.2 (Linux/4.1.0quirk-00001-gf1e27b0-dirty; KDE/4.14.2; x86_64; ; )

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 via email to

[Prev in Thread] Current Thread [Next in Thread]