Lines Matching defs:spi
12 #include <linux/spi/spi.h>
31 struct spi_device *spi = to_spi_device(dev);
53 return spi_write(spi, buf, 8);
58 struct spi_device *spi = to_spi_device(dev);
63 ret = spi_w8r8(spi, M41T94_REG_HT);
69 spi_write(spi, buf, 2);
73 ret = spi_w8r8(spi, M41T94_REG_SECONDS);
79 spi_write(spi, buf, 2);
82 tm->tm_sec = bcd2bin(spi_w8r8(spi, M41T94_REG_SECONDS));
83 tm->tm_min = bcd2bin(spi_w8r8(spi, M41T94_REG_MINUTES));
84 hour = spi_w8r8(spi, M41T94_REG_HOURS);
86 tm->tm_wday = bcd2bin(spi_w8r8(spi, M41T94_REG_WDAY)) - 1;
87 tm->tm_mday = bcd2bin(spi_w8r8(spi, M41T94_REG_DAY));
88 tm->tm_mon = bcd2bin(spi_w8r8(spi, M41T94_REG_MONTH)) - 1;
89 tm->tm_year = bcd2bin(spi_w8r8(spi, M41T94_REG_YEAR));
109 static int m41t94_probe(struct spi_device *spi)
114 spi->bits_per_word = 8;
115 spi_setup(spi);
117 res = spi_w8r8(spi, M41T94_REG_SECONDS);
119 dev_err(&spi->dev, "not found.\n");
123 rtc = devm_rtc_device_register(&spi->dev, m41t94_driver.driver.name,
128 spi_set_drvdata(spi, rtc);
145 MODULE_ALIAS("spi:rtc-m41t94");