summaryrefslogtreecommitdiff
path: root/board/coachz
Commit message (Collapse)AuthorAgeFilesLines
* USB MUX: Update mux HPD update interface to use mux_state_tDiana Z2021-09-161-1/+2
| | | | | | | | | | | | | | | | | Since the drivers are now taking a mux_state_t set of flags to update, go ahead and unify the usb_mux API this way as well. It makes the parameters more apparent than the 1/0 inputs, and aligns the stack to use the same parameters. BRANCH=None BUG=b:172222942 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie943dbdf03818d8497c0e328adf2b9794585d96e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095438 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Coachz: MotionSensor: Combine BMI160 & BMI260pengjunhao52021-09-083-2/+88
| | | | | | | | | | | | | | | | | | | | This commit is for second source BMI260, We use chip id to detect which MotionSensor is on the board(BMI160 or BMI260) and combine two different setting for different MotionSensor. BUG=b:195908820 TEST=make -j BOARD=coachz Verify build on SIT board BRANCH=Trogdor Signed-off-by: pengjunhao <pengjunhao5@huaqin.corp-partner.google.com> Reviewed-by: tongjian <tongjian@huaqin.corp-partner.google.com> Reviewed-by: yudengwu <yudengwu@huaqin.corp-partner.google.com> Change-Id: Ib12226744800a9ca2e6f620295e8c2ff762999e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3118645 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* Coachz: MotionSensor: Save some flash spacepengjunhao52021-09-031-0/+9
| | | | | | | | | | | | | | | | | | | | | This commit is for second source motionsensor combine(BMI160 & BMI260), We use chip id to detect which MotionSensor is on the board but flash is not enough so we reduce some console cmd. BUG=b:195908820 TEST=make -j BOARD=coachz Verify build on SIT board BRANCH=Trogdor Signed-off-by: pengjunhao <pengjunhao5@huaqin.corp-partner.google.com> Reviewed-by: tongjian <tongjian@huaqin.corp-partner.google.com> Reviewed-by: yudengwu <yudengwu@huaqin.corp-partner.google.com> Change-Id: I396052cb5996858507864c5201c2d93f1a885618 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3139717 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com> Commit-Queue: 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>
* CoachZ: Disable IRQ from CTN730 in RODaisuke Nojiri2021-08-174-8/+11
| | | | | | | | | | | | | | | | | | | When PCHG isn't enabled in RO, a keyboard is disabled until another USB device is plugged. This patch restores PCHG in RO but disables it by assigning an invalid value to the IRQ signal (GPIO_IH_COUNT). A PCHG task will be started but will not run because there will be no event. BUG=b:193223400, b:173235954 BRANCH=trogdor TEST=On CoachZ, stylus charges in normal mode and doesn't charge in recovery mode. Change-Id: Icb5702474ac5ef74119455ab4879447cb7a963e4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3100491 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tablet_mode: Fix the race condition of setting the tablet modeWai-Hong Tam2021-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There are 2 tablet mode triggers: * Lid: when the lid angle close to 360 degree, either detected by a GMR sensor or by the angle computed by 2 motion sensors. * Base: when the detachable base is detached. These 2 triggers set the tablet mode status, which as a boolean, resulting a race condition. This CL fixes the race condition. Each trigger updates its own bit. The final tablet mode status is the OR of all bits. BRANCH=Trogdor BUG=b:193873098 TEST=Attached the base, checked tablet_mode enabled; detached the base, checked tablet_mode disabled; flip base to 360 degree, checked tablet_mode disabled; move the base out of the lid, checked tablet_mode disabled. Change-Id: Ia9d9d2d66c194796c1039cc8b746c8d1f28a4496 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044414 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* trogdor: Workaround for boards without HIBERNATE_L pull-upWai-Hong Tam2021-06-111-0/+9
| | | | | | | | | | | | | | | | | | | Some hardware doesn't have the external pull-up fix for the bugs, like b/164256614, b/177611071. It requires rework to stuff the resistor. For people who has difficulty to do the rework, this CL is a software workaround, which makes the GPIO push-pull, instead of open-drain. BRANCH=Trogdor BUG=b:190818143 TEST=Booted the Coachz rev-1 board, the I2C bus didn't get wedged. Change-Id: I82116b855db49ec7c93d90727c7837a58cda8d3e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2956832 Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
* Coachz: Remove PCHG from RODaisuke Nojiri2021-06-114-1/+7
| | | | | | | | | | | | | | Peripheral devices don't need to be charged until EC jumps to RW. This patch removes PCHG from the RO copy. BUG=b:173235954 BRANCH=trogdor TEST=Charge stylus on Coachz. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I8156d1408bf69f4c1fccecaf3a77eaec29fa2c99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2795065 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* trogdor: Change GPIO HIBERNATE_L to open drainWai-Hong Tam2021-06-091-1/+1
| | | | | | | | | | | | | | | | We stuffed an external pull-up resistor on the GPIO HIBERNATE_L for fixing the CCD bugs, like b/173828265, b/177611071. The GPIO can be used as open drain. BRANCH=Trogdor BUG=b:189184814 TEST=Tested on Lazor; CCD connection still worked under EC hibernate. Change-Id: I50d832f1619f976a4cb682fa1b666add96563222 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2950925 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* base_state: implement basestate host commandTing Shen2021-05-271-3/+3
| | | | | | | | | | | | | | | | | | | | | This CL introduces an unified method to force base attach/detach, to deprecate the hard-coded gpio pin name table in hammerd/hammertests/common.py. Also modifies base_force_state to use the same parameter type as host command. BUG=b:188625010 TEST=manually, run `ectool basestate attach|detach|reset` on coachz BRANCH=trogdor,kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I5235661727cbbd15015c49d588ec70605e4a33e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2910472 Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* qcom: Generalize the filenames for Qualcomm chipsetsWai-Hong Tam2021-05-171-1/+1
| | | | | | | | | | | | | | | The existing SC7180 power sequence can be reused on its next generation. Generalize the filenames, sc7180.c/sc7180.h to qcom.c/qcom.h. BRANCH=None BUG=b:187980397 TEST=Built all the Chromium EC images and Zephyr EC images. Change-Id: Ie04218ef0a12a4e8aa2db353040c5c39c533ae6f Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2893484 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* mkbp: Move key simulation to input devicesBoris Mittelberg2021-05-101-0/+2
| | | | | | | | | | | | | | | | | | 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
* mkbp: EC buttons and switches via MKBPBoris Mittelberg2021-05-101-2/+1
| | | | | | | | | | | | | | Allowing EC buttons and switches to be signaled via MKBP protocol, using CONFIG_MKBP_INPUT_DEVICES. Default behaviour is unchanged. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Cq-Depend: chromium:2824044 Change-Id: Ib96f98ecb3717a8ee8963be69fb7d7eb72e6d132 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796382
* Coachz: When the base state changes, update the virtual switchWai-Hong Tam2021-05-102-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the base state changes, update the virtual switch. It sends a mode change event to notify AP and then AP will query the latest virtual switch of the base state. BRANCH=None BUG=b:174295396 TEST=Checked detaching and attaching the base. Detach the base: > [269.820490 BASE_DET = 2813 (pulse 0)] [269.821044 tablet mode enabled] [269.821486 event set 0x0000000010000000] [269.821974 base state: detached] Attach the base: > [273.714608 BASE_DET = 156 (pulse 0)] [273.715151 tablet mode disabled] [273.715598 event set 0x0000000010000000] [273.716907 base state: attached] [273.717754 event set 0x0000000010000000] Change-Id: I2f0cac61ee359083df300f4fe3f3d16a14dfb926 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884609 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* Coachz: Enable the basestate console commandWai-Hong Tam2021-05-101-0/+2
| | | | | | | | | | | | | | The basestate console command is used by tests to emulate the base detach or attach state. Enable it to pass the tests. BRANCH=Trogdor BUG=b:174295396 TEST=Run the basestate to emulate the attach and detach states. Change-Id: I49f7b135873dd821d533088b320bfcadafc85659 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2884608 Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
* Coachz: generate locked imagehanwenchao2021-05-041-9/+1
| | | | | | | | | | | | | | | | | Remove bringup configs to generate locked image for production. BRANCH=trogdor BUG=b:183687793 TEST=build Signed-off-by: hanwenchao <hanwenchao@huaqin.corp-partner.google.com> Change-Id: I369d4d8e6d55e34e43dd4218aaed9a25ef845e49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2859349 Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Philip Chen <philipchen@chromium.org>
* PCHG: Support firmware updateDaisuke Nojiri2021-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds EC_CMD_PCHG_UPDATE, which allows the host to update firmware of ctn730 via I2C. An updater (e.g. ectool) is expected to issue EC_PCHG_UPDATE_CMD_OPEN, multiple EC_PCHG_UPDATE_CMD_WRITEs, then EC_PCHG_UPDATE_CLOSE. Each sub-command completion is notified to the host via EC_MKBP_EVENT_PCHG. An updater is supposed to wait for the previous sub-command to complete before proceeding to the next. Example: localhost ~ # ectool pchg 0 State: DOWNLOAD (6) FW Version: 0x104 localhost ~ # ectool pchg 0 update 0x207000 0x105 /path/to/image.bin Update file /path/to/image.bin (85632 bytes) is opened. Writing firmware (port=0 ver=0x105 addr=0x207000 bsize=128): ********************************************************************** FW update session closed (CRC32=0x7bd5c66f). localhost ~ # ectool pchg 0 reset Reset port 0 complete localhost ~ # ectool pchg 0 State: ENABLED (2) FW Version: 0x105 BUG=b:182600604, b:173235954 BRANCH=trogdor TEST=ectool pchg 0 update 0x201200 0x105 /tmp/user_ee_X0.1_V1.5.bin TEST=ectool pchg 0 reset Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I9c62f1714dd69428ab5870c443cb4eb77881a6c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757099
* Add a common header for board_vbus_sink_enable()Simon Glass2021-03-311-2/+0
| | | | | | | | | | | | | | | | This function prototype is defined in quite a few 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: I2f3f1e08614408e7b8f6bb0633a478765c73beaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789800 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Add a common header for board_is_sourcing_vbus()Simon Glass2021-03-311-2/+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>
* sc7180: move switchcap declarations to common headerJack Rosenthal2021-03-192-4/+1
| | | | | | | | | | | | | | | | | | | | | sc7180 depends on board specific functions: - board_set_switchcap_power - board_is_switchcap_enabled - board_is_switchcap_power_good The declaration for these functions were copied between many board.h files. Move the declaration to the new sc7180.h file so it can be commonly sourced. BUG=b:183054226 BRANCH=none TEST=make buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Icecb6220bfecdbee665dacb0834ab5752b06815b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774363 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: Fix issue of resetting AP not initialize the states correctlyWai-Hong Tam2021-02-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | base_detect_change() and tablet_set_mode() skip doing anything if the state has no change. Originally, the S3->S5 hook sets the state to DISCONNECTED. The next startup S5->S3 may not initialize the state correctly if no change, e.g. the case: attach keyboard -> power-off -> detach keyboard -> power-on. It won't set the tablet mode and won't notify AP. We should set the state to UNKNOWN in the S3->S5 hook. The next startup will set the states correctly and notify AP. BRANCH=Trogdor BUG=b:179930342 TEST=Plug keyboard, power-off AP, unplug keyboard, power-on AP, plug keyboard, and checked the EC log that proper states are set and events are sent to AP. Change-Id: Ie6111f2ebbbde7ec6a9de2045a463d769ee6fb2b Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685409 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* pchg: Notify host of full chargeDaisuke Nojiri2021-02-121-0/+1
| | | | | | | | | | | | | | | | | | | Currently, full charge status is implied by capacity = 100 and PCHG_STATE_DETECTED (i.e. state='not charging'). If the charger stops charging before 100% (for battery health control), this condition doesn't work. This patch makes PCHG send PCHG_STATE_FULL explicitly when it sees the soc goes above the threshold in PCHG_STATE_DETECTED. BUG=b:179390065,b:173235954 BRANCH=trogdor TEST=CoachZ. Charge till 96% and verify PCHG0/state becomes 'Full'. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I634f96992cdc7ef44b5e43544603cc5cc9b3a62d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691366 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* CoachZ: Pull down WLC IRQDaisuke Nojiri2021-01-281-5/+4
| | | | | | | | | | | | | | | | | ctn730 push-pulls the IRQ line. When it's off, the line should stay low to prevent the EC from getting false IRQ. This patch also configures the ctn730 reset line as GPIO_ODR_HIGH so that the line is kept high and a reset can be issued if needed. BUG=b:173235954, b:178096436 BRANCH=trogdor TEST=CoachZ. Verified reset line goes up and down by gpioset. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I0023d9a980826a6ea4741459a0b65c2cc11e6106 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2656766 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Coachz: Add BASE_EN debounce time to 350mshegang52021-01-201-5/+11
| | | | | | | | | | | | | | Add BASE_EN debounce time to meet TP reset sequence BRANCH=master BUG=b:176398060 TEST=make BOARD=coachz -j flash ec and check BASE_EN delay time Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I04fb80d9f44a56bbf52dc089406ab0bd4fc2cd16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637166 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTESYuval Peress2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used throughout. The issue is that the units don't match. In Zephyr the value is in KiB instead of bytes. This refactor simply renames CONFIG_FLASH_SIZE in platform/ec to include the unit (via _BYTES). BRANCH=none BUG=b:174873770 TEST=make buildall be generated by the build instead of per board Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Coachz: board rev 2+ changed the TCPC part from PS8805 to PS8755gaochao2021-01-132-0/+11
| | | | | | | | | | | | | | | | | EC firmware picks the correct driver based on the board ID BRANCH=Trogdor BUG=b:172952070 TEST=make BOARD=coachz -j flash ec and check TYPE-C base function Signed-off-by: gaochao <gaochao@huaqin.corp-partner.google.com> Change-Id: Iefedb6cfcff99f406bd1bb1e136433a1e4cd28d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540068 Reviewed-by: Gang He <hegang5@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Gang He <hegang5@huaqin.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* coachz: add battery informationhegang52021-01-112-0/+30
| | | | | | | | | | | | | add battery information for coachz BUG=b:176260625 BRANCH=Trogdor TEST=make BOARD=coachz Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: Ia87062417db1a5a8a53088d4da96948d10b0d129 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2612239 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: remove base_DET ALT settingSimon Zhou2021-01-081-1/+0
| | | | | | | | | | | | | | | | | | | The base_DET pin interrupt requires setting to gpio Remove ALT setting to enable interrupt BRANCH=trogdor BUG=b:175747582 TEST=make BOARD=coach check the softkeyboard hot-plug function is ok Change-Id: I09cf857fc32cf855ef75ce2ad4448a4b65508156 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2529271 Reviewed-by: Gang He <hegang5@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Tested-by: Gang He <hegang5@huaqin.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* coachz:update current limithegang52020-12-191-0/+1
| | | | | | | | | | | | | coachz update current limit to 95 percent BRANCH=none BUG=none TEST=make BOARD=coachz -j Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I9e2fcd2b9fb84114ce7ceb64ec0e91154306da5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597132 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* coachz:support for recovery modeganghe2020-12-181-0/+2
| | | | | | | | | | | | | coachz support enters recovery mode by pressing volume up+down keys BRANCH=none BUG=none TEST=make BOARD=coachz -j Signed-off-by: ganghe <hegang5@huaqin.corp-partner.google.com> Change-Id: I36c405de66a7f4ce8fd24da4dec6525518c148e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592301 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* coachz: config: Add on-body detection configChing-Kang Yen2020-12-171-0/+8
| | | | | | | | | | | | | Add on-body detection configuration on CoachZ devices BRANCH=None BUG=b:169374265 TEST=make buildall Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: I9f3ad1b968ec9a03a49ac3fc4b32efc001599e39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570890 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: correct g_sensor orientationhanwenchao2020-12-141-2/+2
| | | | | | | | | | | | | | | Correct the g-sensor oriention to match the latest board. BRANCH=none BUG=none TEST=make BOARD=coachz -j TEST=check the screen oriention. Signed-off-by: hanwenchao <hanwenchao@huaqin.corp-partner.google.com> Change-Id: Ia0a62cbf7abd64a6a89c300dcbd6f1b74c4616d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2589693 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Bob Moragues <moragues@chromium.org>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* PCHG: Send device event to hostDaisuke Nojiri2020-12-101-0/+1
| | | | | | | | | | | | | | | | | This patch makes PCHG send EC_HOST_EVENT_DEVICE on every state machine cycle. The host is expected to retrieve the device event mask through EC_CMD_DEVICE_EVENT and updates port status if the mask has EC_DEVICE_EVENT_WLC. BUG=b:173235954 BRANCH=Trogdor TEST=Enabled and disabled EC_DEVICE_EVENT_WLC via deviceevent command and verified the sysfs node is updated. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I9dece6bc35599db3d6ae30452fd8e97bbaeab9af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2579722 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* coachz: Remove unuse gpio settingsJennifer2020-12-021-4/+2
| | | | | | | | | | | | | | | | | | | When run the FAFT firmware_ECUsbPorts, getting the fail result. The program can detect pin EN_USB_A_5V using the config file strongbad.json. But coachz board not support USB-A, therefore we modify the gpio to unused signals. BUG=b:168868418 BRANCH=none TEST=make BOARD=coachz Signed-off-by: Jennifer Wang <jenniferchwang@ami.corp-partner.google.com> Change-Id: I017615c0afb8fba4e48d87201096ad1de38d3e9f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563355 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org>
* Coachz: Add ectool battery param CMDgaochao2020-11-302-0/+23
| | | | | | | | | | | | | | | | | Add ectool battery param CMD to get battery CT code BRANCH=master BUG=b:172410020 TEST=make BOARD=coachz -j flash ec and check ectool battery param cmd Signed-off-by: gaochao <gaochao@huaqin.corp-partner.google.com> Change-Id: Id65ef594028096a29da4b7fe44151b232d333994 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540067 Reviewed-by: Dolan Liu <liuyong5@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Dolan Liu <liuyong5@huaqin.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* coachz: Enable stylus chargingDaisuke Nojiri2020-11-244-2/+28
| | | | | | | | | | | | | This patch enables stylus charging. BUG=b:173235954 BRANCH=Trogdor TEST=See the description of CL:2538536. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ia28214cc963168df7b229a6fbf530fc357e85740 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538540 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Coachz: Modify Battery LED behaviorgaochao2020-11-191-15/+47
| | | | | | | | | | | | | | Modify Battery LED behavior based on spec BRANCH=master BUG=b:173095514 TEST=make BOARD=coachz -j flash ec and check Battery LED behavior Signed-off-by: gaochao <gaochao@huaqin.corp-partner.google.com> Change-Id: Iaf149bc37d65048ce68c96ed6758e018c0bb16c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2534439 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Coachz: Detect kickstand position and notify body proximityWai-Hong Tam2020-11-182-1/+56
| | | | | | | | | | | | | | | | | Implement the kickstand hall sensor interrupts and the signal debouncing. Use the kickstand position to approach the human body proximity and update the EC_MKBP_FRONT_PROXIMITY event to kernel. BRANCH=Trogdor BUG=b:168714440 TEST=Built the image correctly. Faked the signals and checked the interrupts triggered and the proximity event updated. Change-Id: I493b87ba5d6d8a801cc9aa6e181f72bf26bcafd6 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543112 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: Update the hall sensor GPIOs and interruptsWai-Hong Tam2020-11-173-6/+12
| | | | | | | | | | | | | | | | | | | | | Reflect the hall sensor change on the next hardware revision: * Wire GPIOD2, i.e. LID_OPEN_EC, to the lid hall sensor * Use GPIO73 as lid 360 detection * Different netnames * No reserse dock detection Add an empty interrupt for the kickstand hall sensors. Enable CONFIG_GMR_TABLET_MODE to handle lid 360. BRANCH=Trogdor BUG=b:168714440 TEST=Built the image correctly. Change-Id: I1eb35f6190c696e5a2598ef3ed7614c585c1173d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543110 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Move CONFIG_CMD_AP_RESET_LOG out of bringup listWai-Hong Tam2020-11-161-1/+0
| | | | | | | | | | | | | Move this CONFIG from bringup to production. BRANCH=None BUG=b:169736149 TEST=Built the image. Change-Id: I490499f3a85f91c6f07a0e099b8c0738bf0eb787 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538262 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: support battery GH02047XLSimon Zhou2020-11-112-0/+60
| | | | | | | | | | | | | | support battery GH02047XL BRANCH=master BUG=b:172613247 TEST=make BOARD=coachz -j flash ec and check battery info Change-Id: I6bdb0b18a88272e56b2aba1f82c99620243a70be Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2529269 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Trogdor: Apply internal PU to the interrupt of PI3USB9201Wai-Hong Tam2020-11-071-2/+2
| | | | | | | | | | | | | | | | | The BC1.2 chip PI3USB9281 some Trogdor old revisions used has push-pull output on the interrupt pin. But the PI3USB9201 some latest revisions used has open-drain output. These lines don't have external PU. So apply EC internal PU. BRANCH=Trogdor BUG=b:172674040 TEST=Plugged a C-to-A adapter to a CDP port, the BC1.2 interrupted and detected the 1.5A source. Change-Id: I15e27221bff1ce35fc35b03ac38340b5dfb1055d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523298 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Apply PD to sensors' interrupts before entering hibernateWai-Hong Tam2020-11-021-0/+7
| | | | | | | | | | | | | | | | Sensors are unpowered in hibernate. Apply PD to the interrupt lines such that they don't float. Don't need to remove the PD as they will be restored to the gpio.inc configs before the interrupts are enabled. BRANCH=None BUG=b:169595541 TEST=Triggered EC hibernate, woke up, and verified sensors working. Change-Id: I18819700d454fbbc16b28f65dad9533d97aa7d4c Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511805 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Configure OE_L and SEL of DP muxes to prevent leakageWai-Hong Tam2020-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | The OE_L has external pull-up. It is actually an open-drain output. Configuring it to push-pull has leakage through the pull-up to an unpowered rail during EC hibernate. Also configure SEL to output low if OE_L is deasserted. The SEL has no meaning if the muxes are disabled. When EC hibernate, the muxing ICs are unpowered. Outputing low prevents leakage through the muxing ICs. BRANCH=None BUG=b:169595541 TEST=Plugged a HDMI monitor to port-0 and port-1; checked the DP mux settings correctly. Change-Id: Icf0e81172626c09bc556756f1bcdddb83f45ac68 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508864 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Define the NC strap and output it lowWai-Hong Tam2020-10-311-0/+3
| | | | | | | | | | | | | Define the NC strap and output it low for power saving. BRANCH=None BUG=b:169595541 TEST=Built the images and booted fine. Change-Id: Ic2f1a098218403c3bff534b921b385ba893a83cf Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508863 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Trogdor: Do not activate g-sensors in S5Wai-Hong Tam2020-10-231-2/+2
| | | | | | | | | | | | | | | | | The g-sensors are not necessary to be active in S5; no gesture recognition in Trogdor designs. Do not activate it in S5. Though without this change, EC doesn't read the g-sensors as there is no config (zero odr) for S5. BRANCH=None BUG=b:170288119 TEST=Still read the g-sensors on S0 and S3. Change-Id: I54e8012e2674e13273e5fe9b96e9e9e6086e6490 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492529 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: initial g-sensor supportSimon Zhou2020-10-231-5/+6
| | | | | | | | | | | | | | | update lid accel matrixes modify motion_sensors data struct BUG=b:170288119 TEST=make BOARD=coachz -j flash ec and ectool motionsense return values BRANCH=master Change-Id: Ida746f6885007f7e396953eef9254879a0ee2963 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492180 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Trogdor: Deprecate PMIC_FAULT_L signalWai-Hong Tam2020-10-221-1/+1
| | | | | | | | | | | | | | This signal is no longer connected to PMIC on recent hardware revisions. It is unused. Deprecate it. BRANCH=None BUG=b:171245607 TEST=Built the affected Trogdor images. Change-Id: I75562f1aa9e411df38afd321ab63b51e91e7d4f7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488660 Reviewed-by: Alexandru M Stan <amstan@chromium.org>