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