/*
- * Copyright 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2005-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
/*!
* Maintains the information on the current state of the sesor.
*/
-struct sensor {
- const struct ov3640_platform_data *platform_data;
- struct v4l2_int_device *v4l2_int_device;
- struct i2c_client *i2c_client;
- struct v4l2_pix_format pix;
- struct v4l2_captureparm streamcap;
- bool on;
-
- /* control settings */
- int brightness;
- int hue;
- int contrast;
- int saturation;
- int red;
- int green;
- int blue;
- int ae_mode;
-
- u32 mclk;
- int csi;
-} ov3640_data;
+struct sensor_data ov3640_data;
static struct reg_value ov3640_setting_15fps_QXGA_2048_1536[] = {
#if 0
*/
static int ioctl_s_power(struct v4l2_int_device *s, int on)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
if (on && !sensor->on) {
if (io_regulator)
regulator_disable(io_regulator);
if (gpo_regulator)
regulator_disable(gpo_regulator);
+
+ if (camera_plat->pwdn)
+ camera_plat->pwdn(1);
}
sensor->on = on;
*/
static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_captureparm *cparm = &a->parm.capture;
int ret = 0;
*/
static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe;
u32 tgt_fps; /* target frames per secound */
enum ov3640_frame_rate frame_rate;
*/
static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
f->fmt.pix = sensor->pix;
*/
static int ioctl_dev_init(struct v4l2_int_device *s)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
u32 tgt_xclk; /* target xclk */
u32 tgt_fps; /* target frames per secound */
enum ov3640_frame_rate frame_rate;
ov3640_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */
ov3640_data.mclk = plat_data->mclk;
ov3640_data.csi = plat_data->csi;
+ ov3640_data.io_init = plat_data->io_init;
ov3640_data.i2c_client = client;
ov3640_data.pix.pixelformat = V4L2_PIX_FMT_UYVY;
if (plat_data->io_init)
plat_data->io_init();
- if (plat_data->pwdn)
- plat_data->pwdn(0);
-
camera_plat = plat_data;
ov3640_int_device.priv = &ov3640_data;
/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
/*!
* Maintains the information on the current state of the sesor.
*/
-struct sensor {
- const struct ov5640_platform_data *platform_data;
- struct v4l2_int_device *v4l2_int_device;
- struct i2c_client *i2c_client;
- struct v4l2_pix_format pix;
- struct v4l2_captureparm streamcap;
- bool on;
-
- /* control settings */
- int brightness;
- int hue;
- int contrast;
- int saturation;
- int red;
- int green;
- int blue;
- int ae_mode;
-
- u32 mclk;
- int csi;
-} ov5640_data;
+struct sensor_data ov5640_data;
static struct reg_value ov5640_setting_15fps_QSXGA_2592_1944[] = {
{0x3103, 0x11, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3008, 0x42, 0, 0},
*/
static int ioctl_s_power(struct v4l2_int_device *s, int on)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
if (on && !sensor->on) {
if (io_regulator)
regulator_disable(io_regulator);
if (gpo_regulator)
regulator_disable(gpo_regulator);
- }
+
+ if (camera_plat->pwdn)
+ camera_plat->pwdn(1);
+}
sensor->on = on;
*/
static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_captureparm *cparm = &a->parm.capture;
int ret = 0;
*/
static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe;
u32 tgt_fps; /* target frames per secound */
enum ov5640_frame_rate frame_rate;
*/
static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
f->fmt.pix = sensor->pix;
*/
static int ioctl_dev_init(struct v4l2_int_device *s)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
u32 tgt_xclk; /* target xclk */
u32 tgt_fps; /* target frames per secound */
enum ov5640_frame_rate frame_rate;
ov5640_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */
ov5640_data.mclk = plat_data->mclk;
ov5640_data.csi = plat_data->csi;
+ ov5640_data.io_init = plat_data->io_init;
ov5640_data.i2c_client = client;
ov5640_data.pix.pixelformat = V4L2_PIX_FMT_YUYV;
if (plat_data->io_init)
plat_data->io_init();
- if (plat_data->pwdn)
- plat_data->pwdn(0);
-
camera_plat = plat_data;
ov5640_int_device.priv = &ov5640_data;
/*!
* Maintains the information on the current state of the sesor.
*/
-struct sensor {
- const struct ov5640_platform_data *platform_data;
- struct v4l2_int_device *v4l2_int_device;
- struct i2c_client *i2c_client;
- struct v4l2_pix_format pix;
- struct v4l2_captureparm streamcap;
- bool on;
-
- /* control settings */
- int brightness;
- int hue;
- int contrast;
- int saturation;
- int red;
- int green;
- int blue;
- int ae_mode;
-
- u32 mclk;
- int csi;
-} ov5640_data;
+struct sensor_data ov5640_data;
static struct reg_value ov5640_init_setting_30fps_VGA[] = {
{0x3103, 0x11, 0, 0}, {0x3008, 0x82, 0, 5}, {0x3008, 0x42, 0, 0},
*/
static int ioctl_s_power(struct v4l2_int_device *s, int on)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
if (on && !sensor->on) {
if (io_regulator)
regulator_disable(io_regulator);
if (gpo_regulator)
regulator_disable(gpo_regulator);
+
+ if (camera_plat->pwdn)
+ camera_plat->pwdn(1);
}
sensor->on = on;
*/
static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_captureparm *cparm = &a->parm.capture;
int ret = 0;
*/
static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe;
u32 tgt_fps; /* target frames per secound */
enum ov5640_frame_rate frame_rate;
*/
static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
f->fmt.pix = sensor->pix;
*/
static int ioctl_dev_init(struct v4l2_int_device *s)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
u32 tgt_xclk; /* target xclk */
u32 tgt_fps; /* target frames per secound */
int ret;
ov5640_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */
ov5640_data.mclk = plat_data->mclk;
ov5640_data.csi = plat_data->csi;
+ ov5640_data.io_init = plat_data->io_init;
ov5640_data.i2c_client = client;
ov5640_data.pix.pixelformat = V4L2_PIX_FMT_UYVY;
if (plat_data->io_init)
plat_data->io_init();
- if (plat_data->pwdn)
- plat_data->pwdn(0);
-
camera_plat = plat_data;
ov5640_int_device.priv = &ov5640_data;
/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
/*!
* Maintains the information on the current state of the sesor.
*/
-struct sensor {
- const struct ov5642_platform_data *platform_data;
- struct v4l2_int_device *v4l2_int_device;
- struct i2c_client *i2c_client;
- struct v4l2_pix_format pix;
- struct v4l2_captureparm streamcap;
- bool on;
-
- /* control settings */
- int brightness;
- int hue;
- int contrast;
- int saturation;
- int red;
- int green;
- int blue;
- int ae_mode;
-
- u32 mclk;
- int csi;
-} ov5642_data;
+struct sensor_data ov5642_data;
static struct reg_value ov5642_rotate_none_VGA[] = {
{0x3818, 0xc1, 0x00, 0x00}, {0x3621, 0x87, 0x00, 0x00},
*/
static int ioctl_s_power(struct v4l2_int_device *s, int on)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
if (on && !sensor->on) {
if (io_regulator)
regulator_disable(io_regulator);
if (gpo_regulator)
regulator_disable(gpo_regulator);
+
+ if (camera_plat->pwdn)
+ camera_plat->pwdn(1);
}
sensor->on = on;
*/
static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_captureparm *cparm = &a->parm.capture;
int ret = 0;
*/
static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe;
u32 tgt_fps; /* target frames per secound */
enum ov5642_frame_rate frame_rate;
*/
static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
{
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
f->fmt.pix = sensor->pix;
static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc)
{
int retval = 0;
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
__u32 captureMode = sensor->streamcap.capturemode;
pr_debug("In ov5642:ioctl_s_ctrl %d\n",
u8 RegVal = 0;
int retval = 0;
- struct sensor *sensor = s->priv;
+ struct sensor_data *sensor = s->priv;
u32 tgt_xclk; /* target xclk */
u32 tgt_fps; /* target frames per secound */
enum ov5642_frame_rate frame_rate;
ov5642_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */
ov5642_data.mclk = plat_data->mclk;
ov5642_data.csi = plat_data->csi;
+ ov5642_data.io_init = plat_data->io_init;
ov5642_data.i2c_client = client;
ov5642_data.pix.pixelformat = V4L2_PIX_FMT_YUYV;
if (plat_data->io_init)
plat_data->io_init();
- if (plat_data->pwdn)
- plat_data->pwdn(0);
-
camera_plat = plat_data;
ov5642_int_device.priv = &ov5642_data;