ds1305 141 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 146 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 149 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[0] & DS1305_AEI0) ds1305 157 drivers/rtc/rtc-ds1305.c err = spi_write_then_read(ds1305->spi, buf, sizeof(buf), NULL, 0); ds1305 159 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] = buf[1]; ds1305 172 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 180 drivers/rtc/rtc-ds1305.c status = spi_write_then_read(ds1305->spi, &addr, sizeof(addr), ds1305 207 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 222 drivers/rtc/rtc-ds1305.c *bp++ = hour2bcd(ds1305->hr12, time->tm_hour); ds1305 231 drivers/rtc/rtc-ds1305.c return spi_write_then_read(ds1305->spi, buf, sizeof(buf), ds1305 268 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 269 drivers/rtc/rtc-ds1305.c struct spi_device *spi = ds1305->spi; ds1305 281 drivers/rtc/rtc-ds1305.c ds1305->ctrl, sizeof(ds1305->ctrl)); ds1305 285 drivers/rtc/rtc-ds1305.c alm->enabled = !!(ds1305->ctrl[0] & DS1305_AEI0); ds1305 286 drivers/rtc/rtc-ds1305.c alm->pending = !!(ds1305->ctrl[1] & DS1305_AEI0); ds1305 320 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 321 drivers/rtc/rtc-ds1305.c struct spi_device *spi = ds1305->spi; ds1305 347 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[0] & DS1305_AEI0) { ds1305 348 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] &= ~DS1305_AEI0; ds1305 351 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 352 drivers/rtc/rtc-ds1305.c status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); ds1305 361 drivers/rtc/rtc-ds1305.c buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour); ds1305 374 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] |= DS1305_AEI0; ds1305 377 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 378 drivers/rtc/rtc-ds1305.c status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); ds1305 388 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = dev_get_drvdata(dev); ds1305 393 drivers/rtc/rtc-ds1305.c if ((ds1305->ctrl[2] & 0xf0) == DS1305_TRICKLE_MAGIC) { ds1305 394 drivers/rtc/rtc-ds1305.c switch (ds1305->ctrl[2] & 0x0c) { ds1305 404 drivers/rtc/rtc-ds1305.c switch (ds1305->ctrl[2] & 0x03) { ds1305 441 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = container_of(work, struct ds1305, work); ds1305 442 drivers/rtc/rtc-ds1305.c struct mutex *lock = &ds1305->rtc->ops_lock; ds1305 443 drivers/rtc/rtc-ds1305.c struct spi_device *spi = ds1305->spi; ds1305 454 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] &= ~(DS1305_AEI1 | DS1305_AEI0); ds1305 455 drivers/rtc/rtc-ds1305.c ds1305->ctrl[1] = 0; ds1305 458 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 468 drivers/rtc/rtc-ds1305.c if (!test_bit(FLAG_EXITING, &ds1305->flags)) ds1305 471 drivers/rtc/rtc-ds1305.c rtc_update_irq(ds1305->rtc, 1, RTC_AF | RTC_IRQF); ds1305 481 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = p; ds1305 484 drivers/rtc/rtc-ds1305.c schedule_work(&ds1305->work); ds1305 515 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = priv; ds1305 516 drivers/rtc/rtc-ds1305.c struct spi_device *spi = ds1305->spi; ds1305 530 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = priv; ds1305 531 drivers/rtc/rtc-ds1305.c struct spi_device *spi = ds1305->spi; ds1305 550 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305; ds1305 574 drivers/rtc/rtc-ds1305.c ds1305 = devm_kzalloc(&spi->dev, sizeof(*ds1305), GFP_KERNEL); ds1305 575 drivers/rtc/rtc-ds1305.c if (!ds1305) ds1305 577 drivers/rtc/rtc-ds1305.c ds1305->spi = spi; ds1305 578 drivers/rtc/rtc-ds1305.c spi_set_drvdata(spi, ds1305); ds1305 583 drivers/rtc/rtc-ds1305.c ds1305->ctrl, sizeof(ds1305->ctrl)); ds1305 590 drivers/rtc/rtc-ds1305.c dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "read", ds1305->ctrl); ds1305 597 drivers/rtc/rtc-ds1305.c if ((ds1305->ctrl[0] & 0x38) != 0 || (ds1305->ctrl[1] & 0xfc) != 0) { ds1305 601 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[2] == 0) ds1305 607 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[0] & DS1305_WP) { ds1305 610 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] &= ~DS1305_WP; ds1305 613 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 624 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[0] & DS1305_nEOSC) { ds1305 625 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] &= ~DS1305_nEOSC; ds1305 631 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[1]) { ds1305 632 drivers/rtc/rtc-ds1305.c ds1305->ctrl[1] = 0; ds1305 639 drivers/rtc/rtc-ds1305.c if (((ds1305->ctrl[2] & 0xf0) != DS1305_TRICKLE_MAGIC)) { ds1305 640 drivers/rtc/rtc-ds1305.c ds1305->ctrl[2] = DS1305_TRICKLE_MAGIC ds1305 648 drivers/rtc/rtc-ds1305.c if (!(ds1305->ctrl[0] & DS1306_1HZ)) { ds1305 649 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] |= DS1306_1HZ; ds1305 653 drivers/rtc/rtc-ds1305.c if (ds1305->ctrl[0] & DS1306_1HZ) { ds1305 654 drivers/rtc/rtc-ds1305.c ds1305->ctrl[0] &= ~DS1306_1HZ; ds1305 665 drivers/rtc/rtc-ds1305.c buf[1] = ds1305->ctrl[0]; ds1305 666 drivers/rtc/rtc-ds1305.c buf[2] = ds1305->ctrl[1]; ds1305 667 drivers/rtc/rtc-ds1305.c buf[3] = ds1305->ctrl[2]; ds1305 675 drivers/rtc/rtc-ds1305.c dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "write", ds1305->ctrl); ds1305 687 drivers/rtc/rtc-ds1305.c ds1305->hr12 = (DS1305_HR_12 & value) != 0; ds1305 688 drivers/rtc/rtc-ds1305.c if (ds1305->hr12) ds1305 692 drivers/rtc/rtc-ds1305.c ds1305->rtc = devm_rtc_allocate_device(&spi->dev); ds1305 693 drivers/rtc/rtc-ds1305.c if (IS_ERR(ds1305->rtc)) ds1305 694 drivers/rtc/rtc-ds1305.c return PTR_ERR(ds1305->rtc); ds1305 696 drivers/rtc/rtc-ds1305.c ds1305->rtc->ops = &ds1305_ops; ds1305 698 drivers/rtc/rtc-ds1305.c ds1305_nvmem_cfg.priv = ds1305; ds1305 699 drivers/rtc/rtc-ds1305.c ds1305->rtc->nvram_old_abi = true; ds1305 700 drivers/rtc/rtc-ds1305.c status = rtc_register_device(ds1305->rtc); ds1305 704 drivers/rtc/rtc-ds1305.c rtc_nvmem_register(ds1305->rtc, &ds1305_nvmem_cfg); ds1305 713 drivers/rtc/rtc-ds1305.c INIT_WORK(&ds1305->work, ds1305_work); ds1305 715 drivers/rtc/rtc-ds1305.c 0, dev_name(&ds1305->rtc->dev), ds1305); ds1305 729 drivers/rtc/rtc-ds1305.c struct ds1305 *ds1305 = spi_get_drvdata(spi); ds1305 733 drivers/rtc/rtc-ds1305.c set_bit(FLAG_EXITING, &ds1305->flags); ds1305 734 drivers/rtc/rtc-ds1305.c devm_free_irq(&spi->dev, spi->irq, ds1305); ds1305 735 drivers/rtc/rtc-ds1305.c cancel_work_sync(&ds1305->work);