I was looking for a way to use my smartphone as webcam and found this page:
http://www.skipser.com/p/2/p/android-as-webcam.html
I tried the second option listed in the post, an application called DroidCAM. The post is a little bit outdated and currently the DroidCAM has a client for Linux.
You need to compile a kernel module that will “fake” a device driver webcam, the instructions to compile and test it is here:
http://www.dev47apps.com/droidcam/linuxx/
A limitation is the max resolution of 640×480.