summaryrefslogtreecommitdiff
path: root/board/kinox
Commit message (Collapse)AuthorAgeFilesLines
* charger: Move charger_state_v2.h into charge_state.hSimon Glass2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | We don't have a v1 anymore, so the name makes no sense. Move it into the existing file. Include charge_state.h instead of v2, doing this in the same change to avoid build errors. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: Ic3e3adc45e4d002c2cd5ba8aa65e24686e01d628 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516191 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* board: Sort header filesJeremy Bettis2022-12-016-13/+12
| | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | 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>
* kinox: modify OBP pointer valueMatt Wang2022-09-222-11/+11
| | | | | | | | | | | | | | The 170w and 230w OBP value change to ADC 2816mv and 2815mv. Because of the ADC converter max is 2816mv. BUG=b:247009142,b:211806236 BRANCH=none TEST=The 90w/170w/230w can successfully boot to OS. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I6222cece83c2ae3e559aacb9f29842655fc68845 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3905447 Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* brask: usb_mux: Split struct usb_mux in brask boardsTomasz Michalec2022-09-131-10/+15
| | | | | | | | | | | | | | | | Update brask 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: Ifec0efa0dac67a2a1910e3193a7c346a6d36359a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779629 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-1215-15/+15
| | | | | | | | | | | | | | | 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>
* kinox: modify the ADP_ID valueMatt Wang2022-09-021-13/+13
| | | | | | | | | | | | | | | | | Modify the default watt to TINY 45w and the value is the real volatge, not the ADC value. And sort the TIO2 power list by max voltage. BUG=b:211806236 BRANCH=none TEST=make BOARD=kinox Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: If22348b299363f46eb6d3ac96bd1c5e2433f0665 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3861813 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
* tree-wide: const-ify argv for console commandsCaveh Jalali2022-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* kinox: modfiy console print functionMatt Wang2022-08-181-2/+2
| | | | | | | | | | | | | Let the OBP prochot log be readable. BUG=none BRANCH=none TEST=make BOARD=kinox Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I8a57fbc881355dcc2d4dbd20e2d5f9703c36f7a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3832178 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* kinox: modify S5 power type control methodMatt Wang2022-08-171-1/+2
| | | | | | | | | | | | | | | | | | Disable the PPC sink when the power type change from Type-C to Barrel Jack at S5. Let the MB lose the power by itself. And then the MB will power up by Barrel Jack again. It can prevent the Type-C and Barrel Jack has some abnormal to damage the MB when power switch. BUG=b:240461218 BRANCH=none TEST=The Power Team member check the power switch voltage can meet the spec. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I89b120d1098b76c7be9ff523f476f27c04ead9f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3829209 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
* kinox: remove unused type-c configurationJosh Tsai2022-08-081-10/+1
| | | | | | | | | | | | | | | | Due to kinox does not suuport USB4 and TBT, so remove the unused configuration BRANCH=none BUG=b:238587431 TEST=monitor can be detected after system reboot with type-c dongle Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Change-Id: I8159a0e271f221e3a0d04d65f71d5b2c0b2a54d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3807179 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* util: remove unused includesYuval Peress2022-08-051-1/+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>
* kinox: modify detect ADP_ID formulaMatt Wang2022-07-192-11/+14
| | | | | | | | | | | | | | | | Modify the comparison value is volage to voltage. Delete the ADP_ID factor_div's +1 method to make sure the method can to get max 2816 value(2.816v). BUG=b:211806236,b:238157622 BRANCH=none TEST=Can get the TIO and Tiny adapter watt. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I1be5b834c40465664a79d50fa8c09603c8b2c94f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3760805 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* kinox: modify the SIO_LEGO_EN_L for AIO buttonMatt Wang2022-07-192-1/+3
| | | | | | | | | | | | | | | | | Add the SIO_LEGO_EN_L control when using the AIO device. SIO_LEGO_EN_L set to 0 can use the AIO power button. SIO_LEGO_EN_L set to 1 cannot use the AIO power button. BUG=b:238157622 BRANCH=none TEST=Has been confirmed that the AIO power button has a function. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I036a7e177de440f9cf056a778589d97ad5cc1dd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3759836 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
* kinox: disable fan full on when board initialMatt Wang2022-07-182-8/+1
| | | | | | | | | | | | | Remove fan pwm duty 100 when board initial. BUG=b:238284556 BRANCH=none TEST=Fan not rotating when board initial. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Id03d958fa3badfe4e36e79ed4b2f8f12ed8230c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3759837 Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* kinox: enable barrel jack switch at CHIPSET_STATE_ANY_OFFMatt Wang2022-07-134-1/+11
| | | | | | | | | | | | | | | Add back the original function about the chromebox can swutch the barrel jack from type-c adapter at CHIPSET_STATE_ANY_OFF BUG=b:225769067 BRANCH=none TEST=Power type can switch to barrel jack in S5/G3 but can not switch in the others mode. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I3427df6860ef5d282ceab1f842452b12fb0be01a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3754820 Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* kinox: set the default 65w when barrel jack presentMatt Wang2022-07-131-1/+10
| | | | | | | | | | | | | | | | | The barrel jack needs almost 1.1 secnods to get the voltage and current. It will cause get the wrong charge port. So set the default 65w when BJ_ADP_PRESENT_ODL is present on board init. BUG=b:236202586 BRANCH=none TEST=The PPVAR_SYS not drop and the EN_PPVAR_BJ_ADP_L not set to high when EC do reboot. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I0c473377a8bfdc2ea3ac4dc51649fa10faecd907 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3752439 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* kinox: modify fan table settingMatt Wang2022-07-132-5/+5
| | | | | | | | | | | | | Modify fan table setting. BUG=b:238277632 BRANCH=none TEST=The THM team member test success.make BOARD=kinox passed. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I50f2fce224a976f145e858bdc0f0060515f875d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3754782 Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* board/kinox/pwm.c: Format with clang-formatJack Rosenthal2022-07-061-16/+11
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I71be2827b92312f4d1fffe178970fe7115b618c5 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728557 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/fw_config.c: Format with clang-formatJack Rosenthal2022-07-011-1/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I51c821e32da7ac6ddc00bcdf52232cf898d51202 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728554 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/board.h: Format with clang-formatJack Rosenthal2022-07-011-59/+44
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I95361e908772ca505f7e227ba21359f2dc190f45 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728553 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* kinox: LED_PWR_L change to open drainMatt Wang2022-07-011-1/+2
| | | | | | | | | | | | | | According to the LED_PWR_L GPIO change to OD from push-pull. So modify the setting. BUG=b:237482098 BRANCH=none TEST=The LED can light up at S0, breath at suspend, off at shutdown. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Ibbfe291adc4b2c2df1463e630c206f47534d1e78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3739981 Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* board/kinox/fw_config.h: Format with clang-formatJack Rosenthal2022-07-011-5/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I14e4a68b945c97b0f8a2c00601b867f01ba6cc86 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728535 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/led.c: Format with clang-formatJack Rosenthal2022-07-011-7/+6
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Icf873a4c34ea16430b5eeb116b312fbb4298a10d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728555 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/usbc_config.h: Format with clang-formatJack Rosenthal2022-07-011-5/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ie6197397bace8177b40a7ef8d474f5f32927331a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728537 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/fans.c: Format with clang-formatJack Rosenthal2022-06-291-1/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I16a4d7d620b62fee35ba6d00143aacc5f7b9a7ce Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728534 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/sensors.c: Format with clang-formatJack Rosenthal2022-06-281-26/+18
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I258e4968271141ca578c732fb70a003270356e93 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728558 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/board.c: Format with clang-formatJack Rosenthal2022-06-281-4/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I6afb493a7d72404c2d6f892678f0b36cc75af0c9 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728552 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/usbc_config.c: Format with clang-formatJack Rosenthal2022-06-281-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ib81f194e11ffc207c164279f1560853b5c2b50a0 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728536 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/kinox/power_detection.c: Format with clang-formatJack Rosenthal2022-06-281-166/+162
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I170f4fa38b575ff1441c906abed1fd76d9dd4a82 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728556 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Revert "kinox: add enable and disable ppc sink mode"Matt Wang2022-06-211-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e85c5bab8282346ef8ec0d9a4c480be3e0e8780f. Reason for revert: Power source have to switch adapter under S5.b:225769067#comment27 Original change's description: > kinox: add enable and disable ppc sink mode > > When Kinox is sinking power from the type-c port then enable the PPC to sink and disabled when using the barrel jack. > And the Kinox does not support the adapter change when EC is on. > > BUG=b:225769067 > BRANCH=none > TEST=Test on Kinox, > The system can power on to OS via barrel adapter or type-c adapter. > Plugin the barrel adapter the log has the "New charger is p1" and successfully disables C0 to sink path. > Plugin the Type-C 65w adapter the log has the"New charger is p0" and successfully enables C0 to sink path. > > Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> > Change-Id: I7adaa113d15cd607f1be799da072386160bdcb74 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535546 > Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> > Reviewed-by: Ricky Chang <rickytlchang@chromium.org> > Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Bug: b:225769067 Change-Id: I4848b0bacea96024960997fffac10a0d315e7130 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3716172 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com>
* kinox: update the charge manager infoMatt Wang2022-06-031-2/+14
| | | | | | | | | | | | | | | | | | | Modify the charge info for the host command EC_CMD_USB_PD_POWER_INFO can get which one type the adapter plugin then set the corresponding intel power limit parameters. The CHARGE_SUPPLIER_PROPRIETARY for TIO1 and TIO2. The CHARGE_SUPPLIER_DEDICATED for TINY. BUG=b:231911918 BRANCH=none TEST=The host can get the correct adpater type.(b:231911918#comment12) Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I801fba3a7630c77271abe6b07ebcf53734537d02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3662863 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kinox: Add control type-c adapter OBP methodMatt Wang2022-06-022-18/+102
| | | | | | | | | | | | | | | | | | | The barrel jack OBP method at CL:3521743, this CL add for type-c adapter. Use the charge manager info to get the adapter source capacity to set the OBP pointer then trigger PROCHOT. BUG=b:211806236;b:213955278 BRANCH=none TEST=Kinox can get the barrel(90w) type-c(65w/45w) adapter. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I3e1af004aa5e22ff61af06c89690237059cce00b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3644747 Commit-Queue: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org>
* kinox: modify fan frequencyMatt Wang2022-06-021-2/+2
| | | | | | | | | | | | | | Modify fan freq to 25kHz and remove the PWM_CONFIG_DSLEEP flag. BUG=b:231380285 BRANCH=none TEST=ectool pwmsetfanrpm 1000 and the ectool pwmgetfanrpm can nearly 1000rpm. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Ic09d741c319cbcfbdfcb3147d371e8eef4264d0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3685930 Reviewed-by: Ricky Chang <rickytlchang@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>
* Kinox: Add board_led_auto_controlLeila Lin2022-05-261-0/+11
| | | | | | | | | | | | | | | | | | Add board_led_auto_control for factory test to check led state while receive the auto control command. BUG=b:233552221 BRANCH=none TEST="ectool led power auto" can show correct led behavior Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Change-Id: I4ade8e9102528fa6f79b2bf73b7c756c72133fcf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3666956 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: 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> Commit-Queue: Ricky Chang <rickytlchang@chromium.org>
* kinox: Enable I2C_CONTROL host commandMatt Wang2022-05-241-0/+3
| | | | | | | | | | | | | | | Enable the CONFIG_HOSTCMD_I2C_CONTROL for host control i2c. BUG=b:233298528 BRANCH=none TEST=Switched I2C bus speed between 400 kHz and 1 MHz. And update the PDFW success. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I58902856f2e4cf13a9246860bb42232a754aada8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3659122 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kinox: Allow I2C speed change on port 0 (tcpc0)Matt Wang2022-05-241-0/+1
| | | | | | | | | | | | | | | Add flag for allow i2c speed change. BUG=b:233298528 BRANCH=none TEST=Switched I2C bus speed between 400 kHz and 1 MHz. And update the PDFW success. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I2df4fa1ea4591ae3fe151e9cb37f28a912e9d8b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3659124 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kinox: modify bc12 i2c portMatt Wang2022-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | The original BC12 I2C port setting the wrong port I2C_PORT_USB_C0_PPC(NPCX_I2C_PORT2_0) will let the I2C protocol send the wrong I2C port. And will cause the BC12 no function. The BC12 correct port is I2C_PORT_USB_C0_BC12(NPCX_I2C_PORT6_1). BUG=b:232033240 BRANCH=none TEST=Kinox can get the USB2.0 device from type-c port. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: If4a7170df26d9f6643d4b87716b2f70b2de2d689 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3643576 Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kinox: add enable and disable ppc sink modeMatt Wang2022-05-121-21/+23
| | | | | | | | | | | | | | | | | | | When Kinox is sinking power from the type-c port then enable the PPC to sink and disabled when using the barrel jack. And the Kinox does not support the adapter change when EC is on. BUG=b:225769067 BRANCH=none TEST=Test on Kinox, The system can power on to OS via barrel adapter or type-c adapter. Plugin the barrel adapter the log has the "New charger is p1" and successfully disables C0 to sink path. Plugin the Type-C 65w adapter the log has the"New charger is p0" and successfully enables C0 to sink path. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I7adaa113d15cd607f1be799da072386160bdcb74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535546 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Ricky Chang <rickytlchang@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* kinox: implement OBP functionMatt Wang2022-05-064-0/+358
| | | | | | | | | | | | | | | | | | Add the two ADC pins to detect the ADP_ID and the PWR_IN_IMON. ADP_ID can identify the Barrel power device and the PWR_IN_IMON can detect the adapter input voltage. Use those ADC values to set the OBP pointer then trigger PROCHOT. BUG=b:211806236;b:213955278 BRANCH=none TEST=Kinox can get the 90w barrel adapter. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I84455d1028b2cfc4297e10410092454f3dd61bc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3521743 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* kinox: add new fw_config for dp_displayMatt Wang2022-04-062-2/+11
| | | | | | | | | | | | | | | | | | Add the fw_config bits(0-3) for dp_display BIT DB_DISPLAY 0 ABSENT 1 DB_HDMI 2 DB_DP BUG=b:218786349;b:223380935 BRANCH=none TEST=make BOARD=kinox Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Iedd224dc41676c21faecf7f8cb9493f52676e9f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3541802 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* kinox: remove the bj_power fw config settingMatt Wang2022-03-315-88/+3
| | | | | | | | | | | | | Remove the barrel jack fw_config bits(0-3) then set to the reserved. BUG=b:218786349;b:223380935 BRANCH=none TEST=make BOARD=kinox Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I64f6a6442521afe6517a6f834dc4de7f577c7a1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535279 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* hooks: rename charger init priority to match othersKeith Short2022-03-291-1/+1
| | | | | | | | | | | | | | Rename HOOK_PRIO_CHARGE_MANAGER_INIT to HOOK_PRIO_INIT_CHARGE_MANAGER, matching the pattern used for the other initialization priorities. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Icb80b3cb1297888fcde2eb7d6de86fbc215fe212 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553673 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* kinox: modify GPIO initial settingMatt Wang2022-03-298-406/+93
| | | | | | | | | | | | | | | | | | Modify the GPIO,TCPC,PPC,MUX,I2C setting base on the LA-M451PR01_20220304B.pdf. And remove the unused code. BUG=b:223950161 BRANCH=none TEST=make BOARD=kinox, On brask power on success. Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: Ia3242051c008273c388d8c39aa2a917c979e3e41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508119 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* kinox: separate fw_config from the boardMatt Wang2022-03-295-46/+111
| | | | | | | | | | | | | | Put the fw_config control in the board.* and it would be better to separate it from the board.* and put it into the fw_config. BUG=b:223380935 BRANCH=none TEST=make BOARD=kinox pass Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I5e5ada0516d83fb00a2da14f9a4687183acc34ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3531869 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* Kinox: Modify fan tablefelixtwchang2022-03-282-7/+10
| | | | | | | | | | | | | | Modify fan table and thermal protection. BUG=b:221180425 BRANCH=none TEST=Make board passed Signed-off-by: felixtwchang <felixtw_chang@compal.corp-partner.google.com> Change-Id: I1d21fef099a5c5c3eae025df0a981e992bbd5911 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3503076 Reviewed-by: KevinSJ Yu <kevinsj_yu@compal.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* kinox: Initial EC imagestabilize-quickfix-14526.91.B-mainstabilize-14526.89.B-mainstabilize-14526.84.B-mainstabilize-14526.73.B-mainstabilize-14526.67.B-mainstabilize-14526.57.B-mainrelease-R100-14526.B-mainDtrain Hsu2022-02-1713-0/+1610
Create the initial EC image for the kinox variant by copying the brask reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:215049181 BRANCH=None TEST=make BOARD=kinox Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com> Change-Id: I604216664a0efc690ba9cd2c0c071a0e4650b228 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3448054 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>