summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-06-12 17:26:49 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-17 00:07:53 +0000
commit0450571a46724c702363d2706142121f9b61e212 (patch)
tree04f9931b475c200bb337075d9f8b3c537d53f66b
parent53a2bbace35a1c55f595b9f052b627a7339c74c5 (diff)
downloadchrome-ec-0450571a46724c702363d2706142121f9b61e212.tar.gz
strago: Initial support for BCRD2
Following features are enabled. 1. Initialise the ADC ports to avoid floating state due to thermistors. 2. Enable the daughter board volume buttons. 3. Enable the PMIC control support. BUG=none TEST=Device boots to UI. BRANCH=none Change-Id: I27907cb79e165ce6c3df9249a35904aa12717c95 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/284110 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/strago/board.c18
-rw-r--r--board/strago/board.h11
2 files changed, 29 insertions, 0 deletions
diff --git a/board/strago/board.c b/board/strago/board.c
index 8dd5c0e1d9..42ec939e28 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -4,7 +4,9 @@
*/
/* Strago board-specific configuration */
+#include "adc.h"
#include "als.h"
+#include "button.h"
#include "charger.h"
#include "charge_state.h"
#include "driver/accel_kxcj9.h"
@@ -104,6 +106,14 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+const struct button_config buttons[] = {
+ {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN, GPIO_VOLUME_DOWN,
+ 30 * MSEC, 0},
+ {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP, GPIO_VOLUME_UP,
+ 30 * MSEC, 0},
+};
+BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT);
+
/* Four Motion sensors */
/* kxcj9 mutex and local/private data*/
static struct mutex g_kxcj9_mutex[2];
@@ -195,3 +205,11 @@ static void motion_sensors_pre_init(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, motion_sensors_pre_init,
MOTION_SENSE_HOOK_PRIO - 1);
+
+/* init ADC ports to avoid floating state due to thermistors */
+static void adc_pre_init(void)
+{
+ /* Configure GPIOs */
+ gpio_config_module(MODULE_ADC, 1);
+}
+DECLARE_HOOK(HOOK_INIT, adc_pre_init, HOOK_PRIO_INIT_ADC - 1);
diff --git a/board/strago/board.h b/board/strago/board.h
index 9225b38c17..1bebbe6b1b 100644
--- a/board/strago/board.h
+++ b/board/strago/board.h
@@ -44,6 +44,8 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
+#define CONFIG_PMIC
+
#define CONFIG_ALS
#define CONFIG_ALS_ISL29035
#define CONFIG_BATTERY_CUT_OFF
@@ -70,6 +72,9 @@
#define CONFIG_LID_ANGLE_SENSOR_BASE 0
#define CONFIG_LID_ANGLE_SENSOR_LID 1
+/* Number of buttons */
+#define CONFIG_BUTTON_COUNT 2
+
/* Modules we want to exclude */
#undef CONFIG_EEPROM
#undef CONFIG_EOPTION
@@ -91,6 +96,12 @@
#define I2C_PORT_PD_MCU MEC1322_I2C2
#define I2C_PORT_THERMAL MEC1322_I2C3
+/* ADC signal */
+enum adc_channel {
+ /* Number of ADC channels */
+ ADC_CH_COUNT
+};
+
/* power signal definitions */
enum power_signal {
X86_ALL_SYS_PWRGD = 0,