/drivers/rtc/ |
D | interface.c | 94 static int rtc_read_alarm_internal(struct rtc_device *rtc, struct rtc_wkalrm *alarm) in rtc_read_alarm_internal() argument 107 alarm->enabled = 0; in rtc_read_alarm_internal() 108 alarm->pending = 0; in rtc_read_alarm_internal() 109 alarm->time.tm_sec = -1; in rtc_read_alarm_internal() 110 alarm->time.tm_min = -1; in rtc_read_alarm_internal() 111 alarm->time.tm_hour = -1; in rtc_read_alarm_internal() 112 alarm->time.tm_mday = -1; in rtc_read_alarm_internal() 113 alarm->time.tm_mon = -1; in rtc_read_alarm_internal() 114 alarm->time.tm_year = -1; in rtc_read_alarm_internal() 115 alarm->time.tm_wday = -1; in rtc_read_alarm_internal() [all …]
|
D | rtc-dev.c | 225 struct rtc_wkalrm alarm; in rtc_dev_ioctl() local 273 err = rtc_read_alarm(rtc, &alarm); in rtc_dev_ioctl() 277 if (copy_to_user(uarg, &alarm.time, sizeof(tm))) in rtc_dev_ioctl() 284 if (copy_from_user(&alarm.time, uarg, sizeof(tm))) in rtc_dev_ioctl() 287 alarm.enabled = 0; in rtc_dev_ioctl() 288 alarm.pending = 0; in rtc_dev_ioctl() 289 alarm.time.tm_wday = -1; in rtc_dev_ioctl() 290 alarm.time.tm_yday = -1; in rtc_dev_ioctl() 291 alarm.time.tm_isdst = -1; in rtc_dev_ioctl() 314 alarm.time.tm_mday = tm.tm_mday; in rtc_dev_ioctl() [all …]
|
D | rtc-mpc5121.c | 201 static int mpc5121_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mpc5121_rtc_read_alarm() argument 206 *alarm = rtc->wkalarm; in mpc5121_rtc_read_alarm() 208 alarm->pending = in_8(®s->alm_status); in mpc5121_rtc_read_alarm() 213 static int mpc5121_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mpc5121_rtc_set_alarm() argument 221 if (alarm->time.tm_sec) { in mpc5121_rtc_set_alarm() 222 alarm->time.tm_sec = 0; in mpc5121_rtc_set_alarm() 223 alarm->time.tm_min++; in mpc5121_rtc_set_alarm() 224 if (alarm->time.tm_min >= 60) { in mpc5121_rtc_set_alarm() 225 alarm->time.tm_min = 0; in mpc5121_rtc_set_alarm() 226 alarm->time.tm_hour++; in mpc5121_rtc_set_alarm() [all …]
|
D | rtc-lp8788.c | 62 enum lp8788_alarm_sel alarm; member 167 static int lp8788_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in lp8788_read_alarm() argument 171 struct rtc_time *tm = &alarm->time; in lp8788_read_alarm() 175 addr = addr_alarm_sec[rtc->alarm]; in lp8788_read_alarm() 187 alarm->enabled = data[LPTIME_WDAY] & LP8788_ALM_EN_M; in lp8788_read_alarm() 192 static int lp8788_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in lp8788_set_alarm() argument 196 struct rtc_time *tm = &alarm->time; in lp8788_set_alarm() 215 addr = addr_alarm_sec[rtc->alarm] + i; in lp8788_set_alarm() 221 alarm->enabled = 1; in lp8788_set_alarm() 222 addr = addr_alarm_en[rtc->alarm]; in lp8788_set_alarm() [all …]
|
D | rtc-tegra.c | 173 static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in tegra_rtc_read_alarm() argument 183 alarm->enabled = 0; in tegra_rtc_read_alarm() 186 alarm->enabled = 1; in tegra_rtc_read_alarm() 187 rtc_time_to_tm(sec, &alarm->time); in tegra_rtc_read_alarm() 191 alarm->pending = (tmp & TEGRA_RTC_INTR_STATUS_SEC_ALARM0) != 0; in tegra_rtc_read_alarm() 219 static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in tegra_rtc_set_alarm() argument 224 if (alarm->enabled) in tegra_rtc_set_alarm() 225 rtc_tm_to_time(&alarm->time, &sec); in tegra_rtc_set_alarm() 240 alarm->time.tm_mon+1, in tegra_rtc_set_alarm() 241 alarm->time.tm_mday, in tegra_rtc_set_alarm() [all …]
|
D | rtc-pl031.c | 196 static int pl031_stv2_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_stv2_read_alarm() argument 202 readl(ldata->base + RTC_YMR), &alarm->time); in pl031_stv2_read_alarm() 204 alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; in pl031_stv2_read_alarm() 205 alarm->enabled = readl(ldata->base + RTC_IMSC) & RTC_BIT_AI; in pl031_stv2_read_alarm() 210 static int pl031_stv2_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_stv2_set_alarm() argument 218 ret = rtc_valid_tm(&alarm->time); in pl031_stv2_set_alarm() 220 ret = pl031_stv2_tm_to_time(dev, &alarm->time, in pl031_stv2_set_alarm() 226 pl031_alarm_irq_enable(dev, alarm->enabled); in pl031_stv2_set_alarm() 274 static int pl031_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pl031_read_alarm() argument 278 rtc_time_to_tm(readl(ldata->base + RTC_MR), &alarm->time); in pl031_read_alarm() [all …]
|
D | rtc-pm8xxx.c | 206 static int pm8xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pm8xxx_rtc_set_alarm() argument 215 rtc_tm_to_time(&alarm->time, &secs); in pm8xxx_rtc_set_alarm() 235 if (alarm->enabled) in pm8xxx_rtc_set_alarm() 247 alarm->time.tm_hour, alarm->time.tm_min, in pm8xxx_rtc_set_alarm() 248 alarm->time.tm_sec, alarm->time.tm_mday, in pm8xxx_rtc_set_alarm() 249 alarm->time.tm_mon, alarm->time.tm_year); in pm8xxx_rtc_set_alarm() 255 static int pm8xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in pm8xxx_rtc_read_alarm() argument 272 rtc_time_to_tm(secs, &alarm->time); in pm8xxx_rtc_read_alarm() 274 rc = rtc_valid_tm(&alarm->time); in pm8xxx_rtc_read_alarm() 281 alarm->time.tm_hour, alarm->time.tm_min, in pm8xxx_rtc_read_alarm() [all …]
|
D | rtc-ab3100.c | 112 static int ab3100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab3100_rtc_read_alarm() argument 126 alarm->enabled = 1; in ab3100_rtc_read_alarm() 128 alarm->enabled = 0; in ab3100_rtc_read_alarm() 130 alarm->pending = 0; in ab3100_rtc_read_alarm() 140 rtc_time64_to_tm(time, &alarm->time); in ab3100_rtc_read_alarm() 142 return rtc_valid_tm(&alarm->time); in ab3100_rtc_read_alarm() 145 static int ab3100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab3100_rtc_set_alarm() argument 154 secs = rtc_tm_to_time64(&alarm->time); in ab3100_rtc_set_alarm() 171 alarm->enabled << 2); in ab3100_rtc_set_alarm()
|
D | rtc-ab8500.c | 183 static int ab8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab8500_rtc_read_alarm() argument 197 alarm->enabled = 1; in ab8500_rtc_read_alarm() 199 alarm->enabled = 0; in ab8500_rtc_read_alarm() 201 alarm->pending = 0; in ab8500_rtc_read_alarm() 217 rtc_time_to_tm(secs, &alarm->time); in ab8500_rtc_read_alarm() 219 return rtc_valid_tm(&alarm->time); in ab8500_rtc_read_alarm() 229 static int ab8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ab8500_rtc_set_alarm() argument 236 if (alarm->time.tm_year < (AB8500_RTC_EPOCH - 1900)) { in ab8500_rtc_set_alarm() 243 rtc_tm_to_time(&alarm->time, &secs); in ab8500_rtc_set_alarm() 277 return ab8500_rtc_irq_enable(dev, alarm->enabled); in ab8500_rtc_set_alarm() [all …]
|
D | rtc-sysfs.c | 134 unsigned long alarm; in wakealarm_show() local 147 rtc_tm_to_time(&alm.time, &alarm); in wakealarm_show() 148 retval = sprintf(buf, "%lu\n", alarm); in wakealarm_show() 159 unsigned long now, alarm; in wakealarm_store() local 183 retval = kstrtoul(buf_ptr, 0, &alarm); in wakealarm_store() 187 alarm += now; in wakealarm_store() 189 if (alarm > now || push) { in wakealarm_store() 200 alarm += push; in wakealarm_store() 212 alarm = now + 300; in wakealarm_store() 214 rtc_time_to_tm(alarm, &alm.time); in wakealarm_store()
|
D | rtc-ds3232.c | 178 static int ds3232_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds3232_read_alarm() argument 195 alarm->time.tm_sec = bcd2bin(buf[0] & 0x7F); in ds3232_read_alarm() 196 alarm->time.tm_min = bcd2bin(buf[1] & 0x7F); in ds3232_read_alarm() 197 alarm->time.tm_hour = bcd2bin(buf[2] & 0x7F); in ds3232_read_alarm() 198 alarm->time.tm_mday = bcd2bin(buf[3] & 0x7F); in ds3232_read_alarm() 200 alarm->enabled = !!(control & DS3232_REG_CR_A1IE); in ds3232_read_alarm() 201 alarm->pending = !!(stat & DS3232_REG_SR_A1F); in ds3232_read_alarm() 212 static int ds3232_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds3232_set_alarm() argument 222 buf[0] = bin2bcd(alarm->time.tm_sec); in ds3232_set_alarm() 223 buf[1] = bin2bcd(alarm->time.tm_min); in ds3232_set_alarm() [all …]
|
D | rtc-ab-b5ze-s3.c | 326 struct rtc_wkalrm *alarm) in _abb5zes3_rtc_read_timer() argument 329 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_timer() 374 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL2_WTAIE); in _abb5zes3_rtc_read_timer() 382 struct rtc_wkalrm *alarm) in _abb5zes3_rtc_read_alarm() argument 385 struct rtc_time rtc_tm, *alarm_tm = &alarm->time; in _abb5zes3_rtc_read_alarm() 441 alarm->enabled = !!(reg & ABB5ZES3_REG_CTRL1_AIE); in _abb5zes3_rtc_read_alarm() 456 static int abb5zes3_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in abb5zes3_rtc_read_alarm() argument 463 ret = _abb5zes3_rtc_read_timer(dev, alarm); in abb5zes3_rtc_read_alarm() 465 ret = _abb5zes3_rtc_read_alarm(dev, alarm); in abb5zes3_rtc_read_alarm() 476 static int _abb5zes3_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in _abb5zes3_rtc_set_alarm() argument [all …]
|
D | rtc-digicolor.c | 116 static int dc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in dc_rtc_read_alarm() argument 125 rtc_time64_to_tm(reference + alarm_reg, &alarm->time); in dc_rtc_read_alarm() 131 alarm->pending = alarm_reg + reference > now; in dc_rtc_read_alarm() 132 alarm->enabled = readl_relaxed(rtc->regs + DC_RTC_INTENABLE); in dc_rtc_read_alarm() 137 static int dc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in dc_rtc_set_alarm() argument 143 alarm_time = rtc_tm_to_time64(&alarm->time); in dc_rtc_set_alarm() 148 writeb_relaxed(!!alarm->enabled, rtc->regs + DC_RTC_INTENABLE); in dc_rtc_set_alarm()
|
D | rtc-mc13xxx.c | 157 static int mc13xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mc13xxx_rtc_read_alarm() argument 188 alarm->enabled = enabled; in mc13xxx_rtc_read_alarm() 189 alarm->pending = pending; in mc13xxx_rtc_read_alarm() 193 rtc_time64_to_tm(s1970, &alarm->time); in mc13xxx_rtc_read_alarm() 199 static int mc13xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in mc13xxx_rtc_set_alarm() argument 217 s1970 = rtc_tm_to_time64(&alarm->time); in mc13xxx_rtc_set_alarm() 219 dev_dbg(dev, "%s: %s %lld\n", __func__, alarm->enabled ? "on" : "off", in mc13xxx_rtc_set_alarm() 222 ret = mc13xxx_rtc_irq_enable_unlocked(dev, alarm->enabled, in mc13xxx_rtc_set_alarm()
|
D | rtc-coh901331.c | 102 static int coh901331_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in coh901331_read_alarm() argument 107 rtc_time_to_tm(readl(rtap->virtbase + COH901331_ALARM), &alarm->time); in coh901331_read_alarm() 108 alarm->pending = readl(rtap->virtbase + COH901331_IRQ_EVENT) & 1U; in coh901331_read_alarm() 109 alarm->enabled = readl(rtap->virtbase + COH901331_IRQ_MASK) & 1U; in coh901331_read_alarm() 115 static int coh901331_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in coh901331_set_alarm() argument 120 rtc_tm_to_time(&alarm->time, &time); in coh901331_set_alarm() 123 writel(alarm->enabled, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_set_alarm()
|
D | rtc-ds1343.c | 484 static int ds1343_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds1343_read_alarm() argument 499 alarm->enabled = !!(priv->irqen & RTC_AF); in ds1343_read_alarm() 500 alarm->pending = !!(stat & DS1343_IRQF0); in ds1343_read_alarm() 502 alarm->time.tm_sec = priv->alarm_sec < 0 ? 0 : priv->alarm_sec; in ds1343_read_alarm() 503 alarm->time.tm_min = priv->alarm_min < 0 ? 0 : priv->alarm_min; in ds1343_read_alarm() 504 alarm->time.tm_hour = priv->alarm_hour < 0 ? 0 : priv->alarm_hour; in ds1343_read_alarm() 505 alarm->time.tm_mday = priv->alarm_mday < 0 ? 0 : priv->alarm_mday; in ds1343_read_alarm() 512 static int ds1343_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) in ds1343_set_alarm() argument 522 priv->alarm_sec = alarm->time.tm_sec; in ds1343_set_alarm() 523 priv->alarm_min = alarm->time.tm_min; in ds1343_set_alarm() [all …]
|
D | rtc-at91sam9.c | 141 u32 offset, alarm, mr; in at91_rtc_settime() local 165 alarm = rtt_readl(rtc, AR); in at91_rtc_settime() 166 if (alarm != ALARM_DISABLED) { in at91_rtc_settime() 169 alarm += (offset - secs); in at91_rtc_settime() 170 } else if ((alarm + offset) > secs) { in at91_rtc_settime() 172 alarm -= (secs - offset); in at91_rtc_settime() 175 alarm = ALARM_DISABLED; in at91_rtc_settime() 178 rtt_writel(rtc, AR, alarm); in at91_rtc_settime() 191 u32 alarm = rtt_readl(rtc, AR); in at91_rtc_readalarm() local 199 if (alarm != ALARM_DISABLED && offset != 0) { in at91_rtc_readalarm() [all …]
|
D | rtc-vt8500.c | 156 u32 isr, alarm; in vt8500_rtc_read_alarm() local 158 alarm = readl(vt8500_rtc->regbase + VT8500_RTC_AS); in vt8500_rtc_read_alarm() 161 alrm->time.tm_mday = bcd2bin((alarm & ALARM_DAY_MASK) >> ALARM_DAY_S); in vt8500_rtc_read_alarm() 162 alrm->time.tm_hour = bcd2bin((alarm & TIME_HOUR_MASK) >> TIME_HOUR_S); in vt8500_rtc_read_alarm() 163 alrm->time.tm_min = bcd2bin((alarm & TIME_MIN_MASK) >> TIME_MIN_S); in vt8500_rtc_read_alarm() 164 alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK)); in vt8500_rtc_read_alarm() 166 alrm->enabled = (alarm & ALARM_ENABLE_MASK) ? 1 : 0; in vt8500_rtc_read_alarm()
|
/drivers/gpu/drm/nouveau/nvkm/subdev/timer/ |
D | base.c | 35 struct nvkm_alarm *alarm, *atemp; in nvkm_timer_alarm_trigger() local 41 list_for_each_entry_safe(alarm, atemp, &tmr->alarms, head) { in nvkm_timer_alarm_trigger() 43 if (alarm->timestamp > nvkm_timer_read(tmr)) { in nvkm_timer_alarm_trigger() 45 tmr->func->alarm_init(tmr, alarm->timestamp); in nvkm_timer_alarm_trigger() 46 if (alarm->timestamp > nvkm_timer_read(tmr)) in nvkm_timer_alarm_trigger() 53 list_del_init(&alarm->head); in nvkm_timer_alarm_trigger() 54 list_add(&alarm->exec, &exec); in nvkm_timer_alarm_trigger() 63 list_for_each_entry_safe(alarm, atemp, &exec, exec) { in nvkm_timer_alarm_trigger() 64 list_del(&alarm->exec); in nvkm_timer_alarm_trigger() 65 alarm->func(alarm); in nvkm_timer_alarm_trigger() [all …]
|
/drivers/hwmon/ |
D | gpio-fan.c | 54 struct gpio_fan_alarm *alarm; member 84 struct gpio_fan_alarm *alarm = fan_data->alarm; in show_fan_alarm() local 85 int value = gpio_get_value_cansleep(alarm->gpio); in show_fan_alarm() 87 if (alarm->active_low) in show_fan_alarm() 96 struct gpio_fan_alarm *alarm) in fan_alarm_init() argument 102 fan_data->alarm = alarm; in fan_alarm_init() 104 err = devm_gpio_request(&pdev->dev, alarm->gpio, "GPIO fan alarm"); in fan_alarm_init() 108 err = gpio_direction_input(alarm->gpio); in fan_alarm_init() 116 alarm_irq = gpio_to_irq(alarm->gpio); in fan_alarm_init() 331 if (index == 0 && !data->alarm) in gpio_fan_is_visible() [all …]
|
/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/ |
D | gk20a.c | 41 struct nvkm_alarm alarm; member 118 gk20a_pmu_dvfs_work(struct nvkm_alarm *alarm) in gk20a_pmu_dvfs_work() argument 121 container_of(alarm, struct gk20a_pmu, alarm); in gk20a_pmu_dvfs_work() 166 nvkm_timer_alarm(tmr, 100000000, alarm); in gk20a_pmu_dvfs_work() 173 nvkm_timer_alarm_cancel(subdev->device->timer, &pmu->alarm); in gk20a_pmu_fini() 194 nvkm_timer_alarm(device->timer, 2000000000, &pmu->alarm); in gk20a_pmu_init() 225 nvkm_alarm_init(&pmu->alarm, gk20a_pmu_dvfs_work); in gk20a_pmu_new()
|
/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()
|
D | fan.c | 98 nvkm_timer_alarm(tmr, delay * 1000 * 1000, &fan->alarm); in nvkm_fan_update() 105 nvkm_fan_alarm(struct nvkm_alarm *alarm) in nvkm_fan_alarm() argument 107 struct nvkm_fan *fan = container_of(alarm, struct nvkm_fan, alarm); in nvkm_fan_alarm() 218 nvkm_timer_alarm_cancel(tmr, &therm->fan->alarm); in nvkm_therm_fan_fini() 266 nvkm_alarm_init(&therm->fan->alarm, nvkm_fan_alarm); in nvkm_therm_fan_ctor()
|
/drivers/hwmon/pmbus/ |
D | pmbus_core.c | 959 const char *alarm; /* Alarm attribute name */ member 1010 l->alarm, index, in pmbus_add_limit_attrs() 1104 .alarm = "min_alarm", 1109 .alarm = "lcrit_alarm", 1114 .alarm = "max_alarm", 1119 .alarm = "crit_alarm", 1143 .alarm = "min_alarm", 1148 .alarm = "lcrit_alarm", 1153 .alarm = "max_alarm", 1158 .alarm = "crit_alarm", [all …]
|
/drivers/iio/adc/ |
D | xilinx-xadc-core.c | 231 static unsigned int xadc_zynq_transform_alarm(unsigned int alarm) in xadc_zynq_transform_alarm() argument 233 return ((alarm & 0x80) >> 4) | in xadc_zynq_transform_alarm() 234 ((alarm & 0x78) << 1) | in xadc_zynq_transform_alarm() 235 (alarm & 0x07); in xadc_zynq_transform_alarm() 399 static void xadc_zynq_update_alarm(struct xadc *xadc, unsigned int alarm) in xadc_zynq_update_alarm() argument 405 alarm = ((alarm & 0x08) << 4) | ((alarm & 0xf0) >> 1) | (alarm & 0x07); in xadc_zynq_update_alarm() 411 xadc_write_reg(xadc, XADC_ZYNQ_REG_INTSTS, status & alarm); in xadc_zynq_update_alarm() 414 ~alarm & XADC_ZYNQ_INT_ALARM_MASK); in xadc_zynq_update_alarm() 493 static void xadc_axi_update_alarm(struct xadc *xadc, unsigned int alarm) in xadc_axi_update_alarm() argument 504 alarm = ((alarm & 0x07) << 1) | ((alarm & 0x08) >> 3) | in xadc_axi_update_alarm() [all …]
|