peach_pit: enable EC support using devfs interface
This enables EC support for peach_pit now that the devfs interface
is working.
BUG=chrome-os-partner:19077
BRANCH=peach_pit
TEST=compiled and run on peach_pit (see below for output)
localhost ~ # mosys -k ec info
vendor="stm" name="stm32l15x" fw_version="pit_v1.1.880-7e24fdb"
Change-Id: I7a94bcdebc067d7a331ae9feef32804f78cdb5fc
Reviewed-on: https://gerrit.chromium.org/gerrit/57426
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
diff --git a/platform/experimental/peach_pit/ec.c b/platform/experimental/peach_pit/ec.c
index c23c4dc..83b691a 100644
--- a/platform/experimental/peach_pit/ec.c
+++ b/platform/experimental/peach_pit/ec.c
@@ -34,14 +34,7 @@
#include "drivers/google/gec.h"
-#define PEACH_PIT_EC_BUS 2
-#define PEACH_PIT_EC_CS 0
-
-#if 0
-struct gec_priv peach_pit_ec_priv = {
- .addr.spi.bus = PEACH_PIT_EC_BUS, /* may be overridden */
- .addr.spi.cs = PEACH_PIT_EC_CS,
-};
+struct gec_priv peach_pit_ec_priv;
int peach_pit_ec_setup(struct platform_intf *intf)
{
@@ -50,19 +43,13 @@
MOSYS_CHECK(intf->cb && intf->cb->ec);
intf->cb->ec->priv = &peach_pit_ec_priv;
- ret = gec_probe_spi(intf);
+ ret = gec_probe_dev(intf);
if (ret == 1)
- lprintf(LOG_DEBUG, "GEC found on SPI bus\n");
+ lprintf(LOG_DEBUG, "CrOS EC found using /dev interface\n");
else if (ret == 0)
- lprintf(LOG_DEBUG, "GEC not found on SPI bus\n");
+ lprintf(LOG_DEBUG, "CrOS EC not found in /dev\n");
else
- lprintf(LOG_ERR, "Error when probing GEC on SPI bus\n");
+ lprintf(LOG_ERR, "Error when probing GEC via devfs\n");
return ret;
}
-#endif
-int peach_pit_ec_setup(struct platform_intf *intf)
-{
- /* TODO: implement this */
- return 1;
-}
diff --git a/platform/experimental/peach_pit/peach_pit.c b/platform/experimental/peach_pit/peach_pit.c
index 47f492e..3864722 100644
--- a/platform/experimental/peach_pit/peach_pit.c
+++ b/platform/experimental/peach_pit/peach_pit.c
@@ -192,11 +192,8 @@
if (peach_pit_board_config == PEACH_PIT_CONFIG_UNKNOWN)
return -1;
- /* FIXME: add pit EC support */
-#if 0
if (peach_pit_ec_setup(intf) <= 0)
return -1;
-#endif
return 0;
}
@@ -207,7 +204,7 @@
}
struct platform_cb peach_pit_cb = {
-// .ec = &gec_cb,
+ .ec = &gec_cb,
.eeprom = &peach_pit_eeprom_cb,
.gpio = &peach_pit_gpio_cb,
.memory = &peach_pit_memory_cb,