Symbol: ds1305
drivers/rtc/rtc-ds1305.c
141
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
146
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
149
if (ds1305->ctrl[0] & DS1305_AEI0)
drivers/rtc/rtc-ds1305.c
157
err = spi_write_then_read(ds1305->spi, buf, sizeof(buf), NULL, 0);
drivers/rtc/rtc-ds1305.c
159
ds1305->ctrl[0] = buf[1];
drivers/rtc/rtc-ds1305.c
172
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
180
status = spi_write_then_read(ds1305->spi, &addr, sizeof(addr),
drivers/rtc/rtc-ds1305.c
207
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
222
*bp++ = hour2bcd(ds1305->hr12, time->tm_hour);
drivers/rtc/rtc-ds1305.c
231
return spi_write_then_read(ds1305->spi, buf, sizeof(buf),
drivers/rtc/rtc-ds1305.c
268
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
269
struct spi_device *spi = ds1305->spi;
drivers/rtc/rtc-ds1305.c
281
ds1305->ctrl, sizeof(ds1305->ctrl));
drivers/rtc/rtc-ds1305.c
285
alm->enabled = !!(ds1305->ctrl[0] & DS1305_AEI0);
drivers/rtc/rtc-ds1305.c
286
alm->pending = !!(ds1305->ctrl[1] & DS1305_AEI0);
drivers/rtc/rtc-ds1305.c
320
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
321
struct spi_device *spi = ds1305->spi;
drivers/rtc/rtc-ds1305.c
339
if ((later - now) > ds1305->rtc->alarm_offset_max)
drivers/rtc/rtc-ds1305.c
343
if (ds1305->ctrl[0] & DS1305_AEI0) {
drivers/rtc/rtc-ds1305.c
344
ds1305->ctrl[0] &= ~DS1305_AEI0;
drivers/rtc/rtc-ds1305.c
347
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
348
status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0);
drivers/rtc/rtc-ds1305.c
357
buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour);
drivers/rtc/rtc-ds1305.c
370
ds1305->ctrl[0] |= DS1305_AEI0;
drivers/rtc/rtc-ds1305.c
373
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
374
status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0);
drivers/rtc/rtc-ds1305.c
384
struct ds1305 *ds1305 = dev_get_drvdata(dev);
drivers/rtc/rtc-ds1305.c
389
if ((ds1305->ctrl[2] & 0xf0) == DS1305_TRICKLE_MAGIC) {
drivers/rtc/rtc-ds1305.c
390
switch (ds1305->ctrl[2] & 0x0c) {
drivers/rtc/rtc-ds1305.c
400
switch (ds1305->ctrl[2] & 0x03) {
drivers/rtc/rtc-ds1305.c
437
struct ds1305 *ds1305 = container_of(work, struct ds1305, work);
drivers/rtc/rtc-ds1305.c
438
struct spi_device *spi = ds1305->spi;
drivers/rtc/rtc-ds1305.c
443
rtc_lock(ds1305->rtc);
drivers/rtc/rtc-ds1305.c
449
ds1305->ctrl[0] &= ~(DS1305_AEI1 | DS1305_AEI0);
drivers/rtc/rtc-ds1305.c
450
ds1305->ctrl[1] = 0;
drivers/rtc/rtc-ds1305.c
453
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
461
rtc_unlock(ds1305->rtc);
drivers/rtc/rtc-ds1305.c
463
if (!test_bit(FLAG_EXITING, &ds1305->flags))
drivers/rtc/rtc-ds1305.c
466
rtc_update_irq(ds1305->rtc, 1, RTC_AF | RTC_IRQF);
drivers/rtc/rtc-ds1305.c
476
struct ds1305 *ds1305 = p;
drivers/rtc/rtc-ds1305.c
479
schedule_work(&ds1305->work);
drivers/rtc/rtc-ds1305.c
510
struct ds1305 *ds1305 = priv;
drivers/rtc/rtc-ds1305.c
511
struct spi_device *spi = ds1305->spi;
drivers/rtc/rtc-ds1305.c
525
struct ds1305 *ds1305 = priv;
drivers/rtc/rtc-ds1305.c
526
struct spi_device *spi = ds1305->spi;
drivers/rtc/rtc-ds1305.c
545
struct ds1305 *ds1305;
drivers/rtc/rtc-ds1305.c
569
ds1305 = devm_kzalloc(&spi->dev, sizeof(*ds1305), GFP_KERNEL);
drivers/rtc/rtc-ds1305.c
570
if (!ds1305)
drivers/rtc/rtc-ds1305.c
572
ds1305->spi = spi;
drivers/rtc/rtc-ds1305.c
573
spi_set_drvdata(spi, ds1305);
drivers/rtc/rtc-ds1305.c
578
ds1305->ctrl, sizeof(ds1305->ctrl));
drivers/rtc/rtc-ds1305.c
585
dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "read", ds1305->ctrl);
drivers/rtc/rtc-ds1305.c
592
if ((ds1305->ctrl[0] & 0x38) != 0 || (ds1305->ctrl[1] & 0xfc) != 0) {
drivers/rtc/rtc-ds1305.c
596
if (ds1305->ctrl[2] == 0)
drivers/rtc/rtc-ds1305.c
602
if (ds1305->ctrl[0] & DS1305_WP) {
drivers/rtc/rtc-ds1305.c
605
ds1305->ctrl[0] &= ~DS1305_WP;
drivers/rtc/rtc-ds1305.c
608
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
619
if (ds1305->ctrl[0] & DS1305_nEOSC) {
drivers/rtc/rtc-ds1305.c
620
ds1305->ctrl[0] &= ~DS1305_nEOSC;
drivers/rtc/rtc-ds1305.c
626
if (ds1305->ctrl[1]) {
drivers/rtc/rtc-ds1305.c
627
ds1305->ctrl[1] = 0;
drivers/rtc/rtc-ds1305.c
634
if (((ds1305->ctrl[2] & 0xf0) != DS1305_TRICKLE_MAGIC)) {
drivers/rtc/rtc-ds1305.c
635
ds1305->ctrl[2] = DS1305_TRICKLE_MAGIC
drivers/rtc/rtc-ds1305.c
643
if (!(ds1305->ctrl[0] & DS1306_1HZ)) {
drivers/rtc/rtc-ds1305.c
644
ds1305->ctrl[0] |= DS1306_1HZ;
drivers/rtc/rtc-ds1305.c
648
if (ds1305->ctrl[0] & DS1306_1HZ) {
drivers/rtc/rtc-ds1305.c
649
ds1305->ctrl[0] &= ~DS1306_1HZ;
drivers/rtc/rtc-ds1305.c
660
buf[1] = ds1305->ctrl[0];
drivers/rtc/rtc-ds1305.c
661
buf[2] = ds1305->ctrl[1];
drivers/rtc/rtc-ds1305.c
662
buf[3] = ds1305->ctrl[2];
drivers/rtc/rtc-ds1305.c
670
dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "write", ds1305->ctrl);
drivers/rtc/rtc-ds1305.c
682
ds1305->hr12 = (DS1305_HR_12 & value) != 0;
drivers/rtc/rtc-ds1305.c
683
if (ds1305->hr12)
drivers/rtc/rtc-ds1305.c
687
ds1305->rtc = devm_rtc_allocate_device(&spi->dev);
drivers/rtc/rtc-ds1305.c
688
if (IS_ERR(ds1305->rtc))
drivers/rtc/rtc-ds1305.c
689
return PTR_ERR(ds1305->rtc);
drivers/rtc/rtc-ds1305.c
691
ds1305->rtc->ops = &ds1305_ops;
drivers/rtc/rtc-ds1305.c
692
ds1305->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
drivers/rtc/rtc-ds1305.c
693
ds1305->rtc->range_max = RTC_TIMESTAMP_END_2099;
drivers/rtc/rtc-ds1305.c
694
ds1305->rtc->alarm_offset_max = 24 * 60 * 60;
drivers/rtc/rtc-ds1305.c
696
ds1305_nvmem_cfg.priv = ds1305;
drivers/rtc/rtc-ds1305.c
697
status = devm_rtc_register_device(ds1305->rtc);
drivers/rtc/rtc-ds1305.c
701
devm_rtc_nvmem_register(ds1305->rtc, &ds1305_nvmem_cfg);
drivers/rtc/rtc-ds1305.c
710
INIT_WORK(&ds1305->work, ds1305_work);
drivers/rtc/rtc-ds1305.c
712
0, dev_name(&ds1305->rtc->dev), ds1305);
drivers/rtc/rtc-ds1305.c
726
struct ds1305 *ds1305 = spi_get_drvdata(spi);
drivers/rtc/rtc-ds1305.c
730
set_bit(FLAG_EXITING, &ds1305->flags);
drivers/rtc/rtc-ds1305.c
731
devm_free_irq(&spi->dev, spi->irq, ds1305);
drivers/rtc/rtc-ds1305.c
732
cancel_work_sync(&ds1305->work);