示例#1
0
/**
 * vpbe_enum_dv_presets - Enumerate the dv presets in the current encoder
 *
 * Get the preset in the current encoder. Return the status. 0 - success
 * -EINVAL on error
 */
static int vpbe_enum_dv_presets(struct vpbe_device *vpbe_dev,
			 struct v4l2_dv_enum_preset *preset_info)
{
	struct vpbe_display_config *vpbe_config = vpbe_dev->cfg;
	int out_index = vpbe_dev->current_out_index;
	struct vpbe_output *output = &vpbe_config->outputs[out_index];
	int i, j = 0;

	if (!(output->output.capabilities & V4L2_OUT_CAP_PRESETS))
		return -EINVAL;

	for (i = 0; i < output->num_modes; i++) {
		if (output->modes[i].timings_type == VPBE_ENC_DV_PRESET) {
			if (j == preset_info->index)
				break;
			j++;
		}
	}

	if (i == output->num_modes)
		return -EINVAL;

	return v4l_fill_dv_preset_info(output->modes[i].timings.dv_preset,
					preset_info);
}
示例#2
0
static int hdmi_enum_dv_presets(struct v4l2_subdev *sd,
	struct v4l2_dv_enum_preset *preset)
{
	if (preset->index >= hdmi_pre_cnt)
		return -EINVAL;
	return v4l_fill_dv_preset_info(hdmi_conf[preset->index].preset, preset);
}
示例#3
0
static int hdmi_enum_dv_presets(struct v4l2_subdev *sd,
	struct v4l2_dv_enum_preset *enum_preset)
{
	struct hdmi_device *hdev = sd_to_hdmi_dev(sd);
	u32 preset = edid_enum_presets(hdev, enum_preset->index);

	if (preset == V4L2_DV_INVALID)
		return -EINVAL;

	return v4l_fill_dv_preset_info(preset, enum_preset);
}
示例#4
0
static int nxp_hdmi_enum_dv_presets(struct v4l2_subdev *sd,
        struct v4l2_dv_enum_preset *enum_preset)
{
    u32 preset;
    struct nxp_hdmi_context *ctx;
    struct nxp_hdmi *me = subdev_to_nxp_hdmi(sd);
    ctx = &me->ctx;

    preset = ctx->edid.enum_presets(&ctx->edid, enum_preset->index);

    if (preset == V4L2_DV_INVALID) {
        printk("error invalid\n");
        return -EINVAL;
    }

    pr_debug("%s: supported %d\n", __func__, preset);
    return v4l_fill_dv_preset_info(preset, enum_preset);
}