Пример #1
0
uint32_t hal_tui_activate(void)
{
	/* Protect NWd */
	trustedui_clear_mask(TRUSTEDUI_MODE_VIDEO_SECURED|
			     TRUSTEDUI_MODE_INPUT_SECURED);

#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
	pr_info("Unblanking\n");
	/* TODO-[2014-03-19]-julare01: disabled for Arndale board but this
	 * should be re enabled and put into a HAL */
/*		enable_irq(gpio_to_irq(190));*/
	unblank_framebuffer(1);
#endif

	/* Clear linux TUI flag */
	trustedui_set_mode(TRUSTEDUI_MODE_OFF);

#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
	pr_info("Unsetting TUI flag (blank counter=%d)",
		trustedui_blank_get_counter());
	if (0 < trustedui_blank_get_counter())
		blank_framebuffer(0);
#endif

	return TUI_DCI_OK;
}
Пример #2
0
uint32_t hal_tui_deactivate(void)
{
	/* Set linux TUI flag */
	trustedui_set_mask(TRUSTEDUI_MODE_TUI_SESSION);
	trustedui_blank_set_counter(0);
#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
	blank_framebuffer(1);
	/* TODO-[2014-03-19]-julare01: disabled for Arndale board but this
	 * should be re enabled and put into a HAL */
/*		disable_irq(gpio_to_irq(190)); */
#endif
	trustedui_set_mask(TRUSTEDUI_MODE_VIDEO_SECURED|
			   TRUSTEDUI_MODE_INPUT_SECURED);

	return TUI_DCI_OK;
}
/* ------------------------------------------------------------- */
static void tlcProcessCmd(void)
{
	uint32_t ret = TUI_DCI_ERR_INTERNAL_ERROR;
	uint32_t commandId = CMD_TUI_SW_NONE;

	if (NULL == pDci) {
		pr_debug("ERROR tlcProcessCmd: DCI has not been set up properly - exiting\n");
		return;
	} else {
		commandId = pDci->cmdNwd.id;
	}

	/* Warn if previous response was not acknowledged */
	if (CMD_TUI_SW_NONE == commandId) {
		pr_debug("ERROR tlcProcessCmd: Notified without command\n");
		return;
	} else {
		if (pDci->nwdRsp.id != CMD_TUI_SW_NONE)
			pr_debug("tlcProcessCmd: Warning, previous response not ack\n");
	}

	/* Handle command */
	switch (commandId) {
	case CMD_TUI_SW_OPEN_SESSION:
		pr_debug("tlcProcessCmd: CMD_TUI_SW_OPEN_SESSION.\n");

		/* Start android TUI activity */
		ret = sendCmdToUser(TLC_TUI_CMD_START_ACTIVITY);
		if (TUI_DCI_OK == ret) {

			/* allocate TUI frame buffer */
			if (!allocateTuiBuffer(pDci))
				ret = TUI_DCI_ERR_INTERNAL_ERROR;
		}

		break;

	case CMD_TUI_SW_STOP_DISPLAY:
		pr_debug("tlcProcessCmd: CMD_TUI_SW_STOP_DISPLAY.\n");

#ifndef CONFIG_SOC_EXYNOS5420
		/* Set linux TUI flag */
		trustedui_set_mask(TRUSTEDUI_MODE_TUI_SESSION);
#endif
		trustedui_blank_set_counter(0);
#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
		blank_framebuffer(1);
		disable_irq(gpio_to_irq(190));
#endif

		trustedui_set_mask(TRUSTEDUI_MODE_VIDEO_SECURED|TRUSTEDUI_MODE_INPUT_SECURED);

		ret = TUI_DCI_OK;
		break;
		
	case CMD_TUI_SW_CLOSE_SESSION:
		pr_debug("tlcProcessCmd: CMD_TUI_SW_CLOSE_SESSION.\n");

		freeTuiBuffer();
		// Protect NWd
		trustedui_clear_mask(TRUSTEDUI_MODE_VIDEO_SECURED|TRUSTEDUI_MODE_INPUT_SECURED);

#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
		pr_info("Unblanking");
		enable_irq(gpio_to_irq(190));
		unblank_framebuffer(1);
#endif

		/* Clear linux TUI flag */
		trustedui_set_mode(TRUSTEDUI_MODE_OFF);

#ifdef CONFIG_TRUSTONIC_TRUSTED_UI_FB_BLANK
		pr_info("Unsetting TUI flag (blank counter=%d)", trustedui_blank_get_counter());
		if (0 < trustedui_blank_get_counter()) {
			blank_framebuffer(0);		
		}
#endif

		/* Stop android TUI activity */
		ret = sendCmdToUser(TLC_TUI_CMD_STOP_ACTIVITY);
		break;

	default:
		pr_debug("ERROR tlcProcessCmd: Unknown command %d\n",
				commandId);
		break;
	}

	/* Fill in response to SWd, fill ID LAST */
	pr_debug("tlcProcessCmd: return 0x%08x to cmd 0x%08x\n",
			ret, commandId);
	pDci->nwdRsp.returnCode = ret;
	pDci->nwdRsp.id = RSP_ID(commandId);

	/* Acknowledge command */
	pDci->cmdNwd.id = CMD_TUI_SW_NONE;

	/* Notify SWd */
	pr_debug("DCI RSP NOTIFY CORE\n");
	ret = mc_notify(&drSessionHandle);
	if (MC_DRV_OK != ret)
		pr_debug("ERROR tlcProcessCmd: Notify failed: %d\n", ret);
}