view src/cs/drivers/drv_app/r2d/r2d_blrr_api.c @ 223:740a8e8fc9d7

startup sync logic rework for the new PWON button boot scheme Previously we added logic to the MMI task to hold off PEI init until R2D is running, and then extended that condition to wait for FCHG init too. However, the dependencies of MMI upon R2D and FCHG don't start until mmiInit(), and that call is driven by Switch_ON() code, hence the wait for R2D and FCHG init can be made in that code path instead of the MMI task. Furthermore, with our new way of signaling PWON button boot to MMI, we need a new wait to ensure that the MMI task is up - previously this assurance was provided by the wait for Kp pointers to be set. Solution: revert our previous PEI init hold-off additions to MMI, add a new flag indicating MMI task init done, and put the combined wait for all needed conditions into our new PWON button boot code in power.c.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Apr 2021 06:24:52 +0000
parents 6541e43f88e5
children bb1f572ac098
line wrap: on
line source

/*
 * This module implements the blrr_display_ctrl() function defined
 * in r2d_blrr_api.h; this implementation consists of posting the
 * necessary internal message to the R2D task.
 */

#include "r2d/r2d_blrr_api.h"
#include "r2d/r2d_i.h"
#include "r2d/r2d_messages.h"
#include "rv/rv_general.h"
#include "rvf/rvf_api.h"
#include "rvm/rvm_use_id_list.h"

T_RV_RET blrr_display_ctrl(enum blrr_display_state arg)
{
	T_R2D_EVT *msg;

	if (rvf_get_buf(r2d_mb_id, sizeof(T_R2D_EVT), (T_RVF_BUFFER **)&msg)
	    == RVF_RED) {
		rvf_send_trace(
			"rvf_get_buf() failed in blrr_display_ctrl()", 43,
			NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
		return RV_MEMORY_ERR;
	}
	msg->os_hdr.msg_id        = R2D_MESSAGE_ONOFF;
	msg->os_hdr.src_addr_id   = r2d_addr_id;
	msg->os_hdr.dest_addr_id  = r2d_addr_id;
	msg->os_hdr.callback_func = NULL;
	msg->status = arg;
	if (rvf_send_msg(r2d_addr_id, msg) != RV_OK) {
		rvf_send_trace("blrr_display_ctrl(): Send failed!", 33,
				NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
		rvf_free_buf(msg);
		return RV_INTERNAL_ERR;
	}
	return RV_OK;
}