summaryrefslogtreecommitdiff
path: root/board/dratini/board.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* thermisor: move header to include dirDawid Niedzwiecki2021-04-221-1/+1
| | | | | | | | | | | | | | | | Move the "thermistor.h" header to the include/driver/temp_sensor directory. It is used by the Zephyr shim, so the change is useful to include the header. BUG=b:180403276 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e83df97e50a3b324440b65ddb900ddf135f2439 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2843323 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* dratini: Set TCPC_AUX_SWITCH to 0xC on Port 0 on CCD enableBoris Mittelberg2021-03-251-0/+24
| | | | | | | | | | | | | | | | | | When the screen brightness is changed, DP sends signal on AUX channel. This causes CCD mode to be disconnected. This patch sets the MUX to aux+ <-> sbu2, aux- <-> sbu1 to fix it. Same change as I3dba1bdfd44a921077a2f60dec17119bb0077238 BUG=b:183123775 BRANCH=none TEST=manually verify servod doesn't exit when screen brightness is changed Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: Iff91a4b4753b42ee42cd5baac36ba8243d966ce0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785192 Reviewed-by: Daisuke Nojiri <dnojiri@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>
* ec: change usage of "sane" per inclusive languagePaul Fagerburg2020-07-221-1/+1
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "sane", "sanity check", and similar with inclusive/non-stigmatizing alternatives. BUG=b:161832469 BRANCH=None TEST=`make buildall -j` succeeds. `grep -Eir "sane|sanity" .` shows results only in third-party code or documentation. Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I29e78ab27f84f17b1ded75cfa10868fa4e5ae88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311169 Reviewed-by: Jett Rink <jettrink@chromium.org>
* driver: Replace BMI160 to BMI in board configChing-Kang Yen2020-04-231-6/+6
| | | | | | | | | | | | | | | | | 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>
* HACK: dratini: Prevent system can't power onDevin Lu2020-04-071-0/+21
| | | | | | | | | | | | | | | | | | Apply CL:2014001 to dratini. Currently few systems can't power on, because pp2500_dram_u doesn't assert. To prevent potential risk, this patch trigger re-power on again. BUG=b:152456965 BRANCH=firmware-hatch-12672.B TEST=Verified with defect system and make sure boot up normally. Change-Id: Ia88703286ed6b9d26060cb7fee8cfce98a500d26 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130151 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dratini: change thermal configuration for PVTDevin Lu2020-03-311-1/+1
| | | | | | | | | | | | BUG=b:152695211 BRANCH=firmware-hatch-12672.B TEST=manually remove dptf control then do following: make sure system shutdown when over 80 degree with temp sensor 1. Change-Id: Idf5ee08ed58239239aa9d7b326b8fcf2be5946b9 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123625 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dratini: Enable HDMI power and add debounce to HDMI HPD low interruptTim Wawrzynczak2020-03-171-1/+39
| | | | | | | | | | | | | | | | | | | Enable power to HDMI rail when AP is in S0, off otherwise. Also, when runtime S0ix kicks in, there can be a long transient pulse low on the HDMI_CONN_HPD signal (300+ ms). This patch adds a 2-second debounce time when the HPD goes low. BUG=b:147261818 BRANCH=firmware-hatch-12672.B TEST=Verified runtime S0ix, suspend/resume S0ix, shutdown, and startup all correctly operate the HDMI & MST signals. Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ia9fce8a2020995c57e9bb3634a147765e3c556f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103366 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* usb_mux: retimer: mux as chained mux and retimerDenis Brockus2020-02-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Temp sensor: Remove action_delay_sec fieldDiana Z2020-02-141-6/+3
| | | | | | | | | | | | | | The action_delay_sec field hasn't actually been referenced by any code since 2013. Removing the corresponding struct field. BUG=None BRANCH=None TEST=builds Change-Id: Ia7334c26b85d0161ff61bb51fbdda61bb921595a Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2054945 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* dratini: change thermal configuration for DVTDevin Lu2020-01-311-7/+7
| | | | | | | | | | | | | | | | | BUG=b:147792204 BRANCH=hatch TEST=manually remove dptf control then do following: make sure system shutdown when over 75 degree with temp sensor 1. make sure system shutdown when over 70 degree with temp sensor 2. make sure fan works when over 40 degree with temp sensor 1. make sure fan fully on when over 70 degree with temp sensor 1. make sure fan works when over 40 degree with temp sensor 2. make sure fan fully on when over 55 degree with temp sensor 2. Change-Id: I51de773107df248b393e04e5ee6755a06712728c Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2002992 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dratini: assign SKUIDs for DVTDevin Lu2019-12-221-5/+8
| | | | | | | | | | | BUG=b:146504217 BRANCH=hatch TEST=make buildall -j. Change-Id: Iccf5f9e5785ca3bfcb14af619718f9b8c6747a0b Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1975946 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: override battery LEDs to indicate system suspendDevin Lu2019-12-221-1/+1
| | | | | | | | | | | | | | | Dratini is non-power LED design, to indicate system suspend, blinking both two side battery white LEDs (1 sec on/1 sec off) to indicate system suspend with non-charging state. BUG=none BRANCH=hatch TEST=make sure both two side LEDs are blinking white after system suspend. Change-Id: Ia8173bd78b6678633de50c747100c6c3f11fb29e Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1977989 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* board: Set Accelerometer range to 4gGwendal Grignou2019-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dratini: configure fan speed at initialDevin Lu2019-12-111-3/+3
| | | | | | | | | | | | | | | Set correct fan maxima/minimum and initial speed for EVT. To provent fan loudly after ec reset. Set lower initial speed to 10 percent. BUG=none BRANCH=hatch TEST=make buildall Change-Id: I468b82942ec2e5841ed35ced9baea296b35f620b Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1958390 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* Define board_override_features_flags APIs as overridablednojiri2019-12-101-6/+1
| | | | | | | | | | | | | | | | | | | | | | Currently board_override_features_flags0/1 are enabled by CONFIG_EC_FEATURE_BOARD_OVERRIDE. This patch defines the callbacks as overridable. It will allow us to remove CONFIG_EC_FEATURE_BOARD_OVERRIDE and the redundancy it incurs. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I0c2870b746879b272ada35b9615b611627a9f426 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1951810 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* Dratini/Jinlon: Add support for TEMP_SENSOR3Devin Lu2019-11-221-4/+11
| | | | | | | | | | | | | | A new temperature sensor is added to Dratini/Jinlon boards, close to the CPU. It is used to support the fan control. BUG=none BRANCH=hatch TEST=temp command in EC console Change-Id: Icd5974133da5e1aec81f2201f87e1b83b79c6169 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925802 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini/dragonair: add new SKUDevin Lu2019-11-071-3/+7
| | | | | | | | | | | | | | add unprovisioned SKUID to support kblight and convertible for pre-flash cbi. add SKU ID: 23 (Convertible, TS, Stylus) BUG=b:142987639, b:143994766 BRANCH=none TEST=make buildall -j. Change-Id: Ie8d4b611d8073ff993a94699d832ada6830a2771 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1902892 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: enable keyboard factory scanningDevin Lu2019-11-061-0/+18
| | | | | | | | | | | | | | | | Clone from CL:1309572 This patch add for factory keyboard connector test. BUG=none BRANCH=none TEST=Short keyboard pins and make sure "ectool kbfactorytest" works. Change-Id: I06deb1539845bc3490c69943579aa4b6bbc1d4ab Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1898258 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ec-fans: Make fans configuration const by default.Andrew McRae2019-11-021-1/+1
| | | | | | | | | | | | | | | | It was pointed out to me that the fans config list was non-const, but there is only 2 boards that require non-const configuration, so by default make it const, but allow an override. BRANCH=none BUG=None TEST=EC compiles, make tests, buildall Change-Id: I3ef8c72f6774e1a76584c47d89287f446199e0f2 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1893025 Reviewed-by: Andrew McRae <amcrae@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
* Rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNTKarthikeyan Ramasubramanian2019-11-011-3/+3
| | | | | | | | | | | | | | | | | 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>
* dratini: chagne thermal configrationDevin Lu2019-10-211-8/+18
| | | | | | | | | | | | | | | | | | | | split thermal configration table for temp sensor 1/temp sensor 2, because sensor location is different, they have their own table. BUG=none BRANCH=none TEST=manually remove dptf control then do follwoing: make sure system shutdown when over 85 degree with temp sensor 1. make sure system shutdown when over 75 degree with temp sensor 2. make sure fan works when over 25 degree with temp sensor 1. make sure fan fully on when over 70 degree with temp sensor 1. make sure fan works when over 25 degree with temp sensor 2. make sure fan fully on when over 50 degree with temp sensor 2. Change-Id: I1139f9ee8a8ef9fc67c3ba6f5cbc2b6cf265ede9 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869171 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: disable accel, gyro sensors and tablet mode switch for clamshellsDevin Lu2019-10-211-2/+29
| | | | | | | | | | | | | | | | | | dratini and dragonair use the same PCB with BOM changes. Dratini uses a hall sensor instead of GMR, and does not stuff the accelerometer and gryo sensors. Disable initialization of those sensors on Dratini. Dratini is a clamshell that does not support tablet mode, so disable that, too. BUG=none BRANCH=none TEST=make buildall -j. make sure no initial event occurs with dratini. make sure tablet mode was disabled with dragonair. Change-Id: If65183f458d62f0b74e21233900d86102c4cc88d Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866220 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: enable GMR sensor for tablet modeDevin Lu2019-10-211-0/+1
| | | | | | | | | | | | BUG=none BRANCH=none TEST=Check screen rotation with tablet mode. Check keyboard disabled and on-screen keyboard enabled with tablet mode. Change-Id: Ifa3bcc24b19608fb52525208569e8fdde25e99ea Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866218 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: correct accel orientationDevin Lu2019-10-181-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=none BRANCH=none TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -1040 4336 15408 Sensor 1: 760 -291 17127 Sensor 2: 0 0 0 When on the base bottom edge, report gravity along Y axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -960 14112 -5952 Sensor 1: 453 16136 -373 Sensor 2: 0 0 0 When on its left side, report gravity along X axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: 16352 -432 64 Sensor 1: 16802 -338 192 Sensor 2: 0 0 0 and check the screen rotation was normally. Change-Id: Idbe7184d5c14eb31d7823f9e17648d9bf3df4443 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866209 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dratini: enable ec_feature kbbacklit by SKUIDDevin Lu2019-10-161-0/+24
| | | | | | | | | | | | | BUG=b:140610519 BRANCH=none TEST=make sure ectool inventory has shown keyboard backlight support with dratini/dragonair kbbacklit SKU. Change-Id: I8fceebc417d4b5b319dbc6126d8311346f09bdcf Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859234 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* dratini: Change keyboard backlight pwm to 100 HzDevin Lu2019-09-121-1/+1
| | | | | | | | | | | | | | | dratini does not have LED backlight drive ic, change pwm frequency to 100 Hz to be compatible with dratini hardware. BUG=none BRANCH=none TEST=make sure kblight 0~50 can work intended. Change-Id: Idbf99d3ddfb6da48c7f8792d78bab0090d973f16 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789956 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* dratini: Update EC GPIOs for proto and remove unsupport functionDevin Lu2019-09-121-119/+0
| | | | | | | | | | | | | | | 1. Correct PP5000_A that just have one pin for proto. 2. Remove ALS support. BUG=none BRANCH=none TEST=make BOARD=dratini Change-Id: I0b5ccc911facb73d5e32ae5d363db0ad1fd94273 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1788764 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* dratini: initial EC imageDevin Lu2019-08-271-0/+493
Copy hatch for dratini EC image. Below CLs will come after this CL merged. 1. Battery configration. 2. Implement leds. 3. Fix accel direction. BUG=none BRANCH=none TEST=make BOARD=dratini Change-Id: Ia0fa6de06c36550c8a296657df7bd04f38e4726d Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770333 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>