Skip to content

Commit 03a1f18

Browse files
CharlesWu465CL Wang
authored andcommitted
rtc: atcrtc100: Add driver for atcrtc100 RTC (torvalds#201)
RTC driver for atcrtc100 Real-Time Clock. Signed-off-by: CL Wang <[email protected]> Co-authored-by: CL Wang <[email protected]> Reviewed-on: https://gitea.andestech.com/RD-SW/linux/pulls/201 Reviewed-by: randolph <[email protected]> Reviewed-by: Tim Shih-Ting OuYang <[email protected]>
1 parent 607132d commit 03a1f18

File tree

7 files changed

+603
-0
lines changed

7 files changed

+603
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/andestech,atcrtc100.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Andes ATCRTC100 Real-Time Clock
8+
9+
maintainers:
10+
- CL Wang <[email protected]>
11+
12+
allOf:
13+
- $ref: rtc.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- andestech,atcrtc100
19+
20+
reg:
21+
maxItems: 1
22+
23+
interrupts:
24+
minItems: 1
25+
items:
26+
- description: Periodic timekeeping interrupt
27+
- description: RTC alarm interrupt
28+
29+
wakeup-source: true
30+
31+
required:
32+
- compatible
33+
- reg
34+
- interrupts
35+
36+
unevaluatedProperties: false
37+
38+
examples:
39+
- |
40+
rtc@f0300000 {
41+
compatible = "andestech,atcrtc100";
42+
reg = <0xf0300000 0x100>;
43+
interrupts = <1>, <2>;
44+
wakeup-source;
45+
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3539,6 +3539,12 @@ F: drivers/power/reset/atc260x-poweroff.c
35393539
F: drivers/regulator/atc260x-regulator.c
35403540
F: include/linux/mfd/atc260x/*
35413541

3542+
ATCRTC100 RTC DRIVER
3543+
M: CL Wang <[email protected]>
3544+
S: Supported
3545+
F: Documentation/devicetree/bindings/rtc/andestech,atcrtc100.yaml
3546+
F: drivers/rtc/rtc-atcrtc100
3547+
35423548
ATHEROS 71XX/9XXX GPIO DRIVER
35433549
M: Alban Bedel <[email protected]>
35443550
S: Maintained

arch/riscv/configs/andes-support.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ CONFIG_FB_FTLCDC100=y
2929
CONFIG_PANEL_AUA036QN01=y
3030
CONFIG_FFB_MODE_RGB=y
3131
CONFIG_FFB_MODE_16BPP=y
32+
33+
CONFIG_RTC_DRV_ATCRTC100=y

arch/riscv/configs/andes_defconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@ CONFIG_SND_VERBOSE_PROCFS=y
199199
CONFIG_SND_DRIVERS=y
200200
CONFIG_SND_HDA_PREALLOC_SIZE=64
201201

202+
CONFIG_RTC_LIB=y
203+
CONFIG_RTC_CLASS=y
204+
CONFIG_RTC_HCTOSYS=y
205+
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
206+
CONFIG_RTC_SYSTOHC=y
207+
CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
208+
CONFIG_RTC_NVMEM=y
209+
CONFIG_RTC_INTF_SYSFS=y
210+
CONFIG_RTC_INTF_PROC=y
211+
CONFIG_RTC_INTF_DEV=y
212+
202213
CONFIG_ZSMALLOC=y
203214
CONFIG_ZRAM=y
204215
CONFIG_CRYPTO_LZO=y

drivers/rtc/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,20 @@ config RTC_DRV_ALPHA
10291029
Direct support for the real-time clock found on every Alpha
10301030
system, specifically MC146818 compatibles. If in doubt, say Y.
10311031

1032+
config RTC_DRV_ATCRTC100
1033+
tristate "Andes ATCRTC100"
1034+
depends on RISCV
1035+
help
1036+
If you say yes here you will get support for the Andes ATCRTC100
1037+
RTC driver.
1038+
1039+
This driver provides support for the Andes ATCRTC100 real-time clock
1040+
device. It allows setting and retrieving the time and date, as well
1041+
as setting alarms.
1042+
1043+
To compile this driver as a module, choose M here: the module will
1044+
be called rtc-atcrtc100.
1045+
10321046
config RTC_DRV_DS1216
10331047
tristate "Dallas DS1216"
10341048
depends on SNI_RM

drivers/rtc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ obj-$(CONFIG_RTC_DRV_ASM9260) += rtc-asm9260.o
3232
obj-$(CONFIG_RTC_DRV_ASPEED) += rtc-aspeed.o
3333
obj-$(CONFIG_RTC_DRV_AT91RM9200)+= rtc-at91rm9200.o
3434
obj-$(CONFIG_RTC_DRV_AT91SAM9) += rtc-at91sam9.o
35+
obj-$(CONFIG_RTC_DRV_ATCRTC100) += rtc-atcrtc100.o
3536
obj-$(CONFIG_RTC_DRV_AU1XXX) += rtc-au1xxx.o
3637
obj-$(CONFIG_RTC_DRV_BBNSM) += rtc-nxp-bbnsm.o
3738
obj-$(CONFIG_RTC_DRV_BD70528) += rtc-bd70528.o

0 commit comments

Comments
 (0)