Files
OpenCellular/board/phaser/board.c
Jett Rink 0385f2fefd phaser: initial files commit
BRANCH=none
BUG=b:78770036
TEST=build

Change-Id: I10ce1cc0196bc1e9b7d892834351bb9b3d27e3e1
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1042730
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2018-05-09 14:40:24 -07:00

60 lines
1.3 KiB
C

/* Copyright 2018 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Phaser board-specific configuration */
#include "adc.h"
#include "adc_chip.h"
#include "common.h"
#include "driver/ppc/nx20p3483.h"
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
#include "switch.h"
#include "tcpci.h"
static void tcpc_alert_event(enum gpio_signal signal)
{
if ((signal == GPIO_USB_C1_PD_INT_ODL) &&
!gpio_get_level(GPIO_USB_C1_PD_RST_ODL))
return;
#ifdef HAS_TASK_PDCMD
/* Exchange status with TCPCs */
host_command_pd_send_status(PD_CHARGE_NO_CHANGE);
#endif
}
static void ppc_interrupt(enum gpio_signal signal)
{
switch (signal) {
case GPIO_USB_PD_C0_INT_L:
nx20p3483_interrupt(0);
break;
case GPIO_USB_PD_C1_INT_L:
nx20p3483_interrupt(1);
break;
default:
break;
}
}
/* Must come after other header files and GPIO interrupts*/
#include "gpio_list.h"
/* ADC channels */
const struct adc_t adc_channels[] = {
[ADC_TEMP_SENSOR_AMB] = {
"TEMP_AMB", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX+1, 0},
[ADC_TEMP_SENSOR_CHARGER] = {
"TEMP_CHARGER", NPCX_ADC_CH1, ADC_MAX_VOLT, ADC_READ_MAX+1, 0},
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);