Lines Matching defs:spi
22 #include <linux/spi/spi.h>
61 struct spi_device *spi = to_spi_device(dev);
62 struct rs5c348_plat_data *pdata = dev_get_platdata(&spi->dev);
66 ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_CTL2));
72 ret = spi_write_then_read(spi, txbuf, 2, NULL, 0);
100 ret = spi_write_then_read(spi, txbuf, sizeof(txbuf), NULL, 0);
108 struct spi_device *spi = to_spi_device(dev);
109 struct rs5c348_plat_data *pdata = dev_get_platdata(&spi->dev);
113 ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_CTL2));
117 dev_warn(&spi->dev, "voltage-low detected.\n");
119 dev_warn(&spi->dev, "oscillator-stop detected.\n");
131 ret = spi_write_then_read(spi, txbuf, sizeof(txbuf),
164 static int rs5c348_probe(struct spi_device *spi)
170 pdata = devm_kzalloc(&spi->dev, sizeof(struct rs5c348_plat_data),
174 spi->dev.platform_data = pdata;
177 ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_SECS));
179 dev_err(&spi->dev, "not found.\n");
183 dev_info(&spi->dev, "spiclk %u KHz.\n",
184 (spi->max_speed_hz + 500) / 1000);
186 ret = spi_w8r8(spi, RS5C348_CMD_R(RS5C348_REG_CTL1));
192 rtc = devm_rtc_allocate_device(&spi->dev);
215 MODULE_ALIAS("spi:rtc-rs5c348");