Raspberry pi device driver tutorial. Use the V4L2 drivers.