/* Query the EC for specified mask indicating enabled events. The EC maintains separate event masks for SMI, SCI and WAKE.  */
static int cros_ec_uhepi_cmd(struct udevice *dev, uint mask, uint action, uint64_t *value)
/* Query the EC for specified mask indicating enabled events. The EC maintains separate event masks for SMI, SCI and WAKE.  */
static int cros_ec_uhepi_cmd(struct udevice *dev, uint mask, uint action, uint64_t *value)
{
	int ret;
	struct ec_params_host_event req;
	struct ec_response_host_event rsp;
	req.action = action;
	req.mask_type = mask;
	if (action != EC_HOST_EVENT_GET)
		req.value = *value;
	else
		*value = 0;
	ret = ec_command(dev, EC_CMD_HOST_EVENT, 0, &req, sizeof(req), &rsp,
			 sizeof(rsp));
	if (action != EC_HOST_EVENT_GET)
		return ret;
	if (ret == 0)
		*value = rsp.value;
	return ret;
}