Lines Matching refs:spi
51 struct spi_device *spi = to_spi_device(dev); in ds1390_get_reg() local
61 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 1); in ds1390_get_reg()
72 struct spi_device *spi = to_spi_device(dev); in ds1390_read_time() local
80 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 8); in ds1390_read_time()
101 struct spi_device *spi = to_spi_device(dev); in ds1390_set_time() local
116 return spi_write_then_read(spi, chip->txrx_buf, 8, NULL, 0); in ds1390_set_time()
124 static int ds1390_probe(struct spi_device *spi) in ds1390_probe() argument
130 spi->mode = SPI_MODE_3; in ds1390_probe()
131 spi->bits_per_word = 8; in ds1390_probe()
132 spi_setup(spi); in ds1390_probe()
134 chip = devm_kzalloc(&spi->dev, sizeof(*chip), GFP_KERNEL); in ds1390_probe()
138 spi_set_drvdata(spi, chip); in ds1390_probe()
140 res = ds1390_get_reg(&spi->dev, DS1390_REG_SECONDS, &tmp); in ds1390_probe()
142 dev_err(&spi->dev, "unable to read device\n"); in ds1390_probe()
146 chip->rtc = devm_rtc_device_register(&spi->dev, "ds1390", in ds1390_probe()
149 dev_err(&spi->dev, "unable to register device\n"); in ds1390_probe()