summaryrefslogtreecommitdiff
path: root/driver
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge remote-tracking branch cros/main into ↵factory-brya-14909.124.B-mainYH Lin2022-12-05109-304/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | factory-brya-14909.124.B-main" This reverts commit 184d13e77614be3be5374d3fef9d1edf66ec8687. Reason for revert: broken build due to ec-utils. Original change's description: > Merge remote-tracking branch cros/main into factory-brya-14909.124.B-main > > Generated by: util/update_release_branch.py --baseboard brya --relevant_paths_file > baseboard/brya/relevant-paths.txt factory-brya-14909.124.B-main > > Relevant changes: > > git log --oneline 19d4d68ffa..aa40b859b3 -- baseboard/brya board/agah > board/anahera board/banshee board/brya board/crota board/felwinter > board/gimble board/kano board/mithrax board/osiris board/primus > board/redrix board/taeko board/taniks board/vell board/volmar > driver/bc12/pi3usb9201_public.* driver/charger/bq25710.* > driver/ppc/nx20p348x.* driver/ppc/syv682x_public.* > driver/retimer/bb_retimer_public.* driver/tcpm/nct38xx.* > driver/tcpm/ps8xxx_public.* driver/tcpm/tcpci.* include/power/alderlake* > include/intel_x86.h power/alderlake* power/intel_x86.c > util/getversion.sh > > e6da633c38 driver: Sort header files > 234a87ae2d tcpci: Add FRS enable to driver structure > a56be59ccd tcpm_header: add test for tcpm_dump_registers > 57b3256963 Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMIT > e420c8ff9a marasov: Modify TypeC and TypeA configuration. > 43b53e0045 Add default implementation of board_set_charge_limit > b75dc90677 Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT > f1b563c350 baseboard: Sort header files > 7d01b1e58d driver/retimer/ps8818.h: Add I2C ADDR FLAGS 0x30, 0x58, 0x70 > ec31407993 Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT > 8f89f69a5b crota: disable lid angle sensor for clamshell > > BRANCH=None > BUG=b:260630630 b:163093572 b:259002141 b:255184961 b:259354679 > BUG=b:247100970 b:254328661 > TEST=`emerge-brya chromeos-ec` > > Force-Relevant-Builds: all > Change-Id: I0ecfa0e6af68631283c7a9e8f1afb9d827176c62 > Signed-off-by: YH Lin <yueherngl@google.com> Bug: b:260630630 b:163093572 b:259002141 b:255184961 b:259354679 Bug: b:247100970 b:254328661 Change-Id: Ia14942d1bd6a502062399d77cb59d1f4b549b2c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4077247 Auto-Submit: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: YH Lin <yueherngl@chromium.org>
* driver: Sort header filesJeremy Bettis2022-11-29101-177/+177
| | | | | | | | | | | | | | | | | | | | | Sort all includes in driver with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds -a Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I675e0db416b6b7cbcfce031c97fd24ad97b66f4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4052767 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* ec: IWYU Add missing includesJeremy Bettis2022-11-293-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are some circular include problems here also. Add "config.h" for CONFIG_ZEPHYR. Add <zephyr/devicetree.h> for DT_NODE_EXISTS Add <stddef.h> for size_t Add <sys/types.h> for ssize_t Add "gpio_signal.h" for enum gpio_signal BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ifbadcba90c2c0774713dc7ed3992e58f1d15d70d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4052766 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tcpci: Add FRS enable to driver structureAbe Levkoy2022-11-291-0/+3
| | | | | | | | | | | | | | Use the generic FRS enable driver function in the generic TCPCI driver. BUG=b:260630630 TEST=twister -s zephyr/test/drivers/drivers.usbc_frs BRANCH=none Change-Id: I711fb41569d477f1dad3d14fa18a7b7f8f217ce4 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4063186 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tcpm_header: add test for tcpm_dump_registersClayton Whitelaw2022-11-291-1/+1
| | | | | | | | | | | | | | | | | | This function previously had no coverage for the case where standard registers should be dumped. To support this test, mark tcpc_dump_std_registers as test_mockable. BUG=none TEST=twister, verify lines are now covered BRANCH=none Change-Id: Id7bbba6f77c1684a7eeafb1be1f990fb9176e16b Signed-off-by: Clayton Whitelaw <cawhitelaw@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4062461 Commit-Queue: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Yuval Peress <peress@google.com>
* Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMITPeter Marheine2022-11-295-11/+12
| | | | | | | | | | | | | | | | | | | "Default input current" is not a very clear name, so rename this option to better express its use as a default value that is set in the charger. This is made possible by splitting other uses into CHARGER_MIN_INPUT_CURRENT_LIMIT, making the only use for CHARGER_INPUT_CURRENT be as a default. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=isl9241 and sm5803 currently lack emulators Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia9c1df9061825b15477466e85343afeb2a371288 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4025404 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* keyboard_backlight: drop the get() functionFabio Baltieri2022-11-212-17/+0
| | | | | | | | | | | | | | | | | struct kblight_drv defines a get() function to access the current brightness level from the hardware, but nothing uses it in the code. The higher level kblight_get() uses a cached value. Drop the method, save some flash. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I822b0bf2c44ba4298cf4365504797f280aaab946 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4043981 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* isl923x: fix index checkBoris Mittelberg2022-11-181-2/+2
| | | | | | | | | | | | | | | Fix chgnum bound check to avoid out-of-bound access BUG=b:64477774 BRANCH=none TEST=make -j buildall Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I293732c2a751f71552b6cf17bc9c9e9e2df70391 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4032281 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: move periodic temp read hook to shim layerDawid Niedzwiecki2022-11-142-0/+26
| | | | | | | | | | | | | | | | | | | | | | Some of the temperature sensor drivers declare periodic one second hook to update cached temperature measurement. Declare common hook and call the update function for every sensor. The change allows better manageing of the update calls, e.g. checking power-good pin. BUG=b:244474857 BRANCH=main TEST=skyrim doesn't spam "Recover Bus failed" in G3 Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ibdfe63e20c726efb738deaa23444f7d6dd87b5e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3909669 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Dawid Niedzwiecki <dawidn@google.com>
* rt9490: disable special TA detectionalvishsu2022-11-112-0/+7
| | | | | | | | | | | | | | | | | | | ChromeOS doesn't support any non-standard TA other than SDP/CDP/DCP, so disable this feature to make behavior consistent. BUG=b:249226376 TEST=zmake BRANCH=corsola Change-Id: I86bffc94f8ef36b5119f471618955ab77ea16bf2 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949344 Reviewed-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Eric Yilun Lin <yllin@google.com>
* pujjo: enable interrupts for lid accelPeter Marheine2022-11-091-0/+2
| | | | | | | | | | | | | | | | The BMA4xx driver now supports interrupts, so stop polling the lid accel. BUG=b:254380338 TEST=accelinfo still shows accurate lid angle on pujjo with LIS2DW12 sensor installed BRANCH=none LOW_COVERAGE_REASON=board-specific code is not tested Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I29b8675736d38e1f737f9faf139ae9aa0058758c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4005683 Reviewed-by: Andrew McRae <amcrae@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* ctn730: Log optional NDEF messageDaisuke Nojiri2022-11-082-0/+7
| | | | | | | | | | | | | | | | | Currently, optional NDEF messages (0x1f) are logged as unknown events. This patch makes them logged with a proper name. BUG=b:245806799 BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ic0326a7358b2648654ec2b16222e5e72aecc742c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4010581 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Revert "BB retimer: Set 'DP CONNECTION' bit only when mux_state gets HPD event"Peter Chi2022-11-021-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4dfe7f2a385d9ad3ca10064b29e4acb0f68c30a3. Reason for revert: In VESA DisplayPortAltMode v2.0 chapter 3.9.2.2, the HPD will be sent after SBU isolation switches have been close to connect the AUX_CH. In this behavior, it will only enable AUX_CH when received HPD and cause type-c devices couldn't output display. So we need revert this CL to meet the VSEA DisplayPortAltMode spec. Original change's description: > BB retimer: Set 'DP CONNECTION' bit only when mux_state gets HPD event > > For some chromebooks design, there are expanssion card (typeC > to HDMI) communicate with TCPC through CC line, when the HDMI > card connect to chromebook the DP CONNECTION bit would be enable > even no connect HDMI moinitor. > > It will increase BBR power consumption, so set 'DP CONNECTION' > bit only when mux_state gets HPD event. > > BUG=b:233975818 > BRANCH=None > TEST=Test on Banshee, measure BBR power consumption reduce from > 143mW to 7mW. And the HDMI monitor can be output. > > Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> > Change-Id: I8a80235992cfa1bac28f03c3b6a7ec378e07ecf3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3726600 > Reviewed-by: Diana Z <dzigterman@chromium.org> > Tested-by: Enzo Hong <enzo.hong@intel.corp-partner.google.com> > Commit-Queue: Diana Z <dzigterman@chromium.org> Bug: b:233975818, b:240896516 Change-Id: I48f2818d2eaee921bc0374976f6eddcdc152ac36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3995963 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: Peter Chi <peter_chi@wistron.corp-partner.google.com> Tested-by: Peter Chi <peter_chi@wistron.corp-partner.google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test/fpsensor_hw: Convert to C++Tom Hughes2022-11-012-0/+16
| | | | | | | | | | | | BRANCH=none BUG=b:243700149, b:234181908 TEST=./test/run_device_tests.py --board dartmonkey -t fpsensor_hw Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I2c32f2493abf60dea0de6c1a8671598f8b30034b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3860407 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Andrea Grandi <agrandi@google.com>
* anx7483: Add Flat Gain tuning interfaceMatt Wang2022-11-012-0/+31
| | | | | | | | | | | | | | | | | Add an API which may be used to adjust the flat gain settings of pins on the retimer individually. BUG=b:254616597 BRANCH=none TEST=zmake skyrim winterhold successfully LOW_COVERAGE_REASON=no emulator for the ANX7483 exists Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I3677f25a0fe16b4a0393dc1377848a6a453a849e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3985350 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* tree: Allow building Minute-IA with clangTom Hughes2022-10-281-37/+35
| | | | | | | | | | | | | | BRANCH=none BUG=b:172020503, b:255967867 TEST=CC=clang make BOARD=arcada_ish -j TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I91f6f1e28646f7be821050cca870fa2a396c1e50 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3977109 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* rt9490: disable the force B-FET on experimental featureTing Shen2022-10-282-0/+29
| | | | | | | | | | | | | | | | | | | | See b:254186078. This is a workaround that applies to all devices, so it's implemented in the common driver code. BUG=b:254186078, b:253568743 TEST=`i2c read_byte I2C_PWR_CBI 0x53 0x6f` returns 0x5e (bit5=0) on tentacruel BRANCH=corsola Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I6c2864423a5bb04fefdc261f20209f44dce8053e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3985083 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Ting Shen <phoenixshen@chromium.org>
* RAA48900 : Modify configuring trickle charge current codejimmy.wu2022-10-281-1/+1
| | | | | | | | | | | | | | | | | Change requested by power team. Modify register value calculation formula to fit RAA48900 bit. Set PLATFORM_EC_RAA489000_TRICKLE_CHARGE_CURRENT value directly by project.conf. BUG=b:253154031 BRANCH=none TEST=Power team verified get possitive result. Signed-off-by: jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com> Change-Id: I5f5c9e2bb2ce2c2849967621c333269aafea160b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3980705 Code-Coverage: Andrew McRae <amcrae@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* isl923x: Add ISL9238C CMOUT latch disable functionYu-An Chen2022-10-282-0/+7
| | | | | | | | | | | | | | | Add ISL9238C CMOUT latch disable function BUG=b:255697209 BRANCH=none TEST=check ISL9238C control6 bit3 can set Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I9b07aec9065a86b261a0ab76ced3f95bdef7387b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3980939 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org>
* rt9490: disable EOC-Force-CCMalvishsu2022-10-282-1/+13
| | | | | | | | | | | | | | | | | | | RT9490 enables EOC-Force-CCM from ES2 to improve IEOC accuracy, while causes other serious problems, like causing Vsys drop randomly when removing the AC. BUG=b:254187010 TEST=Check IEOC accuracy is still tolerable (200~240mA), and 0x11[3]==1'b1 BRANCH=none Signed-off-by: Alvis Hsu <alvishsu@google.com> Change-Id: I9427262d495234360ccd192ef1b83196652615b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943273 Reviewed-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* bma4xx: support interrupt-driven operationPeter Marheine2022-10-282-33/+248
| | | | | | | | | | | | | | | | | | | | | | This adds support for using interrupts to read data from the accelerometer similar to other supported sensors. It configures the sensor to trigger an interrupt on acquisition, with data read from the internal FIFO. Init behavior is changed to disable the sensor on startup to avoid generating excess interrupts, requiring users to set the desired ODR. BUG=b:254380338 TEST=Nereid lid angle reported by `accelinfo on` is consistent with previous behavior when lid sensor is reconfigured to use interrupts. BRANCH=none LOW_COVERAGE_REASON=driver currently has no tests Change-Id: I4096cfa1a40b3bcb7df38c12201125a3801e9d2b Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3977028 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* driver/touchpad_st: Fix unaligned access warningsTom Hughes2022-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it now warns if there is an unpacked struct nested in a packed struct: driver/touchpad_st.c:109:2: error: field within 'struct (unnamed at driver/touchpad_st.c:105:8)' is less aligned than 'union (anonymous at driver/touchpad_st.c:109:2)' and is usually due to 'struct (unnamed at driver/touchpad_st.c:105:8)' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ See https://github.com/llvm/llvm-project/issues/55520. BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=whiskers TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id870922e05ecb89037e323a6d38083d07f205ee3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3975947 Reviewed-by: Diana Z <dzigterman@chromium.org>
* PCHG: Add pass-through modeDaisuke Nojiri2022-10-262-7/+24
| | | | | | | | | | | | | | | | | | | In pass-through (passthru in short) mode, EC stops handling PCHG events but reports IRQs to the host. This mode allows the host to directly communicate with a chip using I2C pass-through, for example. A host sends EC_CMD_PCHG_UPDATE with EC_PCHG_UPDATE_CMD_ENABLE_PASSTHRU sub-command or EC_PCHG_UPDATE_CMD_RESET_TO_NORMAL sub-command to enter or exit the mode. BUG=b:245764044 BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I16fe3f6ccd4a78bf3417fe3c0e86b5428a954acd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3938411 Reviewed-by: caveh jalali <caveh@chromium.org>
* test: chg_ramp_is_detected()Aaron Massey2022-10-251-1/+1
| | | | | | | | | | | | | | | Add a test that verifies the chg_ramp_is_detected() function fetched the charge ramping detection state from driver-specific functions. BRANCH=none BUG=b:255357127 TEST=twister -i -s zephyr/test/drivers/drivers.common_charger Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I0621f899da731d1b21e5a1d29ffc95c60d4fb586 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3975972 Reviewed-by: Tristan Honscheid <honscheid@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* test: chg_ramp_is_stable()Aaron Massey2022-10-251-1/+1
| | | | | | | | | | | | | | | | | Add drivers test library for testing `common/charger.c` functions. Include a test that verifies the chg_ramp_is_stable() function calls the driver-specific function for fetching whether charge ramping has reached a stable state. BRANCH=none BUG=b:255357127 TEST=twister -i -s zephyr/test/drivers/drivers.common_charger Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I3955ba2b585b149bc8a75997a64aa9512ecd0bf7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3975971 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* ctn730: Handle foreign object errorDaisuke Nojiri2022-10-252-0/+12
| | | | | | | | | | | | | This patch makes ctn730 driver report a foreign object error. BUG=b:245764044 BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Iee4572a2b6ed3826629212fffc8cc062b2ee5c0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3965281 Reviewed-by: caveh jalali <caveh@chromium.org>
* PCHG: Report errors to hostDaisuke Nojiri2022-10-251-9/+14
| | | | | | | | | | | | | | | | | | | | | This patch makes PCHG sub-system handle errors. It adds event and error masks to select which events and errors to be reported in each chipset power state. A host can clear error flags by sending a mask via EC_CMD_PCHG command when it acknowledges errors. This patch itself will not introduce any behavioral change. Actual changes will happen when the host takes actions on reported errors. BUG=b:245764044 BRANCH=None TEST=Redrix Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I19b432d6515ad6821b4e3bc9a228a1fdaa353b0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3938410 Reviewed-by: caveh jalali <caveh@chromium.org>
* tcpci: skip processing RX message when BIST mode enabledMike Lee2022-10-251-1/+17
| | | | | | | | | | | | | | BUG=b:229812911 TEST=Pass BIST test mode with ANX3447 on kingler BRANCH=none Change-Id: I89c0ec3db0224683e2bcf13997ba837689fa2386 Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607486 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* RAA48900 : Allow configuring trickle charge currentjimmy.wu2022-10-241-0/+11
| | | | | | | | | | | | | | | | Change requested by power team. Allow configuring trickle charge current. BUG=b:253154031 BRANCH=none TEST=Power team verified get possitive result. Signed-off-by: jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com> Change-Id: I5a3b4aa8e42d8516cfb16e25863eb9d5df2c65f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3955084 Code-Coverage: Andrew McRae <amcrae@google.com> Commit-Queue: Andrew McRae <amcrae@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* led/tlc59116f: Set brightness before driver disablestabilize-15208.B-mainstabilize-15207.B-mainLeila Lin2022-10-221-0/+9
| | | | | | | | | | | | | | | | | Set brightness to 0 before disable rgbkb backlight to make sure keyboard backlight is off. BUG=b:251332820 BRANCH=brya TEST=mithrax can close rgbkb backlight when lid close Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Change-Id: I3fc1e2139608c2db142c52dc82d96a111d2f3bc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3971237 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* tree: Enable warning for fallthrough in switch statementsTom Hughes2022-10-194-2/+6
| | | | | | | | | | | | | | | | | | | | | | | The EC code has generally been good about adding comments about intentional fallthrough in switch statements, but there were a few cases without comments (e.g., https://crrev.com/c/3949622). Enabling -Wimplicit-fallthrough generates a compiler warning if the fallthrough is not annotated with __attribute__((fallthrough)). For convenience, we add a "__fallthrough" macro for this attribute. See https://clang.llvm.org/docs/AttributeReference.html#fallthrough and https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html. BRANCH=none BUG=b:253644823 TEST=make buildall LOW_COVERAGE_REASON=legacy code Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I9f4d6049f4507a25ce706675d159b70e28b4b825 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957420 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tcpc: modify nct38xx and fusb302 get vbus voltage functionMatt Wang2022-10-192-2/+6
| | | | | | | | | | | | | | | | | | Modify nct38xx and fusb3802 get vbus voltage function to use the tcpm_drv API. BUG=b:252974232 BRANCH=none TEST=zmake build skyrim winterhold adlrvp_npcx ass TEST=Winterhold with this function ectool usbpdpower can get the voltage LOW_COVERAGE_REASON=we don't have an NCT emulator yet Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Iedd7165aad0c471c60f750cc4b207eef609d2eed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3951752 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* driver/als_si114x: Add missing case statementTom Hughes2022-10-171-0/+3
| | | | | | | | | | | | | | | | | | | | When building with clang it warns: driver/als_si114x.c:317:10: error: no case matching constant switch condition '0' [-Werror] switch (SI114X_NUM_LEDS) { ^~~~~~~~~~~~~~~ ./driver/als_si114x.h:35:25: note: expanded from macro 'SI114X_NUM_LEDS' ^~~~~~~~~~~~~~~~~~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=eve Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I94db5530c681c438db53bb065c45b223caea7917 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949622 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* driver/als_si114x.c: Fix LED enableTom Hughes2022-10-141-2/+2
| | | | | | | | | | | | | | | | https://crrev.com/c/2603076 introduced a change that inadvertently used SI114X_PARAM_CHLIST_EN_PS3, regardless of the number of LEDs. This was found on inspection when fixing https://crrev.com/c/3949622. BRANCH=none BUG=b:172020503 TEST=make BOARD=eve Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iccc77d0cfc6c70635df8553406dbf28e5f37f129 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957419 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Revert "rt9490: remove set_mode function"stabilize-15185.B-mainstabilize-15185.7.B-mainEric Yilun Lin2022-10-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48ed43a6f372ea3588ccc7e14ff5da1501050216. Reason for revert: charger_task need set_mode function to prevent error. Original change's description: > rt9490: remove set_mode function > > The flags we implemented is not used anywhere in the codebase. > > BUG=none > TEST=zmake > BRANCH=none > > Signed-off-by: Ting Shen <phoenixshen@google.com> > Change-Id: I72b01806463aec903b1bfe23bb1c12a58a97265d > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3896556 > Tested-by: Ting Shen <phoenixshen@chromium.org> > Reviewed-by: Eric Yilun Lin <yllin@google.com> > Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> > Commit-Queue: Ting Shen <phoenixshen@chromium.org> Bug: none Change-Id: I5a3942111dbe2e707c34f79a7e5d170be635d69e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949076 Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Code-Coverage: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* bb_retimer: Deprecate bb_retimer_set_usb3() APIstabilize-15183.14.B-mainCaveh Jalali2022-10-131-5/+0
| | | | | | | | | | | | | | | The bb_retimer_set_usb3() function is no longer used. Set USB_MUX_FLAG_CAN_IDLE in usb_mux.flags instead. BRANCH=none BUG=b:245753005 TEST='make buildall' passes Change-Id: I2ca48ae6e641ac7a8243a0ddac198d7234241d52 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3914996 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* rt9490: remove set_mode functionTing Shen2022-10-071-28/+0
| | | | | | | | | | | | | | | | The flags we implemented is not used anywhere in the codebase. BUG=none TEST=zmake BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I72b01806463aec903b1bfe23bb1c12a58a97265d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3896556 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* sm5803: disable sinking before other reconfigurationPeter Marheine2022-10-061-5/+11
| | | | | | | | | | | | | | | | | | | | | Silicon Mitus say that writing to flow2 enable bits when flow1 is set to an active state (sinking or sourcing) will have no effect, and a silently failed write like that may lead to unexpected (but not dangerous) behavior because the enable bits will not be in the expected state. Most code paths already satisfy this, but disabling the sink currently does not: change sm5803_vbus_sink_enable to disable sinking before updating other configuration, the mirror of ordering when enabling sinking. BUG=none TEST=nereid battery still charges/discharges as expected when PD source is connected or disconnected BRANCH=none LOW_COVERAGE_REASON=no emulators currently exist for sm5803 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I50c7bf20569d7cad058c19aa238aeed8eaf2aa56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3930177 Reviewed-by: Andrew McRae <amcrae@google.com>
* bb_retimer: Add .set_idle_mode supportCaveh Jalali2022-10-051-23/+49
| | | | | | | | | | | | | | | | | | | | | This updates the BB driver to support the recently introduced .set_idle_mode() interface. Also, the existing bb_retimer_set_usb3() interface is implemented using this new .set_idle_mode() interface. bb_retimer_set_usb3() will be removed when callers are updated to use the new interface. BRANCH=none BUG=b:245753005 TEST='make buildall' passes Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: I0c8d8e53ecf4dca7f1ded4bab560597570e5ea44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3914993 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* anx7447: fix get chip infolschyi2022-10-051-0/+3
| | | | | | | | | | | | | | | | | | | The get chip info method call does not check the passed in chip info struct is null or not, which causes test failure on the native POSIX system. Add a null check, and return EC_SUCCESS if the chip info is null. BUG=b:225312229 TEST=./twister -p native_posix -p unit_testing BRANCH=none Signed-off-by: lschyi <lschyi@google.com> Change-Id: Ia52b72b3a412ec4f6617b4d431175e2ea96a55e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935726 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
* usb_mux: Clarify hpd_update APICaveh Jalali2022-10-041-2/+2
| | | | | | | | | | | | | | | This clarifies that usb_mux.hpd_update() only uses 2 relevant flags in mux_state. These can be masked using MUX_STATE_HPD_UPDATE_MASK. BRANCH=none BUG=b:245753005 TEST=buildall passes Change-Id: I4b746c053ca9a59bb57aa278c0e53bd48967c1fd Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3931288 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* usb_mux: Add support for idling USB muxesCaveh Jalali2022-10-041-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for putting USB muxes in a non-active mode on chipset suspend (S0ix, S3). Some USB muxes consume a significant amount of power when the AP goes into suspend mode which has prompted some board support files to explicitly power down the USB3 portion of the Burnside Bridge. So, add a more general interface for notifying mux chip drivers about AP power state changes. This interface is optional and only kicks in for mux drivers that implement the new .set_idle_mode() method and the board's mux config specifies USB_MUX_FLAG_CAN_IDLE in usb_mux.flags. If a port is already considered to be in low power mode, no actions are taken on chipset suspend/resume. USB_MUX_FLAG_CAN_IDLE is intended to give boards full control over enabling this feature for each mux chip. This feature flag is disabled by default. BRANCH=none BUG=b:245753005 TEST='make buildall' passes './twister -v -T zephyr/test' passes Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: I93eda041e816398806eb29eb0625cca97c69c2ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3914992 Reviewed-by: Boris Mittelberg <bmbm@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* rt1739: add interrupt callback in rt1739 ppc driverTing Shen2022-10-031-0/+1
| | | | | | | | | | | | | | | | BUG=none TEST=manually tested on tentacruel BRANCH=none LOW_COVERAGE_REASON=test implemented in CL:3928388 Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: If92270e142cd524d2a0ce80dda75074e59742514 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3928387 Tested-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Jeffrey Lin <jeffrey_lin@pegatron.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* bmi3xx: fix watchdog warning during fifo processingTing Shen2022-09-301-2/+5
| | | | | | | | | | | | | | | | | | | | The `break` lines inside the nested loop of `bmi3_parse_fifo_data` does not work as intended. it should either exit the outer loop or increase the `fifo_index`, otherwise it becomes an infinite loop. BUG=b:248197142 TEST=run sw sync on tentacruel, no watchdog warning on uart console BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I1c762bbfa71f763e65f04b82a9e61e210f9e94c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3928385 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Eric Yilun Lin <yllin@google.com> Code-Coverage: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* charger: Detect the number of battery cellsKyle Lin2022-09-281-0/+24
| | | | | | | | | | | | | | | | | | | | | The charging mode of SM5803 charger is configured by sensing an external resistors. The number of battery cells can be determined from the charging mode. To support 2S and 3S batteries in one model(project), the number of battery cells should be detected at run time. BUG=b:242477985 BRANCH=none TEST='make buildall' and 'zmake build -a' Change-Id: Icb7af51ab7b3b27a6fb7ad4ac4b8fe87331108fe Signed-off-by: Kyle Lin <kylelinck@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3892078 Code-Coverage: Andrew McRae <amcrae@google.com> Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Andrew McRae <amcrae@google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* fpsensor: Build fpsensor source file with C++Tom Hughes2022-09-281-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that this change also removes abs() since this change makes the fingerprint firmware link against the toolchain's C standard library, which already provides an implementation. abs() is not actually used by the FPC matching algorithm even though it links against it. BRANCH=none BUG=b:236025198, b:234181908 TEST=On dragonclaw v0.2 with servo_micro and J-Trace attached: ./util/flash_jlink.py -b bloonchipper -i ./build/bloonchipper/ec.bin > fpenroll > fpmatch TEST=On dragonclaw v0.2 with servo_micro and J-Trace attached: ./test/run_device_tests.py --board bloonchipper Test "aes": PASSED Test "cec": PASSED Test "cortexm_fpu": PASSED Test "crc": PASSED Test "flash_physical": PASSED Test "flash_write_protect": PASSED Test "fpsensor_hw": PASSED Test "fpsensor_spi_ro": PASSED Test "fpsensor_spi_rw": PASSED Test "fpsensor_uart_ro": PASSED Test "fpsensor_uart_rw": PASSED Test "mpu_ro": PASSED Test "mpu_rw": PASSED Test "mutex": PASSED Test "pingpong": PASSED Test "printf": PASSED Test "queue": PASSED Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Test "rtc": PASSED Test "sha256": PASSED Test "sha256_unrolled": PASSED Test "static_if": PASSED Test "stdlib": PASSED Test "system_is_locked_wp_on": PASSED Test "system_is_locked_wp_off": PASSED Test "timer_dos": PASSED Test "utils": PASSED Test "utils_str": PASSED Test "stm32f_rtc": PASSED Test "panic_data_bloonchipper_v2.0.4277": PASSED Test "panic_data_bloonchipper_v2.0.5938": PASSED TEST=On icetower v0.1 with servo_micro and J-Trace attached: ./util/flash_jlink.py -b dartmonkey -i ./build/dartmonkey/ec.bin > fpenroll > fpmatch TEST=On icetower v0.1 with servo_micro and J-Trace attached: ./test/run_device_tests.py --board dartmonkey Test "aes": PASSED Test "cec": PASSED Test "cortexm_fpu": PASSED Test "crc": PASSED Test "flash_physical": PASSED Test "flash_write_protect": PASSED Test "fpsensor_hw": PASSED Test "fpsensor_spi_ro": PASSED Test "fpsensor_spi_rw": PASSED Test "fpsensor_uart_ro": PASSED Test "fpsensor_uart_rw": PASSED Test "mpu_ro": PASSED Test "mpu_rw": PASSED Test "mutex": PASSED Test "pingpong": PASSED Test "printf": PASSED Test "queue": PASSED Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Test "rtc": PASSED Test "sha256": PASSED Test "sha256_unrolled": PASSED Test "static_if": PASSED Test "stdlib": PASSED Test "system_is_locked_wp_on": PASSED Test "system_is_locked_wp_off": PASSED Test "timer_dos": PASSED Test "utils": PASSED Test "utils_str": PASSED Test "panic_data_dartmonkey_v2.0.2887": PASSED Test "panic_data_nocturne_fp_v2.2.64": PASSED Test "panic_data_nami_fp_v2.2.144": PASSED LOW_COVERAGE_REASON=legacy code Force-Relevant-Builds: all Cq-Depend: chromium:3894586 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I2c7947d21e7020b51f7b5b3d87ef64545de867c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893045 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Bobby Casey <bobbycasey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* rt9490: implement get/set_optionEric Yilun Lin2022-09-261-0/+15
| | | | | | | | | | | | | | | | | | | RT9490 doesn't support charger options, but we still need to implement this function in case of the charger_task reports charge problem and it caused the busy charger_task. BUG=b:246704732 TEST=no charge_problem at the krabby's console BRANCH=none Change-Id: I2a2518d9ef501a1ee9a80603a54772ad5c2bf990 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3906518 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* anx7483: Mark tuning data as constant.Keith Short2022-09-221-4/+4
| | | | | | | | | | | | | | | The tuning data is not modified at runtime. Mark as constant to save RAM space. LOW_COVERAGE_REASON=anx7483 driver does not yet have tests b:248086547 BUG=none BRANCH=none TEST=zmake build -a Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9bb80d804ceea5c54f02c2a2ee9f02c25009ba83 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3906614 Reviewed-by: Diana Z <dzigterman@chromium.org>
* rt9490: various bug fixTing Shen2022-09-221-3/+5
| | | | | | | | | | | | | | | | Fixes some bug caught during writing unittest. BUG=b:244233556 TEST=pass all tests BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Icceed42e100ba71207b99eabb3a79a74e8c9a32d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3896555 Tested-by: Ting Shen <phoenixshen@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* driver/wpc/cps8100.c: Add support of CPS8200Derek Huang2022-09-211-22/+157
| | | | | | | | | | | | | | | CPS8200 is revision of CPS8100 and it supports Qi 1.3 spec. The register mapping is the same as CPS8100, the main difference is the I2C register access. This patch adds the support of CPS8200. BUG=b:239783274 BRANCH=None TEST=Check CPS8100 and CPS8200 wireless charger work on Brask. Change-Id: Id6007e86c01236fcf10099d3574ad11df5b1d52d Signed-off-by: Derek Huang <derekhuang@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3819444 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>