Commit 7f4940ea authored by Samuel Ortiz's avatar Samuel Ortiz Committed by Juha Yrjola

OMAP: camera code cleanups and compilation fixes

- Fixed the Makefile: camera_core should be compiled only for OMAP1, and in
  conjunction with omap16xxcam.c.
- Fixed the sensor->init() calls and prototype in camera_core.c and
  sensor_ov9640.c.
- Ported the code to the new videobuf code.
- Renamed camera_sensor to omap_camera_sensor since this is an OMAP-specific
  structure.
Signed-off-by: default avatarSamuel Ortiz <samuel.ortiz@solidboot.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 2a419496
......@@ -3,9 +3,7 @@
obj-$(CONFIG_VIDEO_OMAP_CAMERA) += omapcamera.o
obj-$(CONFIG_VIDEO_CAMERA_SENSOR_OV9640) += sensor_ov9640.o
objs-yy := camera_core.o
objs-y$(CONFIG_ARCH_OMAP16XX) += omap16xxcam.o
objs-y$(CONFIG_ARCH_OMAP16XX) += omap16xxcam.o camera_core.o
objs-y$(CONFIG_MACH_OMAP_H3) += h3_sensor_power.o
objs-y$(CONFIG_MACH_OMAP_H4) += h4_sensor_power.o
......
......@@ -52,7 +52,7 @@
#include "camera_core.h"
struct camera_device *camera_dev;
extern struct camera_sensor camera_sensor_if;
extern struct omap_camera_sensor camera_sensor_if;
extern struct camera_hardware camera_hardware_if;
static void camera_core_sgdma_process(struct camera_device *cam);
......@@ -324,7 +324,7 @@ static void
camera_core_vbq_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
videobuf_waiton(vb, 0, 0);
videobuf_dma_pci_unmap(NULL, &vb->dma);
videobuf_dma_unmap(q, &vb->dma);
videobuf_dma_free(&vb->dma);
vb->state = STATE_NEEDS_INIT;
......@@ -374,7 +374,7 @@ camera_core_vbq_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
spin_unlock(&cam->img_lock);
if (vb->state == STATE_NEEDS_INIT)
err = videobuf_iolock(NULL, vb, NULL);
err = videobuf_iolock(q, vb, NULL);
if (!err)
vb->state = STATE_PREPARED;
......@@ -1054,7 +1054,7 @@ static int __init camera_core_probe(struct platform_device *pdev)
cam->xclk = cam->cam_hardware->set_xclk(cam->xclk, cam->hardware_data);
/* initialize the sensor and define a default capture format cam->pix */
cam->sensor_data = cam->cam_sensor->init(&cam->pix, &cam->pix2);
cam->sensor_data = cam->cam_sensor->init(&cam->pix);
if (!cam->sensor_data) {
cam->cam_hardware->disable(cam->hardware_data);
printk(KERN_ERR CAM_NAME ": cannot initialize sensor\n");
......
......@@ -90,7 +90,7 @@ struct camera_device {
unsigned long xclk;
/* Pointer to the sensor interface ops */
struct camera_sensor *cam_sensor;
struct omap_camera_sensor *cam_sensor;
void *sensor_data;
/* Pointer to the camera interface hardware ops */
......
/*
* drivers/media/video/omap/sensor_if.h
*
......@@ -19,11 +18,11 @@
#ifndef OMAP_SENSOR_IF_H
#define OMAP_SENSOR_IF_H
#define LEN_SENSOR_NAME 31
#define OMAP_SENSOR_NAME_LEN 31
struct camera_sensor {
struct omap_camera_sensor {
unsigned int version;
char name[LEN_SENSOR_NAME + 1];
char name[OMAP_SENSOR_NAME_LEN + 1];
void *(*init)(struct v4l2_pix_format *);
int (*cleanup)(void *);
......@@ -32,17 +31,17 @@ struct camera_sensor {
int (*power_off)(void *);
int (*enum_pixformat)(struct v4l2_fmtdesc *, void *);
int (*try_format) (struct v4l2_pix_format *, void *);
int (*try_format)(struct v4l2_pix_format *, void *);
unsigned long (*calc_xclk) (struct v4l2_pix_format *,
unsigned long (*calc_xclk)(struct v4l2_pix_format *,
struct v4l2_fract *, void *);
int (*configure) (struct v4l2_pix_format *, unsigned long,
int (*configure)(struct v4l2_pix_format *, unsigned long,
struct v4l2_fract *, void *);
int (*query_control) (struct v4l2_queryctrl *, void *);
int (*get_control) (struct v4l2_control *, void *);
int (*set_control) (struct v4l2_control *, void *);
int (*get_control)(struct v4l2_control *, void *);
int (*set_control)(struct v4l2_control *, void *);
};
......
......@@ -1143,7 +1143,7 @@ static struct i2c_driver ov9640sensor_i2c_driver = {
* initialization is successful.
*/
static void *
ov9640sensor_init(struct v4l2_pix_format *pix, struct v4l2_pix_format *pix2)
ov9640sensor_init(struct v4l2_pix_format *pix)
{
struct ov9640_sensor *sensor = &ov9640;
int err;
......@@ -1177,7 +1177,7 @@ ov9640sensor_init(struct v4l2_pix_format *pix, struct v4l2_pix_format *pix2)
return (void *)sensor;
}
struct camera_sensor camera_sensor_if = {
struct omap_camera_sensor camera_sensor_if = {
.version = 0x01,
.name = "OV9640",
.parallel_mode = PAR_MODE_NOBT8,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment