| /kernel/linux/linux-5.10/drivers/rtc/ |
| D | Makefile | 3 # Makefile for RTC class/drivers. 10 obj-$(CONFIG_RTC_CLASS) += rtc-core.o 11 obj-$(CONFIG_RTC_MC146818_LIB) += rtc-mc146818-lib.o 12 rtc-core-y := class.o interface.o 14 rtc-core-$(CONFIG_RTC_NVMEM) += nvmem.o 15 rtc-core-$(CONFIG_RTC_INTF_DEV) += dev.o 16 rtc-core-$(CONFIG_RTC_INTF_PROC) += proc.o 17 rtc-core-$(CONFIG_RTC_INTF_SYSFS) += sysfs.o 21 obj-$(CONFIG_RTC_DRV_88PM80X) += rtc-88pm80x.o 22 obj-$(CONFIG_RTC_DRV_88PM860X) += rtc-88pm860x.o [all …]
|
| D | class.c | 3 * RTC subsystem, base class 15 #include <linux/rtc.h> 21 #include "rtc-core.h" 28 struct rtc_device *rtc = to_rtc_device(dev); in rtc_device_release() local 30 ida_simple_remove(&rtc_ida, rtc->id); in rtc_device_release() 31 kfree(rtc); in rtc_device_release() 35 /* Result of the last RTC to system clock attempt. */ 38 /* IMPORTANT: the RTC only stores whole seconds. It is arbitrary 42 * in an rtc sync function, to read both xtime.tv_sec and 49 static void rtc_hctosys(struct rtc_device *rtc) in rtc_hctosys() argument [all …]
|
| D | rtc-ds1685.c | 3 * An rtc driver for the Dallas/Maxim DS1685/DS1687 and related real-time 13 * Application Note 90, Using the Multiplex Bus RTC Extended Features. 23 #include <linux/rtc.h> 26 #include <linux/rtc/ds1685.h> 40 * ds1685_read - read a value from an rtc register. 41 * @rtc: pointer to the ds1685 rtc structure. 45 ds1685_read(struct ds1685_priv *rtc, int reg) in ds1685_read() argument 47 return readb((u8 __iomem *)rtc->regs + in ds1685_read() 48 (reg * rtc->regstep)); in ds1685_read() 52 * ds1685_write - write a value to an rtc register. [all …]
|
| D | rtc-omap.c | 8 * Copyright (C) 2006 David Brownell (new RTC framework) 27 #include <linux/rtc.h> 30 * The OMAP RTC is a year/month/day/hours/minutes/seconds BCD clock 38 * RTC_OFF_NOFF used as the reset signal (so the RTC won't be reset), 39 * and wiring RTC_WAKE_INT (so the RTC alarm can wake the system from 44 /* RTC registers */ 136 void (*lock)(struct omap_rtc *rtc); 137 void (*unlock)(struct omap_rtc *rtc); 141 struct rtc_device *rtc; member 154 static inline u8 rtc_read(struct omap_rtc *rtc, unsigned int reg) in rtc_read() argument [all …]
|
| D | interface.c | 3 * RTC subsystem, interface functions 11 #include <linux/rtc.h> 18 #include <trace/events/rtc.h> 20 static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer); 21 static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer); 23 static void rtc_add_offset(struct rtc_device *rtc, struct rtc_time *tm) in rtc_add_offset() argument 27 if (!rtc->offset_secs) in rtc_add_offset() 33 * Since the reading time values from RTC device are always in the RTC in rtc_add_offset() 38 if ((rtc->start_secs > rtc->range_min && secs >= rtc->start_secs) || in rtc_add_offset() 39 (rtc->start_secs < rtc->range_min && in rtc_add_offset() [all …]
|
| D | rtc-sh.c | 3 * SuperH On-Chip RTC Support 9 * Based on the old arch/sh/kernel/cpu/rtc.c by: 18 #include <linux/rtc.h> 29 #include <asm/rtc.h> 31 /* Default values for RZ/A RTC */ 38 #define DRV_NAME "sh-rtc" 44 #define RSECCNT RTC_REG(1) /* RTC sec */ 45 #define RMINCNT RTC_REG(2) /* RTC min */ 46 #define RHRCNT RTC_REG(3) /* RTC hour */ 47 #define RWKCNT RTC_REG(4) /* RTC week */ [all …]
|
| D | rtc-lpc32xx.c | 11 #include <linux/rtc.h> 51 struct rtc_device *rtc; member 58 struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); in lpc32xx_rtc_read_time() local 60 elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); in lpc32xx_rtc_read_time() 68 struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); in lpc32xx_rtc_set_time() local 72 spin_lock_irq(&rtc->lock); in lpc32xx_rtc_set_time() 74 /* RTC must be disabled during count update */ in lpc32xx_rtc_set_time() 75 tmp = rtc_readl(rtc, LPC32XX_RTC_CTRL); in lpc32xx_rtc_set_time() 76 rtc_writel(rtc, LPC32XX_RTC_CTRL, tmp | LPC32XX_RTC_CTRL_CNTR_DIS); in lpc32xx_rtc_set_time() 77 rtc_writel(rtc, LPC32XX_RTC_UCOUNT, secs); in lpc32xx_rtc_set_time() [all …]
|
| D | Kconfig | 3 # RTC class/drivers configuration 19 Generic RTC class support. If you say yes here, you will 26 bool "Set system time from RTC on startup and resume" 30 the value read from a specified RTC device. This is useful to avoid 34 string "RTC used to set the system time" 38 The RTC device that will be used to (re)initialize the system 50 sleep states. Do not specify an RTC here unless it stays powered 54 bool "Set the RTC time based on NTP synchronization" 58 in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 62 string "RTC used to synchronize NTP adjustment" [all …]
|
| D | rtc-sc27xx.c | 14 #include <linux/rtc.h> 104 struct rtc_device *rtc; member 113 * The Spreadtrum RTC controller has 3 groups registers, including time, normal 114 * alarm and auxiliary alarm. The time group registers are used to set RTC time, 126 static int sprd_rtc_clear_alarm_ints(struct sprd_rtc *rtc) in sprd_rtc_clear_alarm_ints() argument 128 return regmap_write(rtc->regmap, rtc->base + SPRD_RTC_INT_CLR, in sprd_rtc_clear_alarm_ints() 132 static int sprd_rtc_lock_alarm(struct sprd_rtc *rtc, bool lock) in sprd_rtc_lock_alarm() argument 137 ret = regmap_read(rtc->regmap, rtc->base + SPRD_RTC_SPG_VALUE, &val); in sprd_rtc_lock_alarm() 147 ret = regmap_write(rtc->regmap, rtc->base + SPRD_RTC_SPG_UPD, val); in sprd_rtc_lock_alarm() 152 ret = regmap_read_poll_timeout(rtc->regmap, in sprd_rtc_lock_alarm() [all …]
|
| D | rtc-armada38x.c | 3 * RTC driver for the Armada 38x Marvell SoCs 16 #include <linux/rtc.h> 86 /* Initialize the RTC-MBUS bridge timing */ 87 void (*update_mbus_timing)(struct armada38x_rtc *rtc); 88 u32 (*read_rtc_reg)(struct armada38x_rtc *rtc, u8 rtc_reg); 89 void (*clear_isr)(struct armada38x_rtc *rtc); 90 void (*unmask_interrupt)(struct armada38x_rtc *rtc); 96 * register write to the RTC hard macro so that the required update 98 * According to errata RES-3124064, Write to any RTC register 99 * may fail. As a workaround, before writing to RTC [all …]
|
| D | dev.c | 3 * RTC subsystem, dev interface 15 #include <linux/rtc.h> 17 #include "rtc-core.h" 25 struct rtc_device *rtc = container_of(inode->i_cdev, in rtc_dev_open() local 28 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) in rtc_dev_open() 31 file->private_data = rtc; in rtc_dev_open() 33 spin_lock_irq(&rtc->irq_lock); in rtc_dev_open() 34 rtc->irq_data = 0; in rtc_dev_open() 35 spin_unlock_irq(&rtc->irq_lock); in rtc_dev_open() 42 * Routine to poll RTC seconds field for change as often as possible, [all …]
|
| D | rtc-at91sam9.c | 7 * Based on rtc-at91rm9200.c by Rick Bronson 20 #include <linux/rtc.h> 38 * The RTC's value is the RTT counter plus that offset. The RTC's alarm 42 * choose from, or a "real" RTC module. All systems have multiple GPBR 43 * registers available, likewise usable for more than "RTC" support. 81 #define rtt_readl(rtc, field) \ argument 82 readl((rtc)->rtt + AT91_RTT_ ## field) 83 #define rtt_writel(rtc, field, val) \ argument 84 writel((val), (rtc)->rtt + AT91_RTT_ ## field) 86 static inline unsigned int gpbr_readl(struct sam9_rtc *rtc) in gpbr_readl() argument [all …]
|
| D | rtc-st-lpc.c | 3 * rtc-st-lpc.c - ST's LPC RTC, powered by the Low Power Timer 23 #include <linux/rtc.h> 52 static void st_rtc_set_hw_alarm(struct st_rtc *rtc, in st_rtc_set_hw_alarm() argument 57 spin_lock_irqsave(&rtc->lock, flags); in st_rtc_set_hw_alarm() 59 writel_relaxed(1, rtc->ioaddr + LPC_WDT_OFF); in st_rtc_set_hw_alarm() 61 writel_relaxed(msb, rtc->ioaddr + LPC_LPA_MSB_OFF); in st_rtc_set_hw_alarm() 62 writel_relaxed(lsb, rtc->ioaddr + LPC_LPA_LSB_OFF); in st_rtc_set_hw_alarm() 63 writel_relaxed(1, rtc->ioaddr + LPC_LPA_START_OFF); in st_rtc_set_hw_alarm() 65 writel_relaxed(0, rtc->ioaddr + LPC_WDT_OFF); in st_rtc_set_hw_alarm() 67 spin_unlock_irqrestore(&rtc->lock, flags); in st_rtc_set_hw_alarm() [all …]
|
| D | rtc-lpc24xx.c | 3 * RTC driver for NXP LPC178x/18xx/43xx Real-Time Clock (RTC) 16 #include <linux/rtc.h> 18 /* LPC24xx RTC register offsets and bits */ 64 struct rtc_device *rtc; member 71 struct lpc24xx_rtc *rtc = dev_get_drvdata(dev); in lpc24xx_rtc_set_time() local 73 /* Disable RTC during update */ in lpc24xx_rtc_set_time() 74 rtc_writel(rtc, LPC24XX_CCR, LPC178X_CCALEN); in lpc24xx_rtc_set_time() 76 rtc_writel(rtc, LPC24XX_SEC, tm->tm_sec); in lpc24xx_rtc_set_time() 77 rtc_writel(rtc, LPC24XX_MIN, tm->tm_min); in lpc24xx_rtc_set_time() 78 rtc_writel(rtc, LPC24XX_HOUR, tm->tm_hour); in lpc24xx_rtc_set_time() [all …]
|
| /kernel/linux/linux-4.19/drivers/rtc/ |
| D | Makefile | 3 # Makefile for RTC class/drivers. 8 obj-$(CONFIG_RTC_LIB) += rtc-lib.o 11 obj-$(CONFIG_RTC_CLASS) += rtc-core.o 12 obj-$(CONFIG_RTC_MC146818_LIB) += rtc-mc146818-lib.o 13 rtc-core-y := class.o interface.o 16 rtc-core-y += rtc-efi-platform.o 19 rtc-core-$(CONFIG_RTC_NVMEM) += nvmem.o 20 rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o 21 rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o 22 rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o [all …]
|
| D | class.c | 2 * RTC subsystem, base class 18 #include <linux/rtc.h> 24 #include "rtc-core.h" 32 struct rtc_device *rtc = to_rtc_device(dev); in rtc_device_release() local 33 ida_simple_remove(&rtc_ida, rtc->id); in rtc_device_release() 34 kfree(rtc); in rtc_device_release() 38 /* Result of the last RTC to system clock attempt. */ 44 * On suspend(), measure the delta between one RTC and the 53 struct rtc_device *rtc = to_rtc_device(dev); in rtc_suspend() local 61 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) in rtc_suspend() [all …]
|
| D | rtc-omap.c | 7 * Copyright (C) 2006 David Brownell (new RTC framework) 32 #include <linux/rtc.h> 35 * The OMAP RTC is a year/month/day/hours/minutes/seconds BCD clock 43 * RTC_OFF_NOFF used as the reset signal (so the RTC won't be reset), 44 * and wiring RTC_WAKE_INT (so the RTC alarm can wake the system from 49 /* RTC registers */ 141 void (*lock)(struct omap_rtc *rtc); 142 void (*unlock)(struct omap_rtc *rtc); 146 struct rtc_device *rtc; member 159 static inline u8 rtc_read(struct omap_rtc *rtc, unsigned int reg) in rtc_read() argument [all …]
|
| D | interface.c | 2 * RTC subsystem, interface functions 14 #include <linux/rtc.h> 21 #include <trace/events/rtc.h> 23 static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer); 24 static void rtc_timer_remove(struct rtc_device *rtc, struct rtc_timer *timer); 26 static void rtc_add_offset(struct rtc_device *rtc, struct rtc_time *tm) in rtc_add_offset() argument 30 if (!rtc->offset_secs) in rtc_add_offset() 36 * Since the reading time values from RTC device are always in the RTC in rtc_add_offset() 41 if ((rtc->start_secs > rtc->range_min && secs >= rtc->start_secs) || in rtc_add_offset() 42 (rtc->start_secs < rtc->range_min && in rtc_add_offset() [all …]
|
| D | rtc-ds1685.c | 2 * An rtc driver for the Dallas/Maxim DS1685/DS1687 and related real-time 12 * Application Note 90, Using the Multiplex Bus RTC Extended Features. 26 #include <linux/rtc.h> 29 #include <linux/rtc/ds1685.h> 40 * ds1685_read - read a value from an rtc register. 41 * @rtc: pointer to the ds1685 rtc structure. 45 ds1685_read(struct ds1685_priv *rtc, int reg) in ds1685_read() argument 47 return readb((u8 __iomem *)rtc->regs + in ds1685_read() 48 (reg * rtc->regstep)); in ds1685_read() 52 * ds1685_write - write a value to an rtc register. [all …]
|
| D | Kconfig | 2 # RTC class/drivers configuration 18 Generic RTC class support. If you say yes here, you will 25 bool "Set system time from RTC on startup and resume" 29 the value read from a specified RTC device. This is useful to avoid 33 string "RTC used to set the system time" 37 The RTC device that will be used to (re)initialize the system 43 The driver for this RTC device must be loaded before late_initcall 52 sleep states. Do not specify an RTC here unless it stays powered 56 bool "Set the RTC time based on NTP synchronization" 60 in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 [all …]
|
| D | rtc-sh.c | 2 * SuperH On-Chip RTC Support 8 * Based on the old arch/sh/kernel/cpu/rtc.c by: 21 #include <linux/rtc.h> 32 #include <asm/rtc.h> 34 /* Default values for RZ/A RTC */ 41 #define DRV_NAME "sh-rtc" 47 #define RSECCNT RTC_REG(1) /* RTC sec */ 48 #define RMINCNT RTC_REG(2) /* RTC min */ 49 #define RHRCNT RTC_REG(3) /* RTC hour */ 50 #define RWKCNT RTC_REG(4) /* RTC week */ [all …]
|
| D | rtc-dev.c | 2 * RTC subsystem, dev interface 17 #include <linux/rtc.h> 19 #include "rtc-core.h" 27 struct rtc_device *rtc = container_of(inode->i_cdev, in rtc_dev_open() local 30 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) in rtc_dev_open() 33 file->private_data = rtc; in rtc_dev_open() 35 spin_lock_irq(&rtc->irq_lock); in rtc_dev_open() 36 rtc->irq_data = 0; in rtc_dev_open() 37 spin_unlock_irq(&rtc->irq_lock); in rtc_dev_open() 44 * Routine to poll RTC seconds field for change as often as possible, [all …]
|
| D | rtc-armada38x.c | 2 * RTC driver for the Armada 38x Marvell SoCs 21 #include <linux/rtc.h> 91 /* Initialize the RTC-MBUS bridge timing */ 92 void (*update_mbus_timing)(struct armada38x_rtc *rtc); 93 u32 (*read_rtc_reg)(struct armada38x_rtc *rtc, u8 rtc_reg); 94 void (*clear_isr)(struct armada38x_rtc *rtc); 95 void (*unmask_interrupt)(struct armada38x_rtc *rtc); 101 * register write to the RTC hard macro so that the required update 103 * According to errata RES-3124064, Write to any RTC register 104 * may fail. As a workaround, before writing to RTC [all …]
|
| D | rtc-lpc32xx.c | 19 #include <linux/rtc.h> 50 #define RTC_NAME "rtc-lpc32xx" 61 struct rtc_device *rtc; member 68 struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); in lpc32xx_rtc_read_time() local 70 elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); in lpc32xx_rtc_read_time() 78 struct lpc32xx_rtc *rtc = dev_get_drvdata(dev); in lpc32xx_rtc_set_mmss() local 81 spin_lock_irq(&rtc->lock); in lpc32xx_rtc_set_mmss() 83 /* RTC must be disabled during count update */ in lpc32xx_rtc_set_mmss() 84 tmp = rtc_readl(rtc, LPC32XX_RTC_CTRL); in lpc32xx_rtc_set_mmss() 85 rtc_writel(rtc, LPC32XX_RTC_CTRL, tmp | LPC32XX_RTC_CTRL_CNTR_DIS); in lpc32xx_rtc_set_mmss() [all …]
|
| D | rtc-sc27xx.c | 14 #include <linux/rtc.h> 104 struct rtc_device *rtc; member 113 * The Spreadtrum RTC controller has 3 groups registers, including time, normal 114 * alarm and auxiliary alarm. The time group registers are used to set RTC time, 126 static int sprd_rtc_clear_alarm_ints(struct sprd_rtc *rtc) in sprd_rtc_clear_alarm_ints() argument 128 return regmap_write(rtc->regmap, rtc->base + SPRD_RTC_INT_CLR, in sprd_rtc_clear_alarm_ints() 132 static int sprd_rtc_disable_ints(struct sprd_rtc *rtc) in sprd_rtc_disable_ints() argument 136 ret = regmap_update_bits(rtc->regmap, rtc->base + SPRD_RTC_INT_EN, in sprd_rtc_disable_ints() 141 return regmap_write(rtc->regmap, rtc->base + SPRD_RTC_INT_CLR, in sprd_rtc_disable_ints() 145 static int sprd_rtc_lock_alarm(struct sprd_rtc *rtc, bool lock) in sprd_rtc_lock_alarm() argument [all …]
|