platform/chrome: wilco_ec: Add RTC driver
authorNick Crews <ncrews@chromium.org>
Sat, 9 Feb 2019 00:37:19 +0000 (17:37 -0700)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Thu, 21 Feb 2019 20:36:53 +0000 (21:36 +0100)
commit0d2f2a3da1f2a9ebeb66bb03073dd149fccf1bdd
tree1fb3c4114555aae7a7831adff13aa3f0ffd3f782
parentb787bb126cbcd73754bcbc055ae9f804ac576e4a
platform/chrome: wilco_ec: Add RTC driver

This Embedded Controller has an internal RTC that is exposed
as a standard RTC class driver with read/write functionality.

The driver is added to the drivers/rtc/ so that the maintainer of that
directory will be able to comment on this change, as that maintainer is
the expert on this system. In addition, the driver code is called
indirectly after a corresponding device is registered from core.c,
as opposed to core.c registering the driver callbacks directly.

To test:
> hwclock --show --rtc /dev/rtc1
2007-12-31 16:01:20.460959-08:00
> hwclock --systohc --rtc /dev/rtc1
> hwclock --show --rtc /dev/rtc1
2018-11-29 17:08:00.780793-08:00

> hwclock --show --rtc /dev/rtc1
2007-12-31 16:01:20.460959-08:00
> hwclock --systohc --rtc /dev/rtc1
> hwclock --show --rtc /dev/rtc1
2018-11-29 17:08:00.780793-08:00

Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Nick Crews <ncrews@chromium.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[Fix the sparse warning: symbol 'wilco_ec_rtc_read/write' was not declared]
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/wilco_ec/core.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-wilco-ec.c [new file with mode: 0644]
include/linux/platform_data/wilco-ec.h