summaryrefslogtreecommitdiff
path: root/driver
Commit message (Collapse)AuthorAgeFilesLines
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-1418-36/+26
| | | | | | | | | | | | | | | | | | | | 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>
* driver: fix build error in accelgyro_icm426xx.cSue Chen2020-12-141-3/+2
| | | | | | | | | | | | | | | | | Remove const attribute in icm426xx_set_range and icm426xx_init. Remove struct accelgyro_saved_data_t *data in icm426xx_set_range for no used. BUG=none BRANCH=none TEST=change the base motionsensor in Ezkinil and build the code successfully. The motion function is workable on Ezkinil DUT with the ICM chip. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I183bdd9de2d148466e5ba57ba6917108b04ce332 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2581160 Reviewed-by: Edward Hill <ecgh@chromium.org>
* tcpm/it83xx: don't enable/disable Tx when Rx_enable() calledRuibin Chang2020-12-112-64/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register BMC PHY (00h bit4) enable/disable both Tx and Rx module, and we shouldn't enable/disable Tx module when Rx_enable() called, So I change to set Rx decode enable/disable only in Rx_enable(). Setting PD sleep mask shouldn't tie with Rx_enable(), so I change to set sleep mask by HOOK_CONNECT/DISCONNECT. Enable deep sleep mode, when all ITE ports are in Unattach.SRC/SNK state and other ports aren't pd_capable(). Disable deep sleep mode, when one of ITE port is in Attach.SRC/SNK state or one of other ports is pd_capable(). BUG=b:174151372 BRANCH=none TEST=on drawcia, plug-in dongle and adapter: 1.console cmd "pd 0 hard", hard reset tx done is set within 1ms. 2.check PD sleep mask: nothing attached = 0, one port attached = 1 3.lid close to G3(Rd_5.1k), then plug-in adapter, can go to SNK_READY state 4.can send SOP' to E-mark cable 5.console cmd "sysjump rw", can go to SNK/SRC_READY Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: Ibbf2f2d3d086be0bad4f3430c78f5ac3a26f8b1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573667 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Revert "bb_retimer: Bypass safe mode configuration in retimer"Divya Sasidharan2020-12-111-15/+1
| | | | | | | | | | | | | | | | | This reverts commit 14a10f746d2e4ae195a14fbcf9c0a2fb57d42239. This was a workaround and is being removed for appropriate solution to synchronize time in safe mode for retimer and TCSS mux. BUG=b:166300460 BRANCH=none TEST=none Change-Id: I6d997caca59942a0bd14a987737997b48a1ede4f Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2504477 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com>
* ctn730: Add BIST commandDaisuke Nojiri2020-12-101-44/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the BIST console command to ctn730 driver. BIST-0x04 command allows the host to detect a listener without a battery. BIST-0x01 command switches on the RF field. This allows the host to charge a depleted battery. > pchg 0 disable PCHG: ->INITIALIZED > ctn730 0 bist 4 RSP header: RSP, BIST, LEN=13 STATUS_OK 00 04 76 54 42 f9 6b 80 00 04 02 00 00 >ctn730 0 bist 1 STATUS_OK BUG=b:173235954 BRANCH=Trogdor TEST=See the description above. Used a mockup stylus on CoachZ. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I92ffde8670248abe21e9823e6bb73a1d4fab0af2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2554352 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* BB retimer: Set USB2.0 bit to 0Ayushee Shah2020-12-101-16/+0
| | | | | | | | | | | | | Since the TCSS mux ignores the USB2.0, set it to 0 BUG=b:175119818 BRANCH=None TEST=Able to set the USB2.0 bit to 0 in the BB retimer config register Signed-off-by: Ayushee Shah <ayushee.shah@intel.com> Change-Id: Ia76ede10f9bdbf746a400816017e7d36b0790764 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580455 Reviewed-by: Keith Short <keithshort@chromium.org>
* sm5803: Add linear charge supportAseda Aboagye2020-12-101-1/+64
| | | | | | | | | | | | | | | | | | | | The SM5803 supports manipulating the BFET in the linear region. This will be used for the precharge portion of the charge curve in OCPC systems. This commit adds support for the linear charge feature for the charger IC. BUG=b:174683659 BRANCH=dedede TEST=With other changes, build and flash drawcia, charge from subboard on depleted battery and verify that linear charging is taking place according to precharge current limits. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ib3c7f14e127b89301cccc6e93848da9249232678 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570938 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* sm5803: Add is_icl_reached methodAseda Aboagye2020-12-102-0/+20
| | | | | | | | | | | | | | | | | The SM5803A has a more precise and faster way to determine if the input current limit is being reached. This commit registers that method with the common charger driver framework for use by the system. BUG=b:174167890 BRANCH=dedede TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I5f96e86f37294b6cbd4bcc57827bd0ffa845b7da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2568564 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* charger: replace charger_get_input_current usesEric Yilun Lin2020-12-088-31/+76
| | | | | | | | | | | | | | | | | | | | | | | | | Replace them with charger_get_input_current_limit which is aligned to the old usage, no funcional changes. Keep OCPC charger_get_input_current uses as was, since it is its intended use. Also, implement - isl923x_get_input_current, raa48900_get_input_current - sm5803_get_input_current_limit BUG=b:171853295 TEST=1. grep "\<charger_get_input_current\>"; only ocpc uses the function. 2. make buildall 3. test with CL:2569086 on waddledee(sm5803), waddledoo(raa489000), hayato(isl923x), pompom(isl923x), and ensure the output of `curr 0|1` equalts to the report of power meter. BRANCH=none Change-Id: I71aca33cbc88dda9b0238cb71b1609665a9c9a7f Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569085 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* charger: rename charger_set_input_currentEric Yilun Lin2020-12-089-56/+59
| | | | | | | | | | | | | | | charger_set_input_current was actually sets the input current limit, so renames it to charger_set_input_current_limit. BUG=b:171853295 TEST=make buildall TEST=not output from `grep -r "\<charger_set_input_current\>"` BRANCH=none Change-Id: Icf4e99f287a7d4fc2d9560e8502e46cc07bfc085 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569083 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* driver: tcs3400: Report ODR for RGB sensorGwendal Grignou2020-12-081-5/+5
| | | | | | | | | | | | | | | | | | To be able to send data to the host, the oversampling ratio must be non-zero. It implies: - the host send a set frequency request for the RGB sensor - the EC use the frequency from the clear sensor to calculate the RGB sensor oversampling ratio BUG=b:172343923 BRANCH=kukui,hatch,volteer TEST=On Volteer, in calibration mode, check we get samples from the RGB sensor. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I70eb62287cae983800cdadaee4cfe00b2f22b734 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570825 Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* driver: tcs3400: In calibration mode: always send dataGwendal Grignou2020-12-081-7/+9
| | | | | | | | | | | | | | When in calibration mode, send data periodically, even when measurement is identical to the previous one. BUG=b:172343923 TEST=On Volteer, check data is coming periodically. BRANCH=kukui,hatch,volteer Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I31da6edcf5d175812697b99b7e7ef6ec85497770 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570824 Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* Kakadu: Fix battery charging status for bq27542wen zhang2020-12-081-0/+4
| | | | | | | | | | | | | | | | Fix the battery charging status for gauge bq27542. BUG=b:174725434 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery charging status and the result is OK. Change-Id: Ie3a926dd96b967679d2c51856afc3d1c157835f5 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576196 Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* SYV682: Disable VCONN on VCONN OCPEric Herrmann2020-12-081-4/+26
| | | | | | | | | | | | | | | | | | | The SYV682 has a 'soft' overcurrent protection on VCONN which current limits to ~600mA. If the cause is a short it will eventually hit thermal shutdown. Instead, we should disable VCONN when we get an OCP event. We must allow current spikes for at least 1ms, so disable with a deglitch. BUG=b:170441866,b:172710638 TEST=make buildall TEST=On Voxel, short VCONN to ground for at least 100ms, then observe that VCONN is disabled and 'VCONN OC!' is printed in the EC console. BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: I6712543b73072c959597c73cd493f248267a42ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2572237 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* delbin: Initial PS8811 registers.Michael5 Chen2020-12-071-1/+10
| | | | | | | | | | | | | | | | Depend on b/160937185 #32, initial PS8811 registers. BUG=b:160937185 BRANCH=firmware-volteer-13521.B TEST=manual Check register value under s0. Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I262858b61050f9ad857f44e703bbd3cfd0e989f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2561904 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* gl3590: Add initial support for USB HUB I2C interfaceJan Dabros2020-12-073-0/+166
| | | | | | | | | | | | | | | | | | | | | GL3590 is a USB hub with support for out-of-band transactions via I2C. Set of additional registers allow to disable/enable ports, query port status (including power-related information), handle over-current events and others. This initial driver implements method for reading and writing from/to GL3590 registers as well as event handler to parse asynchronous messages from hub. BUG:b:150323106,b:169929627 BRANCH:master TEST:buildall. Functionality can be tested on servo_v4p1 with a consecutive commit applied. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I385ff4790ddc367d07b7e588f4e10aeb83e9f1c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563686 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* max14637: add a config to define delay in ms from power off to onMarco Chen2020-12-071-1/+1
| | | | | | | | | | | | | | | BUG=b:173166535 BRANCH=octopus TEST=Change delay to 100; build and flash casta; verify whether BC12 can detect CDP/DCP/SDP correctly. TEST=`make -j buildall` Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I08cd881a2413e540eaaab3789f98e28f39514ad5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567197 Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* syv682x: update OVP warningEric Yilun Lin2020-12-041-1/+1
| | | | | | | | | | | | | | | | The VBAT OVP function is actually protecting the CC lines (if not VCONN SRC), and VBAT (if VCONN SRC). BUG=none TEST=none BRANCH=none Change-Id: I2eda0d2777d7e0facaf7340afe8e500454fc7169 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573664 Reviewed-by: Ayo Wu <ayowu@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Kakadu: Fix battery is_present status for bq27542wen zhang2020-12-041-2/+4
| | | | | | | | | | | | | | Fix the battery is_present status for gauge bq27542. BUG=b:174802149 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery present status and the result is OK. Change-Id: Ic8d9d503bc2f7d9648df56c150018f304aacfb18 Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2571145 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* sm5803: add parenthesis to the input of macrosEric Yilun Lin2020-12-041-4/+4
| | | | | | | | | | | | | | Inputs have to be guarded with parenthesis. BUG=none TEST=make buildall BRANCH=main Change-Id: Iedf678e1a2b0f3525aa2b788b0e2c9171d3b4acc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570885 Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* eldrid: modify charger configurationTerry Chen2020-12-032-1/+53
| | | | | | | | | | | | | BUG=b:166728543 BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Terry Chen <terry_chen@wistron.corp-partner.google.com> Change-Id: I1a918326a625f294fe6cd9a2ec8e2c5b2af43569 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2534231 Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* power: move headers to include/powerJack Rosenthal2020-12-031-1/+1
| | | | | | | | | | | | | | This makes the headers visible to the Zephyr build. BUG=b:173798264 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3b6d27c1234b3924ee8902a86eec5fdb2ccd9998 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2571897 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* isl923x: make get_amon_bmon a functionEric Yilun Lin2020-12-031-43/+59
| | | | | | | | | | | | | A pre-processing CL for the charger_get_input_current API. BUG=b:169532537 TEST=make buildall BRANCH=none Change-Id: Iec7baeb32e0d8f7f6c7260fada8a78d920cc325e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569081 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* tcpm/it8xxx2: add cc parameter tuning functionRuibin Chang2020-12-022-0/+28
| | | | | | | | | | | | | | | | | | | | | Add function for board hayato to tune cc pre-driving parameters, so that we can improve eye diagram. BUG=b:171279731 BRANCH=none TEST=on hayato, console check registers 0x3773 = 0x1, 0x3774 = 0x2, 0x3873 = 0x1, 0x3874 = 0x2, values are same as setting. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I8829f1fb4672bc98287e9526458f71026e19ca16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537528 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
* ln9310: Startup sequence update.Sean Hou2020-11-302-0/+74
| | | | | | | | | | | | | | | Update Startup sequence to fully address SC_OUT over voltage issue. BRANCH=master BUG=170591575 TEST=Build successfully. Change-Id: I31cbd839a7943ee19c19601bf178db6911f3dffd Signed-off-by: Sean Hou <seanhou@lionsemi.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2520279 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com>
* tcpm/anx74xx: Provide implementation of sop_prime_enable functionPatryk Duda2020-11-301-0/+3
| | | | | | | | | | | | | | | | | | | | CL:2542865 adds calls to tcpm_sop_prime_enable() function but there is no implementation of sop_prime_enable() provided in anx74xx_tcpm_drv. This causes EC crashes during firmware_PDTrySrc test. This patch adds tcpci_tcpm_sop_prime_enable() and implementation of sop_prime_enable() in anx74xx_tcpm_drv, similarly to other ANX drivers. BUG=b:168560801, b:162254118 BRANCH=none TEST=Flash eve with EC ToT, run firmware_PDTrySrc test. Make sure that EC doesn't crash during test. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I7cb2738f2a238901d03e3d8cb98ee39ce26bf38a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2560635 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* FUSB302:Implement decode SOP' and SOP'' enable functionPoornima Tom2020-11-251-18/+33
| | | | | | | | | | | | | | | | Support for decode SOP' & and SOP'' enable function in the driver to avoid system reboot when tcpm_sop_prime_enable() is called. Refer to https://crrev.com/c/2381030 . BRANCH=None BUG=b:173081501 TEST=Connect Gatex to ADLP-RVP. No reboot and USB4 connection is established. Signed-off-by: Poornima Tom <poornima.tom@intel.com> Change-Id: I418f7dfdf488289f27d7b0becf012f6cf554a025 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2517261 Reviewed-by: Keith Short <keithshort@chromium.org>
* PCHG: Add ctn730 driverDaisuke Nojiri2020-11-242-0/+481
| | | | | | | | | | | | | | CTN730 is a NFC/WLC transmitter (a.k.a. poller), which communicates with a receiver (a.k.a. listener) to transfer power wirelessly. BUG=b:173235954 BRANCH=Trogdor TEST=See the description of CL:2538536. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Icf5df30d2dffe617887ff6a591ea5b4a753cb3d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538539 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* amd_r19me4070: Set GPU temp to 0 when read failedPuthikorn Voravootivat2020-11-241-1/+6
| | | | | | | | | | | | | | | This avoids returning bogus temperature that caused thermal shutdown. BRANCH=none BUG=b:171325612 TEST=no more thermal shutdown when suspend Change-Id: Ie72d7798431636f23ae528ec9fbf8c9125ea32cc Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2544571 Reviewed-by: Shelley Chen <shchen@chromium.org> Reviewed-by: Dominik Behr <dbehr@chromium.org>
* RAA489000: Vbus OCP threshold and target current settingKo_Ko2020-11-242-0/+17
| | | | | | | | | | | | | | | | | | | When device at USB-C port happen short, the RAA489000 charger IC have current limit function with OTG UVP function. In order to enable OTG UVP function, the registers of 0x92 and 0x94 has to be set. Since normal output is 5V, set register 0x94 to 4.75V (0xBE) for detection, and set 0x92 to 3.104A (0x61) for better protection. BUG=b:169788521 BRANCH=None TEST=build and flash on madoo Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com> Change-Id: Ia20febce9be2ac26530c30c42f9a292602dec63c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2489704 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Ko Ko <ko_ko@compal.corp-partner.google.com> Tested-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
* driver:tcs3400: Add placeholder set_rangeGwendal Grignou2020-11-231-0/+8
| | | | | | | | | | | | | | | | | | set_range is now called all the time at init to set the current range at resume. Set one for tcs3400 otherwise the EC crashes. fixes: commit d28c10498cd ("motion_sense: Make change in range permanenti") CL:2215751 BUG=chromium:1083791 BRANCH=none TEST=check on Volteer EC is not crashing in motion_sense_switch_sensor_rate() at resume. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I172d3289bb69c14fa757d761b0099fea312292e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553346 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
* PD: Fix passing information about polarity when DTS is connectedPatryk Duda2020-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7dec638eb577aaa3a00d0551d73c276b94ebacb2 introduced two polarity modes POLARITY_CC1_DTS, POLARITY_CC2_DTS in enum tcpc_cc_polarity, but in many places there was an assumption that value other than 0 means that cable is inverted, the most notable example is usb_mux_set(). As a result kernel sometimes was not reporting SuperSpeed depending on if cable was inverted or not. This patch adds mapping from polarity with DTS to polarity without DTS where necessary. BUG=b:162254118 BRANCH=none TEST=Connect ServoV4 to eve and run servod. Make sure that USB-C muxer is connects USB3.0 lines (servod should set it). Flash EC ToT on eve. Boot ChromeOS and go to Developer Console. Run 'dmesg -w', check if device (eg. ethernet adapter) is attached as SuperSpeed device. Unplug cable, invert and plug again. Kernel should report that device is attached as SuperSpeed. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I354ef7047240cc8b5db01936b3780fae7387edb5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555157 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* raa489000: Adjust charger IC settings for rippleAseda Aboagye2020-11-232-0/+25
| | | | | | | | | | | | | | | | | | | This commit updates some of the charger IC settings to help reduce the current ripple. These settings including enable hysteresis for DCM/CCM as well as reducing the switching frequency to 600KHz. BUG=b:163056834 BRANCH=dedede TEST=Build and flash waddledoo, verify that input current ripple is reduced. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I8c19ed040b92cf833d132ad247e761849985a919 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2552860 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* driver: add custom PS8802 I2C slave addressBen Chen2020-11-202-0/+25
| | | | | | | | | | | | | | | | Add custom PS8802 slave address, page offset define, and switch PS8802 slave address change function. Be sure the slave device was not conflicted. BUG=b:168761485, b:168761483 BRANCH=none TEST=make buildall. Change-Id: I4c02b574de7dc932cacfffae0cb695cecf8f1a22 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537517 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* berknip: update hdmi retimer settingZick Wei2020-11-191-2/+4
| | | | | | | | | | | | | | | This patch update pi3hdx1204 eq setting, berknip use 0xAA on byte5, and keep other variant 0xFF. BUG=b:170708732 BRANCH=zork TEST=read back eq setting from i2c. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I543f1137dc63b5494cc2e170fa4da025d7fef03b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2452009 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* isl9241: add missing newline to cprintf callsCaveh Jalali2020-11-181-2/+2
| | | | | | | | | | | | | | | this adds missing newlines to the end of format strings in cprintf calls. BRANCH=none BUG=none TEST=buildall Change-Id: Ia7603182b79bfec88913355296e1d31599769e49 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2545736 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* TCPC: Change SOP' disable interfaceDiana Z2020-11-1814-32/+39
| | | | | | | | | | | | | | | Add the ability to enable or disable SOP' traffic through a new parameter. Name the function for "enable" to match other EC conventions. BRANCH=None BUG=b:168560801 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ife52e7d7d098825ab2163c70a4c59510da958876 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2542864 Reviewed-by: Keith Short <keithshort@chromium.org>
* berknip: update tusb544 eq settingZick Wei2020-11-182-5/+67
| | | | | | | | | | | | | | This patch update tusb544 eq setting for berknip. BUG=b:170708727, b:170708972 BRANCH=zork TEST=verify USB type C 3.0 RX , DP eq can pass, make buildall. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ief018e02090f5bc409a57a93da86f9ff095773aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2467602 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* touchpad_elan: add support for CoachZ touchpadTing Shen2020-11-181-34/+113
| | | | | | | | | | | | | | | | Port probe / update logic from linux driver code (drivers/input/mouse/elan_i2c_i2c.c), and support different page size. BUG=b:169651794 TEST=flash fw successfully on Zed. BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I2aa7316219d235e28e446de13b0d24fe3c6dac15 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537415 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* SM5803: Add overcurrent reportingDiana Z2020-11-181-1/+30
| | | | | | | | | | | | | | | | | | Report overcurrent on OTG failure interrupt. Note that this may manifest with no discharge status, or with a Vbus short discharge status. BRANCH=None BUG=b:171501161 TEST=on drawcia, connect a USB load and observe the port is shut off after too many overcurrent events, but another port partner plugged in will receive Vbus and Vconn. Observe that connecting a reasonable load of less than 1.5A can succeed after a single OTG failure. Observe sourcing out to several dongles works normally. Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I72162b32c5bacd34be599abc260b0d4156c764a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532677 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* ps8815: Add a delay after writes to ROLE_CONTROLKeith Short2020-11-182-5/+77
| | | | | | | | | | | | | | | | | | The PS8815 can corrupt the transmit buffer. Add a delay following writes to the ROLE_CONTROL register to workaround the corruption until a new revision of the chip is available. BUG=b:171430855 BRANCH=firmware-volteer-13521.B-master TEST=make buildalls TEST=Connect DP+USB monitor to Delbin. Perform repeated power role swaps and verify no corrupted PS_RDY packets. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If887af58b0a7c3f27df879156e0f234f88db14ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2544803 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tcpc: Cleanup usage of tcpci_set_role_ctrl()Keith Short2020-11-184-10/+16
| | | | | | | | | | | | | | Cleanup arguments for tcpci_set_role_ctrl(). BUG=b:171430855 BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib58defb5f9bcd3c3fe3d7de4239aa19e5545b778 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2544802 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* driver: bmi: Fix accelerometer sensor data read failedAlvinCC_Hsu2020-11-171-0/+44
| | | | | | | | | | | | | | | | This patch reverts CL:2483357. Fix accelerometer sensor data read failed after EC reboot. BUG=b:173207451 BRANCH=none TEST=read sensor data use "ectool motionsense" after EC reboot Signed-off-by: AlvinCC_Hsu <alvincc_hsu@compal.corp-partner.google.com> Change-Id: I1cd6f8364335244a3037e94d859ac1f81a63b395 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543565 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Alexandru M Stan <amstan@chromium.org>
* Casta : Support Multi-ChargerYongBeum.Ha2020-11-179-80/+94
| | | | | | | | | | | | | | | Casta needs to support 2 chargers(ISL9238 & BQ25710) BUG=b:168122776 BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I18758acbd0920132c2958bf9d238b4eac3fb5b73 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428354 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* crc8: rename crc8 to cros_crc8 to to avoid zephyr conflictJett Rink2020-11-131-1/+1
| | | | | | | | | | | | | | | | | Zephyr already provides a robust implementation for crc8, but it conflicts with platform/ec's name of crc8. Rename platform/ec to use cros_crc8 instead since it is a special case of zephyr crc8 implementation. BRANCH=none BUG=b:168032589 TEST=builds. Just a rename Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I2dc509fe1c1d8c2a4cdec3943b63f29429919137 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532691 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Kakadu: Add new battery support for gauge bq27542wen zhang2020-11-121-4/+75
| | | | | | | | | | | | | | Configure battery parameter and driver for gauge bq27542 on kakadu. BUG=b:172197008, b:171456201 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery parameter and the result is OK. Change-Id: I4c2cc11df1e13cb7313280afca717a7f1e2461ff Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531765 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* usb_mux: Remove ec host command dependencyScott Collyer2020-11-121-1/+2
| | | | | | | | | | | | | | | This CL removes EC host command dependency for the virtual type-c mux. BUG=None BRANCH=None TEST=make BOARD=quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I7d5107b60310456cb23393a443fb4f303106954b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2441390 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* sm5803: Add hardware charging rampingDevin Lu2020-11-122-26/+69
| | | | | | | | | | | | | | | | | | This patch add support hardware charging ramp. The hw ramp is implemented by enabling DPM (Dynamic Power Management). Once a DPM Voltage loop regulation is set and the DPM loop is enabled, the DPM guarantees that the Vbus will not go below the threshold voltage limiting the power that can be delivered to the load. BUG=b:172173517 BRANCH=none TEST=On drawcia, i2ctrace to make sure DPM is enabled with 5V source. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I0622da35bf57f367b21e97c5e39cb157ef911521 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521551 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* motion_sense: Make change in range permanentGwendal Grignou2020-11-1226-247/+87
| | | | | | | | | | | | | | | | | | | | | | | | | When AP changes range, unlike offset or ODR, it was not surviving init() call. If the sensor is powered off in S3, at resume the range would be back to the default. To make it consistent with other attributes, remember range change until EC powers down. - remove get_range - add current_range to store the range currently used. This is modifiable by the AP - when the AP shutdown, revert current_range to default_range - Remove const attribute for sensor structure when init and set_range is called. BUG=chromium:1083791 BRANCH=none TEST=One eve branch, check range is preserved even after 'shutdown -h 0' Change-Id: Ia7126ac0cc9c3fef60b4464d95d6dd15e64b0fc4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2215751 Reviewed-by: Yuval Peress <peress@chromium.org>
* Revert "crc8: rename crc8 to cros_crc8 to to avoid zephyr conflict"Jett Rink2020-11-111-1/+1
| | | | | | | | | | | | | | | Something slipped through CQ coverage. Need to figure out, but in the mean time, revert the 3 CLs that seemed to have caused the issue. BRANCH=none BUG=chromium:1147953 TEST=none This reverts commit befe5a9c78ff4e75db7c5cda801688c8976e95f3. Change-Id: I14e82f33646b6574b1b3da13783143e3a29d417b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533357