Commit Graph

61 Commits

Author SHA1 Message Date
Bruce
a24d8db154 pyro: Open interrupt gate for trackpad
Follow reef setting.

BUG=none
BRANCH=reef
TEST=Verified the value was 0 by gpioget command

Change-Id: If471f4f5495e46b2b4712816edfe481e287d50fa
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/444592
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-02-18 23:56:00 -08:00
Bruce
aeeeafb192 pyro: add ANX74XX low power mode for different DRP state
Follow reef setting.

BUG=chrome-os-partner:58384
BRANCH=reef
TEST=make buildall

Change-Id: Icd661ed4ab78a7c8d2d5f1694934ad6723db2ddb
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/442254
Commit-Ready: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-02-14 17:28:18 -08:00
Daisuke Nojiri
c51e0b2f75 PD: Remove CONFIG_USB_PD_TCPC_FW_VERSION
This removes CONFIG_USB_PD_TCPC_FW_VERSION.
board_print_tcpc_fw_version is removed since it's no longer called.
PD chip info is printed in usb_pd_protocol.c.

BUG=none
BRANCH=none
TEST=buildall. Boot Electro, verify chip info is printed.

Change-Id: I2ff860c2a1b17ceea124644ba8feb356b9cca2eb
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/434911
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-11 15:04:42 -08:00
Daisuke Nojiri
9985a2e388 Reef-ish: Remove extra newline after board version
This removes the extra newline character after the board version
from EC's debug output.

BUG=none
BRANCH=none
TEST=Boot Electro.

Change-Id: If6e365a7f175c7e8f2c8db5adbf1780f6715d615
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/441265
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-02-10 19:02:57 -08:00
Harry Pan
20cf61354c pyro: Disable Trackpad in S5 to save power
Follow CL:433083, integrate this to children.

BUG=chrome-os-partner:59712,chrome-os-partner:62642
BRANCH=reef
TEST=gpioget EN_P3300_TRACKPAD_ODL is 1 in S5 & below, 0 otherwise.

Change-Id: I79250b8f8765fbcee065f673b1c02afff123abdf
Signed-off-by: Harry Pan <harry.pan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/438780
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-02-10 04:13:59 -08:00
Devin Lu
a3b0d7c897 pyro: Defer sensor switching rate in S3
BUG=none
BRANCH=reef
TEST=Put the device in S5 and observed no I2C errors printed
     on the EC console.

Change-Id: I15e3eedd05c7f8d5c67ee01d78afc3b4c072f1c1
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/438077
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-02-06 12:47:05 -08:00
Shawn Nematbakhsh
f08109522d charge_ramp: Specify port number in board_is_vbus_too_low()
charge_ramp needs to make a decision based upon the VBUS level on one
specific port - the port that is ramping. The VBUS level on any other
charge ports (if present) is not relevant.

BUG=chrome-os-partner:54099
BRANCH=reef, gru
TEST=With subsequent patches, verify charge_ramp success with a variety
of BC1.2 chargers.

Change-Id: Ie0a51a577e2b7491222560cd08dd5321ff3b7975
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/435561
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-02-02 19:09:52 -08:00
Bruce
479b74223d pyro/snappy: add console command to read ManufactureAccess() data
Follow reef setting.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: I2e98ccfcc152963dbe8bdd0a412d347147b38414
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/433258
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-26 18:43:54 -08:00
Bruce
7736c887d7 pyro: Add battery firmware update support.
Add battery firmware update support.

BUG=chrome-os-partner:59517
BRANCH=reef
TEST=check ec_sb_firmware_update tool can work.

Change-Id: I02fc91974ebf30d0b6177c45985ce879b92d7066
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/433477
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-26 18:43:52 -08:00
Scott
44676699b0 pd: Move PD_DEFAULT_STATE to a common define in usb_pd.h
Servo_v4 requires the ability to have a different default state per
port. In previous devices, the assumption was that each supported port
had the same default usb pd state and power role. This CL moves the
by the default power role which in turn is derived from
CONFIG_USB_PD_DUAL_ROLE. In addiiton to moving the location, it now
uses 'port' as argument so it can be port specific if required.

PD_DEFAULT_STATE was a board.h specific config, but in practice each
instance used to date was set to PD_STATE_SNK_DISCONNECTED if
CONFIG_USB_PD_DUAL_ROLE was defined and set to
PD_STATE_SRC_DISCONNECTED otherwise.

BUG=chrome-os-partner:61878
BRANCH=servo
TEST=Manual run 'make -j buildall' to verify that all instances of
PD_DEFAULT_STATE were removed.

Change-Id: Iaf40718668732f525485ed7942ee7fc246d3f75d
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/431787
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-01-26 16:10:30 +00:00
Bruce
b63404ba2d pyro: remove KB/TP control in S3
Remove all TP control because TP lose function.
Remove KB control because this action of disable KB in S3 work
after modify 'SENSOR_ACTIVE_S0' to 'SENSOR_ACTIVE_S0_S3'.

BUG=chrome-os-partner:62138
BRANCH=reef
TEST=check TP don't lose function after resume, then KB disable in
tablet mode and enable normal mode whether S0 or S3.

Change-Id: Ida023f8fa34cadb80dbcd071ee77927e94a5386d
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/430560
Commit-Ready: Aaron Durbin <adurbin@google.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-21 17:00:55 -08:00
Anson Tseng
a1064d9979 Pyro: Release control of trackpad entirely
Backdrop:
Touchpad power source disabling should be constrained in tablet mode
and S0->S3 transition only, in case that disable it in the S0 state
of tablet mode, it would cause disaster while touchpad driver of AP
tries to perform suspend procedure.

Solution: follow CL:421275

This change takes away control of trackpad from EC entirely. This will
prevent EC from interfering with the OS's interaction with the trackpad
for firmware update, device detection at boot, or entering S3.

Disadvantages are the trackpad will stay on (thus can wake up the system
unintentionally) when the system enters S3 in laptop mode then
transitions to tablet mode, or vice versa: the trackpad will stay off
(thus cannot wake up the system) when the system enters S3 in tablet mode
then transitions to laptop mode.

However, these corner cases can be handled by waking up the system upon
mode transition. The OS can then disable or enable the trackpad depending
on the transition direction (laptop <-> tablet) and re-enters S3. Or the
OS can leave the system running because mode transition implies a user's
intention to start interacting with the device.

The keyboard will continue to be managed by EC and disabled or enabled
upon mode transition.

BUG=chrome-os-partner:62138
BRANCH=reef
TEST=suspend device in tablet mode then wake it up,
examine touchpad function; hint: root shell to execute command
'ectool gpioget EN_P3300_TRACKPAD_ODL' to examine trackpad power
integrity.

Change-Id: I533cdc4a182ab878917495a7b9391f68e7e92e3e
Signed-off-by: Anson Tseng <anson.tseng@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/430392
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-19 21:27:54 -08:00
Bruce
fa6ec33cff pyro: fix discharge even plug in adapter issue
Add CONFIG_CHARGER_PROFILE_OVERRIDE, and it can check battery state
to set charge or discharge between battery capacity 95-100%.

BUG=chrome-os-partner:61767,chrome-os-partner:57571
BRANCH=reef
TEST=check unit can charge to 100%, then discharge to 95%, then
swich to charge until 100%. Loop charge and discharge between
95-100%.

Change-Id: I4f68e5a2d51e26f62ed7f6bd6ae7af061225f8cb
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/426444
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-12 04:50:58 -08:00
Devin Lu
5fe810db60 pyro: Enable CONFIG_POWER_BUTTON_IGNORE_LID
Workaround to Pyro DVT system can not power on when system at G3 state.
Hardware has leakage with LID_OPEN pin to touch control board if system
turns off PP3300 power rail, so enable CONFIG_POWER_BUTTON_IGNORE_LID
on temporarily.

BRANCH=reef

BUG=chrome-os-partner:61707,chrome-os-partner:61696

TEST=Manual.
Verify power button can power on system on pyro DVT touch sku.

Change-Id: I23608ae508ca419cecc3642d36eeee089a870778
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/426309
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-12 04:50:54 -08:00
Bruce
ef85513be4 pyro/snappy: Enter/exit from S0ix based on host commands from kernel
Follow reef setting.

This patch changes the entry/exit model for S0ix from a PCH
SLP_S0 signal based model to a hybrid host event/direct interrupt
model. The kernel will send host events on kernel freeze/thaw exit;
EC will initiate the S0ix entry based on host command and exit via
another host command from kernel.

The assertion of SLP_S0 comes later than HC(suspend) and deasserion
of SLP_S0 comes earlier than HC(resume).
        ________                        ________
SLP_S0          |______________________|
        _____                             ________
HC           |___________________________|

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: I1073b5cb2cbb8492cec0967f2a6004c5ce368ecb
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/426558
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-10 21:35:07 -08:00
Bruce
0ad4297190 pyro/snappy: Add CONFIG option to maintain VBAT voltage
Follow reef setting.

On the bd9995*, back boosting may occur when actual battery voltage
drops below VBAT register setting. Maintain the VBAT register at the
battery-requested charge voltage even when not charging to ensure the
bd9995* doesn't become a back boosted animal.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: Ie7aaffc38fef65721886d00be3d6827e9e124efa
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/426499
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-10 21:35:05 -08:00
Bruce
690ab41d89 pyro: modify led pin setting at hibernate state.
HW change led power rail, so the battery led and logo led will
light in hibernate state. I modify battery led pin (gpio84,
gpioC4) and logo led pin (pwm3) setting in hibernate, let them
will not light in hibernate.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: I6c75694cf92fe05b5afc0d2a399e15c5bff6b7f8
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/425563
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-09 23:47:34 -08:00
Bruce
e8b252c738 pyro/snappy: enable/disable KB and TP function in S3
In S3 state, then disable KB/TP function when state switch to tablet
mode from normal mode.Enable KB/TP function when state switch to nromal
mode from tablet mode.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: If759504b6d471ddc18f322aeda07ccbd6ccd636e
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/425416
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-06 05:40:36 -08:00
Bruce
a80a815ea2 pyro/snappy: Do not discharge on AC when battery is still waking up
Follow reef setting.

discharges on AC till the charger is detected and settled but
when booting from the cut-off mode this will kill the power hence
do not discharge on AC when battery is still waking up and settled.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: I09d8f5a363d20bb3d0df80694de52ae3a37a0ed9
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/422621
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-02 20:57:19 -08:00
Vijay Hiremath
66ea614158 smart_battery: Cleanup smart battery & SB users code
BUG=chrome-os-partner:61173
BRANCH=none
TEST=Manually tested on Reef. Battery info works.

Change-Id: I6e867eee38885186f8e63a934f52e826f0cf72fd
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/422998
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-02 16:16:59 -08:00
Bruce
0775e5ae06 pyro/snappy: Discharge on AC till charger is detected
Follow reef setting.

To avoid inrush current from the external charger, enable discharge
on AC till the new charger is detected and charge detect delay has
passed.

BUG=none
BRANCH=reef
TEST=make buildall

Change-Id: Ie4e249a3f8cc3140b99a944e5f252cdbaef4cab3
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/423277
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-29 21:26:54 -08:00
Gwendal Grignou
d5bd0bd0f6 als: Define CONFIG_ALS when HAS_TASK_ALS is present.
For oak, set a different list of task (no als, no accel) for compiling
revision 4 or less. Fix GPIO include issue.

BUG=chrome-os-partner:59423,chrome-os-partner:59084
TEST=compile for oak with board 4 and 5, tested on Reef.
BRANCH=kevin,reef

Change-Id: I09051a69cbad6d477a7b3bf9907f4c5c144b5136
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424220
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-12-28 21:49:32 -08:00
Gwendal Grignou
1c68913e02 driver: Move sensor private struture definition to boards.
sensor private structure for bmi160 and bmp280 were defined
in the drivers themselves. It worked because there was only one
instance of each sensors on a board. However, this is an error it
should be in board files, as it was done for other sensors like the kionix.

BUG=none
TEST=buildall.
BRANCH=kevin,reef

Change-Id: Ica3aba358d141a7df9a3e97251d4c1e520cbf2c8
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424218
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-12-28 21:49:29 -08:00
Bruce
b19c81b0b6 pyro/snappy: ensure tablet mode state is correct at startup
Follow reef setting.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I953f5380820c1ff94be7d4dbf70ff744dfbf8f10
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/418597
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-09 14:37:21 -08:00
Bruce
80121352b0 pyro/snappy: Disable keyboard and trackpad in tablet mode
(Original CL: https://chromium-review.googlesource.com/#/c/411395/)

Enabling/Dislabling keyboard and touchpad is required to prevent EC
from waking up the system from S3 in tablet mode.

This change disables the keyboard and the trackpad when the lid goes
beyond 180 degree.

Keyboard and touchpad are also enabled/disabled by the tablet switch.
When the lid reaches 360 position, keyboard and touchpad are disabled.
And they stay disabled as long as the lid stays at 360 position.
This prevents keyboard and touchpad from turning on by the (faulty) lid
angle calculation.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I919f44bae4a13aa4d9e6072e96e46bb90c08ec22
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/417643
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-08 16:38:36 -08:00
Bruce
b65e2a895a pyro/snappy: BD9995X: Suspend DC-DC converter when discharging on AC
When the battery is fully charged or not charging, upon removal of
the AC, discharge takes long time. To overcome this issue suspend
the DC-DC converter when discharging on AC.
(Refers Reef CL:413153)

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Iebfcb95d0469be552283d17eb1aea0310eccbcb9
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/417428
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-08 16:38:32 -08:00
Bruce
3e8eb98d7b pyro/snappy: modify keyboard scan rate.
Slow the keyboard scan rate from 50 us to 80 us.

BUG=chrome-os-partner:60335
BRANCH=none
TEST=check press key "f3" then system only output "f3" scan code.

Change-Id: Ic6d009fc45948267447b532beeeb12924ec77069
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/415672
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-12-07 00:37:02 -08:00
Vijay Hiremath
f66113247a charge_state_v2: Limit i/p current to meet allowed MAX i/p system power
If battery is not present, input current is set to PD_MAX_CURRENT_MA.
If the input power set is greater than the maximum allowed system power,
system might get damaged. Hence, limit the input current to meet maximum
allowed input system power.

BUG=chrome-os-partner:58498
BRANCH=none
TEST=Manually tested on Reef. Removed the battery & using 'charger'
     console command observed the following.
     With Zinger charger at 20V - Input current is set to 2.25A
     With Type-C & other chargers - Input current is set to 3A

Change-Id: Ife8686f322e095aa74b740a7c469bfe87107fb9a
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/397865
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>
2016-12-05 16:43:00 -08:00
Bruce
c5ebdd4a04 pyro/snappy: Enable battery learn-mode when battery charging not allowed
Follow reef setting.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I5fb77cce01b3eec865f3491032ad66c05db3b1c3
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/416031
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-02 11:53:07 -08:00
Bruce
20a54ee93d pyro: support ectool control
Support ectool control logo led.

BUG=none
BRANCH=none
TEST=check ectool can control led normally.

Change-Id: I627f80db61bc66eba5cf9111dd2c440c5be85592
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/413165
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-02 03:35:05 -08:00
Shawn Nematbakhsh
1bdf8584bb npcx: flash: Use common code for SPI flash protect reg translation
Common code is more flexible and supports more parts, so delete the
npcx-only register translation code.

BUG=chrome-os-partner:60029
BRANCH=gru
TEST=Manual on gru, run 'flashrom -p ec --wp-enable' and check that 0x28
gets written to SR1, which matches our desired 'protect botton 128KB',
according to the datasheet. Also run 'flashrom -p ec --erase' then read
back EC SPI contents, verify ROM is erased except for first 128KB
region.

Change-Id: I526401997ff7ec77f2a6047a4a9af74a671ed69a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/413228
Reviewed-by: David Hendricks <dhendrix@chromium.org>
(cherry picked from commit 43634d36d273887b1f2349c333a7b4b229a83365)
Reviewed-on: https://chromium-review.googlesource.com/415498
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
2016-12-01 19:59:09 -08:00
Bruce
ba50aab904 pyro/snappy: Support keyboard factory scanning
Add keyboard factory scanning tool.

BUG=none
BRANCH=none
TEST=check this tool work normal

Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Change-Id: Ifd6aa5c03ce668c4a44a5685fa721af11eb7a84e
Reviewed-on: https://chromium-review.googlesource.com/413764
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-27 22:00:51 -08:00
Bruce
09f2702066 pyro/snappy: add a pull down to KBD_KSO2 during hibernate
Cr50 has an internal pull down. This change changes the PULL_UP on KSO2
to a PULL_DOWN to match Cr50.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I0c25aebc727bf6c2015c3037305f3bd2f22efd20
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/414709
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-27 22:00:47 -08:00
Bruce
a9e1b4d093 pyro/snappy: Enable interrupt for BMI160
This patch enables an interrupt handler for BMI160. This will improve
response time of the motion sense task.

BUG=None
BRANCH=none
TEST=make buildall

Change-Id: Ibf5f0182273d076ed5f04156c680cd5b2f420306
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/414828
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-27 22:00:43 -08:00
Vijay Hiremath
7f8ad649dd BD9995X/reef/snappy/pyro: Boot from the shipmode battery
Charger BGATE is off on POR hence the voltage to the battery pack is
not applied immediately from the VBUS. To overcome this issue, BGATE
is turned on (CHG_EN) at charger initialization. If the voltage across
VBATT is high but I2C is still failing, battery is booting from ship
mode hence overwrite the battery as not present till I2C on battery
is success and INIT bit is set.

BUG=chrome-os-partner:59308
BRANCH=none
TEST=Reef can boot to OS from shipmode battery.

Change-Id: If1b212612e27fd65a822675a9609f0a8c03d8add
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/411360
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>
2016-11-18 20:07:47 -08:00
Devin Lu
c8557a0e4e pd: add PDO selection for choosing highest voltage
pyro board is using 3S1P battery, it is near 13V.
To avoid the charger entering buck-boost mode, sinking as higher voltage
to get the higher power efficiency.

BRANCH=none
BUG=chrome-os-partner:59276
TEST=plug in pyro's charger (offering 20V@2.25A, 15V@3A, 9V@3A and 5V@3A),
see it selecting 20V as below:
C1 st2
C1 st3
C1 st15
C1 st3
C1 st6
Req C1 [1] 5000mV 3000mA
[6391.078044 New chg p1]
[6391.081020 Ramp reset: st1]
[6391.081664 CL: p1 s0 i500 v20000]
C1 st7
C1 st8
C1 st9
[6391.192437 Ramp reset: st1]
[6391.193339 CL: p1 s0 i3000 v5000]
Req C1 [4] 20000mV 2250mA
C1 st7
C1 st8
C1 st9
[6391.457545 Ramp reset: st1]
[6391.458340 CL: p1 s0 i2250 v20000]
C1 st27
C1 st9
[6392.081252 AC on]
[6392.113477 charge_request(0mV, 0mA)]
[6393.116998 Ramp p1 st5 2250mA 2250mA]

plug in other charger (offering 15V@3A, 12V@3A and 5V@3A),
see it selecting 15V as below:
C1 st2
C1 st3
C1 st15
C1 st3
C1 st6
Req C1 [1] 5000mV 3000mA
[6636.084963 New chg p1]
[6636.087117 Ramp reset: st1]
[6636.087786 CL: p1 s0 i500 v15000]
C1 st7
C1 st8
C1 st9
[6636.165409 Ramp reset: st1]
[6636.166314 CL: p1 s0 i3000 v5000]
Req C1 [3] 15000mV 3000mA
C1 st7
C1 st8
C1 st9
C1 st27
C1 st9
[6637.092559 AC on]
[6637.125043 charge_request(0mV, 0mA)]
[6638.091158 Ramp p1 st5 3000mA 3000mA]
[6639.374815 charge_request(13040mV, 3712mA)]

Change-Id: I74fe4cbd6b9d1b416a94eec3fe944a9b725f0ced
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/411621
Commit-Ready: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-18 20:07:34 -08:00
Bruce
c4aa651a21 pyro/snappy: Enable high current on type-A ports by default
BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Iefa74d574e8f6354a9344abaab638a71b8783bfa
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/412240
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-17 16:09:54 -08:00
Bruce
82aaccad40 pyro/snappy: Support 360 Degree rotation
BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Idcb7a31b66896eab7232ce4d5f4920d5596b7fef
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/411584
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-17 16:09:42 -08:00
Bruce
a1ec4e2d59 pyro/snappy: Add force wake for PS8751.
If PS8751 goes into low power mode during sysjump, then tcpm_init will
fail since PS8751 is not accessible via I2C, so force it to wake up
during hook_init.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I5edfef2ac4524310d4cb5485dec68999bed08210
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/411646
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-17 16:09:35 -08:00
Bruce
342bf53465 pyro/snappy: enable tcpc low power mode
BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I28210f753cb596762facc3f2f3a2bde49d0e40df
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/411604
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-17 16:09:30 -08:00
Vincent Palatin
e9584bc6ce reef/pyro/eve/snappy: source 3A on one port
Add a new source policy to provide 3A if there is only one port used
as a source.
Also ensure that the load switch on VBUS when sourcing power is properly
configured to limit the current to 1.5A or 3.0A depending on the case.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:56110
TEST=manual: connect the laptop to a type-C sink with Twinkie in between,
without anything else connected on the laptop, see 3A flowing when measuring
with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on the other
port and see 1.5A flowing through Twinkie.
Force the input current limit on the sink to 3.0A and see the laptop cutting
VBUS.

Change-Id: Ic94ba186fc0648e770c8d13be0f96b23e968f855
Reviewed-on: https://chromium-review.googlesource.com/403851
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-17 04:35:32 -08:00
Bruce
2051adae6d Pyro: Add battery FUD support
Add battery FUD support

BUG=chrome-os-partner:59771
BRANCH=None
TEST=make buildall

Change-Id: I0969b3c25d187f1de025f53f9a61fd298c9631c4
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/410963
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-16 16:47:46 -08:00
Bruce
4975e8db75 Pyro: Enable BD9995X power save mode when hibernated
Turn off the charger BGATE when the system is hibernated to
save maximum power.

BUG=None
BRANCH=None
TEST=make buildall

Change-Id: Ifd5d50bbdfde1383538e3ce86f002845798940ac
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409853
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:10 -08:00
Bruce
b7c2f5c295 Pyro: enable tcpc-controlled drp toggle
BUG=None
BRANCH=None
TEST=make buildall

Change-Id: I9a37cffc6018a34ba865d718f488206f06d96087
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409895
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:08 -08:00
Bruce
c6273b6145 Pyro: clear hpd bit in board level tcpc init
PD alternate mode is covered in tcpc interface. So tcpci_tcpm_init()
doesn't reset HPD. If keeping HDMI/DP type-C cable connected, doing
sysjump sets HPD signal to high while it's already high(this high comes
from previous state), then OS doesn't output to HDMI/DP monitor.

BUG=None
BRANCH=none
TEST=make buildall

Change-Id: Ic3bc75b1e5579816d8c1b294fe2eb65a20e3eae3
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409751
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:07 -08:00
Wonjoon Lee
b044fba33c bd9995*: maintain VBAT voltage as battery maximum
BUG=chrome-os-partner:54248
BRANCH=gru
TEST=Manual on kevin, high temperature chamber(60C),
battery will require 0 voltage because of high temp,
then check 'chgstate' vbat maintained at 8688 mV.

Change-Id: I3b5835701c42a0cd861400ba921b3d3797152bbd
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/400088
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-11-08 02:53:54 -08:00
Bruce
49ed82eaa7 Pyro: Add firmware for shipping mode follow Pyro battery spec.
Add firmware for shipping mode follow Pyro battery spec.

BUG=None
BRANCH=None
TEST=The battery could enter shipping mode and wake up

Change-Id: If1b6e88192ad0a59b19b6b6b664b46780596fa18
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/403731
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-31 14:21:27 -07:00
Vincent Palatin
cf7ff32b92 kevin: set accurate current limit on USB load switch
When sourcing current on the type-C port, set the OCP limit on the VBUS
load switch according to current dynamic capability.
(3.0A when only one port is a power source, 1.5A else)

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=gru
BUG=chrome-os-partner:56110
TEST=manual: connect Caroline to Kevin with Twinkie in between,
ask Caroline to sink current through the UI.
without anything else connected on Kevin, see 3A flowing when measuring
with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on
the other Kevin port and see 1.5A flowing through Twinkie.
Force the input current limit on Caroline to 3.0A and see Kevin cutting
VBUS.

Change-Id: Ib879b1ed720b20aa702c5f3643948ba0575d1193
Reviewed-on: https://chromium-review.googlesource.com/403869
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-31 03:27:49 -07:00
Bruce
df028763fb Pyro: Yoga sensor setting fine tune
Fine tune matrix of base and lid.

BUG=chrome-os-partner:58798
BRANCH=None
TEST=check sceen rotate normally

Change-Id: Ib6740f0f5d6cda87d937b95dfa5788ae72b6aaaf
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/403694
Commit-Ready: Saurabh Madan <ssmadan@chromium.org>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Saurabh Madan <ssmadan@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 21:07:35 -07:00
Bruce
3df0f6a8d0 Pyro: modify led behaivor for Pyro spec
modify led behaivor for Pyro spec

BUG=chrome-os-partner:58696
BRANCH=None
TEST=make buildall

Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Change-Id: I072dee0d15e83e6ea537b52e5475ed6c894e64ef
Reviewed-on: https://chromium-review.googlesource.com/403578
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-28 21:07:02 -07:00