summaryrefslogtreecommitdiff
path: root/driver/mag_lis2mdl.c
diff options
context:
space:
mode:
authorRong Chang <rongchang@chromium.org>2019-03-13 17:26:41 +0800
committerCommit Bot <commit-bot@chromium.org>2019-06-22 00:05:04 +0000
commite7024509621ddf9cd64b55bcf2898bf2cb3e3cdb (patch)
tree7c55ae681d23e336c77f76e2af792de9d232262a /driver/mag_lis2mdl.c
parentf5121aa5b762a68e9e2bca3c4c132cb2ffc9cfdb (diff)
downloadchrome-ec-e7024509621ddf9cd64b55bcf2898bf2cb3e3cdb.tar.gz
kukui: scp: calibrate ULPOSC1&2
ULPOSC generates clock for SCP core and peripherals. The calibration process adjust 2 values, div and cali. Both values are positive correlated to OSC frequency. The frequency function is: f(div, cali) = k1 * (div + k2) / R(cali) * C Where: R(cali) = k3 / (1 + k4 * (cali - k4)) The actual frequency is not linear to cali parameter. This change selects the div that generates closest frequency when cali == 32. And then adjust cali to get better output. [drinkcat: This relands e08a71fd0 "kukui: scp: calibrate ULPOSC1&2", with the following modifications: - Replace udelay by udelay_busy as the clock is not yet ready when calibrating - Simplify calibration logic. ] BRANCH=none BUG=b:120176040,b:120169529 TEST=manual check SCP console command: > ulposc ULPOSC1 frequency: 252 MHz ULPOSC2 frequency: 333 MHz Change-Id: I1a6b9d1ad140cd67b1fdecebf14b61cad88b2c4f Signed-off-by: Rong Chang <rongchang@chromium.org> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1655221 Reviewed-by: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'driver/mag_lis2mdl.c')
0 files changed, 0 insertions, 0 deletions