Ejemplo n.º 1
0
/**
 * fimc_pipeline_s_power - change power state of all pipeline subdevs
 * @fimc: fimc device terminating the pipeline
 * @state: true to power on, false to power off
 *
 * Needs to be called with the graph mutex held.
 */
static int fimc_pipeline_s_power(struct fimc_pipeline *p, bool on)
{
	static const u8 seq[2][IDX_MAX - 1] = {
		{ IDX_IS_ISP, IDX_SENSOR, IDX_CSIS, IDX_FLITE },
		{ IDX_CSIS, IDX_FLITE, IDX_SENSOR, IDX_IS_ISP },
	};
	int i, ret = 0;

	if (p->subdevs[IDX_SENSOR] == NULL)
		return -ENXIO;

	for (i = 0; i < IDX_MAX - 1; i++) {
		unsigned int idx = seq[on][i];

		ret = __subdev_set_power(p->subdevs[idx], on);


		if (ret < 0 && ret != -ENXIO)
			goto error;
	}
	return 0;
error:
	for (; i >= 0; i--) {
		unsigned int idx = seq[on][i];
		__subdev_set_power(p->subdevs[idx], !on);
	}
	return ret;
}
/**
 * fimc_pipeline_s_power - change power state of all pipeline subdevs
 * @fimc: fimc device terminating the pipeline
 * @state: 1 to enable power or 0 for power down
 *
 * Need to be called with the graph mutex held.
 */
int fimc_pipeline_s_power(struct fimc_dev *fimc, int state)
{
	int ret = 0;

	if (fimc->pipeline.sensor == NULL)
		return -ENXIO;

	if (state) {
		ret = __subdev_set_power(fimc->pipeline.csis, 1);
		if (ret && ret != -ENXIO)
			return ret;
		return __subdev_set_power(fimc->pipeline.sensor, 1);
	}

	ret = __subdev_set_power(fimc->pipeline.sensor, 0);
	if (ret)
		return ret;
	ret = __subdev_set_power(fimc->pipeline.csis, 0);

	return ret == -ENXIO ? 0 : ret;
}
Ejemplo n.º 3
0
int gsc_cap_pipeline_s_power(struct gsc_dev *gsc, int state)
{
	int ret = 0;

	if (!gsc->pipeline.sensor || !gsc->pipeline.flite)
		return -ENXIO;

	if (state) {
		ret = __subdev_set_power(gsc->pipeline.flite, 1);
		if (ret && ret != -ENXIO)
			return ret;
		ret = __subdev_set_power(gsc->pipeline.csis, 1);
		if (ret && ret != -ENXIO)
			return ret;
		ret = __subdev_set_power(gsc->pipeline.sensor, 1);
	} else {
		ret = __subdev_set_power(gsc->pipeline.flite, 0);
		if (ret && ret != -ENXIO)
			return ret;
		ret = __subdev_set_power(gsc->pipeline.sensor, 0);
		if (ret && ret != -ENXIO)
			return ret;
		ret = __subdev_set_power(gsc->pipeline.csis, 0);
	}
	return ret == -ENXIO ? 0 : ret;
}
Ejemplo n.º 4
0
/**
 * fimc_pipeline_s_power - change power state of all pipeline subdevs
 * @fimc: fimc device terminating the pipeline
 * @state: true to power on, false to power off
 *
 * Needs to be called with the graph mutex held.
 */
static int fimc_pipeline_s_power(struct fimc_pipeline *p, bool state)
{
	unsigned int i;
	int ret;

	if (p->subdevs[IDX_SENSOR] == NULL)
		return -ENXIO;

	for (i = 0; i < IDX_MAX; i++) {
		unsigned int idx = state ? (IDX_MAX - 1) - i : i;

		ret = __subdev_set_power(p->subdevs[idx], state);
		if (ret < 0 && ret != -ENXIO)
			return ret;
	}

	return 0;
}
Ejemplo n.º 5
0
/**
 * fimc_pipeline_s_power - change power state of all pipeline subdevs
 * @fimc: fimc device terminating the pipeline
 * @state: true to power on, false to power off
 *
 * Needs to be called with the graph mutex held.
 */
int fimc_pipeline_s_power(struct fimc_pipeline *p, bool state)
{
	unsigned int i;
	int ret=0;
	int use_isp=0;
	struct s5p_fimc_isp_info *s_info1;
	if (gfmd->fimc[0]->vid_cap.use_isp) {
		s_info1 = gfmd->sensor[0].pdata;
		s_info1->cam_power(1);
		use_isp = 1;
	}
	if (p->subdevs[IDX_SENSOR] == NULL)
		return -ENXIO;

	for (i = 0; i < IDX_MAX; i++) {
		unsigned int idx = state ? (IDX_MAX - 1) - i : i;
		if(idx!=IDX_SENSOR || !use_isp)
		ret = __subdev_set_power(p->subdevs[idx], state);
		if (ret < 0 && ret != -ENXIO)
			return ret;
	}

	return 0;
}