summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/bootmode.h1
-rw-r--r--src/mainboard/google/auron/chromeos.c14
-rw-r--r--src/mainboard/google/bolt/chromeos.c22
-rw-r--r--src/mainboard/google/falco/chromeos.c22
-rw-r--r--src/mainboard/google/link/chromeos.c14
-rw-r--r--src/mainboard/google/peppy/chromeos.c22
-rw-r--r--src/mainboard/google/rambi/chromeos.c24
-rw-r--r--src/mainboard/google/samus/chromeos.c14
-rw-r--r--src/mainboard/google/slippy/chromeos.c22
9 files changed, 78 insertions, 77 deletions
diff --git a/src/include/bootmode.h b/src/include/bootmode.h
index da4e070607..ff562d5069 100644
--- a/src/include/bootmode.h
+++ b/src/include/bootmode.h
@@ -27,6 +27,7 @@ int get_developer_mode_switch(void);
int get_recovery_mode_switch(void);
int clear_recovery_mode_switch(void);
int get_wipeout_mode_switch(void);
+int get_lid_switch(void);
int gfx_get_init_done(void);
diff --git a/src/mainboard/google/auron/chromeos.c b/src/mainboard/google/auron/chromeos.c
index a5e2aea1f4..38bb8d9e4d 100644
--- a/src/mainboard/google/auron/chromeos.c
+++ b/src/mainboard/google/auron/chromeos.c
@@ -35,13 +35,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-}
-
/*static void fill_lb_gpio(struct lb_gpio *gpio, int num,
int polarity, const char *name, int force)
{
@@ -75,6 +68,13 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/bolt/chromeos.c b/src/mainboard/google/bolt/chromeos.c
index 02a6ee64d1..6ccb1549f3 100644
--- a/src/mainboard/google/bolt/chromeos.c
+++ b/src/mainboard/google/bolt/chromeos.c
@@ -37,17 +37,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
-#if CONFIG_EC_GOOGLE_CHROMEEC
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-#else
- return 0;
-#endif
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -68,6 +57,17 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+#if CONFIG_EC_GOOGLE_CHROMEEC
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+#else
+ return 0;
+#endif
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/falco/chromeos.c b/src/mainboard/google/falco/chromeos.c
index ef10c48997..cd2728ed92 100644
--- a/src/mainboard/google/falco/chromeos.c
+++ b/src/mainboard/google/falco/chromeos.c
@@ -34,17 +34,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
-#if CONFIG_EC_GOOGLE_CHROMEEC
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-#else
- return 0;
-#endif
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -65,6 +54,17 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+#if CONFIG_EC_GOOGLE_CHROMEEC
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+#else
+ return 0;
+#endif
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/link/chromeos.c b/src/mainboard/google/link/chromeos.c
index 7a6b3a2a4b..a020b06664 100644
--- a/src/mainboard/google/link/chromeos.c
+++ b/src/mainboard/google/link/chromeos.c
@@ -31,13 +31,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
@@ -91,6 +84,13 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+}
+
/* The dev-switch is virtual on Link (and so handled elsewhere). */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/peppy/chromeos.c b/src/mainboard/google/peppy/chromeos.c
index ef10c48997..cd2728ed92 100644
--- a/src/mainboard/google/peppy/chromeos.c
+++ b/src/mainboard/google/peppy/chromeos.c
@@ -34,17 +34,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
-#if CONFIG_EC_GOOGLE_CHROMEEC
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-#else
- return 0;
-#endif
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -65,6 +54,17 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+#if CONFIG_EC_GOOGLE_CHROMEEC
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+#else
+ return 0;
+#endif
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/rambi/chromeos.c b/src/mainboard/google/rambi/chromeos.c
index c3631617cc..3e070447ad 100644
--- a/src/mainboard/google/rambi/chromeos.c
+++ b/src/mainboard/google/rambi/chromeos.c
@@ -37,18 +37,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
-#if CONFIG_EC_GOOGLE_CHROMEEC
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-#else
- /* Default to force open. */
- return 1;
-#endif
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -69,6 +57,18 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+#if CONFIG_EC_GOOGLE_CHROMEEC
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+#else
+ /* Default to force open. */
+ return 1;
+#endif
+}
+
int get_developer_mode_switch(void)
{
return 0;
diff --git a/src/mainboard/google/samus/chromeos.c b/src/mainboard/google/samus/chromeos.c
index e3a9f4a84e..dc28ed1e8d 100644
--- a/src/mainboard/google/samus/chromeos.c
+++ b/src/mainboard/google/samus/chromeos.c
@@ -37,13 +37,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -64,6 +57,13 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
diff --git a/src/mainboard/google/slippy/chromeos.c b/src/mainboard/google/slippy/chromeos.c
index ef10c48997..cd2728ed92 100644
--- a/src/mainboard/google/slippy/chromeos.c
+++ b/src/mainboard/google/slippy/chromeos.c
@@ -34,17 +34,6 @@
#define GPIO_COUNT 6
-static int get_lid_switch(void)
-{
-#if CONFIG_EC_GOOGLE_CHROMEEC
- u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
-
- return !!(ec_switches & EC_SWITCH_LID_OPEN);
-#else
- return 0;
-#endif
-}
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio *gpio;
@@ -65,6 +54,17 @@ void fill_lb_gpios(struct lb_gpios *gpios)
}
#endif
+int get_lid_switch(void)
+{
+#if CONFIG_EC_GOOGLE_CHROMEEC
+ u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+
+ return !!(ec_switches & EC_SWITCH_LID_OPEN);
+#else
+ return 0;
+#endif
+}
+
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{