summaryrefslogtreecommitdiff
path: root/board/cerise
Commit message (Collapse)AuthorAgeFilesLines
* Default charger current derating to 5%Peter Marheine2023-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not derating seems like a common pitfall that can cause problems with some chargers, so set a reasonably conservative default. 5% is chosen as the most common derating factor used among boards today (counting occurrences in source code, so this may undercount 5% occurrences because several projects set 5% at the project rather than board-level): 1. 38 x 5% 2. 23 x 4% 3. 6 x 10% 3. 2 x 3% 4. 1 x 2% Boards that currently configure this setting are modified only to continue building without warnings regardless of whether they use the new default value in order to signal that they were explicitly configured. BUG=b:260774380 TEST=make buildall / zmake build -a BRANCH=none Change-Id: I017849d38572fbc48090ae1fa2c539b808e426f9 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4109651 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* board: Sort header filesJeremy Bettis2022-12-012-2/+3
| | | | | | | | | | | | | | | | | | | | Sort all includes in board 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: I6ad72b167cbb768a64c338fa633eb4bf5a401897 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060360 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* Add default implementation of board_set_charge_limitPeter Marheine2022-11-241-6/+0
| | | | | | | | | | | | | | | | | | | The majority of boards simply call charge_set_input_current_limit() from board_set_charge_limit() now that the minimum current limit and derating are available as config options. Make this the default behavior of the charge manager, overridable by boards as needed. Boards that have existing custom behavior retain it, with their versions of board_set_charge_limit() marked as __override as necessary. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I72475ca0e8381596cafbcda4b042c7f884ae0432 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022857 Reviewed-by: Keith Short <keithshort@chromium.org>
* Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMITPeter Marheine2022-11-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the dual use of CONFIG_CHARGER_INPUT_CURRENT into two different symbols, changing the uses of that which are used to set a minimum current limit to be CONFIG_CHARGER_MAX_INPUT_CURRENT_LIMIT. Most boards implement this in the same way within either the board or baseboard, so handling of the new option is moved into charge_set_input_current_limit (which is called by every user of the option) and every board which repeated this pattern has the new symbol set to the same value as the old one, with the duplicated code deleted. One functional change to the charge manager is made: when charging stops, the input current limit is set to the default value (CONFIG_CHARGER_INPUT_CURRENT) rather than 0. This captures the intent that the default current is appropriate at any time, which was previously configured by individual boards' implementation of board_set_charge_limit() while still allowing the limit to be set lower as needed. To verify that all changes are appropriate, the following has been manually checked: * All boards with a change to a .c file also have a .h change * All boards without a changed .h file have a changed baseboard.h * For Zephyr projects, those with a changed .c file have config added for the minimum limit and others (only corsola) are unchanged to leave it off. This is intended to verify that each board that duplicated the MAX() logic has its configuration updated to use the shared copy, and that boards with that code in the baseboard also update their configuration. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=added lines will soon be deleted Change-Id: Ia460a16293c1fb82aac3784fd9be57ba0985f2fe Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4019703 Reviewed-by: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCTPeter Marheine2022-11-172-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many boards derate their charge current limits by some fixed ratio, which results in duplicate code appearing in many different boards. Since nearly all of these are in implementations of board_set_charge_limit() and themselves call charge_set_input_current_limit(), make that derating a config option and move it into charge_set_input_current_limit(). This makes most boards' implementations uniform and ripe for further simplification in later changes. For those boards that do more complex adjustments, those can be retained by keeping the existing logic in board_set_charge_limit(). Several boards also uselessly defined multiple versions of board_set_charge_limit(): the redundant ones are removed. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=follow-up CLs delete uncovered code Change-Id: I0a7162e72538a91ad06ba85b91a10b93eb6af96b Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4015966 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* jacuzzi: usb_mux: Split struct usb_mux in jacuzzi boardsTomasz Michalec2022-09-131-6/+9
| | | | | | | | | | | | | | | | Update jacuzzi boards to use new struct usb_mux_chain. BUG=b:236274003 TEST=make buildall BRANCH=None Cq-Depend: chromium:3748785 Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I40e2d8c4050d9928212ffa77e5ff19cd2a5931eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779628 Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-127-7/+7
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util: remove unused includesYuval Peress2022-08-051-0/+1
| | | | | | | | | | | | | | | | Remove these includes as they're not needed in this header. Instead, the includes should go where they're actually being used. BRANCH=none BUG=b:240574048 TEST=make buildall -j TEST=zmake build -a Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I64b10af3216654b2a20caa1cabd267661a0bca39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791980 Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com>
* board/cerise/board.c: Format with clang-formatJack Rosenthal2022-07-011-48/+35
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I10e4985b1884c6d91d0fa5555bfeef4d12fbc418 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728117 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/cerise/board.h: Format with clang-formatJack Rosenthal2022-07-011-11/+11
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I1b736197bfe8b7bcd52e229f9ae56153b9347cb2 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728118 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/cerise/led.c: Format with clang-formatJack Rosenthal2022-06-281-18/+25
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I7352dd2119bec52115b02803b34ffe6b8587371c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728142 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* usbc: wrap task_set_event to have an explicit port argumentFabio Baltieri2022-05-271-1/+1
| | | | | | | | | | | | | | | | | Define an explicit function to set events for the usb charger tasks, so that the caller is not coupled to the internal task implementation, and we can use a single task on a later patch. BRANCH=none BUG=b:226411332 TEST=make buildall TEST=zmake testall TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7a1223642b800568bf4f9864f75b2b647c84d29f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3663746 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/baseboard: Remove ACCEL_INTERRUPTSGwendal Grignou2022-05-231-1/+0
| | | | | | | | | | | | | | Use a finer grain set of define, to allow some sensors to use interrupt when wired properly and some use force mode when not using interrupt. BUG=b:230401133 BRANCH=asurada,dedede,brya TEST=Build all. Check Zephyr with herobrine. Check on bugzzy. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I9c7d50b88a0eaec017f4e5e2ccfdb80761d71fb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3609121 Reviewed-by: Yuval Peress <peress@google.com>
* cleanup: it8801: Rename discrete Keyboard configsVijay Hiremath2022-04-252-3/+3
| | | | | | | | | | | | | | | | Renamed IT8801 discrete keyboard related names like NOT_RAW, I2C_PORT, I2C_ADDRESS and Interrupt GPIO to support discrete keyboard in Zephyr Shim. BUG=b:230008245 BRANCH=none TEST=make buildall Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Change-Id: I9be3ff570681f88e1fc3ac0650f9919ad272b847 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3600627 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* USB MUX: Wait on ACK for HPD changes when requiredDiana Z2021-12-021-1/+5
| | | | | | | | | | | | | | | In order to correctly sequence HPD sets with the AP, allow the HPD set to wait on an ACK from the AP before proceeding. BRANCH=None BUG=b:202137658 TEST=on brya, validate retimer and virtual mux are kept in sync as expected Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I368c3290b69d627829a70847876d7b47a8c36948 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3232293 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* i2c: Use declared initializers for i2c_ports: kukui boardsKeith Short2021-11-301-3/+22
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I326bd6efef5cdfdf8bbd2c68dda268dca543b9d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300185 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* COIL: Update SPI references to controller/peripheralKeith Short2021-11-231-1/+1
| | | | | | | | | | | | | | | Update SPI references to controller/peripheral for inclusivity. BUG=b:163885307 BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I19b02fb949aad9ade569c4658a904e9ce59e27c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3066272 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org>
* ioex: it8801: Support multiple I2C addressesVijay Hiremath2021-09-102-3/+6
| | | | | | | | | | | | | | | | | | | To avoid the I2C address contention between multiple I2C devices on same bus, added code to support multiple I2C addresses for it8801 I/O expander. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I6985973f9ae3ce91383d3b568a851169e6a308af Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115426 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Li Feng <li1.feng@intel.com>
* USB MUX: Convert usb_mux HPD functions to use mux_state_tDiana Z2021-08-301-1/+1
| | | | | | | | | | | | | | Since we have definitions for HPD IRQ and level in the mux flags, extend this to the HPD update function in the usb_mux structure as well. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I19c3a65fc821a341338d73fabd7876339b37fe7d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095437 Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-271-1/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* keyboard: Use __override for keyboard_scan_configDaisuke Nojiri2021-07-231-1/+1
| | | | | | | | | | | | | | | | | Currently keyboard_scan_config is defined by each board using CONFIG_KEYBOARD_BOARD_CONFIG. This patch makes it defined as __override hence removes CONFIG_KEYBOARD_BOARD_CONFIG. BUG=None BRANCH=None TEST=buildall Change-Id: I53a356741ba4d00e829ca59b74ee6dc704188728 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044403 Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* system: Generalize system_get_board_version()Philip Chen2021-07-121-1/+0
| | | | | | | | | | | | | | | | | | Extend system_get_board_version() to support not only AP-sourced SKU ID but also EC-sourced SKU ID, whose getter function can be customized per board. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=zmake testall Change-Id: I764868d6472fb66480a43d028e5a79933b10117d Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3017602 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* kukui: move common mkbp wake events to baseboard.hEric Yilun Lin2021-06-291-4/+0
| | | | | | | | | | | | | | | | also, kodama(detachable) missed MODE_CHANGE event, add it back. BUG=none TEST=make buildall BRANCH=kukui,icarus Change-Id: Id7139ef64caf28720d389d8c048bfd724b42ba95 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2987227 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* COIL: Rename motion sense address macrosDiana Z2021-06-091-2/+4
| | | | | | | | | | | | | | | | Update the motion_sense.h address macros to reflect our current i2c terms, and also to specify that these are used exclusively in the accelerometer code. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibad287df2ba1ecd0b6f3061599476636ac7a5354 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946316 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* COIL: Rename MODULE_SPI_MASTER to MODULE_SPI_CONTROLLERCaveh Jalali2021-06-032-4/+4
| | | | | | | | | | | | | | | | This renames the MODULE_SPI_MASTER to MODULE_SPI_CONTROLLER. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I4d33f57fd82c5b57f111c12387113dc82cebe60b Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932466 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* LED On/Off: Make battery LED optionalDiana Z2021-04-221-4/+5
| | | | | | | | | | | | | | | Currently, all boards using the LED On/Off module have battery LEDs. However, if we'd like to expand support to Chromeboxes then the battery LED must become optional. BRANCH=None BUG=b:185508707 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieae098829ebe6c8b103f23d5abdbf70e7bcbdf2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832692 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Add a common header for board_is_sourcing_vbus()Simon Glass2021-03-311-1/+0
| | | | | | | | | | | | | | | | This function prototype is defined in lots of files, none of which is visible to Zephyr. Add a prototype in one place and remove the others. BUG=b:183296099 BRANCH=none TEST=make buildall Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ia324327a69b117483ab9ee5c85eba93c0fb5ad9c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789799 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* genvif: Use VIF overrides by defaultAbe Levkoy2021-03-301-0/+3
| | | | | | | | | | | | | | Use board-specific override files when generating VIFs for boards. BUG=b:172276715 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I197365018ceb8197c22d631cebf4cbce1c0119f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785506 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* jacuzzi: enable keyboard scanning in S0/tabletTing Shen2021-03-231-13/+0
| | | | | | | | | | | | | | | | | | | Most Jacuzzi devices copied the incorrect lid_angle_peripheral_enable code from Reef. Fix this by sharing Willow's good implementation to all followers. BUG=b:181852624 TEST=1) make buildall 2) manually test on fennel BRANCH=kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie2dd79d5d0dcebe564664c357db73c5956d1b14b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765633 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
* COIL: Rename ioexpander i2c address variableDiana Z2021-02-241-1/+1
| | | | | | | | | | | | | | Rename ioexpander i2c address to match current conventions and update any calling locations. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iddad457f73d0dd0167496b794c00e274f8985615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697855 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* baseboard/kukui: add support for EC variantDino Li2021-02-231-0/+1
| | | | | | | | | | | | | | | With this change, we are able to build baseboard/kukui/baseboard.c on other chips. BUG=none BRANCH=none TEST=buildall. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I209daaa991f021fb7c33c21c28a7be30203510bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2710131 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* board: Set Accelerometer range to 4gGwendal Grignou2021-02-131-1/+1
| | | | | | | | | | | | | | | | | For accelerometer presented to Android, set default range to 4g. Required by Android CDD - Section 7.3.1 - Paragraph C.1.4. mems_setup can correct it, but it is cleaner if the default setting is right. BUG=b:144004449 BRANCH=none TEST=compile Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I781eafc003823e2595d46d7170f717aaee08dc6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657956 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* spi: Pass in spi_device as argument to spi_enable instead of portTom Hughes2021-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | Rather than passing in the port and iterating over the global spi_devices variable, pass in the specific spi_device that is being enabled/disabled. The spi_device_t struct has the port. This change makes the functions in spi.h more consistent since they now all take a spi_device_t*. This change is the first step in making the SPI configuration more dynamic. BRANCH=none BUG=b:177908650 TEST=git grep 'spi_enable(CONFIG' => no results TEST=make buildall TEST=Flash dragonclaw v0.2 and view console to verify FP sensor ID Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I64124e0ebcf898e88496acb77703b5f59ae931c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2654081 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* COIL: Rename fusb302 driver variablesDiana Z2021-01-271-1/+1
| | | | | | | | | | | | | Rename i2c variables in the fusb302 driver and c-file references. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ifaf7984c52fc197403d447e00c02af036e54987e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649354 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Cerise: Modify DC S3 Batled behaviorMike Lee2020-12-301-2/+2
| | | | | | | | | | | | | | Change DC S3 Batled 1s on/3s off BUG=b:176501689 BRANCH=firmware-kukui-12573.B TEST=test firmware branch, DC S3 batled behavior ok Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I83b99abe3153a603637434d8356470abd21d02b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607033 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Commit-Queue: Chen-Tsung Hsieh <chentsung@chromium.org>
* tcpm: Move tcpm.h into an include directorySimon Glass2020-12-221-1/+1
| | | | | | | | | | | | | | | | | | This header file is used from quite a few files, relying on the EC build system to find includes in the driver/tcpm directory. For Zephyr we don't want to add that as an include. It makes more sense for header files to be in an include directory, so move it and fix up the users. BUG=b:175434113 BRANCH=none TEST=build Zephyr and ECOS on volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I5851914b1a7d3fdc1ba911c0fbe9046afbaf6f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597985 Reviewed-by: Keith Short <keithshort@chromium.org>
* Cerise: Enable DC-DC mode ctrlMike Lee2020-12-152-0/+21
| | | | | | | | | | | | | | Enable DC-DC mode ctrl to solve S3 power consumption over spec BUG=b:173343526 BRANCH=firmware-kukui-12573.B TEST=test S3 power consumption meet spec. Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Ia9df2bbe9b86030243c399b8e2ffc2f9993f5e9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2584542 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Stern: Remove power_led and EC_SKU_IDMike Lee2020-11-303-93/+3
| | | | | | | | | | | | | | | Remove power_led and EC_SKU_ID,and use white battery_led to show power state in DC state BUG=b:174282565 BRANCH=firmware-kukui-12573.B TEST=make build all pass test firmware branch ,battery led can work normal Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Ie046588ef608294836ce0bffccfd2d68e8c77e78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563426 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
* Cerise/Stern: Update Led BehaviorMike Lee2020-10-233-7/+81
| | | | | | | | | | | | | | | | | | | | 1. According to EC_SKU_ID to distinguish Cerise and Stern to execute different Battery Led behavior 2. Modify Power Led 2s on, 2s off in S3 3. Add Battery low Led behavior BUG=b:170654166 BRANCH=firmware-kukui-12573.B TEST=make buildall verified LED behavior and result is OK Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: Iac86abc1bd86731acba363cd0da3d83a25896a4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2467597 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Cerise: Change g-sensor setting for ceriseMike Lee2020-10-161-3/+3
| | | | | | | | | | | | | | Config g-sensor matrixes. BUG=b:171024223 BRANCH=firmware-kukui-12573.B TEST=buildall pass Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I18e463631f17544044b8128fa26e2ddc0e4f90f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2437570 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Aaron Zhang <zhangjianbo@huaqin.corp-partner.google.com>
* jacuzzi: remove ADC_BATT_IDTing Shen2020-08-282-2/+0
| | | | | | | | | | | | | | | | | ADC_BATT_ID is reassigned to BATT_PRES in Jacuzzi families. Remove it from source code to prevent people using it. BRANCH=kukui BUG=none TEST=make buildall Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I213b502413642c9bfff99443180ddb43debb2463 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2380842 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* Jacuzzi: initial two new models cerise and stern of ec.Aaron Zhang2020-07-217-0/+918
Copy from damu, which is a model from Jacuzzi. It will need to be revised later. BUG=b:161103367 BRANCH=master BOARD=cerise, stern TEST=1.make -j BOARD=cerise 2.make -j BOARD=stern Change-Id: I1058f0bf18ab05298467a3b6c77c53981028117d Signed-off-by: Aaron Zhang <zhangjianbo@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2299607 Reviewed-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Hash.Hung <hongzhaoyou@huaqin.corp-partner.google.com>