Implement g_parm/s_parm ioctls. Those are used to check the current
frame rate (in fps) and to set it to a value. In practice, there are
only 15 possible different speeds, due to chip limits.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some mt9v011 webcams report 0x8332 chip version, instead of 0x8243. From
the revision history at the mt9v011 datasheet, it seems that the chip
version has changed from the first release of the chip.
Thanks-to hermann pitton <hermann-pitton@arcor.de> for pointing this to
me, on his tests with a Silvercrest webcam.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Since frames per second is a function of cristal frequency, and this is
device-specific, add a function that allows adjusting it, via
subdev->core->s_config callback.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
It is possible to adjust the fps rate by changing some register values.
This is function of the connected Xtal at the camera sensor, being a 27
MHz cristal needed, in order to support 640x480 at 30 fps.
For now, it will only calculate the values for fps. Later patches may
introduce V4L2 ioctls, to allow frequency rate adjustments.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The original driver for Silvercrest cameras were using some values that
are different from what datasheet says. As result, it was taken very
less snapshots per second than expected.
A test with the datasheet values showed that they work fine and give a
better frame rate. So, let's stick with datasheet values.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of working with a table of precalculated values, fill them with
the proper values. Also, adds format functions that allow changing the
resolution, by cropping the image to the center of the sensor.
While here, move the sensor version check to the probe routine, to
indicate to the caller if the sensor is not supported by this driver.
Also, fixes a stupid bug where we're using &buffer[] instead of
buffer[].
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Adds driver for mt9v011 based on its datasheet, available at:
http://download.micron.com/pdf/datasheets/imaging/MT9V011.pdf
The driver was tested with a webcam that will be added on a next patch.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>