| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The extentions were added to make the compiler perform most
of the verification that the conversion was being done correctly
to remove 8bit addressing as the standard I2C/SPI address type.
Now that the compiler has verified the code, the extra
extentions are being removed
BUG=chromium:971296
BRANCH=none
TEST=make buildall -j
TEST=verify sensor functionality on arcada_ish
Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Opt for 7bit slave addresses in EC code. If 8bit is
expected by a driver, make it local and show this in
the naming.
Use __7b, __7bf and __8b as name extensions for i2c/spi
addresses used in the EC codebase. __7b indicates a
7bit address by itself. __7bf indicates a 7bit address
with optional flags attached. __8b indicates a 8bit
address by itself.
Allow space for 10bit addresses, even though this is
not currently being used by any of our attached
devices.
These extensions are for verification purposes only and
will be removed in the last pass of this ticket. I want
to make sure the variable names reflect the type to help
eliminate future 7/8/7-flags confusion.
BUG=chromium:971296
BRANCH=none
TEST=make buildall -j
Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Naming of many vector types and matrix types are not clear enough.
For example, we have:
vector_3_t, which is a vector of three int.
vec3_t, which is a vector of three float.
size4_t, which is a vector of four size_t.
mat33_t, which is a 3x3 matrix of float.
matrix_3x3_t, which is a 3x3 matrix of fixed point.
Besides, we have types like int8_t, uint16_t types.
To clearly distinguished types, the CL propose to,
For vector types, naming should be `$type + 'v' + $num + '_t'`:
vector_3_t becomes intv3_t
vec3_t becomes floatv3_t
vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet)
For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the
matrix size:
matrix_3x3_t becomes mat33_fp_t # fp: fixed point
mat33_t becomes mat33_float_t
TEST=make buildall -j
BUG=b:114662791
Change-Id: I865aa3ecbab6cb97f8585a081a679adf00febe1d
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1215442
Commit-Ready: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the high-level APIs for block transfers eliminates some code
duplication and error-prone manual locking sequences.
- common/cbi: Block transfers
- driver/accel_bma2x2: Block transfers
- driver/accel_kionix: Block transfers
- driver/accelgyro_bmi160: Block transfers
- driver/accelgyro_lsm6ds0: Block transfers
- driver/baro_bmp280: Block and byte transfers
- driver/charger/rt946x: Block transfers
- driver/gyro_l3gd20h: Block transfers
- driver/stm_mems_common: Block transfers
- driver/tcpm: Block transfers
TEST=buildall; motionsense and PD testing on Grunt convertible which
exercises the bma160, kionix and tcpcm drivers.
BRANCH=none
BUG=chromium:871851
Change-Id: I1732253a244c3343459265ce1e1e54488cee65b8
Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1167958
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Kionix suggests that it is recommended to issue the Software Reset
command after the device was powered. This is effective against
dynamic or non-linear behavior of a power supply or unexpected
noise above normal on the power rail during a power up.
BRANCH=eve
BUG=b:62607555
TEST=kx022:
1. press power button 10 second to power off.
2. power on the DUT
3. refresh + power button to cold reboot the DUT
4. Check the g-sensor by 'ectool motionsense'
kxcj9:
eve: sensor kxcj9 found.
Signed-off-by: Yidi Lin <yidi.lin@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/536723
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
(cherry picked from commit 5a52614b8c87ab1de84c461b7bbd0b4a14dc7fdb)
Conflict in init routine in accel_kionix.c.
By moving WHOAMI after reset, we expect the test to work the first
time.)
Change-Id: I362f2af59253519aa35b72cfb6b666c49e425777
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/753969
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1d8fcd4fabfed67d8304b3c5ad418cf6f5ae1878.
It looks like KXCJ9 may not return proper WHOAMI after powerup
but before reset.
BUG=b:67865186
BRANCH=eve
TEST=compile
Change-Id: Iceaaf3b2a45d920e08db587e1308cec0379e68cf
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/753967
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unify get_range/get_datarate by using accelgyro_saved_data_t
structure.
BUG=none
BRANCH=none
TEST=compile
Change-Id: I0bfa2f06c5dd2021a5af9e6499c97e65988167ce
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/961221
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the end of the sensor initialization, all _init sensor routines set
the range to the default value from board.c file.
Put all the code in a single place, move it from sensor_common.c to
motion_sense.c.
BUG=none
BRANCH=none
TEST=compile
Change-Id: If89cf27c6438e0f215c193d68a480e027110174c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/767610
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=chromium:718919
TEST=make buildall -j works, orientation works when enabled on gru
and scarlet.
Change-Id: I16dcfa5d9dea39c082d98190fa1bb6e496168b17
Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/540124
Tested-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
spi_transaction() always returns success even without the sensor.
Check whoami value to make sure that the sensor is existed.
BUG=none
BRANCH=none
TEST=remove LID accel sensor from elm and see init failed log.
[1.258973 Lid Accel: 1: init failed: 4]
Change-Id: I55aa35bc9790e5dec61e22aa2f51243e29368a86
Signed-off-by: Yidi Lin <yidi.lin@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/453579
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port changes cl/288874 to generic kionix driver.
From cl/288874:
After we write SRST in CTRL2, there seems to be a period of time where the
accelerometer doesn't respond to i2c commmands. Instead of failing the init
just consider it as part of the timeout period.
BUG=chrome-os-partner:39269,chrome-os-partner:63146
TEST=make -j buildall
BRANCH=veyron,cave
Reviewed-on: https://chromium-review.googlesource.com/445973
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit 4a34b0d88f6b0075ee66a18f4aa22325dc766eb6)
Change-Id: I2197aa7741d1482b76c7c07b0cb0c171aab86a59
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/446417
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port changes cl/289037 to generic kionix driver.
Form cl/289037
Sometimes the accelerometer doesn't initialize nicely.
Increase the timeout to 20ms.
BUG=chrome-os-partner:39269,chrome-os-partner:63146
TEST=buildall
BRANCH=veyron,cave
Change-Id: I4e4d8951fc821b8b33daa53e6c3b8da5ffa7acde
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/446132
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit 11c00e1a4116bb0ac387c0264053e66e41a5ec92)
Reviewed-on: https://chromium-review.googlesource.com/446699
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shorten certain long prints and reduce the precision of timestamp prints
when CONFIG_CONSOLE_VERBOSE is undef'd.
BUG=chromium:688743
BRANCH=gru
TEST=On kevin, cold reset the EC, boot to OS, and verify cros_ec.log
contains all data since sysjump and is < 2K bytes (~1500 bytes).
Change-Id: Ia9390867788d0ab3087f827b0296107b4e9d4bca
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/438932
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the specs, "KX022-1020 Specifications Rev4.0", the power up time
can be as long as 10ms.
Add a loop to be sure the device is responsive before initalizing it.
BRANCH=reef,glados,oak,veyron,cyan
BUG=none
TEST=After putting a KX022 accel as first in the list, it would not
initialize properly. After adding the loop, it initializes properly.
Change-Id: I3194a5d1deb0c2eb2a04a459aab3b4269e479af3
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394750
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added i2ctest console command to test the reliability of the I2C.
By reading/writing to the known registers this tests provides the
number of successful read and writes.
BUG=chrome-os-partner:57487
TEST=Enabled the i2ctest config on Reef and tested the
i2c read/writes.
BRANCH=none
Change-Id: I9e27ff96f2b85422933bc590d112a083990e2dfb
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/290427
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Put the common code for set_[data_rate|range|resolution] in the same
function
BUG=b:27849483
TEST=tested on Cyan, save 128 bytes on minnie.
BRANCH=none
(cherry picked from commit 79c74a2a662cdc6d9ea0d8729ca4fb1d641400e5)
Reviewed-on: https://chromium-review.googlesource.com/379099
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Change-Id: Ie66f64a478ad73c2a46129a664f2a6c60c5157bc
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/379544
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redundant, already set by the compiler.
BRANCH=none
BUG=none
TEST=compile.
(cherry picked from commit 895476044812a63f0f611d96e11437c49d73443a)
Reviewed-on: https://chromium-review.googlesource.com/379098
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Change-Id: I4d1c7263034c0cef1a6484a516edb3893c11945f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/379543
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Field is not required: sensor->chip already has that information.
BRANCH=veyron
BUG=none
TEST=compile
(cherry picked from commit 90fcd6be2b5d2104301efef295113d7816e14042)
Reviewed-on: https://chromium-review.googlesource.com/379096
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Change-Id: I6c0bc2e71d7c848968caa78c749dd3fb916f6263
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/379541
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
BRANCH=none
BUG=none
TEST=compile tested for Samus
Change-Id: Ib7a0a75a2d63cf8f55d0b59f4a3225da2cb4e70b
Reviewed-on: https://chromium-review.googlesource.com/343282
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL ports c9832e04f1528 to Kionix accel driver. And also enables SPI
access of Elm's base kx022.
BUG=none
BRANCH=none
TEST=manual
Change-Id: I0c1de028c82fc62a124bb5b930a3882c4b368d71
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/331851
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this allow motion sensor devices to be locate on different I2C port
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: Ia7ba2f5729ebb19561768ec87fdb267e79aafb6a
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/334269
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
This commit adds a new basic driver for the Kionix KX022 Accelerometer.
Currently, the driver is capable of reading the sensor data and
manipulating its ODR, resolution, and range.
This sensor also has integrated support for Directional
Tap/Double-Tap(TM), however that functionality is not yet implemented in
the driver.
Lastly, since this accelerometer is very similar to the previous KXCJ9,
this commit tries to combine the drivers.
Note, the variant of the Kionix accelerometer MUST be specified in the
private data structure.
BUG=chrome-os-partner:43494
BRANCH=None
TEST=Build GLaDOS EC with driver enabled and verify that valid
accelerometer data is read, and that range, resolution, and odr can all
be modified.
TEST=Build samus EC image and verify that the lid still
works. Additionally, verify that I can change the odr, rate, and
resolution.
TEST=make buildall tests
Change-Id: I238ff1dc13f5342a93f8f701a0da85c52f25d214
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/299013
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
|