From 23fb9979d999a155a2560a9f09f4fcdc1b96e9e7 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Fri, 21 Jun 2013 20:11:47 +0800 Subject: ec/google: Generalize communication protocol support in EC drivers. Since EC protocol v3, the packet format will be the same for all buses (inclding I2C, SPI, and LPC). That will simplify the implementation in each individual bus driver source file. To prepare for that, we will move the protocol part into crosec_proto.c: crosec_command_proto, with bus driver in callback "crosec_io". Change-Id: I9ccd19a57a182899dd1ef1cd90598679c1546295 Signed-off-by: Hung-Te Lin Reviewed-on: http://review.coreboot.org/3749 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/ec/google/chromeec/crosec_proto.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/ec/google/chromeec/crosec_proto.c (limited to 'src/ec/google/chromeec/crosec_proto.c') diff --git a/src/ec/google/chromeec/crosec_proto.c b/src/ec/google/chromeec/crosec_proto.c new file mode 100644 index 0000000000..016de8d483 --- /dev/null +++ b/src/ec/google/chromeec/crosec_proto.c @@ -0,0 +1,34 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include "ec.h" +#include "ec_commands.h" +#include "ec_message.h" + +int crosec_command_proto(struct chromeec_command *cec_command, + crosec_io_t crosec_io, void *context) +{ + // TODO(hungte) Add v3 protocol. + return -1; +} -- cgit v1.2.3