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
This commit is contained in:
parent
0408bdd240
commit
257ae3f520
|
@ -5,8 +5,7 @@
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; version 2 of
|
* published by the Free Software Foundation; version 2 of the License.
|
||||||
* the License.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* 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
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
* MA 02110-1301 USA
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -60,8 +58,7 @@ int send_ec_data(uint8_t data)
|
||||||
debug(".");
|
debug(".");
|
||||||
}
|
}
|
||||||
if (!timeout) {
|
if (!timeout) {
|
||||||
printf("Timeout while sending data 0x%02x to EC!\n",
|
printf("Timeout while sending data 0x%02x to EC!\n", data);
|
||||||
data);
|
|
||||||
// return -1;
|
// return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +111,6 @@ int ec_write(uint8_t addr, uint8_t data)
|
||||||
{
|
{
|
||||||
send_ec_command(0x81);
|
send_ec_command(0x81);
|
||||||
send_ec_data(addr);
|
send_ec_data(addr);
|
||||||
|
|
||||||
return send_ec_data(data);
|
return send_ec_data(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; version 2 of
|
* published by the Free Software Foundation; version 2 of the License.
|
||||||
* the License.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -15,13 +14,14 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
* MA 02110-1301 USA
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _EC_H
|
#ifndef _EC_H
|
||||||
#define _EC_H
|
#define _EC_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define EC_DATA 0x62
|
#define EC_DATA 0x62
|
||||||
#define EC_SC 0x66
|
#define EC_SC 0x66
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
// 0: byte in data register is data
|
// 0: byte in data register is data
|
||||||
#define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
|
#define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
|
||||||
#define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
|
#define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
|
||||||
|
|
||||||
/* EC_SC output */
|
/* EC_SC output */
|
||||||
#define RD_EC 0x80 // Read Embedded Controller
|
#define RD_EC 0x80 // Read Embedded Controller
|
||||||
#define WR_EC 0x81 // Write Embedded Controller
|
#define WR_EC 0x81 // Write Embedded Controller
|
||||||
|
@ -45,5 +46,5 @@ int send_ec_data(uint8_t data);
|
||||||
int send_ec_data_nowait(uint8_t data);
|
int send_ec_data_nowait(uint8_t data);
|
||||||
uint8_t recv_ec_data(void);
|
uint8_t recv_ec_data(void);
|
||||||
uint8_t ec_read(uint8_t addr);
|
uint8_t ec_read(uint8_t addr);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; version 2 of
|
* published by the Free Software Foundation; version 2 of the License.
|
||||||
* the License.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* 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
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
* MA 02110-1301 USA
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -100,5 +98,6 @@ int main(int argc, char *argv[])
|
||||||
printf("%02x ", ec_read(i));
|
printf("%02x ", ec_read(i));
|
||||||
}
|
}
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue