On Fri, 25 May 2012, [iso-8859-1] Jean-Fran�s Dagenais wrote: > Hi all, > > FYI, I'm a participating kernel device driver developer (i2c, w1, uio) but a > complete USB noob. > > I want to make a proper in-kernel i2c master driver for the Silabs CP2112 usb > to smbus bridge (actually i2c compliant). The device is presented as HID and > uses reports for operation. (see > http://www.silabs.com/Support%20Documents/TechnicalDocs/AN495.pdf ) > > Silabs expects it's customers to drive the chip from userspace using hiddev in > the kernel. This prevents users from harnessing all of the i2c client drivers > in the kernel, hence this effort. (unless I am missing something?) > > I have my CP2112 eval kit with me and I'm ready to get started but I'd like > some pointers to get on the right track ASAP. > > - as per device driver customs, which existing driver (patch or already merged) > should be used as template? I don't really know. There are drivers that do roughly the same sort of thing, but they may not be all that similar to what you want. > - where does such a driver belong? I'm guessing drivers/i2c/busses/i2c-cp2112.c Or else under drivers/usb/misc/. You're talking about writing a driver for a USB device that registers an i2c controller as a child, right? > - would I use the same internal APIs that the IOCTLs of hiddev use for example? Why would you want to? You're not writing an hiddev driver -- you're writing a USB-i2c bridge driver. > - what else should I read/look-at/consider? > > Note that aside from i2c, the chip has GPIOs. I want to properly register those > with the GPIO subsystem and implement an interrupt controller (like > gpio-adp5588.c) with these GPIOs. I know it's going to have latency, but this > would be acceptable for the i2c slaves we would put on it. Problem it, the > CP2112 doesn't have any described feature in it's API which suggests this would > be possible. Being a USB noob, my hardware guy told me something like "the USB > host controller can poll the chip for what you want and report if there's a > change". I still have some generic USB homework to do obviously, but can anyone > push me in the right direction for this? That question is pretty vague. Right direction for what? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html