示例#1
0
static s32 disp_vdevice_tcon_disable(struct disp_device* vdevice)
{
	struct disp_vdevice_private_data *vdevicep = disp_vdevice_get_priv(vdevice);
	struct disp_manager *mgr = NULL;

	if((NULL == vdevice) || (NULL == vdevicep)) {
	    DE_WRN("null  hdl!\n");
	    return DIS_FAIL;
	}

	mgr = vdevice->manager;
	if(!mgr) {
		DE_WRN("%s%d's mgr is NULL\n", vdevice->name, vdevice->disp);
		return DIS_FAIL;
	}

	if(vdevicep->enabled == 0) {
		DE_WRN("%s%d is already closed\n", vdevice->name, vdevice->disp);
		return DIS_FAIL;
	}

	disp_al_vdevice_disable(vdevice->disp);
	vdevice_clk_disable(vdevice);

	if(mgr->disable)
		mgr->disable(mgr);

	vdevicep->enabled = 0;
	disp_sys_disable_irq(vdevicep->irq_no);
	disp_sys_unregister_irq(vdevicep->irq_no, disp_vdevice_event_proc,(void*)vdevice);

	return 0;
}
示例#2
0
static s32 disp_hdmi_disable(struct disp_device* hdmi)
{
	struct disp_device_private_data *hdmip = disp_hdmi_get_priv(hdmi);
	unsigned long flags;
	struct disp_manager *mgr = NULL;

	if((NULL == hdmi) || (NULL == hdmip)) {
	    DE_WRN("hdmi set func null  hdl!\n");
	    return DIS_FAIL;
	}

	mgr = hdmi->manager;
	if(!mgr) {
		DE_WRN("hdmi%d's mgr is NULL\n", hdmi->disp);
		return DIS_FAIL;
	}

	if(hdmip->enabled == 0) {
		DE_WRN("hdmi%d is already closed\n", hdmi->disp);
		return DIS_FAIL;
	}

	disp_al_hdmi_disable(hdmi->disp);
	hdmi_clk_disable(hdmi);

	if(hdmip->hdmi_func.hdmi_close == NULL)
	    return -1;

	hdmip->hdmi_func.hdmi_close();

	if(mgr->disable)
		mgr->disable(mgr);

	disp_sys_irqlock((void*)&hdmi_data_lock, &flags);
	hdmip->enabled = 0;
	disp_sys_irqunlock((void*)&hdmi_data_lock, &flags);
	disp_sys_disable_irq(hdmip->irq_no);
	disp_sys_unregister_irq(hdmip->irq_no, disp_hdmi_event_proc,(void*)hdmi->disp);

	return 0;
}