summaryrefslogtreecommitdiff
path: root/util/ectool/ec.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2009-04-22 12:28:14 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2009-04-22 12:28:14 +0000
commit257ae3f520fae9b82c669115a8d548596ae26f48 (patch)
tree23ce0273ff8bcdd300fdbb310383930c1aae22eb /util/ectool/ec.c
parent0408bdd240e05ff41e24a1b9aa3f0e83f983f785 (diff)
downloadcoreboot-257ae3f520fae9b82c669115a8d548596ae26f48.tar.xz
Quick 'indent' run on ectool with some additional manual cosmetic fixes.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4174 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/ectool/ec.c')
-rw-r--r--util/ectool/ec.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/util/ectool/ec.c b/util/ectool/ec.c
index 9fa81258b7..56e9a61905 100644
--- a/util/ectool/ec.c
+++ b/util/ectool/ec.c
@@ -5,8 +5,7 @@
*
* 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.
+ * 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
@@ -15,8 +14,7 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
@@ -40,8 +38,8 @@ int send_ec_command(uint8_t command)
debug(".");
}
if (!timeout) {
- printf("Timeout while sending command 0x%02x to EC!\n",
- command);
+ printf("Timeout while sending command 0x%02x to EC!\n",
+ command);
// return -1;
}
@@ -54,14 +52,13 @@ int send_ec_data(uint8_t data)
int timeout;
timeout = 0x7ff;
- while ((inb(EC_SC) & EC_IBF) && --timeout) { // wait for IBF = 0
+ while ((inb(EC_SC) & EC_IBF) && --timeout) { // wait for IBF = 0
usleep(10);
if ((timeout & 0xff) == 0)
debug(".");
}
if (!timeout) {
- printf("Timeout while sending data 0x%02x to EC!\n",
- data);
+ printf("Timeout while sending data 0x%02x to EC!\n", data);
// return -1;
}
@@ -83,7 +80,7 @@ uint8_t recv_ec_data(void)
uint8_t data;
timeout = 0x7fff;
- while (--timeout) { // Wait for OBF = 1
+ while (--timeout) { // Wait for OBF = 1
if (inb(EC_SC) & EC_OBF) {
break;
}
@@ -114,6 +111,6 @@ int ec_write(uint8_t addr, uint8_t data)
{
send_ec_command(0x81);
send_ec_data(addr);
+
return send_ec_data(data);
}
-