ov5640: Enable OV5642 in defconfig as it support both OV5640 & OV5642.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l: atmel-isi: Use devm_* managed allocators

This simplifies error and cleanup code paths.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
v4l: atmel-isi: Reset the ISI when starting the stream

The queue setup operation isn't the right place to reset the ISI. Move
the reset call to the start streaming operation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
v4l: atmel-isi: Fix color component ordering

The ISI_CFG2.YCC_SWAP field controls color component ordering. The
datasheet lists the following orderings for the memory formats.

YCC_SWAP	Byte 0	Byte 1	Byte 2	Byte 3
00: Default	Cb(i)	Y(i)	Cr(i)	Y(i+1)
01: Mode1	Cr(i)	Y(i)	Cb(i)	Y(i+1)
10: Mode2	Y(i)	Cb(i)	Y(i+1)	Cr(i)
11: Mode3	Y(i)	Cr(i)	Y(i+1)	Cb(i)

This is based on a sensor format set to CbYCrY (UYVY). The driver
hardcodes the output memory format to YUYV, configure the ordering
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
v4l: atmel-isi: Should clear bits before set the hardware register

In the ISI driver it reads the config register to get original value,
then set the correct FRATE_DIV and YCC_SWAP_MODE directly. This will
cause some bits overlap.

So we need to clear these bits first, then set correct value. This patch
fix it.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
v4l2: atmel-isi: setup the ISI_CFG2 register directly

In the function configure_geometry(), we will setup the ISI CFG2.
If we read it first, then some bit field are still be set when the mode
is changing.
So set up this register directly makes things simpler.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l2: atmel-isi: prepare for the support of preview path

Introduce a bool to know the which path is used in currently.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l2: atmel-isi: enable RGB565 support in ISI driver

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l2: atmel-isi: add more useful debug information

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l2: atmel-isi: enable YUV convertion to RGB via preview path.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
v4l2: atmel-isi: support output same YUV format from sensor without swap

Check user camera formats, if output is YUYV, then swap it to make ISI
output YUYV.
If output format is not the user camera formats, then we output same
format from camera sensor

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Merge branch 'at91-3.10-trunk/v3.10_lcd+heo+isi' into linux-3.10-at91