/drivers/rtc/ |
D | interface.c | 179 struct rtc_wkalrm *alarm) in rtc_read_alarm_internal() argument 192 alarm->enabled = 0; in rtc_read_alarm_internal() 193 alarm->pending = 0; in rtc_read_alarm_internal() 194 alarm->time.tm_sec = -1; in rtc_read_alarm_internal() 195 alarm->time.tm_min = -1; in rtc_read_alarm_internal() 196 alarm->time.tm_hour = -1; in rtc_read_alarm_internal() 197 alarm->time.tm_mday = -1; in rtc_read_alarm_internal() 198 alarm->time.tm_mon = -1; in rtc_read_alarm_internal() 199 alarm->time.tm_year = -1; in rtc_read_alarm_internal() 200 alarm->time.tm_wday = -1; in rtc_read_alarm_internal() [all …]
|
D | rtc-test.c | 18 struct timer_list alarm; member 27 time64_t alarm; in test_rtc_read_alarm() local 29 alarm = (rtd->alarm.expires - jiffies) / HZ; in test_rtc_read_alarm() 30 alarm += ktime_get_real_seconds() + rtd->offset; in test_rtc_read_alarm() 32 rtc_time64_to_tm(alarm, &alrm->time); in test_rtc_read_alarm() 47 del_timer(&rtd->alarm); in test_rtc_set_alarm() 53 rtd->alarm.expires = expires; in test_rtc_set_alarm() 56 add_timer(&rtd->alarm); in test_rtc_set_alarm() 87 add_timer(&rtd->alarm); in test_rtc_alarm_irq_enable() 89 del_timer(&rtd->alarm); in test_rtc_alarm_irq_enable() [all …]
|
D | dev.c | 210 struct rtc_wkalrm alarm; in rtc_dev_ioctl() local 260 err = rtc_read_alarm(rtc, &alarm); in rtc_dev_ioctl() 264 if (copy_to_user(uarg, &alarm.time, sizeof(tm))) in rtc_dev_ioctl() 271 if (copy_from_user(&alarm.time, uarg, sizeof(tm))) in rtc_dev_ioctl() 274 alarm.enabled = 0; in rtc_dev_ioctl() 275 alarm.pending = 0; in rtc_dev_ioctl() 276 alarm.time.tm_wday = -1; in rtc_dev_ioctl() 277 alarm.time.tm_yday = -1; in rtc_dev_ioctl() 278 alarm.time.tm_isdst = -1; in rtc_dev_ioctl() 301 alarm.time.tm_mday = tm.tm_mday; in rtc_dev_ioctl() [all …]
|
D | rtc-lp8788.c | 58 enum lp8788_alarm_sel alarm; member 163 static int lp8788_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in lp8788_read_alarm() argument 167 struct rtc_time *tm = &alarm->time; in lp8788_read_alarm() 171 addr = addr_alarm_sec[rtc->alarm]; in lp8788_read_alarm() 183 alarm->enabled = data[LPTIME_WDAY] & LP8788_ALM_EN_M; in lp8788_read_alarm() 188 static int lp8788_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in lp8788_set_alarm() argument 192 struct rtc_time *tm = &alarm->time; in lp8788_set_alarm() 211 addr = addr_alarm_sec[rtc->alarm] + i; in lp8788_set_alarm() 217 alarm->enabled = 1; in lp8788_set_alarm() 218 addr = addr_alarm_en[rtc->alarm]; in lp8788_set_alarm() [all …]
|
D | rtc-pl031.c | 192 static int pl031_stv2_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_stv2_read_alarm() argument 198 readl(ldata->base + RTC_YMR), &alarm->time); in pl031_stv2_read_alarm() 200 alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; in pl031_stv2_read_alarm() 201 alarm->enabled = readl(ldata->base + RTC_IMSC) & RTC_BIT_AI; in pl031_stv2_read_alarm() 206 static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_stv2_set_alarm() argument 213 ret = pl031_stv2_tm_to_time(dev, &alarm->time, in pl031_stv2_set_alarm() 219 pl031_alarm_irq_enable(dev, alarm->enabled); in pl031_stv2_set_alarm() 261 static int pl031_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_read_alarm() argument 265 rtc_time64_to_tm(readl(ldata->base + RTC_MR), &alarm->time); in pl031_read_alarm() 267 alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; in pl031_read_alarm() [all …]
|
D | rtc-ds1343.c | 236 static int ds1343_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds1343_read_alarm() argument 250 alarm->pending = !!(val & DS1343_IRQF0); in ds1343_read_alarm() 255 alarm->enabled = !!(val & DS1343_A0IE); in ds1343_read_alarm() 261 alarm->time.tm_sec = bcd2bin(buf[0]) & 0x7f; in ds1343_read_alarm() 262 alarm->time.tm_min = bcd2bin(buf[1]) & 0x7f; in ds1343_read_alarm() 263 alarm->time.tm_hour = bcd2bin(buf[2]) & 0x3f; in ds1343_read_alarm() 264 alarm->time.tm_mday = bcd2bin(buf[3]) & 0x3f; in ds1343_read_alarm() 269 static int ds1343_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds1343_set_alarm() argument 282 buf[0] = bin2bcd(alarm->time.tm_sec); in ds1343_set_alarm() 283 buf[1] = bin2bcd(alarm->time.tm_min); in ds1343_set_alarm() [all …]
|
D | rtc-r7301.c | 137 bool alarm) in rtc7301_get_time() argument 150 if (alarm) { in rtc7301_get_time() 171 bool alarm) in rtc7301_write_time() argument 188 rtc7301_write(priv, alarm ? RTC7301_AE : tm->tm_wday, in rtc7301_write_time() 191 if (alarm) in rtc7301_write_time() 250 static int rtc7301_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in rtc7301_read_alarm() argument 262 rtc7301_get_time(priv, &alarm->time, true); in rtc7301_read_alarm() 266 alarm->enabled = !!(alrm_ctrl & RTC7301_ALARM_CONTROL_AIE); in rtc7301_read_alarm() 267 alarm->pending = !!(alrm_ctrl & RTC7301_ALARM_CONTROL_AF); in rtc7301_read_alarm() 274 static int rtc7301_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in rtc7301_set_alarm() argument [all …]
|
D | sysfs.c | 130 time64_t alarm; in wakealarm_show() local 143 alarm = rtc_tm_to_time64(&alm.time); in wakealarm_show() 144 retval = sprintf(buf, "%lld\n", alarm); in wakealarm_show() 155 time64_t now, alarm; in wakealarm_store() local 180 retval = kstrtos64(buf_ptr, 0, &alarm); in wakealarm_store() 184 alarm += now; in wakealarm_store() 185 if (alarm > now || push) { in wakealarm_store() 196 alarm += push; in wakealarm_store() 208 alarm = now + 300; in wakealarm_store() 210 rtc_time64_to_tm(alarm, &alm.time); in wakealarm_store()
|
D | rtc-ab-b5ze-s3.c | 298 struct rtc_wkalrm *alarm) in _abb5zes3_rtc_read_timer() argument 301 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_timer() 344 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL2_WTAIE); in _abb5zes3_rtc_read_timer() 351 struct rtc_wkalrm *alarm) in _abb5zes3_rtc_read_alarm() argument 354 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_alarm() 405 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL1_AIE); in _abb5zes3_rtc_read_alarm() 419 static int abb5zes3_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in abb5zes3_rtc_read_alarm() argument 425 ret = _abb5zes3_rtc_read_timer(dev, alarm); in abb5zes3_rtc_read_alarm() 427 ret = _abb5zes3_rtc_read_alarm(dev, alarm); in abb5zes3_rtc_read_alarm() 437 static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in _abb5zes3_rtc_set_alarm() argument [all …]
|
D | rtc-ab-eoz9.c | 208 static int abeoz9_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in abeoz9_rtc_read_alarm() argument 224 alarm->enabled = val[0] & ABEOZ9_REG_CTRL_INT_AIE; in abeoz9_rtc_read_alarm() 225 alarm->pending = val[1] & ABEOZ9_REG_CTRL_INT_FLAG_AF; in abeoz9_rtc_read_alarm() 231 alarm->time.tm_sec = bcd2bin(FIELD_GET(ABEOZ9_BIT_ALARM_SEC, regs[0])); in abeoz9_rtc_read_alarm() 232 alarm->time.tm_min = bcd2bin(FIELD_GET(ABEOZ9_BIT_ALARM_MIN, regs[1])); in abeoz9_rtc_read_alarm() 233 alarm->time.tm_hour = bcd2bin(FIELD_GET(ABEOZ9_BIT_ALARM_HOURS, regs[2])); in abeoz9_rtc_read_alarm() 235 alarm->time.tm_hour += 12; in abeoz9_rtc_read_alarm() 237 alarm->time.tm_mday = bcd2bin(FIELD_GET(ABEOZ9_BIT_ALARM_DAYS, regs[3])); in abeoz9_rtc_read_alarm() 251 static int abeoz9_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in abeoz9_rtc_set_alarm() argument 263 bin2bcd(alarm->time.tm_sec)); in abeoz9_rtc_set_alarm() [all …]
|
D | rtc-mpc5121.c | 196 static int mpc5121_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mpc5121_rtc_read_alarm() argument 201 *alarm = rtc->wkalarm; in mpc5121_rtc_read_alarm() 203 alarm->pending = in_8(®s->alm_status); in mpc5121_rtc_read_alarm() 208 static int mpc5121_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mpc5121_rtc_set_alarm() argument 213 alarm->time.tm_mday = -1; in mpc5121_rtc_set_alarm() 214 alarm->time.tm_mon = -1; in mpc5121_rtc_set_alarm() 215 alarm->time.tm_year = -1; in mpc5121_rtc_set_alarm() 217 out_8(®s->alm_min_set, alarm->time.tm_min); in mpc5121_rtc_set_alarm() 218 out_8(®s->alm_hour_set, alarm->time.tm_hour); in mpc5121_rtc_set_alarm() 220 out_8(®s->alm_enable, alarm->enabled); in mpc5121_rtc_set_alarm() [all …]
|
D | rtc-digicolor.c | 112 static int dc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in dc_rtc_read_alarm() argument 121 rtc_time64_to_tm(reference + alarm_reg, &alarm->time); in dc_rtc_read_alarm() 127 alarm->pending = alarm_reg + reference > now; in dc_rtc_read_alarm() 128 alarm->enabled = readl_relaxed(rtc->regs + DC_RTC_INTENABLE); in dc_rtc_read_alarm() 133 static int dc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in dc_rtc_set_alarm() argument 139 alarm_time = rtc_tm_to_time64(&alarm->time); in dc_rtc_set_alarm() 144 writeb_relaxed(!!alarm->enabled, rtc->regs + DC_RTC_INTENABLE); in dc_rtc_set_alarm()
|
D | rtc-tegra.c | 148 static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in tegra_rtc_read_alarm() argument 157 alarm->enabled = 0; in tegra_rtc_read_alarm() 160 alarm->enabled = 1; in tegra_rtc_read_alarm() 161 rtc_time64_to_tm(sec, &alarm->time); in tegra_rtc_read_alarm() 165 alarm->pending = (value & TEGRA_RTC_INTR_STATUS_SEC_ALARM0) != 0; in tegra_rtc_read_alarm() 193 static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in tegra_rtc_set_alarm() argument 198 if (alarm->enabled) in tegra_rtc_set_alarm() 199 sec = rtc_tm_to_time64(&alarm->time); in tegra_rtc_set_alarm() 211 dev_vdbg(dev, "alarm set as %u, %ptR\n", sec, &alarm->time); in tegra_rtc_set_alarm()
|
D | rtc-at91sam9.c | 133 u32 offset, alarm, mr; in at91_rtc_settime() local 153 alarm = rtt_readl(rtc, AR); in at91_rtc_settime() 154 if (alarm != ALARM_DISABLED) { in at91_rtc_settime() 157 alarm += (offset - secs); in at91_rtc_settime() 158 } else if ((alarm + offset) > secs) { in at91_rtc_settime() 160 alarm -= (secs - offset); in at91_rtc_settime() 163 alarm = ALARM_DISABLED; in at91_rtc_settime() 166 rtt_writel(rtc, AR, alarm); in at91_rtc_settime() 179 u32 alarm = rtt_readl(rtc, AR); in at91_rtc_readalarm() local 187 if (alarm != ALARM_DISABLED) { in at91_rtc_readalarm() [all …]
|
D | rtc-armada38x.c | 83 #define ALARM_REG(base, alarm) ((base) + (alarm) * sizeof(u32)) argument 91 u32 alarm; member 265 u32 reg = ALARM_REG(RTC_ALARM1, rtc->data->alarm); in armada38x_rtc_read_alarm() 266 u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); in armada38x_rtc_read_alarm() 285 u32 reg = ALARM_REG(RTC_ALARM1, rtc->data->alarm); in armada38x_rtc_set_alarm() 286 u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); in armada38x_rtc_set_alarm() 309 u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); in armada38x_rtc_alarm_irq_enable() 329 u32 reg_irq = ALARM_REG(RTC_IRQ1_CONF, rtc->data->alarm); in armada38x_rtc_alarm_irq() 340 rtc_delayed_write(1 << rtc->data->alarm, rtc, RTC_STATUS); in armada38x_rtc_alarm_irq() 466 .alarm = ALARM1, [all …]
|
D | rtc-ds3232.c | 181 static int ds3232_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds3232_read_alarm() argument 198 alarm->time.tm_sec = bcd2bin(buf[0] & 0x7F); in ds3232_read_alarm() 199 alarm->time.tm_min = bcd2bin(buf[1] & 0x7F); in ds3232_read_alarm() 200 alarm->time.tm_hour = bcd2bin(buf[2] & 0x7F); in ds3232_read_alarm() 201 alarm->time.tm_mday = bcd2bin(buf[3] & 0x7F); in ds3232_read_alarm() 203 alarm->enabled = !!(control & DS3232_REG_CR_A1IE); in ds3232_read_alarm() 204 alarm->pending = !!(stat & DS3232_REG_SR_A1F); in ds3232_read_alarm() 215 static int ds3232_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds3232_set_alarm() argument 225 buf[0] = bin2bcd(alarm->time.tm_sec); in ds3232_set_alarm() 226 buf[1] = bin2bcd(alarm->time.tm_min); in ds3232_set_alarm() [all …]
|
D | rtc-ab8500.c | 140 static int ab8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab8500_rtc_read_alarm() argument 154 alarm->enabled = 1; in ab8500_rtc_read_alarm() 156 alarm->enabled = 0; in ab8500_rtc_read_alarm() 158 alarm->pending = 0; in ab8500_rtc_read_alarm() 171 rtc_time64_to_tm(secs, &alarm->time); in ab8500_rtc_read_alarm() 183 static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab8500_rtc_set_alarm() argument 189 mins = (unsigned long)rtc_tm_to_time64(&alarm->time) / 60; in ab8500_rtc_set_alarm() 203 return ab8500_rtc_irq_enable(dev, alarm->enabled); in ab8500_rtc_set_alarm()
|
D | rtc-brcmstb-waketimer.c | 146 struct rtc_wkalrm *alarm) in brcmstb_waketmr_getalarm() argument 155 alarm->enabled = 1; in brcmstb_waketmr_getalarm() 156 rtc_time64_to_tm(sec, &alarm->time); in brcmstb_waketmr_getalarm() 160 alarm->pending = !!(reg & 1); in brcmstb_waketmr_getalarm() 166 struct rtc_wkalrm *alarm) in brcmstb_waketmr_setalarm() argument 171 if (alarm->enabled) in brcmstb_waketmr_setalarm() 172 sec = rtc_tm_to_time64(&alarm->time); in brcmstb_waketmr_setalarm()
|
D | rtc-opal.c | 114 static int opal_get_tpo_time(struct device *dev, struct rtc_wkalrm *alarm) in opal_get_tpo_time() argument 160 opal_to_tm(y_m_d, h_m_s_ms, &alarm->time); in opal_get_tpo_time() 168 static int opal_set_tpo_time(struct device *dev, struct rtc_wkalrm *alarm) in opal_set_tpo_time() argument 176 if (alarm->enabled) { in opal_set_tpo_time() 177 tm_to_opal(&alarm->time, &y_m_d, &h_m_s_ms); in opal_set_tpo_time() 217 struct rtc_wkalrm alarm = { .enabled = 0 }; in opal_tpo_alarm_irq_enable() local 224 return enabled ? 0 : opal_set_tpo_time(dev, &alarm); in opal_tpo_alarm_irq_enable()
|
D | rtc-mc13xxx.c | 155 static int mc13xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mc13xxx_rtc_read_alarm() argument 186 alarm->enabled = enabled; in mc13xxx_rtc_read_alarm() 187 alarm->pending = pending; in mc13xxx_rtc_read_alarm() 191 rtc_time64_to_tm(s1970, &alarm->time); in mc13xxx_rtc_read_alarm() 197 static int mc13xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mc13xxx_rtc_set_alarm() argument 215 s1970 = rtc_tm_to_time64(&alarm->time); in mc13xxx_rtc_set_alarm() 217 dev_dbg(dev, "%s: %s %lld\n", __func__, alarm->enabled ? "on" : "off", in mc13xxx_rtc_set_alarm() 220 ret = mc13xxx_rtc_irq_enable_unlocked(dev, alarm->enabled, in mc13xxx_rtc_set_alarm()
|
/drivers/gpu/drm/nouveau/nvkm/subdev/timer/ |
D | base.c | 71 struct nvkm_alarm *alarm, *atemp; in nvkm_timer_alarm_trigger() local 77 list_for_each_entry_safe(alarm, atemp, &tmr->alarms, head) { in nvkm_timer_alarm_trigger() 79 if (alarm->timestamp > nvkm_timer_read(tmr)) { in nvkm_timer_alarm_trigger() 81 tmr->func->alarm_init(tmr, alarm->timestamp); in nvkm_timer_alarm_trigger() 82 if (alarm->timestamp > nvkm_timer_read(tmr)) in nvkm_timer_alarm_trigger() 89 list_del_init(&alarm->head); in nvkm_timer_alarm_trigger() 90 list_add(&alarm->exec, &exec); in nvkm_timer_alarm_trigger() 99 list_for_each_entry_safe(alarm, atemp, &exec, exec) { in nvkm_timer_alarm_trigger() 100 list_del(&alarm->exec); in nvkm_timer_alarm_trigger() 101 alarm->func(alarm); in nvkm_timer_alarm_trigger() [all …]
|
/drivers/hwmon/ |
D | max6697.c | 423 static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, 22); 424 static SENSOR_DEVICE_ATTR_RO(temp2_max_alarm, alarm, 16); 425 static SENSOR_DEVICE_ATTR_RO(temp3_max_alarm, alarm, 17); 426 static SENSOR_DEVICE_ATTR_RO(temp4_max_alarm, alarm, 18); 427 static SENSOR_DEVICE_ATTR_RO(temp5_max_alarm, alarm, 19); 428 static SENSOR_DEVICE_ATTR_RO(temp6_max_alarm, alarm, 20); 429 static SENSOR_DEVICE_ATTR_RO(temp7_max_alarm, alarm, 21); 430 static SENSOR_DEVICE_ATTR_RO(temp8_max_alarm, alarm, 23); 432 static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, alarm, 14); 433 static SENSOR_DEVICE_ATTR_RO(temp2_crit_alarm, alarm, 8); [all …]
|
D | max6650.c | 115 u8 alarm; member 185 data->alarm |= reg; in max6650_update_device() 302 bool alarm; in alarm_show() local 307 alarm = data->alarm & attr->index; in alarm_show() 308 if (alarm) { in alarm_show() 310 data->alarm &= ~attr->index; in alarm_show() 315 return sprintf(buf, "%d\n", alarm); in alarm_show() 318 static SENSOR_DEVICE_ATTR_RO(gpio1_alarm, alarm, MAX6650_ALRM_GPIO1); 319 static SENSOR_DEVICE_ATTR_RO(gpio2_alarm, alarm, MAX6650_ALRM_GPIO2); 579 *val = !!(data->alarm & MAX6650_ALRM_MIN); in max6650_read() [all …]
|
/drivers/gpu/drm/nouveau/nvkm/subdev/therm/ |
D | fantog.c | 31 struct nvkm_alarm alarm; member 60 nvkm_timer_alarm(tmr, next_change * 1000, &fan->alarm); in nvkm_fantog_update() 66 nvkm_fantog_alarm(struct nvkm_alarm *alarm) in nvkm_fantog_alarm() argument 69 container_of(alarm, struct nvkm_fantog, alarm); in nvkm_fantog_alarm() 110 nvkm_alarm_init(&fan->alarm, nvkm_fantog_alarm); in nvkm_fantog_create()
|
/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/ |
D | gk20a.c | 41 struct nvkm_alarm alarm; member 114 gk20a_pmu_dvfs_work(struct nvkm_alarm *alarm) in gk20a_pmu_dvfs_work() argument 117 container_of(alarm, struct gk20a_pmu, alarm); in gk20a_pmu_dvfs_work() 154 nvkm_timer_alarm(tmr, 100000000, alarm); in gk20a_pmu_dvfs_work() 161 nvkm_timer_alarm(pmu->subdev.device->timer, 0, &gpmu->alarm); in gk20a_pmu_fini() 186 nvkm_timer_alarm(device->timer, 2000000000, &gpmu->alarm); in gk20a_pmu_init() 228 nvkm_alarm_init(&pmu->alarm, gk20a_pmu_dvfs_work); in gk20a_pmu_new()
|