• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/rtc/

Lines Matching defs:chip

12  * and write the RTC. The extra features provided by the chip family
52 struct ds1390 *chip = dev_get_drvdata(dev);
59 chip->txrx_buf[0] = address & 0x7f;
61 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 1);
65 *data = chip->txrx_buf[1];
73 struct ds1390 *chip = dev_get_drvdata(dev);
77 chip->txrx_buf[0] = DS1390_REG_SECONDS;
80 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 8);
84 /* The chip sends data in this order:
86 dt->tm_sec = bcd2bin(chip->txrx_buf[0]);
87 dt->tm_min = bcd2bin(chip->txrx_buf[1]);
88 dt->tm_hour = bcd2bin(chip->txrx_buf[2]);
89 dt->tm_wday = bcd2bin(chip->txrx_buf[3]);
90 dt->tm_mday = bcd2bin(chip->txrx_buf[4]);
92 dt->tm_mon = bcd2bin(chip->txrx_buf[5] & 0x7f) - 1;
94 dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0);
102 struct ds1390 *chip = dev_get_drvdata(dev);
105 chip->txrx_buf[0] = DS1390_REG_SECONDS | 0x80;
106 chip->txrx_buf[1] = bin2bcd(dt->tm_sec);
107 chip->txrx_buf[2] = bin2bcd(dt->tm_min);
108 chip->txrx_buf[3] = bin2bcd(dt->tm_hour);
109 chip->txrx_buf[4] = bin2bcd(dt->tm_wday);
110 chip->txrx_buf[5] = bin2bcd(dt->tm_mday);
111 chip->txrx_buf[6] = bin2bcd(dt->tm_mon + 1) |
113 chip->txrx_buf[7] = bin2bcd(dt->tm_year % 100);
116 return spi_write_then_read(spi, chip->txrx_buf, 8, NULL, 0);
127 struct ds1390 *chip;
134 chip = kzalloc(sizeof *chip, GFP_KERNEL);
135 if (!chip) {
139 dev_set_drvdata(&spi->dev, chip);
144 kfree(chip);
148 chip->rtc = rtc_device_register("ds1390",
150 if (IS_ERR(chip->rtc)) {
152 res = PTR_ERR(chip->rtc);
153 kfree(chip);
161 struct ds1390 *chip = platform_get_drvdata(spi);
163 rtc_device_unregister(chip->rtc);
164 kfree(chip);