/* Get current standard detected by TVP5146/47, STD_INVALID if there is no standard detected.  */
static enum tvp514x_std tvp514x_get_current_std(struct v4l2_subdev *sd)
/* Get current standard detected by TVP5146/47, STD_INVALID if there is no standard detected.  */
static enum tvp514x_std tvp514x_get_current_std(struct v4l2_subdev *sd)
{
	u8 std, std_status;
	std = tvp514x_read_reg(sd, REG_VIDEO_STD);
	if ((std & VIDEO_STD_MASK) == VIDEO_STD_AUTO_SWITCH_BIT)
		std_status = tvp514x_read_reg(sd, REG_VIDEO_STD_STATUS);
	else
		std_status = std;
	switch (std_status & VIDEO_STD_MASK) {
	case VIDEO_STD_NTSC_MJ_BIT:
		return STD_NTSC_MJ;
	case VIDEO_STD_PAL_BDGHIN_BIT:
		return STD_PAL_BDGHIN;
	default:
		return STD_INVALID;
	}
	return STD_INVALID;
}