From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyhY3-0003XI-4Z for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:47:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyhXy-0007pc-58 for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:47:55 -0500 Received: from lvps176-28-13-145.dedicated.hosteurope.de ([176.28.13.145]:47703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyhXx-0007pM-Um for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:47:50 -0500 From: Tim Sander Date: Tue, 17 Nov 2015 15:47:18 +0100 Message-ID: <4500481.yHUsKNiHKz@dabox> In-Reply-To: <564B35CD.9080905@redhat.com> References: <1691671.NeDo6VeWzF@dabox> <564B35CD.9080905@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [Qemu-devel] i2c-tiny-usb noob question List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org 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