Lines Matching refs:pcf2123
122 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_read_offset() local
126 ret = regmap_read(pcf2123->map, PCF2123_REG_OFFSET, ®); in pcf2123_read_offset()
152 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_set_offset() local
172 return regmap_write(pcf2123->map, PCF2123_REG_OFFSET, (unsigned int)reg); in pcf2123_set_offset()
177 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_read_time() local
181 ret = regmap_bulk_read(pcf2123->map, PCF2123_REG_SC, rxbuf, in pcf2123_rtc_read_time()
206 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_set_time() local
213 ret = regmap_write(pcf2123->map, PCF2123_REG_CTRL1, CTRL1_STOP); in pcf2123_rtc_set_time()
226 ret = regmap_bulk_write(pcf2123->map, PCF2123_REG_SC, txbuf, in pcf2123_rtc_set_time()
232 ret = regmap_write(pcf2123->map, PCF2123_REG_CTRL1, CTRL1_CLEAR); in pcf2123_rtc_set_time()
241 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_alarm_irq_enable() local
243 return regmap_update_bits(pcf2123->map, PCF2123_REG_CTRL2, CTRL2_AIE, in pcf2123_rtc_alarm_irq_enable()
249 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_read_alarm() local
254 ret = regmap_bulk_read(pcf2123->map, PCF2123_REG_ALRM_MN, rxbuf, in pcf2123_rtc_read_alarm()
266 ret = regmap_read(pcf2123->map, PCF2123_REG_CTRL2, &val); in pcf2123_rtc_read_alarm()
277 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_set_alarm() local
284 ret = regmap_update_bits(pcf2123->map, PCF2123_REG_CTRL2, CTRL2_AIE, 0); in pcf2123_rtc_set_alarm()
289 ret = regmap_update_bits(pcf2123->map, PCF2123_REG_CTRL2, CTRL2_AF, 0); in pcf2123_rtc_set_alarm()
299 ret = regmap_bulk_write(pcf2123->map, PCF2123_REG_ALRM_MN, txbuf, in pcf2123_rtc_set_alarm()
309 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_rtc_irq() local
313 rtc_lock(pcf2123->rtc); in pcf2123_rtc_irq()
314 regmap_read(pcf2123->map, PCF2123_REG_CTRL2, &val); in pcf2123_rtc_irq()
321 regmap_update_bits(pcf2123->map, PCF2123_REG_CTRL2, CTRL2_AF, 0); in pcf2123_rtc_irq()
323 rtc_update_irq(pcf2123->rtc, 1, RTC_IRQF | RTC_AF); in pcf2123_rtc_irq()
326 rtc_unlock(pcf2123->rtc); in pcf2123_rtc_irq()
333 struct pcf2123_data *pcf2123 = dev_get_drvdata(dev); in pcf2123_reset() local
337 ret = regmap_write(pcf2123->map, PCF2123_REG_CTRL1, CTRL1_SW_RESET); in pcf2123_reset()
343 ret = regmap_write(pcf2123->map, PCF2123_REG_CTRL1, CTRL1_STOP); in pcf2123_reset()
349 ret = regmap_read(pcf2123->map, PCF2123_REG_CTRL1, &val); in pcf2123_reset()
358 ret = regmap_write(pcf2123->map, PCF2123_REG_CTRL1, CTRL1_CLEAR); in pcf2123_reset()
379 struct pcf2123_data *pcf2123; in pcf2123_probe() local
382 pcf2123 = devm_kzalloc(&spi->dev, sizeof(struct pcf2123_data), in pcf2123_probe()
384 if (!pcf2123) in pcf2123_probe()
387 dev_set_drvdata(&spi->dev, pcf2123); in pcf2123_probe()
389 pcf2123->map = devm_regmap_init_spi(spi, &pcf2123_regmap_config); in pcf2123_probe()
390 if (IS_ERR(pcf2123->map)) { in pcf2123_probe()
392 return PTR_ERR(pcf2123->map); in pcf2123_probe()
412 pcf2123->rtc = rtc; in pcf2123_probe()