android 摄像头 ov2655 驱动注册

android 摄像头 ov2655 驱动注册


#ifdef CONFIG_VIDEO_OV2655
// CAM_PWR:GPF3_4
#define  CAM_PWR    S5PV210_GPJ4(1)
#define  CAM_RESET  S5PV210_GPE1(4)

#define CAM_PWR_ENABLE()                gpio_direction_output(CAM_PWR, 0);
#define CAM_PWR_DISABLE()               gpio_direction_output(CAM_PWR, 1);
#define CAM_RESET_HIGH()                gpio_direction_output(CAM_RESET, 1);
#define CAM_RESET_LOW()                 gpio_direction_output(CAM_RESET, 0);

static int smdkv210_ov2655_power(int onoff)
{
        int err;

        //printk("Open OV2655 camema sensor \n");
#if 0
 //! ov2655 tvp514x switch 
	gpio_request(S5PV210_GPH2(7), "GPH2");
        s3c_gpio_setpull(S5PV210_GPH2(7), S3C_GPIO_PULL_UP);
        s3c_gpio_cfgpin(S5PV210_GPH2(2), S3C_GPIO_SFN(1));
        gpio_direction_output(S5PV210_GPH2(7), 1);
        gpio_free(S5PV210_GPH2(2));
#endif

	err = gpio_request(CAM_PWR, "GPF34");
    if (err){
		printk(KERN_ERR "#### failed to request GPF34 for cam_pwr\n");
    }

	err = gpio_request(CAM_RESET, "GPE14");
    if (err){
		printk(KERN_ERR "#### failed to request GPE14 for cam_reset\n");
	}

	if(onoff){
		CAM_PWR_DISABLE();
		msleep(20);
		CAM_PWR_ENABLE();
		msleep(20);

		CAM_RESET_LOW();
		msleep(50);
		CAM_RESET_HIGH();
		msleep(15);
	}
	else{
		CAM_PWR_DISABLE();
		CAM_RESET_LOW();
	}

	gpio_free(CAM_PWR);
	gpio_free(CAM_RESET);

	return 0;
}

static struct ov2655_platform_data ov2655_plat = {
       .default_width = 800,
       .default_height = 600,
       .pixelformat = V4L2_PIX_FMT_UYVY,
       .freq = 24000000,
       .is_mipi = 0,
};

static struct i2c_board_info  ov2655_i2c_info = {
       I2C_BOARD_INFO("ov2655", 0x30), //7位的i2c地址
       .platform_data = &ov2655_plat,
};

static struct s3c_platform_camera ov2655 = {
#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_CBYCRY,
       .i2c_busnum     = 1,
       .info           = &ov2655_i2c_info,
       .pixelformat    = V4L2_PIX_FMT_UYVY,
       .srclk_name     = "mout_mpll",
       .clk_name       = "sclk_cam0",
       .clk_rate       = 24000000,
       .line_length    = 1920,
       .width          = 800,
       .height         = 600,
       .window         = {
               .left   = 0,
               .top    = 0,
               .width  = 800,
               .height = 600,
       },

       /* Polarity */
       .inv_pclk       = 0,
       .inv_vsync      = 1,
       .inv_href       = 0,
       .inv_hsync      = 0,

       .initialized    = 0,
       .cam_power      = smdkv210_ov2655_power,
};
#endif


static struct s3c_platform_fimc fimc_plat_lsi = {
	.srclk_name	= "mout_mpll",
	.clk_name	= "sclk_fimc",
	.lclk_name	= "fimc",
	.clk_rate	= 166750000,
#if defined(CONFIG_VIDEO_S5K4EA)
	.default_cam	= CAMERA_CSI_C,
#else
#ifdef CAM_ITU_CH_A
	.default_cam	= CAMERA_PAR_A,
#else
	.default_cam	= CAMERA_PAR_B,
#endif
#endif
	.camera		= {
#ifdef CONFIG_VIDEO_S5K4ECGX
			&s5k4ecgx,
#endif
#ifdef CONFIG_VIDEO_S5KA3DFX
			&s5ka3dfx,
#endif
#ifdef CONFIG_VIDEO_S5K4BA
			&s5k4ba,
#endif
#ifdef CONFIG_VIDEO_S5K4EA
			&s5k4ea,
#endif
#ifdef CONFIG_VIDEO_TVP514X
			&tvp514x_cam,
#endif
#ifdef CONFIG_VIDEO_OV9650
			&ov9650,
#endif
#ifdef CONFIG_VIDEO_OV2655
			&ov2655, //注册平台驱动
#endif
	},
	.hw_ver		= 0x43,
};


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值