当前位置: 首页>>代码示例>>C++>>正文


C++ cam_err函数代码示例

本文整理汇总了C++中cam_err函数的典型用法代码示例。如果您正苦于以下问题:C++ cam_err函数的具体用法?C++ cam_err怎么用?C++ cam_err使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cam_err函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: imx214_sunny_csi_disable

int imx214_sunny_csi_disable(hwsensor_intf_t* si)
{
    int ret = 0;
    sensor_t* sensor = NULL;

    sensor = I2S(si);

    ret = hw_csi_pad.hw_csi_disable(0);//by hefei
    if(ret)
    {
        cam_err("failed to csi disable index 0 ");
        return ret;
    }

    return 0;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:16,代码来源:imx214_sunny.c

示例2: ov8865_resume

static int ov8865_resume(struct platform_device *pdev)
{
    int ret = 0;
    struct v4l2_event event =
    {
        .type = HWCAM_V4L2_EVENT_TYPE,
        .id = HWCAM_HARDWARE_RESUME,
    };
    cam_info("%s +", __func__);
    ret = hwsensor_notify(&pdev->dev,&event);
    if(ret!=0){
        cam_err("%s fail to notify resume event to video device user",__func__);
    }
    cam_info("%s -", __func__);
    return ret;
}
开发者ID:CM13-HI6210SFT,项目名称:hisi_kernel_3.10.86_hi6210sft,代码行数:16,代码来源:ov8865_rear.c

示例3: ncp6925_off

static int ncp6925_off(struct hisi_pmic_ctrl_t *pmic_ctrl)
{
	struct ncp6925_private_data_t *pdata;

	cam_info("%s enter.", __func__);

	if (NULL == pmic_ctrl) {
		cam_err("%s pmic_ctrl is NULL.", __func__);
		return -1;
	}

	pdata = (struct ncp6925_private_data_t *)pmic_ctrl->pdata;
	gpio_direction_input(pdata->pin[PMIC_POWER_CTRL]);

	return 0;
}
开发者ID:Machiry,项目名称:android_kernel_huawei_hi6210sft,代码行数:16,代码来源:ncp6925.c

示例4: imx278_csi_enable

int imx278_csi_enable(hwsensor_intf_t* si)
{
    int ret = 0;
    sensor_t* sensor = NULL;

    sensor = I2S(si);

    ret = hw_csi_pad.hw_csi_enable(0, sensor->board_info->csi_lane, sensor->board_info->csi_mipi_clk);//by hefei
    if(ret)
    {
        cam_err("failed to csi enable index 0 ");
        return ret;
    }

    return 0;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:16,代码来源:imx278.c

示例5: tps61310_torch_mode

static int tps61310_torch_mode(struct hisi_flash_ctrl_t *flash_ctrl,
	int data)
{
	struct hisi_flash_i2c_client *i2c_client;
	struct hisi_flash_i2c_fn_t *i2c_func;
	struct tps61310_private_data_t *pdata;
	unsigned char val;

	cam_info("%s data=%d.\n", __func__, data);

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	i2c_client = flash_ctrl->flash_i2c_client;
	i2c_func = flash_ctrl->flash_i2c_client->i2c_func_tbl;
	pdata = (struct tps61310_private_data_t *)flash_ctrl->pdata;

	/*******************************************************
	 * TPS61310 REGISTER0[5:3] control LED1/3 tourch current,
	 * TPS61310 REGISTER0[2:0] control LED2 tourch current,
	 *******************************************************/
	if ((data < pdata->torch_led13_num) && (data < pdata->torch_led2_num)) {
		val = (((pdata->torch_led13[data] & 0x7) << 3)
			| (pdata->torch_led2[data] & 0x7));
		cam_debug("%s torch_led13=0x%x, torch_led2=0x%x.", __func__,
			pdata->torch_led13[data], pdata->torch_led2[data]);
	} else {
		cam_warn("%s data(%d) > torch_led13_num(%d) or torch_led2_num(%d)",
			__func__, data, pdata->torch_led13_num, pdata->torch_led2_num);
		val = (((pdata->torch_led13[pdata->torch_led13_num-1] & 0x7) << 3)
			| (pdata->torch_led2[pdata->torch_led2_num-1] & 0x7));
	}

	i2c_func->i2c_write(i2c_client, REGISTER0, val);

	i2c_func->i2c_read(i2c_client, REGISTER1, &val);
	i2c_func->i2c_write(i2c_client, REGISTER1, (val & MODE_CTRL_SHUTDONW) | TORCH_MODE_CTRL);
	i2c_func->i2c_read(i2c_client, REGISTER2, &val);
	i2c_func->i2c_write(i2c_client, REGISTER2, (val & MODE_CTRL_SHUTDONW) | TORCH_MODE_CTRL);

	/* start tourch mode */
	tps61310_set_strobe1(flash_ctrl, HIGH);
	tps61310_set_strobe0(flash_ctrl, HIGH);
	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:huawei_kernel_3.10.71_hi6210sft,代码行数:47,代码来源:tps61310.c

示例6: tps61310_off

static int tps61310_off(struct hisi_flash_ctrl_t *flash_ctrl)
{
	struct hisi_flash_i2c_client *i2c_client;
	struct hisi_flash_i2c_fn_t *i2c_func;
	struct tps61310_private_data_t *pdata;
	unsigned int state;
	unsigned char val;

	cam_debug("%s ernter.\n", __func__);

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	if (STANDBY_MODE == flash_ctrl->state.mode) {
		cam_notice("%s flash led has been powered off.", __func__);
		return 0;
	}

	mutex_lock(flash_ctrl->hisi_flash_mutex);
	flash_ctrl->state.mode = STANDBY_MODE;
	flash_ctrl->state.data = 0;
	i2c_client = flash_ctrl->flash_i2c_client;
	i2c_func = flash_ctrl->flash_i2c_client->i2c_func_tbl;
	pdata = (struct tps61310_private_data_t *)flash_ctrl->pdata;

	state = gpio_get_value(pdata->pin[RESET]);
	if (state != LOW) {
		/*************************************************
		 * set flash mode ctrl reg
		 * REGISTER1[7:6] & REGISTER2[7:6]:
		 * 00:shutdown mode
		 *************************************************/
		i2c_func->i2c_read(i2c_client, REGISTER1, &val);
		i2c_func->i2c_write(i2c_client, REGISTER1, val & SHUTDOWN_MODE);
		i2c_func->i2c_read(i2c_client, REGISTER2, &val);
		i2c_func->i2c_write(i2c_client, REGISTER2, val & SHUTDOWN_MODE);
	}

	tps61310_set_strobe0(flash_ctrl, LOW);
	tps61310_set_strobe1(flash_ctrl, HIGH);
	tps61310_set_reset(flash_ctrl, LOW);
	mutex_unlock(flash_ctrl->hisi_flash_mutex);

	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:huawei_kernel_3.10.71_hi6210sft,代码行数:47,代码来源:tps61310.c

示例7: db8131m_init

static int db8131m_init(struct v4l2_subdev *sd, u32 val)
{
	/* struct i2c_client *client = v4l2_get_subdevdata(sd); */
	struct db8131m_state *state = to_state(sd);
	int err = -EINVAL;

	cam_dbg("E\n");

	/* set initial regster value */
	if (state->sensor_mode == SENSOR_CAMERA) {
		cam_info("load camera common setting\n");
		err = db8131m_write_regs(sd, db8131m_common_1,
			sizeof(db8131m_common_1) / \
			sizeof(db8131m_common_1[0]));

		msleep(150);

		err |= db8131m_write_regs(sd, db8131m_common_2,
			sizeof(db8131m_common_2) / \
			sizeof(db8131m_common_2[0]));
	} else {
		cam_info("load recording setting\n");
		err = db8131m_write_regs(sd, db8131m_common_1,
			sizeof(db8131m_common_1) / \
			sizeof(db8131m_common_1[0]));

		msleep(150);

		err = db8131m_write_regs(sd, db8131m_common_2,
			sizeof(db8131m_common_2) / \
			sizeof(db8131m_common_2[0]));
	}
	if (unlikely(err)) {
		cam_err("failed to init\n");
		return err;
	}

	/* We stop stream-output from sensor when starting camera. */
	err = db8131m_control_stream(sd, 0);
	if (unlikely(err < 0))
		return err;
	msleep(150);

	state->initialized = 1;

	return 0;
}
开发者ID:AndreiLux,项目名称:Perseus-S3,代码行数:47,代码来源:slp_db8131m.c

示例8: tps61310_set_strobe1

static int tps61310_set_strobe1(struct hisi_flash_ctrl_t *flash_ctrl,
	unsigned int state)
{
	struct tps61310_private_data_t *pdata;

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	pdata = (struct tps61310_private_data_t *)flash_ctrl->pdata;

	cam_debug("%s strobe1=%d, state=%d.", __func__,
		pdata->pin[STROBE1], state);
	gpio_direction_output(pdata->pin[STROBE1], state);
	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:huawei_kernel_3.10.71_hi6210sft,代码行数:17,代码来源:tps61310.c

示例9: hw_lm3642_flash_mode

static int hw_lm3642_flash_mode(struct hw_flash_ctrl_t *flash_ctrl,
	int data)
{
	struct hw_flash_i2c_client *i2c_client;
	struct hw_flash_i2c_fn_t *i2c_func;
	struct hw_lm3642_private_data_t *pdata;
	unsigned char val;

	cam_debug("%s data=%d.\n", __func__, data);
	cam_info("%s 220250 data=%d.\n", __func__, data);
	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	i2c_client = flash_ctrl->flash_i2c_client;
	i2c_func = flash_ctrl->flash_i2c_client->i2c_func_tbl;
	pdata = flash_ctrl->pdata;

	/* clear error flag,resume chip */
	i2c_func->i2c_read(i2c_client, REG_FLAGS, &val);
	i2c_func->i2c_read(i2c_client, REG_CURRENT_CONTROL, &val);

	/* set LED Flash current value */
	if (data < pdata->flash_led_num) {
		cam_info("%s flash_led=0x%x.", __func__,
			pdata->flash_led[data]);
		/* REG_CURRENT_CONTROL[3:0] control flash current */
		val = ((val & 0xf0) | (pdata->flash_led[data] & 0x0f));

	} else {
		cam_warn("%s data(%d) > flash_led_num(%d).", __func__,
			data, pdata->flash_led_num);
		/* REG_CURRENT_CONTROL[3:0] control flash current */
		val = ((val & 0xf0) | (pdata->flash_led[pdata->flash_led_num-1] & 0x0f));
	}

	i2c_func->i2c_write(i2c_client, REG_CURRENT_CONTROL, val);
	if (flash_ctrl->flash_mask_enable) {
		i2c_func->i2c_write(i2c_client, REG_ENABLE, MODE_FLASH|TX_PIN);
	} else {
		i2c_func->i2c_write(i2c_client, REG_ENABLE, MODE_FLASH);
	}

	return 0;
}
开发者ID:herryfan,项目名称:kernel-huawei-h60,代码行数:46,代码来源:lm3642.c

示例10: imx214_get_otp_af

static int imx214_get_otp_af(struct hisi_sensor_ctrl_t *s_ctrl, void *data)
{
	struct sensor_cfg_data *cdata = (struct sensor_cfg_data *)data;
	int rc = 0;

	if (s_ctrl->sensor->sensor_otp.af_otp.af_otp_succeed) {
		memcpy(&cdata->cfg.af_otp, &s_ctrl->sensor->sensor_otp.af_otp,
			sizeof(struct hisi_sensor_af_otp));
		rc = 0;
	} else {
		cam_err("%s failed to get otp af.", __func__);
		memset(&cdata->cfg.af_otp, 0, sizeof(struct hisi_sensor_af_otp));
		rc = -1;
	}

	return rc;
}
开发者ID:Machiry,项目名称:android_kernel_huawei_hi6210sft,代码行数:17,代码来源:imx214.c

示例11: hw_tps61310_set_reset

static int hw_tps61310_set_reset(struct hw_flash_ctrl_t *flash_ctrl,
	unsigned int state)
{
	struct hw_tps61310_private_data_t *pdata;

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	pdata = (struct hw_tps61310_private_data_t *)flash_ctrl->pdata;

	cam_debug("%s reset=%d, state=%d.", __func__,
		pdata->pin[RESET], state);
	gpio_direction_output(pdata->pin[RESET], state);
	return 0;
}
开发者ID:Machiry,项目名称:android_kernel_huawei_hi6210sft,代码行数:17,代码来源:tps61310.c

示例12: hw_lm3646_front_flash_mode

static int hw_lm3646_front_flash_mode(struct hw_flash_ctrl_t *flash_ctrl,
    int data)
{
    struct hw_flash_i2c_client *i2c_client;
    struct hw_flash_i2c_fn_t *i2c_func;
    struct hw_lm3646_front_private_data_t *pdata;
    unsigned char val;

    cam_info("%s data=%d.\n", __func__, data);
    if (NULL == flash_ctrl) {
        cam_err("%s flash_ctrl is NULL.", __func__);
        return -1;
    }

    i2c_client = flash_ctrl->flash_i2c_client;
    i2c_func = flash_ctrl->flash_i2c_client->i2c_func_tbl;
    pdata = flash_ctrl->pdata;

    /* clear error flag,resume chip */
    i2c_func->i2c_read(i2c_client, REG_FLAGS1, &val);
    i2c_func->i2c_read(i2c_client, REG_FLAGS2, &val);
    i2c_func->i2c_read(i2c_client, REG_LED1_FLASH_CURRENT_CONTROL, &val);

    /* set LED Flash current value */
    if (data < FLASH_LED_MAX) {
        cam_info("%s flash_led=0x%x.", __func__,
        pdata->flash_led[data]);
        /* REG_CURRENT_CONTROL[3:0] control flash current */
        val = ((val & 0x80) | (data & 0x7f));
    } else {
        cam_warn("%s data(%d) > flash_led_num(%d).", __func__,
        data, pdata->flash_led_num);
        /* REG_CURRENT_CONTROL[3:0] control flash current */
        val = ((val & 0x80) | (0x7f));
    }
    i2c_func->i2c_write(i2c_client, REG_MAX_CURRENT, 0x7c);
    i2c_func->i2c_write(i2c_client, REG_LED1_FLASH_CURRENT_CONTROL, 0x22);
    if (flash_ctrl->flash_mask_enable) {
        i2c_func->i2c_write(i2c_client, REG_ENABLE, 0xd3);
    } else {
        i2c_func->i2c_write(i2c_client, REG_ENABLE, 0xd3);
    }

    return 0;
}
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:45,代码来源:lm3646_front.c

示例13: pmu_led_flash_mode

static int pmu_led_flash_mode(struct hisi_flash_ctrl_t *flash_ctrl,
	int data)
{
	struct pmu_led_private_data_t *pdata;

	cam_debug("%s data=%d.\n", __func__, data);

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	pum_led_flash_on = true;
	//hi6401_set_gain_for_flashlight(true);

	pdata = (struct pmu_led_private_data_t *)flash_ctrl->pdata;

	pmu_led_write(LED_CTRL1, pdata->led_ctrl_flash[LED_CTRL_1]);
	pmu_led_write(LED_CTRL2, pdata->led_ctrl_flash[LED_CTRL_2]);
	pmu_led_write(LED_CTRL3, pdata->led_ctrl_flash[LED_CTRL_3]);

	/* set LED Flash current value */
	if (data < pdata->flash_led_num) {
		cam_debug("%s flash_led=0x%x.", __func__,
			pdata->flash_led[data]);
		pmu_led_write(LED_CTRL4, (pdata->flash_led[data] & 0x0f));
	} else {
		cam_warn("%s data(%d) > flash_led_num(%d).", __func__,
			data, pdata->flash_led_num);
		pmu_led_write(LED_CTRL4, (pdata->flash_led[pdata->flash_led_num-1] & 0x0f));
	}

	pmu_led_write(LED_CTRL5, pdata->led_ctrl_flash[LED_CTRL_5]);
	if (flash_ctrl->flash_mask_enable) {
		pmu_led_write(LED_CTRL6, (pdata->led_ctrl_flash[LED_CTRL_6] & 0xf7));
	} else {
		pmu_led_write(LED_CTRL6, (pdata->led_ctrl_flash[LED_CTRL_6] | 0x8));
	}

	pmu_led_write(LED_CTRL7, pdata->led_ctrl_flash[LED_CTRL_7]);

	pmu_led_write(LED_CTRL2, LED_FLASH_ENABLE);

	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:hisi_kernel_3.10.86_hi6210sft,代码行数:45,代码来源:pmu_led.c

示例14: hisi_sensor_platform_probe

static int32_t hisi_sensor_platform_probe(struct platform_device *pdev,
	void *data)
{
	int32_t rc = 0;
	uint32_t group_id;
	struct hisi_sensor_ctrl_t *s_ctrl =
		(struct hisi_sensor_ctrl_t *)data;
	const char *sd_name = NULL;

	s_ctrl->pdev = pdev;
	s_ctrl->dev = &pdev->dev;
	group_id = s_ctrl->index ? HISI_CAMERA_SUBDEV_SENSOR1
				: HISI_CAMERA_SUBDEV_SENSOR0;

	if (!s_ctrl->sensor_v4l2_subdev_ops)
		s_ctrl->sensor_v4l2_subdev_ops = &hisi_sensor_subdev_ops;

	s_ctrl->hisi_sd.sd.internal_ops = &hisi_sensor_subdev_internal_ops;

	v4l2_subdev_init(&s_ctrl->hisi_sd.sd,
			s_ctrl->sensor_v4l2_subdev_ops);

	rc = of_property_read_string(pdev->dev.of_node, "hisi,sensor-name",
		&sd_name);
	cam_notice("%s name %s, rc %d\n", __func__, sd_name, rc);
	if (rc < 0) {
		cam_err("%s failed %d\n", __func__, __LINE__);
	}

	snprintf(s_ctrl->hisi_sd.sd.name,
		sizeof(s_ctrl->hisi_sd.sd.name), "%s",
		sd_name);

	cam_debug("%s sd.name is %s.\n", __func__, s_ctrl->hisi_sd.sd.name);

	v4l2_set_subdevdata(&s_ctrl->hisi_sd.sd, pdev);
	s_ctrl->hisi_sd.sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
	media_entity_init(&s_ctrl->hisi_sd.sd.entity, 0, NULL, 0);
	s_ctrl->hisi_sd.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
	s_ctrl->hisi_sd.sd.entity.group_id = group_id;
	s_ctrl->hisi_sd.sd.entity.name = s_ctrl->hisi_sd.sd.name;
	hisi_sd_register(&s_ctrl->hisi_sd);

	return rc;
}
开发者ID:CM13-HI6210SFT,项目名称:hisi_kernel_3.10.86_hi6210sft,代码行数:45,代码来源:hisi_sensor.c

示例15: aat1290a_setGpio

static int aat1290a_setGpio(void)
{
	int ret;
	int temp = 0;

	printk(KERN_DEBUG "[%s : %d]!!\n", __func__, __LINE__);

#if defined(CONFIG_S5C73M3) && defined(CONFIG_S5K6A3YX) /* D2 */
	/* FLASH_LED_UNLOCK*/
	gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
		(PMIC_MPP_FLASH_LED_UNLOCK), 1);
#endif

	/* GPIO_CAM_FLASH_SW : tourch */
	gpio_set_value_cansleep(gpio_cam_flash_sw, 0);
	temp = gpio_get_value(gpio_cam_flash_sw);
	printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_FLASH_SW : %d\n", temp);
	usleep(1*1000);

	/* flash power 1.8V */
	l28 = regulator_get(NULL, "8921_lvs4");
	ret = regulator_enable(l28);
	if (ret)
		cam_err("error enabling regulator\n");
	usleep(1*1000);

	if (pmic_gpio_msm_flash_cntl_en) {
		gpio_set_value_cansleep(pmic_gpio_msm_flash_cntl_en, 1);
	} else {
		gpio_set_value_cansleep(GPIO_MSM_FLASH_CNTL_EN, 1);
		temp = gpio_get_value(GPIO_MSM_FLASH_CNTL_EN);
		printk(KERN_DEBUG "[s5c73m3] check Flash set GPIO : %d\n",
			temp);
	}
	isFlashCntlEn = true;
	usleep(1*1000);

	gpio_set_value_cansleep(GPIO_MSM_FLASH_NOW, 1);
	temp = gpio_get_value(GPIO_MSM_FLASH_NOW);
	printk(KERN_DEBUG "[s5c73m3] check Flash enable GPIO : %d\n", temp);
	usleep(1*1000);

	return 0;
}
开发者ID:LiquidSmooth-Devices,项目名称:Deathly_Kernel_D2,代码行数:44,代码来源:board-m2-camera.c


注:本文中的cam_err函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。