summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Battery: Apply fake SoC to display chargefirmware-zork-13434.B-masterDaisuke Nojiri2022-09-092-6/+7
| | | | | | | | | | | | | | | | | This patch makes the battfake command apply the fake SoC to the display SoC as well as the raw battery SoC. This patch also cleans up battery_compensate_params. BUG=None BRANCH=None TEST=Atlas Change-Id: Ifbdaa81204d27501df8a4f5e025c19a79d62feff Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994748 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880828
* battery: Set host's low battery shutdown SoC to 4%Daisuke Nojiri2022-09-091-4/+4
| | | | | | | | | | | | | | | | Currently, the host's low battery shutdown SoC is 3% by default but most boards are configured to 4%. This patch changes the default value to 4% so that we require only minority boards to customize it. BUG=b:191837893, b:189737806 BRANCH=None TEST=Storo using battfake EC command. Change-Id: I69ed5d8cc8c0d1e321d79c5eae26a9c21624a4ea Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2998509 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880827
* battery: Set host's low battery shutdown SoC to 3%Daisuke Nojiri2022-09-092-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Currently, the host's low battery shutdown SoC is 2%. This is the same as EC's low battery shutdown threshold. The EC waits for 30 secs before it triggers the low battery shutdown and powerd reads the SoC every 30 secs. Thus, in most cases powerd can shut down the system gracefully but these delays can be configured differently and the system may be too busy to process all shutdown tasks within 30 secs. This patch increases the host's shutdown SoC to 3%. This will further guarantee that powerd will be given enough time to do everything for a proper shutdown. It also avoids deeply discharging the battery, which is bad for the battery health. BUG=b:191837893 BRANCH=None TEST=Altas using battfake EC command. Change-Id: I3ab23205b400a1a326a60b8f9501611c027183b2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994747 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880826
* chgstv2: Unify power-on and shutdown battery thresholdsDaisuke Nojiri2022-09-0925-75/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, power-on battery SoC and shutdown battery SoC are independently configured by each board. This patch will unify the setting as follows: CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 2 (don't boot if soc < 2%) CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2 (shutdown if soc <= 2%) BATTERY_LEVEL_SHUTDOWN = 3 (shutdown if soc < 3%) CONFIG_BATTERY_EXPORT_DISPLAY_SOC = Y (removed) CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC = 1 This allows us to show the low battery alert whenever we can because EC doesn't inhibit power-on even if it knows the host would immediately shut down. With CONFIG_BATTERY_EXPORT_DISPLAY_SOC, boards will start using the CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2% as the low battery threshold (and the SoC will be agreed between the EC and Powerd). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 1 will keep the same threshold. This is for avoiding degrading the UX by increasing the power-on threshold (even though a question that 1% may not be enough for soft sync to finish consistently remains to be answered). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON > 2 will have a lower threshold but we think 2% is enough to finish the software sync. A lower threshold also improves the UX by showing the low battery alert in the situation where otherwise the system would leave the user uninformed by not responding to a power button press. BUG=b:191837893 BRANCH=None TEST=buildall Change-Id: If6ff733bc181f929561a3fffb8a84e760668ce37 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880825 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Battery: Add command to export display SoCDaisuke Nojiri2022-09-083-13/+90
| | | | | | | | | | | | | | | | | | | | | | | | Currently, CrOS EC passes the battery remaining capacity (mAh) and the full capacity (mAh) through ACPI to the AP so that the host can calculate the battery SoC. The host further manipulates the SoC to get the display SoC, which is used to determine user visible behaviors. To get consistent behaviors in all power states, this change enables the EC to send the display SoC to the host via EC_CMD_DISPLAY_SOC command. The Powerd's part is I5bd1371f2569d21d55df1b50a3d709b98bbf0325. BUG=b:174433637, b:181506409, b:80270446, b:109954565 BRANCH=dedede, trogdor, nami, hatch TEST=Storo, CoachZ Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Idc6992625d992a73be141987d02ed220508d3b74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2853142 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3880824 Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* chgstv2/sustainer: Stop AC current when dischargingDaisuke Nojiri2022-08-312-7/+79
| | | | | | | | | | | | | | | | | | | | Currently, the battery sustainer discharges the battery using CHARGE_CONTROL_IDLE, which uses the AC current and stops the current from the battery. With this change, when lower < upper, the sustainer discharges using DISCHARGE. When lower == upper, the sustainer discharges using IDLE. BUG=b:188457962 BRANCH=None TEST=run-sbs_charging_v2 Change-Id: I4af31eff488bc9cfa627f84994b685488c3c9061 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3049290 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Derek Basehore <dbasehore@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852913
* chgstv2/sustainer: Add tests for full battery and ACDaisuke Nojiri2022-08-312-16/+64
| | | | | | | | | | | | | | | | | | | Currently, unit tests do not check whether the battery sustainer can be enabled when the battery is already full or when the AC is already present. This patch adds tests which check the battery sustainer can be enabled when the battery is already full or when the AC is already present. BUG=b:188457962 BRANCH=None TEST=run-sbs_charging_v2 Change-Id: I4ec9785554d126baca0b60e889c4a2dabbfb628a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078401 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852912
* chgstv2: call sustain_battery_soc without checking previous statesTommy Chung2022-08-311-1/+4
| | | | | | | | | | | | | | | | | | | | | When we enalbe battery sustain after battery returns that it is full, we need to add this condition for sustain_battery_soc(). Also, add this test condition for battery sustainer. BUG=b:188457962 BRANCH=none TEST=make sure the battery sustain works when enabling it after battery returns that it is full. Also, make sure that "make run-sbs_charging_v2" pass. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: If10b9fd0264717abfb7cdbb7ddc947b370291895 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3070946 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852911
* chgstv2: Add unit test for battery sustainerDaisuke Nojiri2022-08-312-20/+107
| | | | | | | | | | | | | | | This patch adds a unit test for the battery sustainer. BUG=b:188457962 BRANCH=None TEST=make run-sbs_charging_v2 Change-Id: Ica227cf4ee3f71a746150fb6a5f4e40ab8ca0720 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987734 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852910 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* chgstv2: Add battery sustainerDaisuke Nojiri2022-08-311-3/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the battery sustainer. Given a target SoC by the host, the sustainer will try to keep the SoC stay close within the range near the target. The diagram below shows how the sustainer uses the charge mode to charge or discharge the battery as the SoC moves near the target: T-d% T% ----------|----------------------|----------- charge normally charge normally/slowly (mode=NORMAL) ... ----> +---------------------> | | <----------------------+ <----- ... discharge naturally discharge normally (mode=IDLE) (mode=DISCHARGE) When AC is unplugged, the sustainer is disabled. Currently, the sustainer requires CONFIG_CHARGER_DISCHARGE_ON_AC. > chgstate state_of_charge = 69% chg_ctl_mode = NORMAL manual_voltage = -1 manual_current = -1 Battery sustainer = off (-1% ~ -1%) > chgstate sustain 70 72 state_of_charge = 69% chg_ctl_mode = NORMAL manual_voltage = -1 manual_current = -1 Battery sustainer = on (70% ~ 72%) > battfake 71 > chgstate state_of_charge = 71% chg_ctl_mode = NORMAL > battfake 73 > chgstate state_of_charge = 73% chg_ctl_mode = DISCHARGE manual_voltage = -1 manual_current = -1 > battfake 71 > chgstate state_of_charge = 71% chg_ctl_mode = IDLE manual_voltage = 0 manual_current = 0 Unplug AC and EC keeps running. > chgstate state_of_charge = 73% chg_ctl_mode = DISCHARGE manual_voltage = -1 manual_current = -1 Replug AC. > chgstate state_of_charge = 73% chg_ctl_mode = DISCHARGE manual_voltage = 0 manual_current = 0 BUG=b:188457962 BRANCH=None TEST=Atlas. See the description above. Change-Id: I62b4e8bc9517900a5a32d2f35369c645fa8a60c3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929347 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852909 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Update EC_CMD_CHARGE_CONTROL to version 2Daisuke Nojiri2022-08-318-10/+696
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 2 of EC_CMD_CHARGE_CONTROL can control battery sustainer. It allows the host to set the upper and lower thresholds between which the EC tries to keep the battery state of charge. Version 2 of EC_CMD_CHARGE_CONTROL also supports 'GET' request. It allows the host to query the current charge control settings. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = off (-1% ~ -1%) localhost ~ # ectool chargecontrol normal 66 66 Charge state machine is in normal mode with sustainer enabled. localhost ~ # ectool chargecontrol Charge mode = NORMAL (0) Battery sustainer = on (66% ~ 66%) localhost ~ # ectool chargecontrol normal Charge state machine is in normal mode. BUG=b:188457962 BRANCH=none TEST=Atlas. See above. Change-Id: I81ec62172b4f159c46334fc0f940a2adae3f2b8a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929340 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852908 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* chgstv2: Refactor charger_discharge_on_acDaisuke Nojiri2022-08-313-29/+37
| | | | | | | | | | | | | | | | | This patch makes charger_discharge_on_ac call board_discharge_on_ac. It also makes set_chg_ctrl_mode call charger_discharge_on_ac. This makes sense since when the charge control mode changes, discharge-on-ac also needs to be enabled or disabled. BUG=b:188457962 BRANCH=none TEST=make runhosttests Change-Id: I65ec09f580afc987cc86f4c60c15c1f90ead6c3c Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986848 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852907 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* drive/charger/isl9421: Fix race condition with discharge_on_acRobert Zieba2022-06-171-10/+38
| | | | | | | | | | | | | | | | | | | | | | | There is a race condition with `learn_mode`. This variable is read and then discharge_on_ac is disabled if it is not set. However it's possible for isl9241_discharge_on_ac to get called after the branch is taken but before discharge_on_ac is disabled. This can cause factory USB charging tests to fail as discharge_on_ac is disabled improperly. This commit protects the read and branch on `learn_mode` with a mutex to prevent the above from happening. BUG=b:214341758 BRANCH=guybrush TEST=Ran USB left charge test 2000 times Change-Id: I64cd63fb2761e2d01b3b384d580ab3597870425f Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3579624 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3708625 Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Commit-Queue: Zick Wei <zick.wei@quanta.corp-partner.google.com>
* Ezkinil: Add 3rd source InvenSense ICM-42607-PSue Chen2022-03-155-0/+60
| | | | | | | | | | | | | | | | | Add icm42607 driver in ezkinil project to support 3rd accelgyro source. BUG=b:217971875 BRANCH=zork TEST=make BOARD=ezkinil Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Icc31e73caa5a4de60584a46a24edcd24a5dc355a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3442908 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com> (cherry picked from commit 9b8503833dc4415359b594adb45173a33009ad9c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3514491
* driver: icm42607: rename the registerSue Chen2022-03-091-3/+3
| | | | | | | | | | | | | | | | | | | ICM426XX_REG_DEVICE_CONFIG would be redefined while the project is using both icm426xx and icm42607 so rename it to ICM42607_REG_DEVICE_CONFIG. BUG=b:217971875 BRANCH=zork TEST=make build=ezkinil Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Iee5fac247346dde8995580cfa223dcc851357cc8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3442907 Reviewed-by: Keith Short <keithshort@chromium.org> (cherry picked from commit 11c0ad4a2334595bc249ce98c013986113445aa9) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3512412 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* driver: icm42607: removed SW reset and added POC initializeJuHyun Kim2022-03-082-20/+133
| | | | | | | | | | | | | | | | | | | | | | | | | Removed SW reset in initialize code due to hardware issue of ICM42607 Added registers initialization code instead of SW reset BUG=chromium:1288737 BRANCH=None TEST=ectool motionsense && CROS-EC IIO drivers Signed-off-by: JuHyun Kim <jkim@invensense.com> Change-Id: If14c071b82b62a7432cb1855cdf5d1c9dc744a91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403824 Tested-by: JuHyun Kim <jkim@invensense.com> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit 86f19b3430623dab7ce8089a7d3564a98705c5ac) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3499929 Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Auto-Submit: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* driver: add ICM-42607 driver supportJuHyun Kim2022-03-036-0/+1420
| | | | | | | | | | | | | | | | | | | | | | | Add ICM-42607 accel/gyro driver code. BUG=chromium:1198171 BRANCH=None TEST=ectool motionsense && CROS-EC IIO drivers Signed-off-by: JuHyun Kim <jkim@invensense.com> Change-Id: If2cff2bd20ac69ca40bc56af50dcabbd4f5910d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822268 Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> (cherry picked from commit 0602debe983036d8d7285c207b2b5cd0339eb2a8) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3443074 Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Auto-Submit: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Sue Chen <sue.chen@quanta.corp-partner.google.com>
* driver: icm426xx: discard first data instead of sleepingJean-Baptiste Maneyrol2022-02-273-22/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sleeping when turning a sensor on/off is problematic when the other sensor is running. Replace sleeping by discarding first events until sensor is stabilized. BUG=chromium:1175757 BRANCH=hatch,nami,kukui,dedede,grunt,zork,octopus,volteer TEST=turn sensor on/off when the other is running using cros-ec iio devices Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I61801970b12f9fbdcc2cd96cb4df1edae5ed521f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2682715 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> (cherry picked from commit 71d6b16eff18aab1f7c592a75e5489a4f14b8790) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3445982 Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Auto-Submit: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-by: JuHyun Kim <jkim@invensense.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* morphius: fix thermal control issueZick Wei2021-12-021-10/+18
| | | | | | | | | | | | | | | | | | | | | In some condition, CPU prochot will always trigger by EC, this patch fix this issue. BUG=b:202746631 BRANCH=zork TEST=verify prochot no longer trigger in specific steps. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I37409e2cf04fdb2d4c0ca01b8860971eff70e7d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3271799 Reviewed-by: Eric Peers <epeers@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 1e8809d732b006f029ce223d66774ae716946ff6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310023 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* jelboz/jelboz360: The type-C PDO "PD_MAX_POWER_MW" change to 45WMichael5 Chen12021-10-151-0/+2
| | | | | | | | | | | | | | | | | The type-C PDO "PD_MAX_POWER_MW" change to 45W from 65W. BUG=b:202760336 BRANCH=zork TEST=manual Check PDO using command "ectool usbpdpower" Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I448ed37ce892f097aa7a2297868cf22195c8571e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3217476 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 4438e19d17265fad22e51f2c597cb16f055703ed) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3225272 Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* gumboz: remove unused configZick Wei2021-09-131-3/+0
| | | | | | | | | | | | | | | | BUG=none BRANCH=zork TEST=verify DUT can power on normally. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ic9b7c953a0dda88529e2886ab1fd9e736760bb2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3151210 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit f7de5f9b916e36cd36d36447b605a593b0728d8e) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155863
* gumboz: update AC power on limitZick Wei2021-09-131-0/+3
| | | | | | | | | | | | | | | | | | | This patch update AC only power on limit from 50W to 40W, and remove unused config. BUG=b:199254041 BRANCH=zork TEST=make sure AC only can auto power on with 45W adapter. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I55b6f2a91b68fd1f2bd287228719f8b9a35ba532 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3147971 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 23ed5bd2549366eebf7e3ab970f79217eb59d188) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155862
* Clear OWNERS for factory/firmware branchBrian Norris2021-09-117-21/+0
| | | | | | | | | | | | BUG=none TEST=none Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155294 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* dirinboz: update AC power on limitZick Wei2021-09-101-0/+3
| | | | | | | | | | | | | | | | | This patch update AC only power on limit from 50W to 40W. BUG=b:199254041 BRANCH=zork TEST=make sure AC only can auto power on with 45W adapter. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ib68acc22016d0906deacd699b13dfd3af74f6c2b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3147970 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 274173763a2dab4814970c89802a359c0dc5b7e9) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3153116
* Reland "dirinboz: remove imu sensors"Zick Wei2021-09-094-135/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of d7d8a72b24ba3f1b5845ac2d1fa61b032a2f5075 Original change's description: > dirinboz: remove imu sensors > > Dirinboz is a clamshell only device, not use imu sensors. > > BUG=b:174240357 > BRANCH=zork > TEST=can power on DUT normally. > > Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> > Change-Id: I56202d92da86b5da2919d3e285ce953f568aad5f > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3017902 > Reviewed-by: Peter Marheine <pmarheine@chromium.org> > Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Bug: b:174240357 Change-Id: I2b5f1f2d653b7f6277ef5e5cfb261fe2c25779f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045865 Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Commit-Queue: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> (cherry picked from commit d0af5debe2677498eaa87669d5512e708a574f94) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3151040 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Don't cflush in CC_OPEN with batteryEric Herrmann2021-08-251-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the TC state machine, on entry to CC_OPEN we disable vbus/vconn, print a message, flush the console, then disable CC. But this takes too long to meet the tProtErrHardReset, which causes some compliance failures. The main culprit is the console flush. The justification for the console flush is that we may brown out, so this isn't necessary when we have a battery. Only do the console flush on entry to CC_OPEN when we don't have a battery. BUG=b:181053528, b:196936523 TEST=Compliance test TD.PD.FRSISNK3.E3 on Voxel BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: Ia056f3c3010737e18c02a7a80659da201cfe5f92 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2730630 Reviewed-by: Diana Z <dzigterman@chromium.org> (cherry picked from commit 698193fa224863758f2fa74828b10773b295b38c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116357 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* woomax: gyro sensor add 2nd source icm40608Michael5 Chen12021-08-163-1/+79
| | | | | | | | | | | | | | | | | | | gyro sensor add 2nd source icm-40608 BUG=b:196286186 BRANCH=zork TEST=make BOARD=woomax 1. Set CBI SSFC 0x03 and using command "watch ectool motionsense lid_angle" for sensor icm-40608. 2. Using command "watch ectool motionsense lid_angle" for BMI160. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I8db74d6e42858f0e7c6f5c60b22f811c6ab0d190 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088971 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit de26838f8958b258d84ad2f2dbda790d6fdce1ce) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093348
* dalboz: not read thermisotr in S5Zick Wei2021-08-021-0/+5
| | | | | | | | | | | | | | | | | The thermistor: TEMP_SENSOR_SOC powerd by S5 power rail, EC will get abnormal high temperature when DUT get from G3 to S5, we ignore thermistor temperature in S5. BUG=none BRANCH=zork TEST=verify there's no shutdown/prochot message during EC power on. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ie755dfab741ce1340c75bbeb5eb53288381b1c0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045427 Reviewed-by: Peter Marheine <pmarheine@chromium.org> (cherry picked from commit 2b645cccf591967902a359de5b0a3d74f5842580) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058158
* Ezkinil: Add PS8818 for TYPEC C1 secondary MUXSue Chen2021-07-304-1/+44
| | | | | | | | | | | | | | | | | Use SSFC bits 6-7 to choose which secondary MUX is used. BUG=b:192523667 BRANCH=zork TEST=After setting SSFC to 0x80 on the DUT with PS8818, the typec on DB works fine. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I8a66098d1e9b947acfb26b78f0cec7f835bf4c40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3000894 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 05e69748e694ffe803ebc1422c25dda6dfc87d53) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3062072
* berknip: not read thermistor in S5Zick Wei2021-07-261-0/+10
| | | | | | | | | | | | | | | | | | The thermistor: TEMP_SENSOR_SOC and TEMP_SENSOR_5V_REGULATOR are powerd by S5 power rail, EC will get abnormal temperature: 100C when DUT get from G3 to S5, we ignore thermistor temperature in S5. BUG=none BRANCH=zork TEST=verify there's no shutdown/prochot message during EC power on. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Id686375aa50cbbe01384b629b1098a574b3c35fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015909 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 0f91a4ed8c55e338f287f4d0baec2253c6111b6e) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045859
* TCPMv2: Consult board before setting power role swap requestDiana Z2021-07-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | If a board does not want to power role swap (ex. because it is in S5), then do not allow the DPM request for the power role swap to be set. This is equivalent to the logic done when a PR_SWAP message is received by the system. BRANCH=None BUG=b:174726240 TEST=on madoo, plug in phone and shutdown. Verify DUT does not swap to sourcing when in S5 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia6684006d0de6d9f23bac8bd792c34191fabab14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676931 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit b3f5b2b0dd38b5bf92eb14aa0a609142b9588f89) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045022 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* vilboz: adjust dynamic changing charge currentSamsp_Liu2021-07-161-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | S0: This patch base on charger thermistor sensor temperature to dynamic changing charge current. S3/S5: Follow battery charge current. BUG=b:193758974 BRANCH=zork TEST=Verify the S0 status charge current can be changed when charger thermistor sensor temperature rises and drop. S3/S5 status follow battery charge current. Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Change-Id: Ia1ebf69a2ae1b8925240e9b3d043a71b445f8f2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3033226 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit d97b73b882a811ad599da1b50173a73caaa39798) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3035782 Tested-by: Edward Hill <ecgh@chromium.org>
* Ezkinil: support factory keyboard test.Sue Chen2021-07-072-0/+22
| | | | | | | | | | | | | | | | | | | | | | | connector-to-GPIO map: {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6}, {0, 7}, {-1, -1}, {-1, -1}, {1, 4}, {1, 3}, {-1, -1}, {1, 6}, {1, 7}, {3, 1}, {2, 0}, {1, 5}, {2, 6}, {2, 7}, {2, 1}, {2, 4}, {2, 5}, {1, 2}, {2, 3},{2, 2}, {3, 0}, {-1, -1}, {0, 4}, {-1, -1}, {8, 2}, {-1, -1}, {-1, -1}, BUG=b:191931746 BRANCH=zork TEST=`ectool kbfactorytest` PASS. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I0354835b8b606fe735b1cef433e6e07bba658249 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2929062 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> (cherry picked from commit 184955dc875f653ad94ef39a9b7bb89d4bd5c463) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2995712 Reviewed-by: David Huang <david.huang@quanta.corp-partner.google.com>
* Jelboz/Jelboz360: Modity EC thermal config.Michael5 Chen12021-07-051-0/+9
| | | | | | | | | | | | | | | | | | | Modify EC thermal config by thermal team request. sensor 0/1 throttle temperature 72 degree and release 67 degree. sensor 0/1 shutdown temperature 80 degree. BUG=b:192635486 BRANCH=zork TEST=Using command "ectool thermalget" check params Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Id2d68f2897a48a71e1407ffd1250d05b0926a176 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3003029 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 4374e3a112cec93671cede4277252dd51f485740) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3004294 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* jelboz360: gyro sensor add 2nd source icm-40608Michael5 Chen12021-07-013-2/+73
| | | | | | | | | | | | | | | | | | | | | | | gyro sensor add 2nd source icm-40608 BUG=b:191687030 BRANCH=zork TEST=make BOARD=shuboz 1. Set CBI SSFC 0x03 and using command "watch ectool motionsense lid_angle" for sensor icm-40608. 2. Using command "watch ectool motionsense lid_angle" for BMI160. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I2d57245e82f36eef684f483fbb4edb0e7cd56c93 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2993791 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Isaac Lee <isaaclee@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 8df0ec85f3fc54f618cab271f58d6a8a3f55cbc7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2999215 Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Jelboz: Change condition AC >= 40W to boot OSMichael5 Chen12021-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | Change condition AC >= 40W to boot OS for AC only. BUG=b:188936765 BRANCH=zork TEST=manual 1. Insert 45W AC and boot to OS for AC only. 2. EC reset (Refresh + Power button) boot to OS for 45W AC only. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Ifefbeae97f81b91ccc3996226349f2c19e985da3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2914712 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 7afb9fa93b6bc5c9bc34b2fe991235db417e61c7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2977851 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* jelboz:Re-define Volume up/down positionMichael5 Chen12021-05-111-2/+2
| | | | | | | | | | | | | | | | | Depend on dynamic change volume up/down function. Need change Volume up/down position. BUG=b:185557799 BRANCH=zork TEST=Check Volume up/down function. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Iae53d5026060dc0c9c92a8e400a9bd095278cbe8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881717 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 42e4c39d0ad06057c8789e8f8000b8538aae51e7) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2886463 Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* common: motionsense fifo: Reset the initialized bits after commitYuval Peress2021-05-052-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Previously once we had one sample from a sensor, we considered the fifo initialized. Meaning we would use our computed next timestamp to spread the timestamps. This was causing issues with some devices that ended up causing the timestamps to run ahead. Reset next_timestamp_initialized back to 0 after each commit. This will allow repeated timestamps but only if a driver stages/commits the same timestamp twice. Staging the same timestamp with only a single commit will still work as before (which is the expected path). BRANCH=none BUG=b:168335284 TEST=make run-motion_sense_fifo Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ib7c566f69d7c1e4e898050b67105555dd05376e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2871055 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> (cherry picked from commit bc9660a4b3e8bab1d729cb42e0f27ac968a4f457) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875123 Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
* shuboz: Limit PD max current to 3A.Michael5 Chen12021-05-041-0/+3
| | | | | | | | | | | | | | | | | | | The system heavry load will trigger ACPROCHOT# when PDO select 3.25mA. Limit PD max current to 3A to avoid trigger ACPROCHOT#. BUG=b:182868175 BRANCH=zork TEST=Manual Check ACPROCHOT status when system heavry loading on PDO 3.25mA. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Ib363e8f297d24d3d6cf654faf23d364fc2c258fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2853089 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 49154e4cb9cfcb9aad9b927766f746a1a1e11a4d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2858295 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* zork: add SSFC field for eDP PHY alternate tuningIsaac Lee2021-04-162-0/+24
| | | | | | | | | | | | | | | | | | | The signal of some eDP will impact WWAN, will need to adjust PHY settings to avoid the noise. BUG=b:171269338 TEST=builds BRANCH=zork Change-Id: Iaab51a577a9d0c899683ef14ab46efe62f7f9c92 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2772403 Reviewed-by: Peter Marheine <pmarheine@chromium.org> (cherry picked from commit efb183e5eb71cb3cfd1e3a1c13ad6694edf1c792) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2777989 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@google.com> Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
* zork: Turn off CC_LPC console outputEdward Hill2021-04-121-1/+1
| | | | | | | | | | | | | | | | Disable CC_LPC console channel by default, to avoid noisy "ACPI kblight" filling up logs. BUG=none BRANCH=zork TEST=check console output Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I53d3181d25cce4451e9602eb590504ac9e739d2e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821361 Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 6f48e0cfcde1d7f15406aa0a630670fa8628793d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821603
* TCPMv2: Check charge port when bootingDiana Z2021-04-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | When booting into S0, take the current charge port into account when deciding whether to power role swap. If the port has been selected from the UI as a charge port, then refrain from swapping and continue to charge from it. BRANCH=None BUG=b:179334214,b:179095748,b:178070314 TEST=on madoo, connect to magolor and select charging from magolor on the UI. Go through suspend and shutdown iterations and confirm that madoo continues to charge from magolor Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I40ef73309f75372b0a34a7542282244ff30868ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676924 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809635 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* gumboz: add thermal protect parameterZick Wei2021-03-302-0/+102
| | | | | | | | | | | | | | | | | | | | | | This patch add thermal protect parameter for gumboz(same as dirinboz): All trigger/release by charger thermistor, Charging current 0.5A: Trigger > 58’C ; Release < 57’C CPU PROCHOT: Trigger > 63’C ; Release < 62’C Set USB-C0 port to 1.5A: Trigger > 63’C ; Release < 62’C BUG=b:181803301 BRANCH=zork TEST=verify EC behavior intended when trigger/ release thermal protection. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ia2d840536b6e96474de293c7a014ae76816eb607 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780818 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> (cherry picked from commit a68f4691e240a46fed4b8b9f6977382036f93c7d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789808 Commit-Queue: Isaac Lee <isaaclee@google.com>
* dirinboz: add FW_CONFIG support for different keyboard layoutIsaac Lee2021-03-193-0/+33
| | | | | | | | | | | | | | BUG=b:182232569 BRANCH=firmware-zork-13434.B-main TEST=build all Change-Id: I567739a9499249d5bdb067e23ee80a957ba7c2e4 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2755360 (cherry picked from commit fd9ea2bfe6a9b0dbf40ad3aa36409063db15ce06) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2759766 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
* dirinboz: update thermal protect parameterZick Wei2021-03-151-10/+16
| | | | | | | | | | | | | | | | | | | | | This patch update thermal protect parameter as below: All trigger/release by charger thermistor, Charging current 0.5A: Trigger > 58’C ; Release < 57’C CPU PROCHOT: Trigger > 63’C ; Release < 62’C Set USB-C0 port to 1.5A: Trigger > 63’C ; Release < 62’C BUG=b:181803301 BRANCH=zork TEST=verify EC behavior intended when trigger/ release thermal protection. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I9ce794a37c2d29f02f1e2829dcc53340c542b13e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751304 Reviewed-by: Peter Marheine <pmarheine@chromium.org> (cherry picked from commit d4f7c9688c9669088b8ae13c2ada2e50f2bc888a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757821 Commit-Queue: Kangheui Won <khwon@chromium.org>
* Jelboz: Dynamic charging current control.Jacky Wang2021-03-132-0/+90
| | | | | | | | | | | | | | | | | | | | 1. Limit Charging Current by thrmal sensor 0 temperature(Charger). 2. If temperature over or under 54C and keep 5s, Charging Current will change to next level. 3. Limit Charging Current table : 2200/1800/1700/1600 BUG=b:181085004 BRANCH=firmware-zork-13434.B TEST=make BOARD=shuboz 1. Verified pass by thermal team. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ic2526db54815759e52b56c662a364237ff6d878f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2716585 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit ddf23ec1c9810399cd97be585248a4faadaec02c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757808
* shuboz/jelboz/jelboz360: Increase power button init timeoutMichael5 Chen12021-03-041-1/+6
| | | | | | | | | | | | | | | | | | | | | Jelboz's battery takes serval seconds to come back from the cutoff state. Recorded about ~4 seconds, so dump the timeout up to 5 second for some margin as well. BUG=b:181736787 BRANCH=zork TEST=Verify DUT will boot up from cutoff a few seconds after AC power is pluning in. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I340a9c0df38428b8990123f6bb0d7777d4224980 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2731174 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit e295fbdecc415581c7463e6b2bb9c27faf5765b5) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2734056 Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* ectool_keyscan: add missing null terminator to kbd_plain_xlateFabio Baltieri2021-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strchr relies on the source string to be null terminated. This fixes a compiler warning when building outside of the chroot: util/ectool_keyscan.c: In function ‘cmd_keyscan’: util/ectool_keyscan.c:208:9: error: ‘strchr’ argument missing terminating nul [-Werror=stringop-overflow=] 208 | pos = strchr(kbd_plain_xlate, key); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUG=none TEST=build only, warning is gone BRANCH=none Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Iafb8249515ffa1a5f7e04a272e54a048eef9a57c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606228 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 06a82155ef062adaccf3c2469c59ca850f5800c7) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718319 Reviewed-by: Ting Shen <phoenixshen@chromium.org> (cherry picked from commit 7e402ecaadded5744705f0bb6a50e63036054820) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2729255 Tested-by: Mathew King <mathewk@chromium.org> Tested-by: Martin Roth <martinroth@google.com> Auto-Submit: Mathew King <mathewk@chromium.org> Reviewed-by: Martin Roth <martinroth@google.com> Commit-Queue: Martin Roth <martinroth@google.com>
* vilboz: dynamic changing charge currentSamsp_Liu2021-02-052-0/+83
| | | | | | | | | | | | | | | | | | | | | | This patch base on charger thermistor sensor temperature to dynamic changing charge current. BUG=b:174720890 BRANCH=zork TEST=verify the charge current can be changed when charger thermistor sensor temperature rises and drop. Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Change-Id: I0ba4c17fcfa6b5b468778865ded53ab494eebe7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666554 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit c287a298aeaffcf2b954b1f51ca89139c7f35bad) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675326 Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* tcpmv2: Fix pd_set_suspend CC openEdward Hill2021-02-041-40/+42
| | | | | | | | | | | | | | | | | | | | | | | | system_common_shutdown -> handle_pending_reboot was assuming that once pd_set_suspend returned, CC open had been achieved. This was not true, because pd_is_port_enabled saw get_state_tc return TC_DISABLED while tc_cc_open_entry was still waiting for its cflush to finish. Add TC_FLAGS_SUSPENDED to fix this, and ensure CC open timing is correct. Use tc_pause_event_loop in tc_disabled_run instead of task_wait_event(-1), to align with tc_low_power_mode_run. In tc_run, don't keep entering TC_DISABLED if we are already there. BUG=b:174526198 BRANCH=zork TEST=ectool reboot_ec cold at-shutdown Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I5db6da787049361dac43d1f03b7c1fea770dfb85 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666523 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673304