Chromium Code Reviews| Index: mec1308.c |
| diff --git a/mec1308.c b/mec1308.c |
| index c4db628d891ae93b21203d685bcff56a212ed81f..459d438d346158ade70ee39ee87f5963386f8150 100644 |
| --- a/mec1308.c |
| +++ b/mec1308.c |
| @@ -42,6 +42,8 @@ |
| #include "programmer.h" |
| #include "spi.h" |
| +void mec1308_shutdown(void *); |
|
Stefan Reinauer
2011/04/27 20:34:05
Please,
1. no function prototypes in .c files
2.
dhendrix
2011/04/27 21:15:05
Yeah, that's ugly. I just did it to reduce diffs e
|
| + |
| #define MEC1308_SIO_PORT1 0x2e |
| #define MEC1308_SIO_PORT2 0x4e |
| #define MEC1308_SIO_ENTRY_KEY 0x55 |
| @@ -361,12 +363,16 @@ int mec1308_probe_spi_flash(const char *name) |
| mbx_write(MEC1308_MBX_CMD, MEC1308_CMD_ACPI_DISABLE); |
| mbx_write(MEC1308_MBX_CMD, MEC1308_CMD_SMI_DISABLE); |
| + if (register_shutdown(mec1308_shutdown, NULL)) |
| + return 1; |
| + |
| /* |
| * Enter SPI Pass-Thru Mode after commands which do not require access |
| * to SPI ROM are complete. We'll start by doing the exit_passthru_mode |
| * sequence, which is benign if the EC is already in passthru mode. |
| */ |
| mec1308_exit_passthru_mode(); |
| + |
| if (enter_passthru_mode()) |
| return 1; |
| @@ -374,10 +380,10 @@ int mec1308_probe_spi_flash(const char *name) |
| return 0; |
| } |
| -int mec1308_shutdown(void) |
| +void mec1308_shutdown(void *data) |
|
Stefan Reinauer
2011/04/27 20:34:05
make static and move upstairs.
dhendrix
2011/04/27 21:15:05
Done.
|
| { |
| if (spi_controller != SPI_CONTROLLER_MEC1308) |
| - return 0; |
| + return; |
| /* Exit passthru mode before performing commands which do not affect |
| the SPI ROM */ |
| @@ -387,8 +393,6 @@ int mec1308_shutdown(void) |
| FIXME: is there an ordering dependency? */ |
| mbx_write(MEC1308_MBX_CMD, MEC1308_CMD_SMI_ENABLE); |
| mbx_write(MEC1308_MBX_CMD, MEC1308_CMD_ACPI_ENABLE); |
| - |
| - return 0; |
| } |
| int mec1308_spi_read(struct flashchip *flash, uint8_t * buf, int start, int len) |