b/arch/arm/mach-omap2/board-3430sdp.c
@@ -604,6 +604,7 @@ static void __iomem *fpga_map_addr;
static struct omap34xxcam_sensor_config cam_hwc = {
.sensor_isp = 0,
.xclk = OMAP34XXCAM_XCLK_A,
+ .pixelformat = V4L2_PIX_FMT_SGRBG10,
.capture_mem = PAGE_ALIGN(2592 * 1944 * 2) * 4,
};
@@ -640,6 +641,7 @@ static int mt9p012_sensor_set_prv_data(void *priv)
hwc->u.sensor.xclk = cam_hwc.xclk;
hwc->u.sensor.sensor_isp = cam_hwc.sensor_isp;
+ hwc->u.sensor.pixelformat = cam_hwc.pixelformat;
hwc->u.sensor.capture_mem = cam_hwc.capture_mem;
hwc->dev_index = 0;
hwc->dev_minor = 0;
@@ -769,6 +771,7 @@ static struct omap34xxcam_sensor_config ov3640_hwc = {
#else
.xclk = OMAP34XXCAM_XCLK_A,
#endif
+ .pixelformat = V4L2_PIX_FMT_RGB565,
.capture_mem = PAGE_ALIGN(2048 * 1536 * 2) * 2,
};
@@ -804,6 +807,7 @@ static int ov3640_sensor_set_prv_data(void *priv)
hwc = priv;
hwc->u.sensor.xclk = ov3640_hwc.xclk;
hwc->u.sensor.sensor_isp = ov3640_hwc.sensor_isp;
+ hwc->u.sensor.pixelformat = ov3640_hwc.pixelformat;
hwc->u.sensor.capture_mem = ov3640_hwc.capture_mem;
hwc->dev_index = 1;
hwc->dev_minor = 4;
@@ -953,6 +957,7 @@ static struct ov3640_platform_data
sdp3430_ov3640_platform_data = {
static struct omap34xxcam_sensor_config imx046_hwc = {
.sensor_isp = 0,
.xclk = OMAP34XXCAM_XCLK_B,
+ .pixelformat = V4L2_PIX_FMT_SGRBG10,
.capture_mem = PAGE_ALIGN(3280 * 2464 * 2) * 2,
};
@@ -962,6 +967,7 @@ static int imx046_sensor_set_prv_data(void *priv)
hwc->u.sensor.xclk = imx046_hwc.xclk;
hwc->u.sensor.sensor_isp = imx046_hwc.sensor_isp;
+ hwc->u.sensor.pixelformat = imx046_hwc.pixelformat;
hwc->dev_index = 2;
hwc->dev_minor = 5;
hwc->dev_type = OMAP34XXCAM_SLAVE_SENSOR;
@@ -610,6 +610,7 @@ static struct omap34xxcam_sensor_config ov3640_hwc = {
#else
.xclk = OMAP34XXCAM_XCLK_A,
#endif
+ .pixelformat = V4L2_PIX_FMT_RGB565,
.capture_mem = 2592 * 1944 * 2 * 2,
};
@@ -644,6 +645,7 @@ static int ov3640_sensor_set_prv_data(void *priv)
hwc = priv;
hwc->u.sensor.xclk = ov3640_hwc.xclk;
+ hwc->u.sensor.pixelformat = ov3640_hwc.pixelformat;
hwc->u.sensor.sensor_isp = ov3640_hwc.sensor_isp;
hwc->dev_index = 1;
hwc->dev_minor = 4;
b/arch/arm/mach-omap2/board-zoom2.c
@@ -331,6 +331,7 @@ static struct twl4030_keypad_data ldp_kp_twl4030_data = {
static struct omap34xxcam_sensor_config imx046_hwc = {
.sensor_isp = 0,
.xclk = OMAP34XXCAM_XCLK_B,
+ .pixelformat = V4L2_PIX_FMT_SGRBG10,
.capture_mem = PAGE_ALIGN(3280 * 2464 * 2) * 2,
};
@@ -340,6 +341,7 @@ static int imx046_sensor_set_prv_data(void *priv)
hwc->u.sensor.xclk = imx046_hwc.xclk;
hwc->u.sensor.sensor_isp = imx046_hwc.sensor_isp;
+ hwc->u.sensor.pixelformat = imx046_hwc.pixelformat;
hwc->dev_index = 2;
hwc->dev_minor = 5;
hwc->dev_type = OMAP34XXCAM_SLAVE_SENSOR;
b/drivers/media/video/omap34xxcam.c
@@ -392,8 +392,9 @@ static int try_pix_parm(struct omap34xxcam_videodev *vdev,
best_ival->denominator = 0;
best_pix_in->width = 0;
- /* FIXME: this isn't good... */
- best_pix_in->pixelformat = V4L2_PIX_FMT_SGRBG10;
+
+ /* first try with default pixel format designated at sensor config */
+ best_pix_in->pixelformat = vdev->vdev_sensor_config.pixelformat;
best_pix_out.height = INT_MAX >> 1;
best_pix_out.width = best_pix_out.height;
b/drivers/media/video/omap34xxcam.h
@@ -71,6 +71,7 @@ struct omap34xxcam_hw_csi2 {
struct omap34xxcam_sensor_config {
int xclk;
int sensor_isp;
+ u32 pixelformat;
u32 capture_mem;
};