Lines Matching refs:spi

85 	struct spi_device	*spi;  member
157 err = spi_write_then_read(ds1305->spi, buf, sizeof(buf), NULL, 0); in ds1305_alarm_irq_enable()
180 status = spi_write_then_read(ds1305->spi, &addr, sizeof(addr), in ds1305_get_time()
231 return spi_write_then_read(ds1305->spi, buf, sizeof(buf), in ds1305_set_time()
269 struct spi_device *spi = ds1305->spi; in ds1305_get_alarm() local
280 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1305_get_alarm()
290 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1305_get_alarm()
321 struct spi_device *spi = ds1305->spi; in ds1305_set_alarm() local
348 status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); in ds1305_set_alarm()
364 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); in ds1305_set_alarm()
374 status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); in ds1305_set_alarm()
438 struct spi_device *spi = ds1305->spi; in ds1305_work() local
456 status = spi_write_then_read(spi, buf, sizeof(buf), in ds1305_work()
459 dev_dbg(&spi->dev, "clear irq --> %d\n", status); in ds1305_work()
464 enable_irq(spi->irq); in ds1305_work()
511 struct spi_device *spi = ds1305->spi; in ds1305_nvram_read() local
519 return spi_sync(spi, &m); in ds1305_nvram_read()
526 struct spi_device *spi = ds1305->spi; in ds1305_nvram_write() local
534 return spi_sync(spi, &m); in ds1305_nvram_write()
543 static int ds1305_probe(struct spi_device *spi) in ds1305_probe() argument
548 struct ds1305_platform_data *pdata = dev_get_platdata(&spi->dev); in ds1305_probe()
563 if ((spi->bits_per_word && spi->bits_per_word != 8) in ds1305_probe()
564 || (spi->max_speed_hz > 2000000) in ds1305_probe()
565 || !(spi->mode & SPI_CPHA)) in ds1305_probe()
569 ds1305 = devm_kzalloc(&spi->dev, sizeof(*ds1305), GFP_KERNEL); in ds1305_probe()
572 ds1305->spi = spi; in ds1305_probe()
573 spi_set_drvdata(spi, ds1305); in ds1305_probe()
577 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1305_probe()
580 dev_dbg(&spi->dev, "can't %s, %d\n", in ds1305_probe()
585 dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "read", ds1305->ctrl); in ds1305_probe()
593 dev_dbg(&spi->dev, "RTC chip is not present\n"); in ds1305_probe()
597 dev_dbg(&spi->dev, "chip may not be present\n"); in ds1305_probe()
609 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); in ds1305_probe()
611 dev_dbg(&spi->dev, "clear WP --> %d\n", status); in ds1305_probe()
622 dev_warn(&spi->dev, "SET TIME!\n"); in ds1305_probe()
663 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); in ds1305_probe()
665 dev_dbg(&spi->dev, "can't %s, %d\n", in ds1305_probe()
670 dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "write", ds1305->ctrl); in ds1305_probe()
675 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1305_probe()
678 dev_dbg(&spi->dev, "read HOUR --> %d\n", status); in ds1305_probe()
684 dev_dbg(&spi->dev, "AM/PM\n"); in ds1305_probe()
687 ds1305->rtc = devm_rtc_allocate_device(&spi->dev); in ds1305_probe()
709 if (spi->irq) { in ds1305_probe()
711 status = devm_request_irq(&spi->dev, spi->irq, ds1305_irq, in ds1305_probe()
714 dev_err(&spi->dev, "request_irq %d --> %d\n", in ds1305_probe()
715 spi->irq, status); in ds1305_probe()
717 device_set_wakeup_capable(&spi->dev, 1); in ds1305_probe()
724 static void ds1305_remove(struct spi_device *spi) in ds1305_remove() argument
726 struct ds1305 *ds1305 = spi_get_drvdata(spi); in ds1305_remove()
729 if (spi->irq) { in ds1305_remove()
731 devm_free_irq(&spi->dev, spi->irq, ds1305); in ds1305_remove()