Пример #1
0
static ssize_t external_common_rda_video_mode_str(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	ssize_t ret = snprintf(buf, PAGE_SIZE, "%s\n",
		video_format_2string(external_common_state->video_resolution));
	DEV_DBG("%s: '%s'\n", __func__,
		video_format_2string(external_common_state->video_resolution));
	return ret;
}
static ssize_t hdmi_common_wta_video_mode(struct device *dev,
        struct device_attribute *attr, const char *buf, size_t count)
{
    ssize_t ret = strnlen(buf, PAGE_SIZE);
    uint32 video_mode;
    const struct hdmi_disp_mode_timing_type *disp_mode;

    mutex_lock(&hdmi_common_state_hpd_mutex);
    if (!hdmi_common_state->hpd_state) {
        mutex_unlock(&hdmi_common_state_hpd_mutex);
        DEV_INFO("%s: FAILED: display off or cable disconnected\n",
                 __func__);
        return ret;
    }
    mutex_unlock(&hdmi_common_state_hpd_mutex);

    video_mode = atoi(buf)-1;
    disp_mode = hdmi_common_get_supported_mode(video_mode);
    if (!disp_mode) {
        DEV_INFO("%s: FAILED: mode not supported (%d)\n",
                 __func__, video_mode);
        return ret;
    }

    kobject_uevent(hdmi_common_state->uevent_kobj, KOBJ_OFFLINE);

    hdmi_common_state->disp_mode_list.num_of_elements = 1;
    hdmi_common_state->disp_mode_list.disp_mode_list[0] = video_mode;
    DEV_DBG("%s: 'mode=%d %s' successful (sending OFF/ONLINE)\n", __func__,
            video_mode, video_format_2string(video_mode));

    kobject_uevent(hdmi_common_state->uevent_kobj, KOBJ_ONLINE);
    return ret;
}
Пример #3
0
static ssize_t hdmi_common_rda_edid_modes(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	ssize_t ret = 0;
	int i;

	buf[0] = 0;
	if (external_common_state->disp_mode_list.num_of_elements) {
		uint32 *video_mode = external_common_state->disp_mode_list
			.disp_mode_list;
		for (i = 0; i < external_common_state->disp_mode_list
			.num_of_elements; ++i) {
			if (ret > 0)
				ret += snprintf(buf+ret, PAGE_SIZE-ret, ",%d",
					*video_mode++ + 1);
			else
				ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d",
					*video_mode++ + 1);
		}
	} else
		ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d",
			external_common_state->video_resolution+1);

#if defined(CONFIG_VIDEO_MHL_V1) || defined(CONFIG_VIDEO_MHL_V2)
	DEV_DBG("%s: '%s' : %s\n", __func__, buf, video_format_2string(get_best_display_Mode()));
#else
	DEV_DBG("%s: '%s'\n", __func__, buf);
#endif	
	ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n");
	return ret;
}
Пример #4
0
static ssize_t external_common_wta_video_mode(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{
	ssize_t ret = strnlen(buf, PAGE_SIZE);
	uint32 video_mode;
#ifdef CONFIG_FB_MSM_HDMI_COMMON
	const struct hdmi_disp_mode_timing_type *disp_mode;
#endif
	mutex_lock(&external_common_state_hpd_mutex);
	if (!external_common_state->hpd_state) {
		mutex_unlock(&external_common_state_hpd_mutex);
		DEV_INFO("%s: FAILED: display off or cable disconnected\n",
			__func__);
		return ret;
	}
	mutex_unlock(&external_common_state_hpd_mutex);

	video_mode = atoi(buf)-1;
	kobject_uevent(external_common_state->uevent_kobj, KOBJ_OFFLINE);
#ifdef CONFIG_FB_MSM_HDMI_COMMON
	disp_mode = hdmi_common_get_supported_mode(video_mode);
	if (!disp_mode) {
		DEV_INFO("%s: FAILED: mode not supported (%d)\n",
			__func__, video_mode);
		return ret;
	}
	external_common_state->disp_mode_list.num_of_elements = 1;
	external_common_state->disp_mode_list.disp_mode_list[0] = video_mode;
#elif defined(CONFIG_FB_MSM_TVOUT)
	external_common_state->tvout_enable(0);
	external_common_state->video_resolution = video_mode;
	external_common_state->tvout_enable(1);
#endif
	DEV_DBG("%s: 'mode=%d %s' successful (sending OFF/ONLINE)\n", __func__,
		video_mode, video_format_2string(video_mode));
	kobject_uevent(external_common_state->uevent_kobj, KOBJ_ONLINE);
	return ret;
}