/*
 * atomisp_subdev_init - ISP Subdevice  initialization.
 * @dev: Device pointer specific to the ATOM ISP.
 *
 * TODO: Get the initialisation values from platform data.
 *
 * Return 0 on success or a negative error code otherwise.
 */
int atomisp_subdev_init(struct atomisp_device *isp)
{
	struct atomisp_sub_device *asd;
	int i, ret = 0;

	/*
	 * CSS2.0 running ISP2400 support
	 * multiple streams
	 */
	isp->num_of_streams = isp->media_dev.driver_version ==
	    ATOMISP_CSS_VERSION_20 ? 2 : 1;
	isp->asd = devm_kzalloc(isp->dev, sizeof(struct atomisp_sub_device) *
			       isp->num_of_streams, GFP_KERNEL);
	if (!isp->asd)
		return -ENOMEM;
	for (i = 0; i < isp->num_of_streams; i++) {
		asd = &isp->asd[i];
		spin_lock_init(&asd->lock);
		asd->isp = isp;
		isp_subdev_init_params(asd);
		ret = isp_subdev_init_entities(asd);
		if (ret < 0) {
			atomisp_subdev_cleanup_entities(asd);
			break;
		}
		asd->index = i;
	}

	return ret;
}
Example #2
0
/*
 * atomisp_subdev_init - ISP Subdevice  initialization.
 * @dev: Device pointer specific to the ATOM ISP.
 *
 * TODO: Get the initialisation values from platform data.
 *
 * Return 0 on success or a negative error code otherwise.
 */
int atomisp_subdev_init(struct atomisp_device *isp)
{
    struct atomisp_sub_device *isp_subdev = &isp->isp_subdev;
    int ret;

    spin_lock_init(&isp_subdev->lock);
    isp_subdev->isp = isp;
    isp_subdev_init_params(isp_subdev);
    ret = isp_subdev_init_entities(isp_subdev);
    if (ret < 0)
        atomisp_subdev_cleanup(isp);

    return ret;
}