Add config settings for ODR and EC rate per requestor and
per power state (1 for the AP, 3 for the EC).
This way we can finely set ec rate and ODR depending on usage.
On chromeos, AP is not setting frequency, so EC sets for different power
state. On some platform, sensors can now be suspended in S3/S5.
Allow EC oversampling when AP is only looking for a few samples.
It is useful for double tap detection where high accelerator ODR is
required.
BRANCH=ryu
TEST=Tested on Ryu
BUG=chromium:513458
Change-Id: Ic3888a749699f07b10c5da3bc07204afd4de70da
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295637
Simplify sensor get_data_rate, get_range and get_resolution.
Error code was not checked and these functions as currently implemented
have no reason to fail.
BRANCH=ryu,samus,cyan,strago
BUG=chromium:513458
TEST=Check on ryu, compile
Change-Id: I40dca41cee29a19f65b2f84d434b4c19eb6cbf3c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295635
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Good rule of thumb for charger current is that it should be set
between C/20 & C/50 for the battery of the device.
For ryu its presently set at 64mA which may explain why we see
charger's status as charging even when battery is full. In any case
its well below recommendation so lets change it to something within
that.
Sampled data (see issue tracker) indicates charging current is ~256mA
when battery reaches 100% charged. Setting to 192mA (3 * 64) to error
on the side of charging slightly longer. This number is still within
termination current recommendation:
C/20 > term_current >= C/50
Note, also changing bq2589x default termination to match its POR value
of 256 as no other board uses this charger presently.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:42848
TEST=manual, read charger IC termination register and see termination
current set to 192mA
Change-Id: I60dbb9326c3abb8091fd9ab18eda08b9eabb197b
Reviewed-on: https://chromium-review.googlesource.com/293096
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
AMONBMON is a charger feature to measure input current and battery output
current. ISL9237 output analog value of voltage diff across sense
resistor to EC's ADC channel. This change also reorders oak's ADC channel
to fix a reading bug.
BRANCH=none
BUG=chrome-os-partner:42270
TEST=manual
in EC serial console, type command 'adc' and check AMON_BMON value.
type command 'amonbmon' and check AC current and BAT current.
Change-Id: I9db0a72be7c9a428a16d1609eb8c461c6928e548
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/283665
Reviewed-by: Shawn N <shawnn@chromium.org>
Store offsets using sensors axis, not the device axis.
Therefore apply rot_standard_ref to the offset vector before
get and rot_standard_ref^-1 before set.
BRANCH=smaug
TEST=using mag sensor, check the offset are applied to the right axis
and store correctly.
BUG=chromium:517675
Change-Id: I95c8ef2a62603890184412674e7bde91ebecd288
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294596
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Offsets are in the axis of the device, not the sensor.
Apply the offsets after rotiation
BRANCH=cyan
TEST=compile, test on cyan
BUG=chromium:517675
Change-Id: Iae9282efcbb5889bb0f1f556b7e5ca9fabe31b22
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294595
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
When sensor is disabled, HAL will not send flush request to EC.
However, when sensor is reenabled, only new events are expected.
When we have a change in frequency, we have to request the host to
query all the current events.
Flush the FIFO when events are not needed because all sensors are
disabled.
BRANCH=smaug
TEST=Pass more tests: tests like ..._fastest_batching after _50hz_flush
have more change to pass.
BUG=chrome-os-partner:39900
Change-Id: I1a8fc3784e3e6be260b23103b28e336e242f14cd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291991
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
To reduce noise the magnetometer measures in burst and
average the data.
Use "regular" presets: max frequency is limited to 100Hz.
Using a more precise presets limit frequency to no more than 50Hz.
BRANCH=smaug
TEST=Check magnetomter still works.
BUG=chrome-os-partner:39900
Change-Id: Ida6af86f6c207cc91e11378c129032f6d9e6b9ea
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291990
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Add the Silicon Image sensors, add it to the motion_sense module
to be used with the FIFO.
BRANCH=smaug
TEST=Check light and proxy on Smaug:
Check Light value in Lux are reasonable.
Check Proxy is detecting object, but value are in opposite of distance.
BUG=chrome-os-partner:32829
Change-Id: I11419a0f0613f0fae9323f99deedf5a1e6c6e29c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291335
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Add a mask of custom events reserved for IRQ based sensors.
Copy data from raw_xzy to xyz while filling the FIFO
when FIFO is enabled.
BRANCH=smaug
TEST=Test with si1141 driver, check irq works for both driver.
BUG=chrome-os-partner:32829
Change-Id: I5e106df0c121e3bf1385f635195717395235ccc3
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291334
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Allow sending calibration information to the magnetometer.
BRANCH=smaug
TEST=Check from user space that calibration is taken into account.
BUG=chrome-os-partner:39900
Change-Id: Ic0f595bde1afdc0b6a79e3516a42b55d1f50c17c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291333
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Modified TCPC layer to utilize the Power_Status and Power_Status_Mask
registers. VBUS status is stored in Power_Status and when a change
is detected, it's communicated to the TCPM via the ALERT# line.
BUG=chrome-os-partner:43440
BRANCH=none
TEST=Tested the feature on Glados and Oak connecting to both Ziger
and Samus. Verfied that VBUS status is communicated via the TCPCI and
that PD contracts are established without using the VBUS_WAKE GPIO
lines on Glados and Oak.
Change-Id: Ie5aa32eecc887f3cb00880a285f1e710b7064384
Signed-off-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289931
Reviewed-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Create a config to allow customization of a board's charger
termination current and add support to bq2589x charger.
Note, BQ2589X_TERM_CURRENT_LIMIT_DEFAULT, currently set to 64 to make
CL benign to ryu board. Future CL will change to 256 as thats the POR
value for that charger.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:42848
TEST=manual, read charger IC register and see its termination current
set to 64mA
Change-Id: I79348ed62a077a6432c8d8db6ac90e1e4e92dbc7
Reviewed-on: https://chromium-review.googlesource.com/293095
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Add support for ADC / thermistor reads on the BD99992GW PMIC.
BUG=chrome-os-partner:42156
TEST=Manual on Glados with subsequent commit. Boot to S0, run "temps".
Verify that temperatures start around 28C and begin to increase after
system is powered-on for a long duration.
BRANCH=None
Change-Id: Ic15f41046130317a0e0c3bce4a923ba624328c0d
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289935
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Add RX message buffer to the TCPC (currently two deep). If
the buffer is full and message is received, don't send goodCRC.
BUG=chrome-os-partner:43482
BRANCH=none
TEST=tested on glados. saw that with back to back PD
packets, we send goodCRC to both packets and process them in
order, taking about 7ms per packet. also tested buffer size
of 1 and verified that with back to back PD packets, we don't
send goodCRC to second packet.
Change-Id: I7f44b3c3a186ae61be8ca03017deec6e6b6c6f9f
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289005
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Using the LSB bit of motion_sensor addr field, we can
select at run time if a sensor is using SPI or I2C.
When the hardware stabilize, this CL can be removed.
BRANCH=smaug
TEST=Check that same image works on both i2c and SPI devices.
BUG=chrome-os-partner:42304
Change-Id: I9aef9a4dc739366a3d4e2f6fafe063ecfb5199c6
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289925
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
- Add 3ms after write, found issue with SPI writes.
- Do not check FIFO if all sensors are disabled.
It contains garbage (0x848484....)
- Do not check FIFO length. It can be 0 even if there
is data in the fifo.
- Remove forever latch and do not reset Interrupt in the handler,
we are using level interrupt.
- Flush and exit when the FIFO is in a bad state.
BRANCH=smaug
BUG=chrome-os-partner:43339,chrome-os-partner:39900
TEST=Ran CTS tests. Check sensor is stable.
Change-Id: I5cbae819e780b4d50d02829fd8e1178cf34c3f84
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289839
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
SPI being much faster, need to add right sleep to wait for
sensor to change state from suspend.
Set the ODR before the range, an issue I did not have with i2c.
Fix test used when FIFO is disabled.
BRANCH=smaug
BUG=chrome-os-partner:42304
TEST=Check sensors are coming and rate/range are correctly set.
Change-Id: I5bf655626f1f4232478a04d1d4e1a0d443efbf0f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288517
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Add interface to access the sensor using SPI interface.
BRANCH=smaug
TEST=compile and work on new Ryu board
BUG=chrome-os-partner:42304
Change-Id: I987259a7e378de8ada3b3b55b3662e5028ea31b2
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288515
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Added macros to conditionally compile the console commands to save the
memory. These macros can be enabled/disabled in the board specific files.
BUG=none
TEST=make buildall -j
BRANCH=none
Change-Id: I108a072c333762cd24ea973612202c9cc4d40914
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/288950
Reviewed-by: Shawn N <shawnn@chromium.org>
FIFO should not collect events of suspended sensors.
It could still happen at boot, when sensors are set up suspended.
BRANCH=smaug
TEST=Check for invalid FIFO events in HAL code.
BUG=none
Change-Id: Ie363afc3f3263bb10e03a8d0a8ee34b8b92bb6b4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288200
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Move TCPC initialized bit from alert register into error status
register. This is not part of the TCPCI spec, but the existing
code creates a bug that if TCPM reboots without TCPC also rebooting,
then we will never get the initialized alert from TCPC since
it has already happened, so the TCPM will loop indefinitely
waiting for TCPC to be ready. This fixes the bug by moving the
bit to a status register, which is more appropriate.
BUG=none
BRANCH=none
TEST=load on glados, reboot and make sure TCPM see's that the
TCPC is initialized.
Change-Id: I8e96b59031e01a4faec8f519727df1fa95f498bc
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288342
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Allow to force discharging the battery while a power source is plugged
for factory testing.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:42509
TEST=On Smaug EVT2 with USB-C cable plugged, issue "fwtool ec
chargecontrol discharge" or "ectool chargecontrol discharge"
and monitor the battery level for 10 min.
Change-Id: I0c4daa8ab442726cd398c121467718c50dbf0bef
Reviewed-on: https://chromium-review.googlesource.com/287590
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Add matrices to align sensors vectors with the device reference.
Move rotation in read routines, to allow fifo to contains processed
information.
BRANCH=smaug
TEST=Worsk on smaug
BUG=chrome-os-partner:39900
Change-Id: I009e7f24ef6ee0574ed664aeb5fd649fcd7039fd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/286659
Reviewed-by: Alec Berg <alecaberg@chromium.org>
math library can be set independentely.
It is implied when motion sensor drivers are compiled in.
BRANCH=smaug
TEST=Build strago board specific tests, host test and ran
ryu image.
BUG=chromium:512329
Change-Id: I743ea7b44e4a3783602c11f3928cb3fa4b105ec4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/287371
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
BUG=none
BRANCH=none
TEST=Added OPT3001 config to test the sensor in Kunimitsu.
Able to read the als data from "als" console command.
Varied the light intensity and the als reading are changing.
Driver fits into the existing ALS framework.
Change-Id: Idb2e6f9f50b6d0d6c8f64c11336efd3f2c76d498
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/286782
Reviewed-by: Shawn N <shawnn@chromium.org>
In order to support DMA transfers in one or both directions the usart
driver needs to be configurable with producer/consumer operations and
interrupt handler functions. These are now packaged up in the usart_rx
and usart_tx structs, and versions for interrupt driven RX and TX are
provided.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I3fd14c675c90873e903195b8e20d2070d2eda5ac
Reviewed-on: https://chromium-review.googlesource.com/285023
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
- Compass was not set properly if default config is set to
disable it (frequency == 0). We were trying to set it up
while stuck in debug mode.
- BMI150 FIFO collects sensor info even when suspended.
Ask FIFO to ommit suspended sensors.
- FIx compliation issue on nucleo-f411 board, where
MKBP is not enabled.
- Fix location of __packed arguement.
BRANCH=smaug
BUG=none
TEST=Check the compass is back with accelinfo,
FIFO is not filled with garbage with fiforead.
Check by echoing in in_accel_z_calibbias that the format
of MOTIONSENSE_CMD_SENSOR_OFFSET has not changed.
Change-Id: I7ebec12a14a74b8385b9f9532562a1fd0213f4d7
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284929
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Add code for set/getting calibration data on bmi160
Add code to perform FOC (Fast Online Calibration) on bmi160.
Add delay after getting out of suspend to be sure sensor is
available.
BRANCH=smaug
TEST=Check sensors are properly calibrated on Smaug:
Perform calibration:
echo 1 > /sys/bus/iio/devices/iio:device1/calibrate
Read calibration values:
cat /sys/bus/iio/devices/iio:device1/*_calibbias
Check the values are translated properly.
Write calibration values and check it affects the
sensor output.
BUG=chromium:506101,chrome-os-partner:39900
Change-Id: Ib9aad9bbd90b4249625641d68febf94b69aa4987
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/283165
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Add FIFO support, where bmi160 hardware FIFO is copied in local fifo.
Add rudimentary support for single/double tap and lift detection.
BUG=chrome-os-partner:39900
BRANCH=smaug
TEST=Check on F411 that FIFO data is retrieved and correct.
Check on Smaug as well, with proper kernel the collect the FIFO:
- check that increasing sampling_frequency we are collecting
the FIFO less often
- check no frames are lost.
- check tap/lift interrupts are working
- if latency is less than 100ms, check we are collecting much faster.
Change-Id: Ic2317c27fad0ef31dacd6e18cd5f71ccd2cec807
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274227
Add code to store bias from AP at boot and correct
raw data from accelerometer on the fly.
Also return the raw data on 16 bits, as recommned by sysfs.
BRANCH=smaug
BUG=chromium:506101
TEST=check set and get offset works fine.
Check value from accelerometer are sane (on Samus).
Change-Id: Ia62f02aadb9e11988edf0049a0cfee817641db88
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/283163
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Add code to store bias from AP at boot and correct
raw data from accelerometer on the fly.
Also return the raw data on 16 bits, as recommned by sysfs.
BRANCH=smaug
BUG=chromium:506101
TEST=check set and get offset works fine.
Check value from accelerometer are sane (on Samus).
Change-Id: I2ad4ce601665b497527dc8c6acb6e7d398366afe
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/283162
Take profit of the hardware input current ramping/back-off integrated
in the BQ2589x charger by setting the current limits higher for BC1.2
USB modes and letting the hardware adjust to the actual charger
limitation depending on the VBUS voltage droop.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:42045
TEST=Connect a Nexus 9 DCP charger to Smaug and see the input current
adjusted to 1650mA without brown-out, read back the value properly from
the AP:
$ ectool usbpdpower
Port 0: SNK Charger DCP 4958mV / 1650mA, max 5000mV / 1650mA / 8250mW
Change-Id: I348e5ee4980a5652f72f279ab4e3a7126583b093
Reviewed-on: https://chromium-review.googlesource.com/282584
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Use the new TCPC initialization complete bit in alert register to
signal TCPC readiness instead of checking for USB VID to be set.
BUG=none
BRANCH=none
TEST=load on glados, make sure we can boot without battery.
Change-Id: I4b25c973ece0de6dd3f419c5901cff1d8d05ed95
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/282593
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Initial support for Parade PS8740 Type-C redriving switch.
BUG=chrome-os-partner:41696
TEST=Manual on Glados in subsequent commit. Verify set() and get()
functions set and return consistent values. Verify that USB SS device
functions when muxes are set to dock or USB.
BRANCH=None
Change-Id: Iedbe53cc76f30ecd969c2ca99a7377ed3b193729
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/282280
Reviewed-by: Alec Berg <alecaberg@chromium.org>
In preparation for adding support for additional USB-C mux chips, add a
new high-level USB-C mux interface usb_mux.c. usb_mux functions are now
called from pd code instead of board-level functions. usb_mux calls down
into a mux chip-specific driver (currently pi3usb30532) or
board-specific drivers which toggle GPIOs (for legacy boards).
BUG=chrome-os-partner:41696
TEST=Manual on Glados in subsequent commit. Verify set() and get()
functions set and return consistent values. Verify that USB SS device
functions when muxes are set to dock or USB. Also, verify that DP
dongle and USB SS device are functional on both PD ports on samus_pd.
BRANCH=None
Change-Id: Ib6477f489310f3be1430585ea09fea26f57e3752
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/281435
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Refactor the tcpm/tcpc split such that the tcpm driver implements
the alert functionality since it may be unique for different tcpc
chips.
BUG=chrome-os-partner:41842
BRANCH=none
TEST=make -j buildall. run on samus and glados.
Change-Id: I23f2d7f8627d5337b8d001a09bf27622be24fe33
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/281631
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Create driver/tcpm/ folder to hold TCPM drivers. Currently the
two drivers are a stub driver which is used when TCPM and TCPC
are on the same MCU and can make direct calls between the two
and the TCPCI driver which implements the standard TCPCI protocol.
BUG=chrome-os-partner:41842
BRANCH=none
TEST=make -j buildall
Change-Id: Ie4d9b36eb33155254f8b87b83861f98a7a80693a
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/281630
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Set the resistance compensation for the charger IC according to the EE
team measurements :
- Resistance compensation = 60 mOhm
- Voltage clamping = 160 mV
- Thermal regulation = 120C
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:38603
TEST=dump the BQ25892 registers by using the "bq25" command and see that
REG08 contains 0x77.
Change-Id: I90e9ea4569d77fd90ed0290ec78e66810d744648
Reviewed-on: https://chromium-review.googlesource.com/281660
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
This unifies all the EC header files to use __CROS_EC_FILENAME_H
as the include guard. Well, except for test/ util/ and extra/
which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively.
BUG=chromium:496895
BRANCH=none
TEST=make buildall -j
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029
Reviewed-on: https://chromium-review.googlesource.com/278121
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Use the right rounding function for the charging voltage selection.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=chrome-os-partner:41594
TEST=On Smaug EVT2, check that the battery is charging to 100% and
compare the voltage requested by the battery (using "battery" command)
to the voltage set by using "charger" command.
Change-Id: Ic5076f23242d1fac31ad34e0c8c9bfe0a868a91e
Reviewed-on: https://chromium-review.googlesource.com/278260
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Without this change, after a while, the data from the accelerometer is
garbled, weaker than expected.
BUG=chromium:494270
TEST=Check that with this change, the accelerometer vector is always
around 1G.
BRANCH=smaug
Change-Id: I9bb4acd208e8fa4111fc91e35c4cb5636f9425f4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/276666
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Previously we supported using a single pi3usb9281 chip, or using two
chips on the same i2c bus behind a mux. Now that we need to support a
third configuration of multiple chips on different busses, it makes
sense to be able to configure the configuration freely at the board
level.
BUG=chrome-os-partner:40920
TEST=Manual on samus_pd. Plug USB charger, verify detection is correct
on both charge ports.
BRANCH=None
Change-Id: I120dcb1c3ceb6f013b92407effcd8cb66e7ffcce
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/276511
Reviewed-by: Alec Berg <alecaberg@chromium.org>