Example #1
0
static int hdmi_panel_enable(struct omap_dss_device *dssdev)
{
	int r = 0;
	DSSDBG("ENTER hdmi_panel_enable\n");
	HDMIDBG("ENTER \n");

	mutex_lock(&hdmi.hdmi_lock);

	if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
		r = -EINVAL;
		goto err;
	}

	r = omapdss_hdmi_display_enable(dssdev);
	if (r) {
		DSSERR("failed to power on\n");
		goto err;
	}

	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
err:
	mutex_unlock(&hdmi.hdmi_lock);
	HDMIDBG("error:%d\n", r);

	return r;
}
Example #2
0
static void hdmi_hotplug_detect_worker(struct work_struct *work)
{
	struct hpd_worker_data *d = container_of(work, typeof(*d), dwork.work);
	int state = atomic_read(&d->state);
//                                              
	struct omap_dss_device *dssdev = get_hdmi_device();
//                                              

	HDMIDBG("in hpd work %d, state=%d\n", state, dssdev->state);
	pr_err("in hpd work %d, state=%d\n", state, dssdev->state);
	if (dssdev == NULL)
		return;

	mutex_lock(&hdmi.hdmi_lock);
	if (state == HPD_STATE_OFF) {
		switch_set_state(&hdmi.hpd_switch, 0);
		hdmi_inform_hpd_to_cec(false);
		if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
			mutex_unlock(&hdmi.hdmi_lock);
			dssdev->driver->disable(dssdev);
			omapdss_hdmi_enable_s3d(false);
			mutex_lock(&hdmi.hdmi_lock);
		}
		goto done;
	} else {
		if (state == HPD_STATE_START) {
			mutex_unlock(&hdmi.hdmi_lock);
			dssdev->driver->enable(dssdev);
			mutex_lock(&hdmi.hdmi_lock);
		} else if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE ||
			   hdmi.hpd_switch.state) {
			/* powered down after enable - skip EDID read */
			goto done;
		} else if (hdmi_read_edid(&dssdev->panel.timings)) {
			/* get monspecs from edid */
			hdmi_get_monspecs(&dssdev->panel.monspecs);
			pr_info("panel size %d by %d\n",
					dssdev->panel.monspecs.max_x,
					dssdev->panel.monspecs.max_y);
			HDMIDBG("panel size %d by %d\n",
					dssdev->panel.monspecs.max_x,
					dssdev->panel.monspecs.max_y);
			dssdev->panel.width_in_um =
					dssdev->panel.monspecs.max_x * 10000;
			dssdev->panel.height_in_um =
					dssdev->panel.monspecs.max_y * 10000;
			hdmi_inform_hpd_to_cec(true);
			switch_set_state(&hdmi.hpd_switch, 1);
			goto done;
		} else if (state == HPD_STATE_EDID_TRYLAST){
			pr_info("Failed to read EDID after %d times. Giving up.", state - HPD_STATE_START);
			goto done;
		}
		if (atomic_add_unless(&d->state, 1, HPD_STATE_OFF))
			queue_delayed_work(my_workq, &d->dwork, msecs_to_jiffies(60));
	}
done:
	mutex_unlock(&hdmi.hdmi_lock);
}
Example #3
0
static int hdmi_panel_resume(struct omap_dss_device *dssdev)
{
	int r = 0;

	HDMIDBG("ENTER \n");
	mutex_lock(&hdmi.hdmi_lock);

	if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
		goto err;

	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
err:
	mutex_unlock(&hdmi.hdmi_lock);

	hdmi_panel_hpd_handler(hdmi_get_current_hpd());

	HDMIDBG("error:%d \n", r);
	return r;
}
Example #4
0
static void hdmi_panel_disable(struct omap_dss_device *dssdev)
{
	HDMIDBG("ENTER \n");
	mutex_lock(&hdmi.hdmi_lock);

	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
		omapdss_hdmi_display_disable(dssdev);

	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;

	mutex_unlock(&hdmi.hdmi_lock);
}
Example #5
0
static int hdmi_panel_probe(struct omap_dss_device *dssdev)
{
	DSSDBG("ENTER hdmi_panel_probe\n");

	dssdev->panel.config = OMAP_DSS_LCD_TFT |
			OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;

// TODO: conflict with 4AJ.1.1 TI patch

//                                
// MOD : for default mode. p2 is not dvi, is hdmi.
//                                                                                                      
#if 1
	/*
	 * Initialize the timings to 640 * 480
	 * This is only for framebuffer update not for TV timing setting
	 * Setting TV timing will be done only on enable
	 */
	if (dssdev->panel.timings.x_res == 0)
		dssdev->panel.timings = (struct omap_video_timings)
			{640, 480, 31746, 128, 24, 29, 9, 40, 2};
#else
	dssdev->panel.timings.x_res = 1280;
    dssdev->panel.timings.y_res = 720;
#endif
//                                              

	/* sysfs entry to provide user space control to set deepcolor mode */
	if (sysfs_create_group(&dssdev->dev.kobj, &hdmi_panel_attr_group))
		DSSERR("failed to create sysfs entries\n");

	DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
		dssdev->panel.timings.x_res,
		dssdev->panel.timings.y_res);
	HDMIDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
		dssdev->panel.timings.x_res,
		dssdev->panel.timings.y_res);
	return 0;
}

static void hdmi_panel_remove(struct omap_dss_device *dssdev)
{
	sysfs_remove_group(&dssdev->dev.kobj, &hdmi_panel_attr_group);
}
Example #6
0
static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
{
	int r = 0;

	HDMIDBG("ENTER  state=%d\n", dssdev->state);
	mutex_lock(&hdmi.hdmi_lock);

	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
		r = -EINVAL;
		goto err;
	}

	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;

	omapdss_hdmi_display_disable(dssdev);
err:
	mutex_unlock(&hdmi.hdmi_lock);

	return r;
}
Example #7
0
static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
{
	int r = 0;

	HDMIDBG("ENTER \n");
	mutex_lock(&hdmi.hdmi_lock);

	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
		/* We should enable "resume" event handler for case, when HDMI
		 * display is plugged in while device was in suspend mode */
		dssdev->activate_after_resume = true;
		goto err;
	}

	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;

	omapdss_hdmi_display_disable(dssdev);
err:
	mutex_unlock(&hdmi.hdmi_lock);

	return r;
}
Example #8
0
static int hdmi_panel_probe(struct omap_dss_device *dssdev)
{
	DSSDBG("ENTER hdmi_panel_probe\n");

	dssdev->panel.config = OMAP_DSS_LCD_TFT |
			OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;

//                                
// MOD : for default mode. p2 is not dvi, is hdmi.
//                                                                                                      
#if 0
	/*
	 * Initialize the timings to 640 * 480
	 * This is only for framebuffer update not for TV timing setting
	 * Setting TV timing will be done only on enable
	 */
	dssdev->panel.timings.x_res = 640;
	dssdev->panel.timings.y_res = 480;
#else
	dssdev->panel.timings.x_res = 1280;
	dssdev->panel.timings.y_res = 720;
#endif
//                                              

	/* sysfs entry to provide user space control to set deepcolor mode */
	if (sysfs_create_group(&dssdev->dev.kobj, &hdmi_panel_attr_group))
		DSSERR("failed to create sysfs entries\n");

	DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
		dssdev->panel.timings.x_res,
		dssdev->panel.timings.y_res);
	HDMIDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
		dssdev->panel.timings.x_res,
		dssdev->panel.timings.y_res);
	return 0;
}