Lines Matching refs:spi

41 	struct spi_device	*spi = dev_get_drvdata(dev);  in ds1302_rtc_set_time()  local
51 status = spi_write_then_read(spi, buf, 2, in ds1302_rtc_set_time()
70 return spi_write_then_read(spi, buf, sizeof(buf), in ds1302_rtc_set_time()
76 struct spi_device *spi = dev_get_drvdata(dev); in ds1302_rtc_get_time() local
84 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1302_rtc_get_time()
106 static int ds1302_probe(struct spi_device *spi) in ds1302_probe() argument
118 if (spi->bits_per_word && (spi->bits_per_word != 8)) { in ds1302_probe()
119 dev_err(&spi->dev, "bad word length\n"); in ds1302_probe()
121 } else if (spi->max_speed_hz > 2000000) { in ds1302_probe()
122 dev_err(&spi->dev, "speed is too high\n"); in ds1302_probe()
124 } else if (spi->mode & SPI_CPHA) { in ds1302_probe()
125 dev_err(&spi->dev, "bad mode\n"); in ds1302_probe()
130 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
132 dev_err(&spi->dev, "control register read error %d\n", in ds1302_probe()
138 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
140 dev_err(&spi->dev, "control register read error %d\n", in ds1302_probe()
146 dev_err(&spi->dev, "junk in control register\n"); in ds1302_probe()
155 status = spi_write_then_read(spi, buf, 2, NULL, 0); in ds1302_probe()
157 dev_err(&spi->dev, "control register write error %d\n", in ds1302_probe()
163 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
165 dev_err(&spi->dev, in ds1302_probe()
172 dev_err(&spi->dev, "failed to detect chip\n"); in ds1302_probe()
177 spi_set_drvdata(spi, spi); in ds1302_probe()
179 rtc = devm_rtc_device_register(&spi->dev, "ds1302", in ds1302_probe()
183 dev_err(&spi->dev, "error %d registering rtc\n", status); in ds1302_probe()
190 static int ds1302_remove(struct spi_device *spi) in ds1302_remove() argument
192 spi_set_drvdata(spi, NULL); in ds1302_remove()