summaryrefslogtreecommitdiff
path: root/board/amenia
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-09-20 12:52:10 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-21 19:38:13 -0700
commit420b4230968c16c6fb856874a6fd78730c8fd397 (patch)
tree837e00761540e2fa668e82d455db35708ac5b7cc /board/amenia
parentd94fd4faf554eb5cd48d50bc8ce307e03bc87904 (diff)
downloadchrome-ec-420b4230968c16c6fb856874a6fd78730c8fd397.tar.gz
BD9995X: Rename common code of BD99955 and BD99956 as BD9995X
Except the CHIP_ID and charger name code is common between BD99955 and BD99956. Hence renamed the code to BD9995X so that valid output is printed from console commands. BUG=chrome-os-partner:57519 BRANCH=none TEST=Manually tested on Reef. 'charger' console command prints charger name as 'bd99956' Change-Id: I3c995757941bcc5a6a8026dd807d76a7a47c9911 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/387119 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/amenia')
-rw-r--r--board/amenia/board.c26
-rw-r--r--board/amenia/board.h8
-rw-r--r--board/amenia/gpio.inc2
-rw-r--r--board/amenia/usb_pd_policy.c4
4 files changed, 20 insertions, 20 deletions
diff --git a/board/amenia/board.c b/board/amenia/board.c
index ab3dc2ecff..e0d7cc94d0 100644
--- a/board/amenia/board.c
+++ b/board/amenia/board.c
@@ -19,7 +19,7 @@
#include "driver/accel_kx022.h"
#include "driver/accelgyro_bmi160.h"
#include "driver/baro_bmp280.h"
-#include "driver/charger/bd99955.h"
+#include "driver/charger/bd9995x.h"
#include "driver/tcpm/anx74xx.h"
#include "driver/tcpm/tcpci.h"
#include "driver/tcpm/ps8751.h"
@@ -119,7 +119,7 @@ const struct adc_t adc_channels[] = {
[ADC_VBUS] = {"VBUS", NPCX_ADC_CH1, 28160, ADC_READ_MAX+1, 0},
/* Adapter current output or battery discharging current */
[ADC_AMON_BMON] = {"AMON_BMON", NPCX_ADC_CH4,
- (5 << BD99955_IOUT_GAIN_SELECT) * 10000,
+ (5 << BD9995X_IOUT_GAIN_SELECT) * 10000,
ADC_READ_MAX+1, 0},
/* System current consumption */
[ADC_PSYS] = {"PSYS", NPCX_ADC_CH3, ADC_MAX_VOLT * 10,
@@ -269,19 +269,19 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
int pd_snk_is_vbus_provided(int port)
{
- enum bd99955_charge_port bd99955_port;
+ enum bd9995x_charge_port bd9995x_port;
switch (port) {
case 0:
case 1:
- bd99955_port = bd99955_pd_port_to_chg_port(port);
+ bd9995x_port = bd9995x_pd_port_to_chg_port(port);
break;
default:
panic("Invalid charge port\n");
break;
}
- return bd99955_is_vbus_provided(bd99955_port);
+ return bd9995x_is_vbus_provided(bd9995x_port);
}
/**
@@ -294,7 +294,7 @@ int pd_snk_is_vbus_provided(int port)
*/
int board_set_active_charge_port(int charge_port)
{
- enum bd99955_charge_port bd99955_port;
+ enum bd9995x_charge_port bd9995x_port;
static int initialized;
/* charge port is a realy physical port */
@@ -325,10 +325,10 @@ int board_set_active_charge_port(int charge_port)
switch (charge_port) {
case 0:
case 1:
- bd99955_port = bd99955_pd_port_to_chg_port(charge_port);
+ bd9995x_port = bd9995x_pd_port_to_chg_port(charge_port);
break;
case CHARGE_PORT_NONE:
- bd99955_port = BD99955_CHARGE_PORT_NONE;
+ bd9995x_port = BD9995X_CHARGE_PORT_NONE;
break;
default:
panic("Invalid charge port\n");
@@ -337,7 +337,7 @@ int board_set_active_charge_port(int charge_port)
initialized = 1;
- return bd99955_select_input_port(bd99955_port);
+ return bd9995x_select_input_port(bd9995x_port);
}
/**
@@ -355,7 +355,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma)
supplier == CHARGE_SUPPLIER_BC12_SDP ||
supplier == CHARGE_SUPPLIER_OTHER);
- if (bd99955_bc12_enable_charging(port, bc12_enable))
+ if (bd9995x_bc12_enable_charging(port, bc12_enable))
return;
charge_set_input_current_limit(MAX(charge_ma,
@@ -383,7 +383,7 @@ int board_is_ramp_allowed(int supplier)
*/
int board_get_ramp_current_limit(int supplier, int sup_curr)
{
- return bd99955_get_bc12_ilim(supplier);
+ return bd9995x_get_bc12_ilim(supplier);
}
/**
@@ -401,7 +401,7 @@ int board_is_consuming_full_charge(void)
*/
int board_is_vbus_too_low(enum chg_ramp_vbus_state ramp_state)
{
- return charger_get_vbus_level() < BD99955_BC12_MIN_VOLTAGE;
+ return charger_get_vbus_level() < BD9995X_BC12_MIN_VOLTAGE;
}
/* Enable or disable input devices, based upon chipset state and tablet mode */
@@ -682,7 +682,7 @@ void board_hibernate(void)
CPRINTS("Enter Pseudo G3");
/* Enable both the VBUS & VCC ports before entering PG3 */
- bd99955_select_input_port(BD99955_CHARGE_PORT_BOTH);
+ bd9995x_select_input_port(BD9995X_CHARGE_PORT_BOTH);
/*
* Clean up the UART buffer and prevent any unwanted garbage characters
diff --git a/board/amenia/board.h b/board/amenia/board.h
index f18634debc..61904a0079 100644
--- a/board/amenia/board.h
+++ b/board/amenia/board.h
@@ -46,12 +46,12 @@
#define CONFIG_CMD_CHARGER_ADC_AMON_BMON
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
-#define BD99955_IOUT_GAIN_SELECT \
- BD99955_CMD_PMON_IOUT_CTRL_SET_IOUT_GAIN_SET_20V
+#define BD9995X_IOUT_GAIN_SELECT \
+ BD9995X_CMD_PMON_IOUT_CTRL_SET_IOUT_GAIN_SET_20V
#define CONFIG_CMD_CHARGER_PSYS
-#define BD99955_PSYS_GAIN_SELECT \
- BD99955_CMD_PMON_IOUT_CTRL_SET_PMON_GAIN_SET_02UAW
+#define BD9995X_PSYS_GAIN_SELECT \
+ BD9995X_CMD_PMON_IOUT_CTRL_SET_PMON_GAIN_SET_02UAW
#define CONFIG_CHIPSET_APOLLOLAKE
#define CONFIG_CMD_ACCELS
diff --git a/board/amenia/gpio.inc b/board/amenia/gpio.inc
index 8e0dc6c98a..7f0ac580b6 100644
--- a/board/amenia/gpio.inc
+++ b/board/amenia/gpio.inc
@@ -28,7 +28,7 @@ GPIO_INT(RSMRST_L_PGOOD, PIN(9, 3), GPIO_INT_BOTH, power_
GPIO_INT(USB_C0_PD_INT, PIN(8, 5), GPIO_INT_RISING, tcpc_alert_event) /* A43 - RXD for USB_C0_PHY_INT */
GPIO_INT(USB_C1_PD_INT_L, PIN(9, 4), GPIO_INT_FALLING, tcpc_alert_event) /* B49 - GPIO94 for USB_C1_PHY_INT_N */
-GPIO_INT(CHARGER_INT_L, PIN(0, 2), GPIO_INT_FALLING | GPIO_PULL_UP, bd99955_vbus_interrupt) /* A01 - GPIO02 for CHRGR_INT_N */
+GPIO_INT(CHARGER_INT_L, PIN(0, 2), GPIO_INT_FALLING | GPIO_PULL_UP, bd9995x_vbus_interrupt) /* A01 - GPIO02 for CHRGR_INT_N */
GPIO(NC_USB_C0_VBUS_WAKE_L, PIN(A, 7), GPIO_INPUT | GPIO_PULL_UP) /* B56 - PS2_DAT3/TB2/F_DIO3 for USB_C0_VBUS_DET_N */
GPIO(NC_USB_C1_VBUS_WAKE_L, PIN(6, 1), GPIO_INPUT | GPIO_PULL_UP) /* B32 - GPIO61 for USB_C1_VBUS_DET_N */
diff --git a/board/amenia/usb_pd_policy.c b/board/amenia/usb_pd_policy.c
index 2a93151dee..dcc30e6195 100644
--- a/board/amenia/usb_pd_policy.c
+++ b/board/amenia/usb_pd_policy.c
@@ -7,7 +7,7 @@
#include "charge_manager.h"
#include "common.h"
#include "console.h"
-#include "driver/charger/bd99955.h"
+#include "driver/charger/bd9995x.h"
#include "driver/tcpm/anx74xx.h"
#include "driver/tcpm/ps8751.h"
#include "gpio.h"
@@ -55,7 +55,7 @@ int pd_set_power_supply_ready(int port)
{
/* Ensure we're not charging from this port */
if (charge_manager_get_active_charge_port() == port)
- bd99955_select_input_port(BD99955_CHARGE_PORT_NONE);
+ bd9995x_select_input_port(BD9995X_CHARGE_PORT_NONE);
/* Provide VBUS */
gpio_set_level(port ? GPIO_USB_C1_5V_EN :