/* The cheapest way to do this is by looking for the memory-mapped flag. This is faster than sending a new-style 'hello' command and seeing whether the EC sets the EC_HOST_ARGS_FLAG_FROM_HOST flag in args when it responds.  */
static int cros_ec_lpc_check_version(struct udevice *dev)
/* The cheapest way to do this is by looking for the memory-mapped flag. This is faster than sending a new-style 'hello' command and seeing whether the EC sets the EC_HOST_ARGS_FLAG_FROM_HOST flag in args when it responds.  */
static int cros_ec_lpc_check_version(struct udevice *dev)
{
	if (inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_ID) == 'E' &&
			inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_ID + 1)
				== 'C' &&
			(inb(EC_LPC_ADDR_MEMMAP +
				EC_MEMMAP_HOST_CMD_FLAGS) &
				EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED)) {
		return 0;
	}
	printf("%s: ERROR: old EC interface not supported\n", __func__);
	return -1;
}