Lines Matching refs:spi

44 	struct spi_device	*spi = dev_get_drvdata(dev);  in ds1302_rtc_set_time()  local
54 status = spi_write_then_read(spi, buf, 2, in ds1302_rtc_set_time()
73 return spi_write_then_read(spi, buf, sizeof(buf), in ds1302_rtc_set_time()
79 struct spi_device *spi = dev_get_drvdata(dev); in ds1302_rtc_get_time() local
87 status = spi_write_then_read(spi, &addr, sizeof(addr), in ds1302_rtc_get_time()
109 static int ds1302_probe(struct spi_device *spi) in ds1302_probe() argument
121 if (spi->bits_per_word && (spi->bits_per_word != 8)) { in ds1302_probe()
122 dev_err(&spi->dev, "bad word length\n"); in ds1302_probe()
124 } else if (spi->max_speed_hz > 2000000) { in ds1302_probe()
125 dev_err(&spi->dev, "speed is too high\n"); in ds1302_probe()
127 } else if (spi->mode & SPI_CPHA) { in ds1302_probe()
128 dev_err(&spi->dev, "bad mode\n"); in ds1302_probe()
133 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
135 dev_err(&spi->dev, "control register read error %d\n", in ds1302_probe()
141 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
143 dev_err(&spi->dev, "control register read error %d\n", in ds1302_probe()
149 dev_err(&spi->dev, "junk in control register\n"); in ds1302_probe()
158 status = spi_write_then_read(spi, buf, 2, NULL, 0); in ds1302_probe()
160 dev_err(&spi->dev, "control register write error %d\n", in ds1302_probe()
166 status = spi_write_then_read(spi, &addr, sizeof(addr), buf, 1); in ds1302_probe()
168 dev_err(&spi->dev, in ds1302_probe()
175 dev_err(&spi->dev, "failed to detect chip\n"); in ds1302_probe()
180 spi_set_drvdata(spi, spi); in ds1302_probe()
182 rtc = devm_rtc_device_register(&spi->dev, "ds1302", in ds1302_probe()
186 dev_err(&spi->dev, "error %d registering rtc\n", status); in ds1302_probe()
193 static int ds1302_remove(struct spi_device *spi) in ds1302_remove() argument
195 spi_set_drvdata(spi, NULL); in ds1302_remove()