summaryrefslogtreecommitdiff
path: root/board/kukui
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-058-1086/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* 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>
* kukui: move common mkbp wake events to baseboard.hEric Yilun Lin2021-06-291-6/+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>
* mkbp: Move key simulation to input devicesBoris Mittelberg2021-05-101-0/+1
| | | | | | | | | | | | | | | | | | Today some platforms include MKBP_KEYBOARD because they use side buttons, switches or other events that share the same driver with MKBP keyboard. Those platforms don't enable KEYSCAN task. The CL is moving key emulation functionality to MKBP input devices, to make a clear separation between the real keyboard usage and emulation/buttons/switches/etc. All boards that were selecting `CONFIG_KEYBOARD_PROTOCOL_MKBP` without KEYSCAN task are now updated to select `CONFIG_MKBP_INPUT_DEVICES` BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I515140ebf6e175f4b29991329f92266ffca232a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2824044
* 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>
* 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>
* 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>
* motion: Use empty CONFIG_ variable to use IS_ENABLED()Gwendal Grignou2020-11-061-4/+4
| | | | | | | | | | | | | | | | Split information in a boolean variable and another variable that contains a property. For instance, CONFIG_GESTURE_SENSOR_DOUBLE_TAP becomes: CONFIG_GESTURE_SENSOR_DOUBLE_TAP : boolean variable CONFIG_GESTURE_TAP_SENSOR : property that contains the sensor number. BUG=chromium:1140877 BRANCH=none TEST=buildall Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I27ba462f8a12b14882104b9f983f2dc17f917314 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488937
* ec: change usage of dummySam Hurst2020-08-051-1/+1
| | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "dummy" with inclusive alternatives. BUG=b:162781382 BRANCH=None TEST=make -j buildall `grep -ir dummy *` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6a42183d998e4db4bb61625f962867fda10722e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335737 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* krane: Allow MODE_CHANGE as wake sourceFei Shao2020-08-041-1/+2
| | | | | | | | | | | | | | | | Base detach/attach and tablet mode on/off should wake Krane. BUG=b:162593812,b:128800600 BRANCH=kukui TEST=make buildall TEST=make -k BOARD=kukui TEST=test_that -b kukui $IP power_WakeSources Change-Id: I71e3e109e2bee5792f52ce61e2d7e9398394d7ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2336373 Commit-Queue: Fei Shao <fshao@chromium.org> Tested-by: Fei Shao <fshao@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kukui: pull up SPI1_NSS (CS_L).Eric Yilun Lin2020-05-251-1/+1
| | | | | | | | | | | | | | | | There is no pull-up at AP side, so we should pull it up at EC side to prevent EC SPI controller is starved waitting for AP SPI commands. BUG=b:156047546 TEST=make buildall; krane is booted. BRANCH=kukui Change-Id: I81f4aefb5e96f968cfbf5189b1f80e1e82f2d3ae Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2214460 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* PD: Remove unnecessary PDCMD taskDiana Z2020-05-201-1/+0
| | | | | | | | | | | | | | | | | | | The PDCMD task is only pulling interrupts from the TCPCs on most boards, which is unnecessary since the PD_INT tasks handle this job now. Remove it from any boards using the PD_INT command which are not using the older CONFIG_HOSTCMD_PD functionality (ex. samus, oak). Located boards using: find -name "ec.tasklist" | xargs grep -l PD_INT | xargs grep PDCMD BRANCH=None BUG=b:154959596 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I29be8ab1d7a2616603fb55236aed4329ed8654f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2208221 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tcpc: change name of get_vbus_level to check_vbus_levelDenis Brockus2020-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | this is to add near future functionality to allow not only the current PRESENT range check but to add Save0V range checking as well, for platforms that allow for this. This just lays the framework and is functionally equivalent. BUG=none BRANCH=none TEST=verify basic USB functionality Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I1eb3411bc3aa9b792c9b97799e1721e5cb229f64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2199036 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* rt946x: remove usb_charger_set_switches from board.hTing Shen2020-05-071-4/+0
| | | | | | | | | | | | | | | | | | | Since all rt946x users do not customize usb_charger_set_switches(), move this function into rt946x.c for the upcoming bc12 driver refactor. A board can customize this function using the new bc12_drv if needed. BUG=b:155611686 TEST=make buildall BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I8724af15c3508b54dc131a7c99004f3f4b2f893f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187079 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>
* OCPC: Add concept of active charger ICAseda Aboagye2020-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | With OCPC, one charger IC per Type-C port, there are now multiple charger ICs present in the system. This commit adds the beginning of OCPC support by adding the notion of an active charger IC. Charge Manager will select the active charger IC based upon the charge port. Boards must define this mapping in a board specific function. Additionally, this commit adds chgnum as a parameter to charger_set_input_current_limit(). BUG=b:148981052 BRANCH=None TEST=With other patches, verify that the active charger IC is able to be saved and retrieved. Change-Id: Iba4a8958171ad6e1630b0ca3d07d128bc1f2c4dd Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135963 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* driver: Replace BMI160 to BMI in board configChing-Kang Yen2020-04-232-13/+13
| | | | | | | | | | | | | | | | | Replace some macro of BMI160 to BMI version for common function of BMI series. Make board config include the accelgyro_bmi_common.h instead of accel_gyro_bmi160.h. BRANCH=None BUG=b:146144827 TEST=make buildall -j Change-Id: I043ff8a92f15295ead3fa5c1e292319e2b4fa21a Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2156525 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* usb_mux: retimer: mux as chained mux and retimerDenis Brockus2020-02-282-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes retimers appear as generic muxes. By allowing a chain of muxes they can be stacked up to the new configurations that zork requires and will continue to work as they did before on configurations that only have a single mux. The code used to have two different arrays, 1) muxes and 2) retimers. On one of the zork configurations the processor MUX stopped being the primary mux and the retimer took its place. In a different configuration of that same platform it left the primary and secondary alone but the mux_set FLIP operation had to be ignored. Since the same interfaces needed to be available for both it stopped making sense to have two different structures and two different methods of handling them. This consolodates the two into one. The platforms that do not have retimers, this change will not make any difference. For platforms like zork, it will remove the retimers and make them chained muxes. So testing on trembyle makes sense to verify, BUG=b:147593660 BRANCH=none TEST=verify USB still works on trembyle Change-Id: I286cf1e302f9bd3dd7e81098ec08514a2a009fe3 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2066794 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Charger: change get_vbus_voltage to return EC errorDiana Z2020-01-281-1/+5
| | | | | | | | | | | | | | | The other driver structure members return an ec_error_list value and fill in parameters to return data. This commit changes the get_vbus_voltage call to follow that model. BRANCH=None BUG=b:147672225 TEST=builds Change-Id: I7308502a9734274dd308b830762493c4d70d147a Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2015340 Reviewed-by: Jett Rink <jettrink@chromium.org>
* krane: do not support POGO dockEric Yilun Lin2019-12-201-1/+0
| | | | | | | | | | | | | krane doesn't have a POGO dock, the config should be dropped. BRANCH=kukui BUG=none TEST=make buildall Change-Id: I5adc29f72cbfdada9f80fb86512daf09163b5906 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1973972 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* board: Set Accelerometer range to 4gGwendal Grignou2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Required by Android CDD - Section 7.3.1 - Paragraph C.1.4 Modified mechanically with: for i in $(grep -lr "\.default_range" board); do sed -i '/.default_range =/s#\(.*\.default_range = \).* /\ \* g.*#\14, /* g, to meet CDD 7.3.1/C-1-4 reqs */#' $i done Manually reworked to only change the accelerometer that matters to android: The lid accelerometer or the base accelerometer if the base also hosts the gyroscope. This is only for future EC, no need to land the change on branches: mems_setup will take care to set accelerometer ranges at 4g on startup. BUG=b:144004449 BRANCH=none TEST=compile Change-Id: If8c14b2e928c9c70c0ce51451adcfcd674a9e73b Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957375 Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* baseboard/kukui: dynamic adjuct input current by thermal budgetYilun Lin2019-12-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Limit the charger input current if we are overheat, and loose the limit if the thermal in control. kukui/krane/kodama are suffering from thermal issue (>100 celsius degree in charger junction) and the solution was limit the system can only sink 5V/2A in S0. However, this cause slowing charging as well. We'd like to loose the 5V/2A charging limit and controls the thermal by restricting the charger input current. This CL only applies the limitation when PD voltage > 5V, because we don't see the overheat problem when krane charged with 5V. TEST=on krane, ensure the temperature of junction is always under 84 celsius degree; ensure the curve of battery current at charging is a smooth curve when PD voltage switching from high to low. BUG=b:141903096 b:144073892 BRANCH=kukui Change-Id: I9657f5a04897010d7018f910cb77b210147d8356 Signed-off-by: Yilun Lin <yllin@chromium.org> Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1899660 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* drivers/tcs3400: update fields for new irt scale factorNick Vaccaro2019-12-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | A new irt scaling factor was added to the tcs3400 driver to further improve the sensor CCT accuracy, requiring a structure definition to change. This change fixes existing boards that use the tcs3400 to use this new structure definition. Boards modified include flapjack, hatch, kohaku, kukui, and stryke. BUG=b:143246741 BRANCH=master TEST=execute "make -j BOARD=<boardname>" for kukui, kohaku, flapjack, and hatch and make sure they build without error. Cq-Depend: chromium:1879188 Change-Id: Icad96877b5cd9966e927e4dd150335c988725f0c Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879189 Tested-by: Mengqi Guo <mqg@chromium.org> Reviewed-by: Mengqi Guo <mqg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* kukui: enlarge stack for hook_taskEric Yilun Lin2019-12-061-1/+1
| | | | | | | | | | | | | | We are seeing a stack overflow from hook_task. Enlarge it to prevent from crashing. TEST=not seeing a EC crash BUG=none BRANCH=kukui Change-Id: I1c574ecd577528dda57c2771bd4e67b3aa557b75 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954833 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kukui: Do not sink LED power on initYilun Lin2019-12-051-1/+1
| | | | | | | | | | | | | | Enable LED color would start consuming power even if the led brightness is zero. TEST=make buildall BUG=b:137618886 BRANCH=kukui Change-Id: I06120f4fec0cc41e40463989649ac9a5061d9f6b Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1926187 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kukui: refactor PD_MAX_VOLTAGE/PD_OPERATING_POWERTing Shen2019-11-291-0/+2
| | | | | | | | | | | | | | | | | | 1) PD_MAX_VOLTAGE_MV is determined by charger, move it into the ifdef VARIANT_KUKUI_CHARGER_* clause. 2) PD_OPERATING_POWER_MW is determined by board, move it into board.h. 3) update the two config variables above for jacuzzi family. BUG=None TEST=make buildall BRANCH=kukui Change-Id: I6f14a71a34e2c81a5030ff5809996ddf74a4ad12 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1930521 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: Use the PWM mode to adjust brightness as lowestLeo Zhou2019-11-221-4/+22
| | | | | | | | | | | | | | | | | | Adjust current=4ma, pwm=1/32, and change the state as: charging is blue charged full is green low battery is red BUG=b:137618886 BRANCH=kukui TEST=Do a full charging test, notice LED indicator status under different charge state Change-Id: Ic1b7a99ab3edaee5c92a5cae56bc6d9a321e9c23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918995 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Kook Zhang <zhangbinbin@huaqin.corp-partner.google.com> Commit-Queue: Leo Zhou <zhoubo@huaqin.corp-partner.google.com>
* kukui,kodama,jacuzzi: fix charge/discharge control setting orderYilun Lin2019-11-151-4/+7
| | | | | | | | | | | | | | | | | | | | Should enable charge first then the charge port can function normally. Besides, for device using mt6370 and in force discharge mode, mt6370 would receive a DPDM detach event and release BC1.2 charge supply info. We should force BC1.2 detection again to recognize BC1.2 device again. TEST=on krane 'ectool chargecontrol discharge; ectool chargecontrol normal' and see the charge is charging. BUG=b:143045248 BRANCH=kukui Change-Id: I72481dfddf48b1e274d8d81f8d9223ccb8295c72 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916160 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Clean up double tap related definitionHeng-Ruey Hsu2019-11-131-0/+1
| | | | | | | | | | | | | | | | Fixes: commit 2f2a81079191ca "Add double tap and make motion sense wake up ap" CONFIG_GESTURE_DETECTION_MASK includes significant motion in activity list. We cannot use it for double tap. Add more flags to distinguish it. BUG=b:135575671 BRANCH=kukui TEST=AP can receive mkbp event when double tap is triggered Change-Id: I13776a01b14dc251396a615c8c97353f2d0477d4 Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1911263 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* baseboard/kukui: fix pogo extpower statusYilun Lin2019-11-111-1/+8
| | | | | | | | | | | | | | | | On krane, POGO provide extpower when only connects to a dock, so we should check if it's connecting to a dock, rather than checking POGO_VBUS_PRESENT only. TEST=see battery LED is off when connects to keyboard, and LED on when connets to a USB-C charger. BUG=b:144137508 BRANCH=kukui Change-Id: Iab38590780b1e86149287fb9985c8ffa625b016f Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1907670 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* power/mt8183: Need 1s pwrbtn press to exit off stateYilun Lin2019-11-111-0/+1
| | | | | | | | | | | | | | | | | | To prevent mispressed cases, we decide to increase the power button press boot time to at least 1s. TEST=aps; powerbtn $sec; where $sec is between 0~1000 and see it won't boot TEST=aps; powerbtn $sec; where $sec > 1000 and see it boot TEST=aps; ensures the physical power button press is working as expected. BUG=b:131856041 BRANCH=kukui Change-Id: Ie3099ba9639a729cee77b7d444a459fbef72733d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906387 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Enable double tap host detection in kukuiHeng-Ruey Hsu2019-11-112-1/+27
| | | | | | | | | | | BUG=b:135575671 BRANCH=none TEST=AP can receive mkbp event when double tap is triggered Change-Id: I35abf2a62d4980c9b9232c28a72c5ba624142270 Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772867 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNTKarthikeyan Ramasubramanian2019-11-011-2/+2
| | | | | | | | | | | | | | | | | Certain SKUs of certain boards have lesser number of USB PD ports than defined by CONFIG_USB_PD_PORT_COUNT. Hence rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNT. BUG=b:140816510, b:143196487 BRANCH=octopus TEST=make -j buildall; Boot to ChromeOS Change-Id: I7c33b27150730a1a3b5813b7b4a72fd24ab73c6a Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879337 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* kukui: set SPI pin to high speedTing Shen2019-10-261-3/+0
| | | | | | | | | | | | | | | | | The SPI pins should be configured to high speed to meet the spec. And since the pin assignment is same on all kukui families, move the setup code to baseboard/. BUG=b:138768646 TEST=verified by observe the waveform BRANCH=kukui Change-Id: I5b07767000bdf47101f83d338d06e7679c4f4848 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770329 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
* krane: Modify the charge indicatorLeo Zhou2019-10-261-2/+13
| | | | | | | | | | | | | | | | Based on the OD, the charge indicator should be red under low battery BUG=b:142835019 BRANCH=kukui TEST=1. Charge DUT to battery SOC > 20%, then plug out charger 2. Wait for battery SOC <= 10%, notice the charge indicator Change-Id: I2013bc6182067ddf64bb790f5cbf4bc0621b7899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1871502 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* Kodama: folio case has no function but only works in VT2xiong.huang2019-10-221-3/+0
| | | | | | | | | | | | | | | | | | | When DUT starts up in S5/G3, HOOK_CHIPSET_STARTUP only called in RO stage. In fact, POGO ADC interrupt not be enabled after jumping to RW stage. Krane and Kodama board use POGO keyboard function. Moving common API to HOOK_INI (pogo_chipset_init) to ensure POGO ADC interrupt is enabled and API base_detect_deferred would be called after jumping to RW stage. BUG=b:142849032 BRANCH=kukui TEST=folio case works well in UI and VT2. Change-Id: Ie3fed9a88620414afeea2fa4dcbf2cd120e7ac37 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869170 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* krane: set end of charge current threshold to 140mAstabilize-12607.6.Bstabilize-12607.5.Bstabilize-12607.3.BTing Shen2019-10-181-0/+14
| | | | | | | | | | | | | | | | According to the battery spec in b/142097561#comment15, EoC current should be 140mA. BUG=b:142097561 TEST=make BRANCH=kukui Change-Id: I913a1abecd2fc6ac28ba16513c3f0cc145afc38c Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866212 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: Modify the Charging and Fully charged LED colorLeo Zhou2019-10-181-5/+4
| | | | | | | | | | | | | | | Based on the Lenovo requirement,modify the Charging and Fully charged LED color as white BUG=b:137618886 BRANCH=kukui TEST=Do a charge test Change-Id: I75a3e9f24c98a67cb6b9dda8294c73926c20d4d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1706248 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kukui: runtime usb mux config selectionTing Shen2019-10-171-0/+6
| | | | | | | | | | | | | | | | | The compile time IF_ENABLED(CONFIG_USB_MUX_XXX) does not work on kukui, change this to runtime selection. BUG=b:135079572 TEST=On Krane Rev5/Kodama, verify the mux switch to dp + usb mode (i2cxfer r 0 0x48 0x11 returns 0x03 or 0x13) BRANCH=kukui Change-Id: Ib44f0c383ed5f9156e3dd3bf6faa3daebb22e146 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1864493 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* krane: change sensor-ref point to default device orintationYilun Lin2019-09-301-1/+1
| | | | | | | | | | | | | | | Switch from display scanout orientation to device default orientation. (go/chromeos-tablet-orientation) TEST=Ensure the display acts normal with UI patch. BUG=b:133201004 BRANCH=None Change-Id: If7a1632f3fcc03b381411b46d7b5441f8de5847d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826360 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* baseboard/kukui: Move base_detect_* into baseboardYilun Lin2019-09-183-180/+2
| | | | | | | | | | | | | | | | | The implementation of base detection in Kodama and Krane are very similar. This CL unify the implementation by adding VARIANT_KUKUI_POGO_KEYBOARD and VARIANT_KUKUI_POGO_DOCK. VARIANT_KUKUI_POGO_KEYBOARD is a mandatory config if pick and VARIANT_KUKUI_POGO_DOCK is optional. TEST=make buildall BUG=b:140608847 BRANCH=none Change-Id: I068905d8a52404eda6709d88543fcb6042db7378 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1806633
* krane: no longer need for MT6370 to provide display bias voltageTing Shen2019-09-171-4/+4
| | | | | | | | | | | | | | | After kukui rev 4, we use an external chip to provide db voltage (CL:*1584487), limit the display bias setup code to rev 2&3 only. BUG=b:140136293 TEST=manually BRANCH=master Change-Id: I689b0f0e5995dd0fcef0d69b8ecb9052ac62db46 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1790568 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Sean Abraham <seanabraham@chromium.org>
* krane: als: add tcs3400 coefficientsTing Shen2019-09-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Recent tcs3400 driver change requires board file to provide a conversion matrix to convert raw data into lux value. The coeffcients requires some complex step to measure (b:139366662), before the measurement is done, we need some non-precise value instead of the default zero matrix for functional test in next build. Based on the observation in b:135166710, I pick Y(lux) = C/10 in this CL. BUG=b:139366662 TEST=`cat /sys/bus/iio/devices/*/in_illuminance_input`, verify that the sensor readings is around 250 on my desk. (according to wikipedia, office lighting is around 320~500 lux, 250 is a little bit low, but good enough for ALS functional test) BRANCH=master Change-Id: I46cb417b919c40de6a81ce9254fcd2bcb51c0d5f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763897 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Sean Abraham <seanabraham@chromium.org>
* kukui: move board_set_charge_limit to baseboardTing Shen2019-09-121-12/+0
| | | | | | | | | | | | | | | | | The function is shared across all mt6370 users, move it to a common place. BUG=b:140156596 TEST=make BRANCH=master Change-Id: I7a9dafa5aafd078d997afe82fe7e0c555ecb5006 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1797196 Tested-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* krane: set tablet mode switch when base attachedYilun Lin2019-09-121-1/+5
| | | | | | | | | | | | | | | | | The switch should be set to inform AP of base status change. TEST=event_path=$(grep cros_ec_buttons /sys/class/input/event*/device/name \ | sed -nE 's|.*(/input/event[0-9]*)/.*|/dev\1|p' | head -n 1) evtest --query "${event_path}" EV_SW SW_TABLET_MODE ensure the return code is 0 (for success). BUG=b:140608847 BRANCH=none Change-Id: I4ae2a783e7fc3ebbf42fdf0ff0e9a17630631e5d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1795723 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kukui: enable hw ramp for mt6370Ting Shen2019-09-091-1/+0
| | | | | | | | | | | | | BUG=b:139012899 TEST=observe the charging curve (see issue above for result) BRANCH=none Change-Id: Ic4e6368763db4d741d82fc233e63e428fb67e610 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755882 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* jacuzzi: enable DPTing Shen2019-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | enable dp on jacuzzi, and add back the dp implementation before CL:1660524 for all new devices including jacuzzi. usb_pd_policy now supports two different configs: - kukui/krane, rev <= 4: no mux (CONFIG_USB_MUX_VIRTUAL defined) - all new devices: have a real mux BUG=b:135895590,b:135079572 TEST=attach a usb hub and moniter to the dut, verify that dp/dp+mux mode and both polarities can detected correctly BRANCH=master Change-Id: I3e4757c97d555a4afb48076fc4785305c96b0a7f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1723892 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: add it5205 driverTing Shen2019-09-053-4/+35
| | | | | | | | | | | | | | | | | | | | | | | An it5205 is added in kukui/krane rev 5, and deprecated gpio pin USB_C0_DP_OE_L and USB_C0_DP_POLARITY. This CL is intended to make the fw works for both old and new boards: 1) the default usb_mux driver is updated to rev 5, and board_rev_init may change it back for old boards. 2) keep VARIANT_KUKUI_DP_MUX_GPIO in kukui/board.h, and add a customized function to set/clear these gpio pins. BUG=b:135079572 TEST=verify that type c display works on board rev 4/5 BRANCH=master Change-Id: Ibe28816eed026ccb8a9a5234a612f80b038884f1 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1785197 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* include: Move RESET_FLAG_* into ec_commands.h as EC_RESET_FLAG_*You-Cheng Syu2019-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | RESET_FLAGS_* are used when setting/reading the field ec_reset_flags of struct ec_response_uptime_info, which is defined in ec_commands.h. So it might be better to put those macros there. To be consistent with the other macros in the file, add "EC_" prefixes to them. BUG=b:109900671,b:118654976 BRANCH=none TEST=make buildall -j Cq-Depend: chrome-internal:1054910, chrome-internal:1054911, chrome-internal:1045539 Change-Id: If72ec25f1b34d8d46b74479fb4cd09252102aafa Signed-off-by: You-Cheng Syu <youcheng@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1520574 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Ready: Yu-Ping Wu <yupingso@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>