summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-06-11 09:05:08 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-06-18 17:19:18 -0700
commit643e329c7bb6868f85fa12ab899c3997241ed77b (patch)
tree0109db366f93aa69e1653dea2e8265514f2cbd19
parentb3110cc9c35e73af83b66aee70cc773a496379f5 (diff)
downloadchrome-ec-643e329c7bb6868f85fa12ab899c3997241ed77b.tar.gz
Nami: Reduce buck-boost mode switching frequency of isl9238
This patch reduces buck-boost mode switching frequency of isl9238 to half. This should reduce the heat generated from the charger. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:80448805 BRANCH=none TEST=make BOARD=nami Change-Id: I38a12d60f562d828a7d186e43791a8b6aedc2500 Reviewed-on: https://chromium-review.googlesource.com/1095429 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/nami/board.c13
-rw-r--r--driver/charger/isl923x.h6
2 files changed, 17 insertions, 2 deletions
diff --git a/board/nami/board.c b/board/nami/board.c
index 216c30d292..a7460aa372 100644
--- a/board/nami/board.c
+++ b/board/nami/board.c
@@ -33,6 +33,7 @@
#include "hooks.h"
#include "host_command.h"
#include "i2c.h"
+#include "isl923x.h"
#include "keyboard_backlight.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
@@ -744,6 +745,8 @@ static void setup_motion_sensors(void)
static void board_init(void)
{
+ int reg;
+
/*
* This enables pull-down on F_DIO1 (SPI MISO), and F_DIO0 (SPI MOSI),
* whenever the EC is not doing SPI flash transactions. This avoids
@@ -755,8 +758,14 @@ static void board_init(void)
/* Provide AC status to the PCH */
gpio_set_level(GPIO_PCH_ACPRESENT, extpower_is_present());
- /* Enable sensors power supply */
- /* dnojiri: how do we enable it? */
+ /* Reduce Buck-boost mode switching frequency to reduce heat */
+ if (i2c_read16(I2C_PORT_CHARGER, I2C_ADDR_CHARGER,
+ ISL9238_REG_CONTROL3, &reg) == EC_SUCCESS) {
+ reg |= ISL9238_C3_BB_SWITCHING_PERIOD;
+ if (i2c_write16(I2C_PORT_CHARGER, I2C_ADDR_CHARGER,
+ ISL9238_REG_CONTROL3, reg))
+ CPRINTF("Failed to set isl9238\n");
+ }
/* Enable VBUS interrupt */
gpio_enable_interrupt(GPIO_USB_C0_VBUS_WAKE_L);
diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h
index 361bf0272d..65c778e7bf 100644
--- a/driver/charger/isl923x.h
+++ b/driver/charger/isl923x.h
@@ -202,6 +202,12 @@
#define ISL9237_C2_PSYS_GAIN (1 << 0)
/*
+ * Control3: Buck-Boost switching period
+ * 0: x1 frequency, 1: half frequency.
+ */
+#define ISL9238_C3_BB_SWITCHING_PERIOD (1 << 1)
+
+/*
* Control3: AMON/BMON direction.
* 0: adapter/charging, 1:OTG/discharging (ISL9238 only)
*/