]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: abx80x: handle autocalibration
authorMylène Josserand <mylene.josserand@free-electrons.com>
Mon, 21 Mar 2016 17:06:09 +0000 (18:06 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Fri, 25 Mar 2016 01:41:13 +0000 (02:41 +0100)
commit558c59e366c35710d639dd97408bd50ca3415294
tree1e05f7f7883155af28e9bc43b76cefcd0f8a083a
parentdb1e772200c29708dcbb2b9a7ab0ffca04993c4d
rtc: abx80x: handle autocalibration

The autocalibration is separated in two bits to set in Oscillator
Control register (0x1c) :
 - OSEL bit to select the oscillator type (XT or RC).
 - ACAL bit to select the autocalibration type.

These functionnalities are exported in sysfs entries : "oscillator"
and "autocalibration". Respectively, the values are "xtal" for XT
oscillator and "rc" for RC oscillator and 0 to disable the
autocalibration cycle, 512 for a 512 seconds autocalibration cycle
and 1024 for a cycle of 1024 seconds.

Examples :
Set to XT Oscillator
echo xtal > /sys/class/rtc/rtc0/device/oscillator
Activate an autocalibration every 512 seconds
echo 512 > /sys/class/rtc/rtc0/device/autocalibration

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-abx80x.c