/* vpfe_get_app_input - Get app input index for a given subdev input index driver stores the input index of the current sub device and translate it when application request the current input  */
static int vpfe_get_app_input_index(struct vpfe_device *vpfe_dev, int *app_input_index)
/* vpfe_get_app_input - Get app input index for a given subdev input index driver stores the input index of the current sub device and translate it when application request the current input  */
static int vpfe_get_app_input_index(struct vpfe_device *vpfe_dev, int *app_input_index)
{
	struct vpfe_config *cfg = vpfe_dev->cfg;
	struct vpfe_subdev_info *sdinfo;
	int i, j = 0;
	for (i = 0; i < cfg->num_subdevs; i++) {
		sdinfo = &cfg->sub_devs[i];
		if (!strcmp(sdinfo->name, vpfe_dev->current_subdev->name)) {
			if (vpfe_dev->current_input >= sdinfo->num_inputs)
				return -1;
			*app_input_index = j + vpfe_dev->current_input;
			return 0;
		}
		j += sdinfo->num_inputs;
	}
	return -EINVAL;
}