AnsweredAssumed Answered

how to interface camera hm5065 in imx6sl

Question asked by THANGAMEENA RAJENDHIRAN on Jun 14, 2015
Latest reply on Jun 30, 2015 by THANGAMEENA RAJENDHIRAN

hi everyone,

 

i am working imx6sl custom board. using 4.4.2 kitkat kernel 3.0.35..

 

i started to work on camera interface heg module  H004JWP-WM8-C .using hm5065 sensor connected in i2c2 interface.

 

IN   my board file 

{

   I2C_BOARD_INFO("hm5065", 0x3E),

                   .platform_data = (void *)&camera_data,

}

 

static struct fsl_mxc_camera_platform_data camera_data = {

  .mclk = 24000000,

        .mclk_source = 0,

  .csi = 0,

  .io_init = mx6sl_csi_io_init,

  .pwdn = mx6sl_csi_cam_powerdown,

  .core_regulator = "VGEN2_1V5",

  .analog_regulator = "VGEN6_2V8",

};

 

static void mx6sl_csi_io_init(void)

{

 

mxc_iomux_v3_setup_multiple_pads(mx6sl_brd_csi_enable_pads, \

  ARRAY_SIZE(mx6sl_brd_csi_enable_pads));  

 

// Camera power down

  gpio_request(MX6SL_BRD_CSI_PWDN, "cam-pwdn");

  gpio_direction_output(MX6SL_BRD_CSI_PWDN, 1);

  msleep(5);

  gpio_set_value(MX6SL_BRD_CSI_PWDN, 0);

  msleep(5);

  gpio_set_value(MX6SL_BRD_CSI_PWDN, 1);

 

static void mx6sl_csi_cam_powerdown(int powerdown)

{

  if (powerdown)

  gpio_set_value(MX6SL_BRD_CSI_PWDN, 1);

  else

  gpio_set_value(MX6SL_BRD_CSI_PWDN, 0);

}

 

static iomux_v3_cfg_t mx6sl_brd_csi_enable_pads[] = {

  MX6SL_PAD_EPDC_GDRL__CSI_MCLK,

        MX6SL_PAD_I2C2_SCL__I2C2_SCL,

  MX6SL_PAD_I2C2_SDA__I2C2_SDA,

  MX6SL_PAD_EPDC_GDCLK__CSI_PIXCLK,

  MX6SL_PAD_EPDC_GDSP__CSI_VSYNC,

  MX6SL_PAD_EPDC_GDOE__CSI_HSYNC,

  MX6SL_PAD_EPDC_SDLE__CSI_D_9,

  MX6SL_PAD_EPDC_SDCLK__CSI_D_8,

  MX6SL_PAD_EPDC_D7__CSI_D_7,

  MX6SL_PAD_EPDC_D6__CSI_D_6,

  MX6SL_PAD_EPDC_D5__CSI_D_5,

  MX6SL_PAD_EPDC_D4__CSI_D_4,

  MX6SL_PAD_EPDC_D3__CSI_D_3,

  MX6SL_PAD_EPDC_D2__CSI_D_2,

}

added my driver hm5065.c  under  drivers/media/video/mxc/capture/<.c>

then in kconfig

  drivers/media/video/mxc/capture/kconfig

 

config MXC_CAMERA_HM5065

  tristate "hm5065 camera support for rockchip":

        depends on !VIDEO_MXC_EMMA_CAMERA

  select MXC_CAMERA_SENSOR_CLK

  #depends on SOC_CAMERA && I2C

  help

   This is a HM5065 camera driver for rockchip

 

in imx6s_android_defconfig

CONFIG_MXC_CAMERA_HM5065=Y

 

 

I done these things.. my driver file is compiled. and its loaded while booting. but i get error as

 

hm5065_read_reg:write reg error:reg=0

 

it was due to i2c_master_send got failed

but in i2cdetect -y 1

i can found address as 0x1f.. but my address is 0x3e.

Outcomes