Lines Matching full:spi
3 * Driver for Dallas Semiconductor (DS3234) SPI RTC with Integrated Crystal
19 #include <linux/spi/spi.h>
37 struct spi_device *spi = to_spi_device(dev); in ds3234_set_reg() local
44 return spi_write_then_read(spi, buf, 2, NULL, 0); in ds3234_set_reg()
50 struct spi_device *spi = to_spi_device(dev); in ds3234_get_reg() local
54 return spi_write_then_read(spi, data, 1, data, 1); in ds3234_get_reg()
61 struct spi_device *spi = to_spi_device(dev); in ds3234_read_time() local
65 err = spi_write_then_read(spi, buf, 1, buf, 8); in ds3234_read_time()
108 static int __devinit ds3234_probe(struct spi_device *spi) in ds3234_probe() argument
114 spi->mode = SPI_MODE_3; in ds3234_probe()
115 spi->bits_per_word = 8; in ds3234_probe()
116 spi_setup(spi); in ds3234_probe()
118 res = ds3234_get_reg(&spi->dev, DS3234_REG_SECONDS, &tmp); in ds3234_probe()
136 ds3234_get_reg(&spi->dev, DS3234_REG_CONTROL, &tmp); in ds3234_probe()
137 ds3234_set_reg(&spi->dev, DS3234_REG_CONTROL, tmp & 0x1c); in ds3234_probe()
139 ds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp); in ds3234_probe()
140 ds3234_set_reg(&spi->dev, DS3234_REG_CONT_STAT, tmp & 0x88); in ds3234_probe()
143 ds3234_get_reg(&spi->dev, DS3234_REG_CONTROL, &tmp); in ds3234_probe()
144 dev_info(&spi->dev, "Control Reg: 0x%02x\n", tmp); in ds3234_probe()
146 ds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp); in ds3234_probe()
147 dev_info(&spi->dev, "Ctrl/Stat Reg: 0x%02x\n", tmp); in ds3234_probe()
150 &spi->dev, &ds3234_rtc_ops, THIS_MODULE); in ds3234_probe()
154 dev_set_drvdata(&spi->dev, rtc); in ds3234_probe()
159 static int __devexit ds3234_remove(struct spi_device *spi) in ds3234_remove() argument
161 struct rtc_device *rtc = spi_get_drvdata(spi); in ds3234_remove()
188 MODULE_DESCRIPTION("DS3234 SPI RTC driver");
191 MODULE_ALIAS("spi:ds3234");