summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-07-11 14:30:41 -0700
committerChromeBot <chrome-bot@google.com>2013-07-11 16:51:40 -0700
commiteb8920c93921122e19c1ccf682b76d45a0bda7fd (patch)
treedbf17dba2d4be2c24940369f768dd49b2e36a635 /board
parent6696843708b7e5cb83a6c061a76cf70cbfd2523f (diff)
downloadchrome-ec-eb8920c93921122e19c1ccf682b76d45a0bda7fd.tar.gz
Split wireless power/radio control out of switch.c
Chipset control of wireless power uses the new API instead of overriding the wireless power itself. Refactor board-specific support for it to just a few config #defines instead of board-specific functions. This makes some assumptions about the polarity of the enable signals. Not making those assumptions would require defining an array of structs or some other heavier-weight board-specific info. Since the assumptions hold for all current boards, let's make them now because this is a step in the right direction, and reserve doing something more general until we actually have a use case for it (so we build in just the flexibility we need). BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; see that link wifi turns on at boot and off at shutdown (verify via 'gpioget' from EC console) Change-Id: Ic036e76158198d2d5e3dd244c3c7b9b1e8d62982 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61608 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/falco/board.c11
-rw-r--r--board/falco/board.h6
-rw-r--r--board/link/board.c11
-rw-r--r--board/link/board.h5
-rw-r--r--board/peppy/board.c11
-rw-r--r--board/peppy/board.h5
-rw-r--r--board/slippy/board.c11
-rw-r--r--board/slippy/board.h5
-rw-r--r--board/wolf/board.c11
-rw-r--r--board/wolf/board.h5
10 files changed, 26 insertions, 55 deletions
diff --git a/board/falco/board.c b/board/falco/board.c
index b98d03f7b2..a812e8ea1a 100644
--- a/board/falco/board.c
+++ b/board/falco/board.c
@@ -198,17 +198,6 @@ void configure_fan_gpios(void)
}
/**
- * Set wireless switch state.
- */
-void board_enable_wireless(uint8_t enabled)
-{
- gpio_set_level(GPIO_WLAN_OFF_L,
- enabled & EC_WIRELESS_SWITCH_WLAN);
- gpio_set_level(GPIO_PP3300_LTE_EN,
- enabled & EC_WIRELESS_SWITCH_WWAN);
-}
-
-/**
* Perform necessary actions on host wake events.
*/
void board_process_wake_events(uint32_t active_wake_events)
diff --git a/board/falco/board.h b/board/falco/board.h
index 5a20099288..2dc76d7190 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -38,6 +38,7 @@
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
@@ -210,6 +211,11 @@ enum board_version {
BOARD_VERSION_EVT = 1,
};
+/* Wireless signals */
+#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L
+#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
+#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
+
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/board/link/board.c b/board/link/board.c
index 62c7332d78..f93fe22313 100644
--- a/board/link/board.c
+++ b/board/link/board.c
@@ -219,17 +219,6 @@ void configure_fan_gpios(void)
}
/**
- * Set wireless switch state.
- */
-void board_enable_wireless(uint8_t enabled)
-{
- gpio_set_level(GPIO_RADIO_ENABLE_WLAN,
- enabled & EC_WIRELESS_SWITCH_WLAN);
- gpio_set_level(GPIO_RADIO_ENABLE_BT,
- enabled & EC_WIRELESS_SWITCH_BLUETOOTH);
-}
-
-/**
* Perform necessary actions on host events.
*/
void board_process_wake_events(uint32_t active_wake_events)
diff --git a/board/link/board.h b/board/link/board.h
index 38e7130ba7..8ef9e426bc 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -43,6 +43,7 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP006
#define CONFIG_USB_PORT_POWER_SMART
+#define CONFIG_WIRELESS
#define CONFIG_WP_ACTIVE_HIGH
#ifndef __ASSEMBLER__
@@ -234,6 +235,10 @@ enum board_version {
BOARD_VERSION_EVT = 1,
};
+/* Wireless signals */
+#define WIRELESS_GPIO_WLAN GPIO_RADIO_ENABLE_WLAN
+#define WIRELESS_GPIO_BLUETOOTH GPIO_RADIO_ENABLE_BT
+#define WIRELESS_GPIO_WLAN_POWER GPIO_ENABLE_WLAN
#endif /* !__ASSEMBLER__ */
diff --git a/board/peppy/board.c b/board/peppy/board.c
index 293747c43b..fb97805ef7 100644
--- a/board/peppy/board.c
+++ b/board/peppy/board.c
@@ -192,17 +192,6 @@ void configure_fan_gpios(void)
}
/**
- * Set wireless switch state.
- */
-void board_enable_wireless(uint8_t enabled)
-{
- gpio_set_level(GPIO_WLAN_OFF_L,
- enabled & EC_WIRELESS_SWITCH_WLAN);
- gpio_set_level(GPIO_PP3300_LTE_EN,
- enabled & EC_WIRELESS_SWITCH_WWAN);
-}
-
-/**
* Perform necessary actions on host wake events.
*/
void board_process_wake_events(uint32_t active_wake_events)
diff --git a/board/peppy/board.h b/board/peppy/board.h
index 70ad78c48d..a999d6f9e4 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -37,6 +37,7 @@
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
@@ -208,6 +209,10 @@ enum board_version {
BOARD_VERSION_EVT = 1,
};
+/* Wireless signals */
+#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L
+#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
+#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
#endif /* !__ASSEMBLER__ */
diff --git a/board/slippy/board.c b/board/slippy/board.c
index da361174c2..92782827ad 100644
--- a/board/slippy/board.c
+++ b/board/slippy/board.c
@@ -192,17 +192,6 @@ void configure_fan_gpios(void)
}
/**
- * Set wireless switch state.
- */
-void board_enable_wireless(uint8_t enabled)
-{
- gpio_set_level(GPIO_WLAN_OFF_L,
- enabled & EC_WIRELESS_SWITCH_WLAN);
- gpio_set_level(GPIO_PP3300_LTE_EN,
- enabled & EC_WIRELESS_SWITCH_WWAN);
-}
-
-/**
* Perform necessary actions on host wake events.
*/
void board_process_wake_events(uint32_t active_wake_events)
diff --git a/board/slippy/board.h b/board/slippy/board.h
index d41db4781b..3a29c23762 100644
--- a/board/slippy/board.h
+++ b/board/slippy/board.h
@@ -36,6 +36,7 @@
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_WIRELESS
#define CONFIG_WP_ACTIVE_HIGH
#ifndef __ASSEMBLER__
@@ -209,6 +210,10 @@ enum board_version {
BOARD_VERSION_EVT = 1,
};
+/* Wireless signals */
+#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L
+#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
+#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
#endif /* !__ASSEMBLER__ */
diff --git a/board/wolf/board.c b/board/wolf/board.c
index c1afbb1cbd..ddeb3e6ea5 100644
--- a/board/wolf/board.c
+++ b/board/wolf/board.c
@@ -191,17 +191,6 @@ void configure_fan_gpios(void)
}
/**
- * Set wireless switch state.
- */
-void board_enable_wireless(uint8_t enabled)
-{
- gpio_set_level(GPIO_WLAN_OFF_L,
- enabled & EC_WIRELESS_SWITCH_WLAN);
- gpio_set_level(GPIO_PP3300_LTE_EN,
- enabled & EC_WIRELESS_SWITCH_WWAN);
-}
-
-/**
* Perform necessary actions on host wake events.
*/
void board_process_wake_events(uint32_t active_wake_events)
diff --git a/board/wolf/board.h b/board/wolf/board.h
index 2e8a41b884..6c8d440bab 100644
--- a/board/wolf/board.h
+++ b/board/wolf/board.h
@@ -31,6 +31,7 @@
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
@@ -194,6 +195,10 @@ enum board_version {
BOARD_VERSION_EVT = 1,
};
+/* Wireless signals */
+#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L
+#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
+#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
#endif /* !__ASSEMBLER__ */