/* This will set vpif input to capture data from tvp514x or tvp7002.  */
static int setup_vpif_input_path(int channel, const char *sub_dev_name)
/* This will set vpif input to capture data from tvp514x or tvp7002.  */
static int setup_vpif_input_path(int channel, const char *sub_dev_name)
{
	int err = 0;
	int val;
	if (channel != 0)
		return 0;
	if (!cpld_client)
		return -ENXIO;
	val = i2c_smbus_read_byte(cpld_client);
	if (val < 0)
		return val;
	if (!strcmp(sub_dev_name, TVP5147_CH0) ||
	    !strcmp(sub_dev_name, TVP5147_CH1))
		val &= TVP5147_INPUT;
	else
		val |= TVP7002_INPUT;
	err = i2c_smbus_write_byte(cpld_client, val);
	if (err)
		return err;
	return 0;
}