s5pv210 之 OV965X 驱动开发
1. 在 “/linux-2.6.35.7 /drivers/media/video”目录下增加两个文件“ov965x.c”和“ov965x.h”。
2. 在 “/linux-2.6.35.7 /include/media”目录下增加一个文件“ov9650_platform.h”。
3. 在 “/linux-2.6.35.7 /drivers/media/video”目录下找到”Makefile”这个文件如下修改
#ifneq ($(wildcard drivers/media/video/ov9650.c),)
#ifeq ($(FA),1)
#obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
#else
#obj-m += ov9650.o
#endif #FA
#endif
obj-$(CONFIG_VIDEO_OV9650) += ov965x.o
4. 在 “/linux-2.6.35.7-android/drivers/media/video”目录下找到”Kconfig”
增加下面 5 行
config VIDEO_OV9650
tristate "OV9650 Camera Sensor"
depends on I2C && VIDEO_V4L2
---help---
This driver supports OV9650 SoC camera module
5. 在“/linux-2.6.35.7 /arch/arm/mach-s5pv210/mach-mini210.c”加入 OV965X 的配置.
#ifdef CONFIG_VIDEO_OV9650
static int ov9650_power_en(int onoff)
{
#define CAMA_PWR_EN S5PV210_GPJ2(4)
gpio_request(CAMA_PWR_EN, "GPJ2_4");
gpio_direction_output(CAMA_PWR_EN, onoff);
gpio_free(CAMA_PWR_EN);
printk("ov9650: power %s", onoff ? "ON" : "Off");
return 0;
}
static struct ov9650_platform_data ov9650_plat = {
.default_width = 1280,
.default_height = 1024,
.pixelformat = V4L2_PIX_FMT_YUYV,
.freq = 40000000,
.is_mipi = 0,
};
static struct i2c_board_info ov9650_i2c_info = {
I2C_BOARD_INFO("ov9650", (0x60>>1)),
.platform_data = &ov9650_plat,
};
static struct s3c_platform_camera ov9650 = {
#ifdef CAM_ITU_CH_A
.id = CAMERA_PAR_A,
#else
.id = CAMERA_PAR_B,
#endif
.type = CAM_TYPE_ITU,
.fmt = ITU_601_YCBCR422_8BIT,
.order422 = CAM_ORDER422_8BIT_YCBYCR,
.i2c_busnum = 0,
.info = &ov9650_i2c_info,
.pixelformat = V4L2_PIX_FMT_YUYV,
.srclk_name = "mout_mpll",
/* .srclk_name = "xusbxti", */
.clk_name = "sclk_cam1",
.clk_rate = 40000000,
.line_length = 1920,
.width = 1280,
.height = 1024,
.window = {
.left = 0,
.top = 0,
.width = 1280,
.height = 1024,
},
/* Polarity */
- 1
- 2
前往页