Il 17/02/2014 16:33, Alex David ha scritto:
    If you need more than one bus, you need a new device exposing the
    I2C bus, besides the new sensor devices.  USB-I2C could be one such
    device.

So let me see if I understood well. USB-I2C (host QEMU device) seems a
good idea, I could normally do : qemu-system-i386 -device
usb-I2c,chardev=foo -device usb-i2c,chardev=bar -chardev
socket,path=/tmp/test0,server,nowait,id=foo -chardev
socket,path=/tmp/test1,server,nowait,id=bar.

Almost. For QOM:

    -device usb-i2c,id=usb-i2c-0
    -device i2c-my-sensor,address=0x48,bus=usb-i2c-0.0

For chardev:

    -device usb-i2c,id=usb-i2c-0
    -chardev socket,path=/tmp/test0,server,nowait,id=chr-foo-0
    -device i2c-my-sensor,address=0x48,bus=usb-i2c-0.0,chardev=chr-foo-0

Repeat for the other buses, replacing -0 with -1 and -2.

I need a "USB-I2C guest kernel driver" that would register a bus (i2c-1
for chardev foo, i2c-2 for chardev bar etc...), I guess ?

It exists already, drivers/i2c/busses/i2c-tiny-usb.c.

Paolo

Reply via email to