summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-grunt-11031.149.BBrian Norris2021-09-102-10/+1
| | | | | | | | | | | | 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/+/3155182 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* Reland "aleena: Add detect accel/gyro sensor in HOOK_INIT"David Huang2021-02-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e5fa7fc82639d619b7a53db6b8b94117c857014e. Reason for revert: Add include "adc.h" to fix build error. Need this change when sysjump rw and make sure ec get correct sku_id from adc. Original change's description: > Revert "aleena: Add detect accel/gyro sensor in HOOK_INIT" > > This reverts commit 103e253e60bb6e37278eb13ac880f172d6941358. > > Reason for revert: build fails on firmware-grunt-11031.B branch: > board/aleena/board.c:163:204: error: 'HOOK_PRIO_INIT_ADC' undeclared here (not in a function) > > Original change's description: > > aleena: Add detect accel/gyro sensor in HOOK_INIT > > > > Add detect accel/gyro sensor in HOOK_INIT for sysjump rw. > > Use "HOOK_PRIO_INIT_ADC + 2" For sku_id checking. > > And make sure detect sensor when chipset power on. > > > > BUG=none > > BRANCH=grunt > > TEST=sysjump ro/rw to check motionsense data. > > > > Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> > > > > Change-Id: I143cde2ab3028ec5658acd16fdb6ec6aae710ef6 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2655305 > > Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> > > Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> > > Reviewed-by: YH Lin <yueherngl@chromium.org> > > Reviewed-by: Keith Short <keithshort@chromium.org> > > Commit-Queue: David Huang <david.huang@quanta.corp-partner.google.com> > > (cherry picked from commit 8801fd7768c8b8436bd0282af71cdd449257c08a) > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2662223 > > Commit-Queue: Keith Short <keithshort@chromium.org> > > Bug: none > Change-Id: I2cf8d24b2a41f715293b4a08ef11833e2320ce73 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674380 > Reviewed-by: Edward Hill <ecgh@chromium.org> > Commit-Queue: Edward Hill <ecgh@chromium.org> > Tested-by: Edward Hill <ecgh@chromium.org> Bug: none Change-Id: Ic981032a15ec87ec611fd62ccc7bc9c8996cde66 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673584 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Revert "aleena: Add detect accel/gyro sensor in HOOK_INIT"Edward Hill2021-02-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 103e253e60bb6e37278eb13ac880f172d6941358. Reason for revert: build fails on firmware-grunt-11031.B branch: board/aleena/board.c:163:204: error: 'HOOK_PRIO_INIT_ADC' undeclared here (not in a function) Original change's description: > aleena: Add detect accel/gyro sensor in HOOK_INIT > > Add detect accel/gyro sensor in HOOK_INIT for sysjump rw. > Use "HOOK_PRIO_INIT_ADC + 2" For sku_id checking. > And make sure detect sensor when chipset power on. > > BUG=none > BRANCH=grunt > TEST=sysjump ro/rw to check motionsense data. > > Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> > > Change-Id: I143cde2ab3028ec5658acd16fdb6ec6aae710ef6 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2655305 > Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> > Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> > Reviewed-by: YH Lin <yueherngl@chromium.org> > Reviewed-by: Keith Short <keithshort@chromium.org> > Commit-Queue: David Huang <david.huang@quanta.corp-partner.google.com> > (cherry picked from commit 8801fd7768c8b8436bd0282af71cdd449257c08a) > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2662223 > Commit-Queue: Keith Short <keithshort@chromium.org> Bug: none Change-Id: I2cf8d24b2a41f715293b4a08ef11833e2320ce73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674380 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* grunt: Disable SBU on hibernateEdward Hill2021-02-031-0/+7
| | | | | | | | | | | | | | | | | If CCD not active, set port 0 SBU_EN=0 to avoid power leakage during hibernation. BUG=b:175674973 BRANCH=grunt TEST=no power leakage during hibernate Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I05b8079aebc1282b9bb955bbf153c0fc2399bee1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2668063 Tested-by: Peichao Wang <pwang12@lenovo.corp-partner.google.com> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Peichao Wang <pwang12@lenovo.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2643589
* aleena: Fix aleena accel icm matrix.David Huang2021-02-021-1/+1
| | | | | | | | | | | | | | Fix aleena accel icm matrix. BUG=None BRANCH=grunt TEST=Check CTS-V accelerometer measurement tests pass. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: Ic340aa5df4e4121986c99828ac3a88b8ac68708f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666546 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* aleena: Add detect accel/gyro sensor in HOOK_INITDavid Huang2021-02-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Add detect accel/gyro sensor in HOOK_INIT for sysjump rw. Use "HOOK_PRIO_INIT_ADC + 2" For sku_id checking. And make sure detect sensor when chipset power on. BUG=none BRANCH=grunt TEST=sysjump ro/rw to check motionsense data. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I143cde2ab3028ec5658acd16fdb6ec6aae710ef6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2655305 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: David Huang <david.huang@quanta.corp-partner.google.com> (cherry picked from commit 8801fd7768c8b8436bd0282af71cdd449257c08a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2662223 Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: icm426xx: Use calibration unit to set/get offsetGwendal Grignou2021-01-291-24/+15
| | | | | | | | | | | | | | | | EC interface use constant (not range dependent) units to get/set offsets. Use them in icm426xx driver. BUG=b:177292639 BRANCH=hatch,nami,kukui,dedede,grunt,zork,octopus,volteer TEST=compile Change-Id: I6e6b1551464ea389db34646ba5b2bb553d683d7a Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657955 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659407
* aleena: Add base accel/gyro config for icm-426xxDavid Huang2021-01-193-1/+116
| | | | | | | | | | | | | | | | Add icm-426xx config for new second source base accel/gyro. BUG=none BRANCH=grunt TEST=Check ectool motionsense and get x,y,z data. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I9a772fe700e97e29c7110c971683fa1c7f6c2f23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2626796 Reviewed-by: Keith Short <keithshort@chromium.org> (cherry picked from commit 46afea52cc38b00505b24b601b732f035708975b) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2626797 Commit-Queue: Keith Short <keithshort@chromium.org>
* icm426xx: reset data rate when initDavid Huang2021-01-071-0/+2
| | | | | | | | | | | | | | | | | When icm426xx init, reset data rate to enable sensor. BUG=chromium:1160266 BRANCH=main TEST=Check ectool motionsense get data after shutdown and power on. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I0a1042eaf6dbdb132c4bb50975eae3c6f0cfad00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597131 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600805 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: add icm426xx chip type defineJean-Baptiste Maneyrol2021-01-072-0/+4
| | | | | | | | | | | | | | | | | | | | | Add new enum motionsensor_chip and update ectool motionsense. BUG=chromium:1117541 BRANCH=None TEST=ectool motionsense info Cq-Depend: chromium:2317888 Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I07736d61bdb7332bfdc44c8f7294233e43a6e00d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2374647 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600804 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* driver: add ICM-426xx driver supportJean-Baptiste Maneyrol2021-01-079-0/+1581
| | | | | | | | | | | | | | | | | | | | | | | Add ICM-426xx accel/gyro driver code. BUG=chromium:1117541 BRANCH=None TEST=ectool motionsense fifo_read && tast run hardware.SensorRing Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I83fe48abc6aa9cde86576a777ac4272d90fac597 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2317888 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2584545 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600803 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* ec_commands: Add GENMASK macrosTom Hughes2020-12-281-0/+6
| | | | | | | | | | | | | | | | | | GENMASK is used in ec_commands.h, but is not defined if not compiling in kernel or Chrome OS EC environments. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I439b0d77c47f3921f7bf2afd04c62cc72d668ea6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558857 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600802 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: bmi160: Fix rounding error in set_offset() and get_offset()Ching-Kang Yen2020-12-243-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | The original set_offset() and get_offset() codes in the driver/accelgyro_bmi160 use simple divisions to write the data. The more times the set_offset() and get_offset() is used, the data will get closer to 0. Fixing it by replacing simple division to round_divide(), division that round to nearest, in the common/math_util.c. BRANCH=octopus BUG=b:146823505 TEST=Testing on octopus:ampton on branch [firmware-octopus-11297.B]. Checking the data did not rounding to 0. Change-Id: Ide9df9e32fc501e63d6f952cb8254df7662afd23 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2002998 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600801 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com>
* i2c: add generic read/modify/write operationsDenis Brockus2020-12-232-0/+137
| | | | | | | | | | | | | | | | | | | i2c_update is used to set or clear a mask i2c_field_update is used to clear out a field before the set BUG=none BRANCH=none TEST=make buildall -j Change-Id: I7f8f93f4894fb9635092931a93961d328eacfeb9 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1956437 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600800 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com>
* usbc: Remove pd_ts_dts_plugged() check from PD_DRP_FORCE_SINKEdward Hill2020-12-112-21/+3
| | | | | | | | | | | | | | | | | | PD_DRP_FORCE_SINK had an exception (since crrev.com/c/277275), allowing role to remain source on S5 entry if DTS (debug accessory) is connected. Remove this exception. rddkeepalive on cr50 (set when servod starts) ensures CCD mode stays enabled across power and role changes. BUG=b:173457150 BRANCH=none TEST=servo_v4_role:snk, AP S0/S5/G3, EC reboot/hibernate -> CCD keeps working Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Iccdfb504c6269ee2ba072e9818920e3e10a56739 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2584857
* mordin: Add CosMX B00C4473A9D0002 batteryDevin Lu2020-11-182-0/+31
| | | | | | | | | | | | | | BUG=b:173343686 BRANCH=firmware-grunt-11031.B TEST=Test on charging/discharging/battery cut off pass. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I69f50259c25e3fe6774afe2660a65db820cdaead Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2539712 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> (cherry picked from commit 7f46efd099ef8c4b7695658ee5bd0136e3d25b74) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2545910
* careena/barla: enable 2nd TCPC source PS8755 for port 1Devin Lu2020-09-113-0/+27
| | | | | | | | | | | | | | | | | | | | This patch adds one more TCPC PS8755 in the port 1. These two are all supported by ps8xxx.c and the board function board_get_ps8xxx_product_id is implemented to judge the source by checking TCPC ID pin. BUG=b:157298401, b:158983814 BRANCH=firmware-grunt-11031.B TEST=Verify DUT with PS8755 or PS8751 in the sub-board can work correctly in sink and source roles. Verify USBC charger is able to charging. Change-Id: I867e925ee5bb54597ba09539743a0048c220e298 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393407 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* ps8xxx: support multiple chips in the runtimeMarco Chen2020-09-113-115/+298
| | | | | | | | | | | | | | | | BUG=b:159082424 BRANCH=none TEST=verify the same EC image can work on devices with PS8751 or PS8755 for src / snk roles. Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I3a743666a4ccbcae37ecb6f0d6657122cf9c5a69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2304237 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393406 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver/tcpm/ps8xxx: Consistent DCI disable methodDevin Lu2020-09-111-46/+19
| | | | | | | | | | | | | | | | This patch make consistent with DCI disable method for PS8705/PS8805/PS8815, they are in the similar chip group. BUG=b:161202452 BRANCH=none TEST=make buildall -j. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ia919dab9fb6afd72e3b693d94fe8abee628e2f40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2313056 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393397 Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver/tcpm: add support for PS8755Devin Lu2020-09-114-9/+21
| | | | | | | | | | | | | | | | | | | The patch adds support for the Parade Tech PS8755 TCPC/SuperSpeed mux. It is similar chip group as PS8705/PS8805/PS8815. BUG=b:159042756, b:159082424 BRANCH=none TEST=make buildall -j. make BOARD=jinlon with this new CONFIG. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I38fa02704cc352da0e27eae8cd8bbce89a807975 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2279339 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393396 Commit-Queue: Edward Hill <ecgh@chromium.org>
* ps8805: Follow the sequence to enable the DCI register accessWai-Hong Tam2020-09-111-4/+23
| | | | | | | | | | | | | | | | | Follow the sequence in the programming guide to enable the DCI register access, even they are always enabled in the firmware. BRANCH=None BUG=b:161202452, b:147772854 TEST=Tested Trogdor negotiate >5V charging and source power to USB devices. Change-Id: Ia121855cf097fe4b517ceefa461568fbec67b63d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2304264 Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393395 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* ps8xxx: add helper function to access alternate I2C pagesCaveh Jalali2020-09-112-5/+5
| | | | | | | | | | | | | | | | | | this provides a helper function for computing the I2C page address of alternate I2C pages available on the ps8xxx family of chips. BRANCH=none BUG=b:158857815,b:159289062 TEST=buildall passes Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: I121ec9f2beaadf3e4e3c429d177fe38eb2976be8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2271700 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392239 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* PS8805: Do not enable and disable DCI registersWai-Hong Tam2020-09-111-17/+3
| | | | | | | | | | | | | | | | | | | | | PS8805 is not like PS8751, which needs to rewrite the TCPC reg A0 bit 0 to enable the DCI registers. The DCI registers are always accessible. Also there is a bug on firmware, like 0x8, 0xC, 0xD, that rewriting the reg A0 bit 0 to 1 will make the TCPC I2C not accessible. BRANCH=None BUG=b:147772854 TEST=Verified on Trogdor, fw 0xC, 0xD, and 0xF, the TCPC I2C is accessible. Change-Id: Ie554d2b4022397801423fb3670305bf536b2cc20 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2015641 Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392238 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver/tcpm: Add support for PS8705Aseda Aboagye2020-09-114-2/+48
| | | | | | | | | | | | | | | | | | | | | The commit adds support for the Parade Tech PS8705 TCPC/SuperSpeed mux. It is similar to other Parade TCPCs in its family. BUG=b:158760026 BRANCH=None TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I23288757f2baf56742958357b5ee6bac5cffa02f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2243314 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392237 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* ps8xxx: add support for the ps8815Caveh Jalali2020-09-114-7/+25
| | | | | | | | | | | | | | | | | | | | | | this adds support for the ps8815 variant of the parade TCPC. this chip is very similar to its predecessors like the ps8751 and ps8805 and can be supported by the same driver. at this point, the TCPM can talk to the chip but we don't properly detect chargers - the CC line states seem wrong and CC status changes do not trigger an ALERT in the ps8815. BRANCH=none BUG=b:144397088,b:147459088 TEST=EC detects the chip on boot. Change-Id: If86abd1fa21cf8f33f28c4ce89050b29e9408532 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1969524 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392236 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* ps8xxx: disable DCI modeCaveh Jalali2020-09-114-22/+110
| | | | | | | | | | | | | | | | | | | | | | | DCI mode is auto-enabled by default. we don't actually support DCI (intel specific SoC debug path), so we can explicitly disable DCI mode. doing so, saves about 40mW on the 3.3v rail when USB2 devices or USB-C to USB-A dongles are left plugged in. this is particulary relevant in sleep mode as this accounts for a significant portion of the system power consumption. BUG=b:119875949 BRANCH=none TEST=verified power consumption drops using sweetberry, USB devices still functional across suspend/resume. Change-Id: Id13630425c78965d2ac4f2e97715374ae0640d23 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1732231 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2392235 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* syv682x: disable VBUS discharge in sink modeCaveh Jalali2020-07-161-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | The syv682x needs to have FDSG (force discharge mode) disabled in order to allow charging. BRANCH=none BUG=b:148487130,b:148467221 TEST=verified PD charging works with USB3 daughterboard (crrev.com/c/2013656 needed to enable USB3 board). Change-Id: Ifff20576accf88822228b7bd7b9eeb6b6cff6a6b Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2037097 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org> Tested-by: Eric Herrmann <eherrmann@chromium.org> (cherry picked from commit dd5b97c3e86d71919ec1287e19e740e86081fdde) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2291468 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* syv682x: fix status register readCaveh Jalali2020-07-161-1/+4
| | | | | | | | | | | | | | | | | | | | | We were reading CONTROL_1_REG instead of STATUS_REG to check the VSAFE_0V status. This corrects the register being accessed. BRANCH=none BUG=none TEST=volteer boots without a battery Change-Id: I06d0fbc0b9313b809ed43be13138241beca395a5 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1999619 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> (cherry picked from commit d9d96d1b01cb66fbfdc50fe705eaa2cc2579b442) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2291467 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* usb_pd_policy: Make a lot of objects commonAseda Aboagye2020-06-2560-9327/+744
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a board specific usb_pd_policy.c file that contains a lot of code for handling DisplayPort Alternate mode, Google Firmware Update Alternate mode, as well as some PD policy functions such as deciding to Accept or Reject a data role swap or a power role swap. Several boards simply copy/paste this code from project to project as a lot of this functionality is not actually board specific. This commit tries to refactor this by pulling the functions that are not mainly board specific into common code. The functions are made overridable such that boards that truly do require a different implementation may do so. Additionally, this consolidation changes the policy behaviour for some boards, but they should be for the better. Some examples include that data swaps are always allowed if we are a UFP (no system image requirement), power swaps are allowed to become a sink if we are no longer dual role (e.g. - in suspend), and DisplayPort Alternate Mode is not entered if the AP is off. In order to facilitate this refactor, a couple CONFIG_* options were introduced: - CONFIG_USB_PD_DP_HPD_GPIO /* HPD is sent to the GPU from the EC via a GPIO */ - CONFIG_USB_PD_CUSTOM_VDO /* * Define this if a board needs custom SNK and/or SRC PDOs. * * The default SRC PDO is a fixed 5V/1.5A with PDO_FIXED_FLAGS indicating * Dual-Role power, USB Communication Capable, and Dual-Role data. * * The default SNK PDOs are: * - Fixed 5V/500mA with the same PDO_FIXED_FLAGS * - Variable (non-battery) min 4.75V, max PD_MAX_VOLTAGE_MV, * operational current PD_MAX_CURRENT_MA, * - Battery min 4.75V, max PD_MAX_VOLTAGE_MV, operational power * PD_OPERATING_POWER_MW */ BUG=chromium:1021724,b:141458448 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: I18fd7e22dc77fe1dc6c21c38cd7f1bc53cae86cb Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949052 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213574 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* usb_pd: use enum tcpc_rp_value instead of intCaveh Jalali2020-06-2519-19/+20
| | | | | | | | | | | | | | | | | | | | this changes the declaration and definitions of typec_set_source_current_limit() to take an enum tcpc_rp_value instead of int. BUG=none BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: If633641a581eeb6085b94bc727e23fb57f7cd435 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1889117 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213573 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* usb: de-dup common code from old and new PD stackJett Rink2020-06-2511-59/+142
| | | | | | | | | | | | | | | | | | | We still need to pull out more common code between the two stacks, but this is scaffolding with a few examples. BUG=b:137493121 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: Ibd9dda1e544e06f02aa3dde48ca7de1539700cfa Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744655 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213572 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* usb_mux: Send DP safe mode info to virtual MUXVijay Hiremath2020-06-252-0/+3
| | | | | | | | | | | | | | | | | | | Before entering into alternate mode, state of the USB-C MUX needs to be in safe mode so that the USB-C pins cab be re-purposed without getting damaged or do not damage their Port Partner. Hence, sending the DP safe mode info to virtual MUX from EC. BUG=b:139140865 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: I3715b5118112b7744407ac5e652f63f6d7cd0a1b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745540 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213571 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* pd_policy: Change DP AltMode event from host event to MKBP.Aseda Aboagye2020-06-253-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the EC could notify the AP that it had entered into DisplayPort Alternate mode by sending a MODE_CHANGE host event. However, there was no mechanism to disable that functionality if desired without effecting the other MODE_CHANGE events (i.e. - base attach/detach). By changing the DisplayPort Alternate mode entry to an MKBP event, we can have more granularity and only affect this single event. - This commit adds a new MKBP event, EC_MKBP_EVENT_DP_ALT_MODE_ENTERED. - The commit also changes the DP AltMode entry notification from sending a MODE_CHANGE host event to this new MKBP event. BUG=chromium:786721 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: Ia5f294b26701c3c98c9b7f948fc693d26234c835 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1685787 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213570 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* common: Define markers for weak symbolsDaisuke Nojiri2020-06-251-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces macros to mark weak symbols. These macros are used to annotate weak definitions, declarations, and overriding definitions. __override_proto: declarations __override: definitions which take precedence __overridable: default (weak) definitions Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium.org/964060 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: I44cec41e0523e285db19a890d084b52337f64a9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1633911 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213569 Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
* Flapjack: Disable charging from BC 1.2 charger as USB-C chargerDaisuke Nojiri2020-06-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Currently, if a charger shows Rp=USB on USB-C port, the charge manager chooses it and sets the max current to 500 mA even if it can provide higher power as a BC 1.2 charger. This patch introduces CONFIG_USBC_DISABLE_CHARGE_FROM_RP_DEF. When it's defined, a BC 1.2 charger won't be recognized as a USB-C charger. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/131353444 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: I50969973026185dd2aecdb768985cd116c1d32f7 Reviewed-on: https://chromium-review.googlesource.com/1586580 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213568 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* common: pd_policy: Add notification for DP AltModeAseda Aboagye2020-06-253-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | This commit simply adds a notification that can be called when the device enters DisplayPort Alternate mode or a DP attention VDM is received. Calling the notification will send a MODE_CHANGE host event which may wake the AP. BUG=chromium:786721 BRANCH=firmware-grunt-11031.B TEST=With other PD Policies patches, flash grunt and run faft_ec&pd Change-Id: Iaa221e69060a7d1015f7c1e2f6f053e6810a674a Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1666366 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213567 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Liara: adjust Sunwoda and SMP precharge_currentEdward Hill2020-04-251-2/+2
| | | | | | | | | | | | | BUG=b:151877162 BRANCH=grunt TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Icc7c1349db9ecfbb0fa71ab2305a3094dd1ecdac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2128891 Reviewed-by: Diana Z <dzigterman@chromium.org> (cherry picked from commit e0da937f6e9f5bf507b80e18d041be8bd7dc8d7a) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2166928
* grunt/baseboard: Slow keyboard scan rateDevin Lu2020-04-081-2/+7
| | | | | | | | | | | | | | | | | Slow the keyboard scan rate from 60 us to 80 us. This compensates the additional delay added to the KBO line by H1. BUG=b:153470574 BRANCH=grunt TEST=make sure defect unit will not output t Key while pressing F3 key. Change-Id: I9548ccc2368ac7be5ea566577a479e98291efb29 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2141372 Reviewed-by: Edward Hill <ecgh@chromium.org> (cherry picked from commit dbfc6ded455817d6de0ddd9ecfe454bc564d0362) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2141376 Commit-Queue: Edward Hill <ecgh@chromium.org>
* nuwani : Add SKU ID check for different sku boardxiaoqiang.zhu2020-04-062-8/+14
| | | | | | | | | | | | | | | nuwani sku id range is from 0xd0 to 0xdf, and nuwani180 sku id is 0xd0, nuwani360 sku id is 0xd8. BUG=b:150846518 BRANCH=firmware-grunt-11031.B TEST=boot nuwani180/360 board, function as expected. Signed-off-by: xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com> Change-Id: I3be5df864d52415f8b471cf990ff6b50c9ad7909 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2134337 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* stm32: Fix manual interrupt clearing functionCraig Hesling2020-03-161-1/+3
| | | | | | | | | | | | | | | | | | | | | This fixes a bug in gpio_clear_pending_interrupt, where all pending interrupts are unintentionally cleared. This is not in the code path for normal gpio interrupt handlers, since the normal interrupt clearing occurs in gpio_interrupt (right below this function). BRANCH=none BUG=chromium:1059520 TEST=none Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I4d6fe7947f4d76cf3b57dfbf3bb926e41851c80c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101208 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> (cherry picked from commit c2c2c083fef813e3e3c70f8c13a1418717ba682d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106673
* nuwani : Add new battery informationxiaoqiang.zhu2020-03-122-3/+29
| | | | | | | | | | | | | | | | | | nuwani need support new battery --AEC:bq40z50-R3 This CL add to support the AEC battery BUG=b:151045912 BRANCH=firmware-grunt-11031.B TEST=boot treeya board with new battery, charging/discharging/cutoff work as expected. Signed-off-by: xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com> Change-Id: I96d627a270ee16376f30a3471f8bfa6e44293ca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094925 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver: lis2dw12: Fix maximal ODRGwendal Grignou2020-03-101-1/+3
| | | | | | | | | | | | | | | | Be sure EC max frequency is taken into account. BUG=chromium:615059,chromium:1059318 BRANCH=hatch, grunt TEST=Check tast run <IP> hardware.SensorRing works on Akemi(hatch) with new firwmare. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I8c4bf1213c876ceec4b20a4dd87094aab79d7b0b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2092214 Reviewed-by: Heng-ruey Hsu <henryhsu@chromium.org> (cherry picked from commit b13856bc9f193c8c7f4a045b684131b5cf7d0900) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094746
* nuwani: Add new grunt-family board.Peichao Wang2020-03-108-0/+750
| | | | | | | | | | | | | | | | | | | | Add nuwani board. Initially base on treeya. BUG=b:150799568 BRANCH=11031.B TEST=emerge-grunt chromeos-ec Ensure that ec.bin are created Change-Id: I2eb264dbd96aa7cda10b1d8e20fc0e67bc195254 Signed-off-by: xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2087435 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Martin Roth <martinroth@google.com> Tested-by: Martin Roth <martinroth@google.com> (cherry picked from commit 56f8aebc855ad5f031e5a1db975bff43503fe7fd) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094556 Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* ppc: Use hard reset to recover from CC overvoltageEdward Hill2019-12-063-66/+40
| | | | | | | | | | | | | | | | When sn5s330 PPC detects CC overvoltage, recover via hard reset and don't enable PP2 sink FET directly. Also clean up the interrupt unmasking in sn5s330_init(). BUG=b:144892533 BRANCH=grunt TEST=Do ESD test to trigger CC1/CC2 OVP, device recovers to sink Change-Id: I662bf164b55508be4d5cc1b3ad639c9613bd1935 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949264 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949267
* helios: Detect PPC sn5s330 CC1/CC2 OVP and release OVP.Michael5 Chen2019-12-062-14/+58
| | | | | | | | | | | | | | | | | | | | If PPC have CC OVP protection, check VBUS_GOOD. If VBUS_GOOD is ok, release CC OVP. BUG=b:141587322 BRANCH=Master TEST=Manual Do ESD test to trigger CC1/CC2 OVP. Using EC console command PPC_DUMP to check ppc regiset is correct. Change-Id: I3b817cc1dcec4c14ed4e2098b7ad7582b938f613 Signed-off-by: Michael5 Chen <michael5_chen@pegatroncorp.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826098 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1933787 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* treeya : Add new battery informationxiaoqiang.zhu2019-11-262-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | treeya need support three new batteries --SMP:L19M3PG1 --LGC:L19L3PG1 --Celxpert:L19C3PG1 The same manufacturer(SMP) has two kinds of batteries, manuf_name can't specify the unique battery, so need to check device_name. BUG=none BRANCH=none TEST=boot treeya board with new batteries, charging/discharging/cutoff work as expected. Change-Id: I09e2a68961e5df92c6b6d639963ac8894eb7ec20 Signed-off-by: xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1935469 Reviewed-by: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Auto-Submit: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Aleena: support factory keyboard test.David Huang2019-11-062-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | 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:143848117 BRANCH=master TEST="ectool kbfactorytest" Pass. Change-Id: I087c4f11338e58d20ad82ce94c4c64380945c56f Signed-off-by: David Huang <David.Huang@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1893909 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: David Huang <david.huang@quanta.corp-partner.google.com> Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> (cherry picked from commit 49d43283668c702a984bdc52d91b1d645e1042f1) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1899663 Commit-Queue: Edward Hill <ecgh@chromium.org>
* treeya: fix rotation matrix of kx022 lid sensorLu Zhang2019-11-051-1/+0
| | | | | | | | | | | | | | | | | | | The layout has been changed. Need to follow the HW changes. BUG=b:143848116 BRANCH=none TEST=Using ec console 'accelinfo on' verified lid angle now goes from 0 to 360 and swtiches to tablet mode after crossing 180 threshold. Signed-off-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I3ad16a44b419bcce38f0cdbf8d74e6b4876c7250 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1886590 Tested-by: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Reviewed-by: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org> (cherry picked from commit b5053b038fde3e62bd260f5a61bf63df10b0c20c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1898252 Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver: lis2dw12/lis2dwl: fix wrong __fls usagePaul Ma2019-10-252-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | __fls(n) is defined as (31 - __builtin_clz(n)) in include/common.h. Because of the definition, n can't be 0. When n is 0, __fls(0) will be -1 and it is a wrong result. Since sensor data rate can be set lower than LIS2DW12_ODR_MIN_VAL, it is possible for __fls() to get a 0 parameter. This CL will fix this condition. Because macros are getting complex, move them to c file and convert to functions. BUG=b:143242489 BRANCH=none TEST=run 'suspend_stress_test --suspend_min=10 --wake_min=10 \ --count=2500' on DUTs, test pass and no EC crash. Change-Id: I46febb602b47624ba5d0106abaedd34a23ebe96f Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1876297 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> (cherry picked from commit 16275bb36d338dd952b9312450c0cee110d5468c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1880349 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* motionsense: remove panicJett Rink2019-10-241-3/+9
| | | | | | | | | | | | | | | | | | | | | | Remove a panic that should never happen. If there was a bug to make the EC go down that code path, it seems better to log and error about motion sense than take down the entire system with an EC panic. BRANCH=none TEST=builds BUG=none Change-Id: I6231b0b2bf14f9bcb3701040d0844f765d5637ad Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1678254 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> (cherry picked from commit aa329f49dc65ec251133fd745ef3f8fc16fd79eb) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1876303 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>