int msm_camio_probe_on(void *s_ctrl)//(struct platform_device *pdev) { int rc = 0; struct msm_sensor_ctrl_t* sctrl = (struct msm_sensor_ctrl_t *)s_ctrl; struct msm_camera_sensor_info *sinfo = sctrl->sensordata;//pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camio_sctrl = sctrl;//camio_dev = pdev; /* HTC_START (klockwork issue)*/ if (!camdev) { pr_err("%s: Invalid camdev\n", __func__); return -EFAULT; } /* HTC_END */ camio_clk = camdev->ioclk; pr_info("[CAM] %s: sinfo sensor name - %s\n", __func__, sinfo->sensor_name); pr_info("[CAM] %s: camio_clk m(%d) v(%d)\n", __func__, camio_clk.mclk_clk_rate, camio_clk.vfe_clk_rate); rc = msm_camio_config_gpio_table(1); if (rc < 0) return rc; msm_camera_vreg_enable(sinfo);//(pdev); if (camdev && camdev->camera_csi_on && (!probe_up)) rc = camdev->camera_csi_on(); if (rc < 0) pr_info("[CAM] %s camera_csi_on failed\n", __func__); return rc; }
int msm_camio_probe_on(struct platform_device *pdev) { struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camdev->camera_gpio_on(); msm_camera_vreg_enable(); return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); }
int msm_camio_sensor_clk_on(struct platform_device *pdev) { struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; unsigned int mclk_cfg; int rc = 0; pr_info("%s\n", __func__); camio_dev = pdev; camio_ext = camdev->ioext; camio_clk = camdev->ioclk; // Disable MCLK mclk_cfg = GPIO_CFG(32, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA); gpio_tlmm_config(mclk_cfg, GPIO_CFG_ENABLE); msm_camera_vreg_enable(); msleep(10); rc = camdev->camera_gpio_on(); if (rc < 0) return rc; #if defined (CONFIG_SENSOR_M5MO) // ldo on sinfo->sensor_platform_info->sensor_power_control(1); //on // MCLK rc = msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); //MCLK ON mclk_cfg = GPIO_CFG(32, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA); gpio_tlmm_config(mclk_cfg, GPIO_CFG_ENABLE); #if defined (CONFIG_SENSOR_SR200PC20M) msleep(30); // min 30ms #else msleep(3); // min 350ns #endif // reset high if (sinfo->sensor_platform_info->sensor_reset) { gpio_set_value_cansleep(sinfo->sensor_platform_info->sensor_reset, 1); msleep(5); } return rc; #elif defined(CONFIG_MACH_P5_LTE) // MCLK rc = msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); //MCLK ON mclk_cfg = GPIO_CFG(32, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_4MA); gpio_tlmm_config(mclk_cfg, GPIO_CFG_ENABLE); return rc; #else return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); #endif }
int msm_camio_sensor_clk_on(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; msm_camera_vreg_enable(); msleep(10); rc = camdev->camera_gpio_on(); if (rc < 0) return rc; return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); }
int msm_camio_probe_on(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camio_dev = pdev; camio_clk = camdev->ioclk; rc = config_gpio_table(1); if (rc < 0) return rc; msm_camera_vreg_enable(pdev); return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); }
int msm_camio_sensor_clk_on(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camio_clk = camdev->ioclk; camio_ext = camdev->ioext; camdev->camera_gpio_on(); msm_camera_vreg_enable(); msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); msm_camio_clk_enable(CAMIO_CAMIF_PAD_PBDG_CLK); if (!sinfo->csi_if) { pr_err("%s: %d %d %s", __func__, camio_ext.camifpadphy, camio_ext.camifpadsz, pdev->name); camifpadio = request_mem_region(camio_ext.camifpadphy, camio_ext.camifpadsz, pdev->name); msm_camio_clk_enable(CAMIO_VFE_CLK); if (!camifpadio) { rc = -EBUSY; goto common_fail; } camifpadbase = ioremap(camio_ext.camifpadphy, camio_ext.camifpadsz); if (!camifpadbase) { CDBG("msm_camio_sensor_clk_on fail\n"); rc = -ENOMEM; goto parallel_busy; } } return rc; parallel_busy: release_mem_region(camio_ext.camifpadphy, camio_ext.camifpadsz); goto common_fail; common_fail: msm_camio_clk_disable(CAMIO_CAM_MCLK_CLK); msm_camio_clk_disable(CAMIO_VFE_CLK); msm_camio_clk_disable(CAMIO_CAMIF_PAD_PBDG_CLK); msm_camera_vreg_disable(); camdev->camera_gpio_off(); return rc; }
int msm_camio_sensor_clk_on(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camio_dev = pdev; camio_clk = camdev->ioclk; msm_camera_vreg_enable(pdev); if (sinfo->sensor_platform_info->privacy_light) { struct msm8960_privacy_light_cfg *privacy_light_config = sinfo->sensor_platform_info->privacy_light_info; pm8xxx_mpp_config(privacy_light_config->mpp, &privacy_light_on_config); } msleep(20); rc = config_gpio_table(1); if (rc < 0) return rc; return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); }
int msm_camio_sensor_clk_on(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; unsigned int mclk_cfg; camio_dev = pdev; camio_ext = camdev->ioext; camio_clk = camdev->ioclk; // Disable MCLK mclk_cfg = GPIO_CFG(32, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA); gpio_tlmm_config(mclk_cfg, GPIO_CFG_ENABLE); msm_camera_vreg_enable(); msleep(10); rc = camdev->camera_gpio_on(); if (rc < 0) return rc; return msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); }
int msm_camio_enable(struct platform_device *pdev) { int rc = 0; struct msm_camera_sensor_info *sinfo = pdev->dev.platform_data; struct msm_camera_device_platform_data *camdev = sinfo->pdata; camio_dev = pdev; camio_ext = camdev->ioext; camio_clk = camdev->ioclk; camdev->camera_gpio_on(); msm_camera_vreg_enable(); msm_camio_clk_enable(CAMIO_CAM_MCLK_CLK); msm_camio_clk_enable(CAMIO_VFE_CLK); msm_camio_clk_enable(CAMIO_CSI0_VFE_CLK); msm_camio_clk_enable(CAMIO_CSI1_VFE_CLK); msm_camio_clk_enable(CAMIO_CSI_SRC_CLK); msm_camio_clk_enable(CAMIO_CSI0_CLK); msm_camio_clk_enable(CAMIO_CSI1_CLK); msm_camio_clk_enable(CAMIO_VFE_PCLK); msm_camio_clk_enable(CAMIO_CSI0_PCLK); msm_camio_clk_enable(CAMIO_CSI1_PCLK); csiio = request_mem_region(camio_ext.csiphy, camio_ext.csisz, pdev->name); if (!csiio) { rc = -EBUSY; goto common_fail; } csibase = ioremap(camio_ext.csiphy, camio_ext.csisz); if (!csibase) { rc = -ENOMEM; goto csi_busy; } rc = request_irq(camio_ext.csiirq, msm_io_csi_irq, IRQF_TRIGGER_RISING, "csi", 0); if (rc < 0) goto csi_irq_fail; return 0; csi_irq_fail: iounmap(csibase); csi_busy: release_mem_region(camio_ext.csiphy, camio_ext.csisz); common_fail: msm_camio_clk_disable(CAMIO_CAM_MCLK_CLK); msm_camio_clk_disable(CAMIO_CSI0_VFE_CLK); msm_camio_clk_disable(CAMIO_CSI0_CLK); msm_camio_clk_disable(CAMIO_CSI1_VFE_CLK); msm_camio_clk_disable(CAMIO_CSI1_CLK); msm_camio_clk_disable(CAMIO_VFE_PCLK); msm_camio_clk_disable(CAMIO_CSI0_PCLK); msm_camio_clk_disable(CAMIO_CSI1_PCLK); /* Disable CAMIO_CSI1_VFE_CLK, CAMIO_CSI1_CLK, CAMIO_CSI1_PCLK for the secondary sensor */ msm_camera_vreg_disable(); camdev->camera_gpio_off(); return rc; }