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

Signed-off-by: Josh Wu <josh.wu@atmel.com>
ARM: at91: fix the PWM error position in sama5d3

The PWM in the wrong position, move it to the right position.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Merge branch 'at91-3.10-trunk/v3.10_drivers' into linux-3.10-at91

Conflicts:
	arch/arm/boot/dts/sama5d3.dtsi
video: atmel_hlcdfb: LCDC PWM errata

LCDC PWM is not usable with PWMPS set to DIV_1. Other dividers work fine.
This errata concern sama5d3x devices. It is recommended to use standalone PWM
output for at91sam9g35 and at91sam9x35 devices.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Merge branch 'at91-3.10-trunk/v3.10_lcd' into linux-3.10-at91
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
ov5640: only setup ov5640 register when sensor is ov5640

Signed-off-by: Josh Wu <josh.wu@atmel.com>
ov5640: add AFC firmware in registers

Signed-off-by: Josh Wu <josh.wu@atmel.com>
ov5640: enable/disable continuely auto focus when start/stop the sensor

Signed-off-by: Josh Wu <josh.wu@atmel.com>
ov5640: check the afc firmware initialized result

add parameters for wait_status function, so it can be used to check AFC
firmware initialized result

Signed-off-by: Josh Wu <josh.wu@atmel.com>