The iSight in the MacBook has to be initialised with firmware.
For reference, in the AppleUSBVideoSupport binaries, the firmware starts at
The firmware blob is structured like this:
__be16 data_length; __be16 value; __u8 data[data_length];
This type of record repeats until data_length is 0x8001, which means you've reached the end.
- usb_control_msg(dev, 0x40, 0xA0, 0xe600, 0, "1", 1, ...)
- for each firmware record, traverse the data as follows:
- initialise value to the record's value variable
- split the data up into 50 byte pieces (the last one may be shorter) and upload each piece using usb_control_msg(dev, 0x40, 0xA0, value, 0, chunk, chunklen, ...), increasing the value variable by 50 after each chunk. chunklen is obviously 50 for all but (possibly) the last block
- finish off with usb_control_msg(dev, 0x40, 0xA0, 0xe600, 0, "0", 1, ...)
If any of the calls fail, that's an error.
At this point, the device disconnects from and reconnects to the USB bus.
Ronald Bultje has written code to load the firmware.