//*****************************************************************************
//
// Function Name: DISPDRV__Close
// 
// Description:   Close The Driver
//
//*****************************************************************************
Int32 DISPDRV_Close(DISPDRV_HANDLE_T drvH)
{
	Int32 res = 0;
	DISPDRV_PANEL_T *pPanel = (DISPDRV_PANEL_T *)drvH;

	if (CSL_DSI_CloseCmVc(pPanel->dsiCmVcHandle)) {
		LCD_DBG(LCD_DBG_ERR_ID, "[DISPDRV] %s: ERROR, "
			"Closing Command Mode Handle\n\r", __FUNCTION__);
		return (-1);
	}

	if (CSL_DSI_CloseClient(pPanel->clientH) != CSL_LCD_OK) {
		LCD_DBG(LCD_DBG_ERR_ID,
			"[DISPDRV] %s: ERROR, Closing DSI Client\n",
			__FUNCTION__);
		return (-1);
	}

	if (CSL_DSI_Close(pPanel->busNo) != CSL_LCD_OK) {
		LCD_DBG(LCD_DBG_ERR_ID,
			"[DISPDRV] %s: ERR Closing DSI Controller\n",
			__FUNCTION__);
		return (-1);
	}

	if (pPanel->isTE)
		DISPDRV_TeOff(pPanel);

	if (brcm_disable_dsi_pll_clocks(pPanel->busNo)) {
		LCD_DBG(LCD_DBG_ERR_ID,
			"[DISPDRV] %s: ERROR to disable the pll clock\n",
			__FUNCTION__);
		return (-1);
	}

	pPanel->pwrState = STATE_PWR_OFF;
	pPanel->drvState = DRV_STATE_INIT;
	LCD_DBG(LCD_DBG_INIT_ID, "[DISPDRV] %s: OK\n", __FUNCTION__);

	return (res);
}
예제 #2
0
/*
 *
 *  Function Name: DSI_Close
 *
 *  Description:   disp bus OFF
 *
 */
Int32 DSI_Close(DISPDRV_HANDLE_T drvH)
{
	Int32 res = 0;
	DispDrv_PANEL_t	*pPanel	= (DispDrv_PANEL_t *)drvH;

	if (pPanel->disp_info->vmode)
		CSL_DSI_Suspend(pPanel->dsiCmVcHandle);

	if (CSL_DSI_CloseCmVc(pPanel->dsiCmVcHandle)) {
		DSI_ERR("Closing Command Mode Handle\n");
		return -1;
	}

	if (CSL_DSI_CloseClient(pPanel->clientH) != CSL_LCD_OK)	{
		DSI_ERR("Closing DSI Client\n");
		return -1;
	}

	if (CSL_DSI_Close(pPanel->busNo) != CSL_LCD_OK)	{
		DSI_ERR("ERR Closing DSI Controller\n");
		return -1;
	}

	if (pPanel->isTE)
		DSI_TeOff(pPanel);

	if (brcm_disable_dsi_pll_clocks(pPanel->busNo))	{
		DSI_ERR("ERROR disabling the pll clock\n");
		return -1;
	}

	gpio_free(pPanel->disp_info->rst->gpio);

	pPanel->pwrState = STATE_PWR_OFF;
	pPanel->drvState = DRV_STATE_INIT;
	g_display_enabled = 0;
	DSI_INFO("OK\n");

	return res;
}