Commit 3c2b9075 authored by Wolfgang Grandegger's avatar Wolfgang Grandegger Committed by Linus Torvalds

rtc: add stand-alone driver for RX8025 chip

Add support for the Epson RX-8025SA/NB RTC chips.  It includes support for
alarms, periodic interrupts (1 Hz) and clock precision adjustment.

For clock precision adjustment, the SYSFS file "clock_adjust_ppb" gets
created in "/sys/class/rtc/rtcX/device".  It permits to set and get the
clock adjustment in ppb (parts per billion), e.g.:

  # echo -183000 > /sys/class/rtc/rtc0/device/clock_adjust_ppb
  # cat /sys/class/rtc/rtc0/device/clock_adjust_ppb
  -183000

This allows to compensate temperature dependent clock drifts.  According
to the RX8025 SA/NB application manual the frequency and temperature
characteristics can be approximated using the following equation:

  df = a * (ut - t)**2

  df: Frequency deviation in any temperature
  a : Coefficient = (-35 +-5) * 10**-9
  ut: Ultimate temperature in degree = +25 +-5 degree
  t : Any temperature in degree
Signed-off-by: default avatarWolfgang Grandegger <wg@grandegger.com>
Signed-off-by: default avatarSergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: default avatarYuri Tikhonov <yur@emcraft.com>
Signed-off-by: default avatarDmitry Rakhchev <rda@emcraft.com>
Signed-off-by: default avatarMatthias Fuchs <matthias.fuchs@esd.eu>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 97f902b7
...@@ -296,6 +296,15 @@ config RTC_DRV_RX8581 ...@@ -296,6 +296,15 @@ config RTC_DRV_RX8581
This driver can also be built as a module. If so the module This driver can also be built as a module. If so the module
will be called rtc-rx8581. will be called rtc-rx8581.
config RTC_DRV_RX8025
tristate "Epson RX-8025SA/NB"
help
If you say yes here you get support for the Epson
RX-8025SA/NB RTC chips.
This driver can also be built as a module. If so, the module
will be called rtc-rx8025.
endif # I2C endif # I2C
comment "SPI RTC drivers" comment "SPI RTC drivers"
......
...@@ -62,6 +62,7 @@ obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o ...@@ -62,6 +62,7 @@ obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o
obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o
obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o
obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o
obj-$(CONFIG_RTC_DRV_RX8025) += rtc-rx8025.o
obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o
obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o
obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment