summaryrefslogtreecommitdiff
path: root/board/coachz/gpio.inc
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | 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>
* Coachz: MotionSensor: Combine BMI160 & BMI260pengjunhao52021-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | 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: Disable IRQ from CTN730 in RODaisuke Nojiri2021-08-171-2/+0
| | | | | | | | | | | | | | | | | | | 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>
* Coachz: Remove PCHG from RODaisuke Nojiri2021-06-111-0/+2
| | | | | | | | | | | | | | 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>
* 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: 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: 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: Enable stylus chargingDaisuke Nojiri2020-11-241-1/+4
| | | | | | | | | | | | | 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: Update the hall sensor GPIOs and interruptsWai-Hong Tam2020-11-171-6/+4
| | | | | | | | | | | | | | | | | | | | | 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: 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: 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: 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>
* Coachz: Define unused GPIOsWai-Hong Tam2020-10-221-2/+41
| | | | | | | | | | | | | | | For the GPIOs connecting to nothing, define them. The unused GPIOs are configured as input with pull-up to save power. BRANCH=None BUG=b:169595541 TEST=Checked EC booted up correctly. Should be no change except power numbers. Change-Id: I6e23a791b7aa23c1545f195ea169332a57666ba5 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488215 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Remove GPIO 1.8V flagsWai-Hong Tam2020-10-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | The supply of the following GPIOs are VSPI/VHIF which is 1.8V. Their voltage levels are not configurable. The 1.8V flag is unnecessary. * PS_HOLD * PMIC_FAULT_L * AP_SUSPEND * ACCEL_GYRO_INT_L The following GPIOs are on 3.3V supply and not configurable. The 1.8V flag doesn't work. As they are used as open-drain, should be fine. * PM845_RESIN_L * PMIC_KPD_PWR_ODL BRANCH=None BUG=b:169595541 TEST=Tested the power-on and power-off sequence. Change-Id: I309c1a925b78e1140967cf3702e4ec3bba2a4583 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2485910 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Enable pull-down on SHI signalsWai-Hong Tam2020-10-201-0/+9
| | | | | | | | | | | | | | | Enable pull-down to avoid these signals floating. It is believed that it can get better power number in S5/G3. BRANCH=None BUG=b:169595541 TEST=Host commands between EC and AP work as expected. Check the GPIOs are low when AP is off. Change-Id: I1bcf882bf8f29b06a129700faebee8552085f0ef Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2469505 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Assert a GPIO to turn off rails before enter hibernateWai-Hong Tam2020-10-081-0/+1
| | | | | | | | | | | | | | | | We disabled the PSL mode hibernate. We uses another GPIO to control switches, which were originally controlled by PSL_OUT. Add this GPIO, named HIBERNATE_L, such that the non-PSL mode hibernate can retrofit the original design. BRANCH=None BUG=b:169797080 TEST=Triggered EC hibernate and checked the HIBERNATE_L GPIO asserted. Change-Id: I69c0d0296f701f3027adfd4d27fa51bdae0844a5 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2446662 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Trogdor: Disable PSL mode hibernateWai-Hong Tam2020-10-081-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RTC stops counting under PSL mode. The Trogdor design relies on EC to give the RTC counter. Disable the PSL mode hibernate and use the traditional non-PSL mode way, i.e. power down all RAM blocks except the last one. BRANCH=None BUG=b:169595541 TEST=Tested on Lazor; triggered hibernate, and waked it up using: * power button press * lid open * servo toggling EC_RST_ODL * AC plug (doesn't work, need to investigate why) TEST=Verified RTC still counting in hibernate: 2020-10-07 14:35:53 [244.922648 power state 9 = S5->G3, in 0x0005] 2020-10-07 14:35:53 RTC: 0x5f7e34b9 (1602106553.00 s) 2020-10-07 14:35:53 [244.923417 power state 0 = G3, in 0x0005] 2020-10-07 14:35:53 [244.926855 SDC Safe] 2020-10-07 14:35:53 [244.927138 Hibernate due to G3 idle] 2020-10-07 14:36:20 2020-10-07 14:36:20 2020-10-07 14:36:20 --- UART initialized after reboot --- 2020-10-07 14:36:20 [Image: RO, lazor_v2.0.5690-d95436fd6 ...] 2020-10-07 14:36:20 [Reset cause: hibernate wake-pin] 2020-10-07 14:36:20 ... 2020-10-07 14:36:23 > rtc 2020-10-07 14:36:25 RTC: 0x5f7e34d9 (1602106585.00 s) First RTC diff from the wall clock: 6553-53 = 6500 Second RTC diff from the wall clock: 6585-(60+25) = 6500 TEST=Verified RTC wake up from hibernate: 2020-10-07 14:59:25 > hibernate 10 2020-10-07 14:59:27 Hibernating for 10.000000 s 2020-10-07 14:59:37 2020-10-07 14:59:37 2020-10-07 14:59:37 --- UART initialized after reboot --- Change-Id: I23f6a65115d5722cf183948fad81dc16d3a6af47 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2447049 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Coachz: Implement the base detectionWai-Hong Tam2020-09-231-3/+4
| | | | | | | | | | | | | | | | | The implementation is based on the poppy reference, with the following changes: * Use proper GPIOs and ADC channel * Not notify ACPI, which is invalid on ARM boards * Update comments BRANCH=None BUG=b:168712053 TEST=Built the Coachz image. Change-Id: Ie0b0eaf81cdcbd2b2219eef0c895fbd41971d1e4 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2416998 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Coachz: change charge LED port to C0Simon Zhou2020-09-221-2/+2
| | | | | | | | | | | | | | change charge LED port to C0 with reference to the schematic BUG=None BRANCH=master TEST=make -j BOARD=coachz Change-Id: I02f96faed85034edf9f7f73cba250023a3e9a164 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2421402 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* Coachz: Reflect the GPIO changeWai-Hong Tam2020-09-171-7/+22
| | | | | | | | | | | | | | | | | Rename the GPIOs to reflect the netnames. Add the GPIOs for the hall sensors, not implemented yet. Add the GPIOs for the base detection, not implemented yet. Add the GPIOs and I2C bus for the stylus, not implemented yet. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: If30e00d8ede0b6ca2e9a4f9efe474c22a8a16933 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2411507 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: Remove USB-A portWai-Hong Tam2020-09-171-3/+2
| | | | | | | | | | | | | | Coachz doesn't have any USB-A port. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: I84bd2c7c04b810071cd904df26b05211a2fd88f8 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410856 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: Remove the keyboard backlight supportWai-Hong Tam2020-09-171-2/+0
| | | | | | | | | | | | | | | | Coachz doesn't has an internal keyboard. Move the CONFIG from baseboard to board, as the keyboard backlight is not a common feature. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: Idd5937da9ad6a3ab1be277e537bbd2e70e2b1d9a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410855 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: Remove the keyboard supportWai-Hong Tam2020-09-171-16/+0
| | | | | | | | | | | | | Coachz doesn't has an internal keyboard and trackpad. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: I6625b06276ad421ebb50d0e8cedc3098ee700fc9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410854 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* Coachz: Relocate the sensors and remove the base oneWai-Hong Tam2020-09-171-2/+1
| | | | | | | | | | | | | | | The main board is inside the lid, instead of the base. So relocate the sensors, remove the base sensor, and remove the logic of calculating the lid angle. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: Ib3cf3c871c541cddaf3fda7df4bf478615b829a7 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410853 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* Coachz: Simplify switchcap logic to support DA9313 onlyWai-Hong Tam2020-09-161-7/+7
| | | | | | | | | | | | | | Coachz only uses the switchcap DA9313. Remove the other switchcap support to simplify the logic. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: Idd1de592836a29d2ef6105650882517d58ec1f9d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2410852 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* strongbad / coachz : Add Initial SupportBob Moragues2020-09-151-0/+164
BUG=b:162409909 BUG=b:164196066 TEST=Verify build of strongbad target BRANCH=none Signed-off-by: Bob Moragues <moragues@chromium.org> Change-Id: I763d3be6852dfdbcf52a3db5b3bfa82fd654d459 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2396537