14 OV2695 porting

V0.0.1

14.1 Histroy

  • 2014-05-26, rayoslee, release V0.0.1

14.2 Introduction

This document will tell you how to follow Porting Steps to finish 2bytes register address (ov2695) camera sesnor in S605-32 demo kit.

14.3 Porting Steps

  1. How to set compiler configuraiton ?
    • create a compiler option at drivers/media/video/w55fa93_hw/Kconfig

    depends on W55FA93_VIDEOIN_DEV1

        config SENSOR_OV9660_DEV1
            bool "OV9660 sensor support"
        config SENSOR_OV7670_DEV1
            bool "OV7670 sensor support"
        config SENSOR_OV7725_DEV1
            bool "OV7725 sensor support"
        config SENSOR_OV7740_DEV1
            bool "OV7740 sensor support"
    +++ config SENSOR_OV2659_DEV1</font>
    +++     bool "OV2659 sensor support"
        config SENSOR_NT99140_DEV1
            bool "NT99140 sensor support"
        config SENSOR_NT99141_DEV1
            bool "NT99141 sensor support"
        config SENSOR_NT99050_DEV1
            bool "NT99050 sensor support"
    • set a simple Makefile configuration at drivers/media/video/w55fa93_hw/Makefile


    +++ obj-$(CONFIG_SENSOR_OV2659_DEV1) += sensor_ov2659.o

    • tuning sensor clock at drivers/media/video/w55fa93_hw/sensor_ov2659.c
    #ifdef CONFIG_HV_FROM_GPB2_GPB3_DEV1
            vin_priv->pDevVin->Init(TRUE,      // BOOL bIsEnableSnrClock,
                      0,                       // E_DRVVIDEOIN_SNR_SRC eSnrSrc,        
                      24000,                   // UINT32 u32SensorFreq, 24MHz
                      eDrvVideoIn_SNR_CCIR601);// E_DRVVIDEOIN_DEV_TYPE eDevType
    #endif
            vin_priv->pDevVin->Open(72000, 24000);    //24MHz
    • give a sensor number at drivers/media/video/w55fa93_hw/videoin.c
        #elif defined  CONFIG_SENSOR_NT99050_DEV1
          static __u32 u32Sensor = NT_99050;
    +++ #elif defined  CONFIG_SENSOR_OV2659_DEV1
    +++   static __u32 u32Sensor = OV_2659;
    • give a sensor number at arch/arm/mach-w55fa93/include/mach/videodev_ex.h
     +++OV_2659=2659,
        NT_99140=99140,
        NT_99141=99141,
    • configure the sensor polarity at drivers/media/video/w55fa93_hw/sensor_ov2659.c


    vin_priv->pDevVin->SetSensorPolarity(TRUE, FALSE, TRUE); // vsync polarity, hsync polarity, pclk rising/falling latch data

    • set a color order at drivers/media/video/w55fa93_hw/sensor_ov2659.c
      vin_priv->pDevVin->SetDataFormatAndOrder(eVIDEOIN_IN_YUYV, eVIDEOIN_IN_YUV422, eVIDEOIN_OUT_YUV422);

    • set I2C protocol at drivers/media/video/w55fa93_hw/sensor_ov2659.c

    static const struct i2c_device_id sensor_id[] = {
      { "ov2659", 0 },
      { }
    };
    MODULE_DEVICE_TABLE(i2c, sensor_id);
    
    static struct i2c_driver sensor_i2c_driver = {
       .driver = {
            .name = "ov2659",
       },
       .probe    = sensor_probe,
       .remove   = sensor_remove,
       .id_table = sensor_id,
     };
    • set I2C protocol at arch/arm/mach-w55fa93/mach-w55fa93.c
     #if defined(CONFIG_SENSOR_OV2659) || defined(CONFIG_SENSOR_OV2659_DEV1)
        {
                I2C_BOARD_INFO("ov2659", 0x30),//0x60>>1
        }
     #endif