Lines Matching refs:pcf8523
50 struct pcf8523 { struct
55 static int pcf8523_load_capacitance(struct pcf8523 *pcf8523, struct device_node *node) in pcf8523_load_capacitance() argument
64 dev_warn(&pcf8523->rtc->dev, "Unknown quartz-load-femtofarads value: %d. Assuming 12500", in pcf8523_load_capacitance()
74 return regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL1, in pcf8523_load_capacitance()
80 struct pcf8523 *pcf8523 = dev_id; in pcf8523_irq() local
84 err = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL2, &value); in pcf8523_irq()
90 regmap_write(pcf8523->regmap, PCF8523_REG_CONTROL2, value); in pcf8523_irq()
91 rtc_update_irq(pcf8523->rtc, 1, RTC_IRQF | RTC_AF); in pcf8523_irq()
101 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_read_time() local
105 err = regmap_bulk_read(pcf8523->regmap, PCF8523_REG_CONTROL1, regs, in pcf8523_rtc_read_time()
126 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_set_time() local
130 err = regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL1, in pcf8523_rtc_set_time()
144 err = regmap_bulk_write(pcf8523->regmap, PCF8523_REG_SECONDS, regs, in pcf8523_rtc_set_time()
152 regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL1, in pcf8523_rtc_set_time()
157 return regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL1, in pcf8523_rtc_set_time()
163 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_read_alarm() local
168 err = regmap_bulk_read(pcf8523->regmap, PCF8523_REG_MINUTE_ALARM, regs, in pcf8523_rtc_read_alarm()
179 err = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL1, &value); in pcf8523_rtc_read_alarm()
184 err = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL2, &value); in pcf8523_rtc_read_alarm()
194 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_irq_enable() local
196 return regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL1, in pcf8523_irq_enable()
203 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_set_alarm() local
211 err = regmap_write(pcf8523->regmap, PCF8523_REG_CONTROL2, 0); in pcf8523_rtc_set_alarm()
220 err = regmap_bulk_write(pcf8523->regmap, PCF8523_REG_MINUTE_ALARM, regs, in pcf8523_rtc_set_alarm()
233 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_param_get() local
239 ret = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL3, &value); in pcf8523_param_get()
272 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_param_set() local
294 return regmap_update_bits(pcf8523->regmap, PCF8523_REG_CONTROL3, in pcf8523_param_set()
310 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_ioctl() local
317 ret = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL3, &value); in pcf8523_rtc_ioctl()
324 ret = regmap_read(pcf8523->regmap, PCF8523_REG_SECONDS, &value); in pcf8523_rtc_ioctl()
340 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_read_offset() local
345 err = regmap_read(pcf8523->regmap, PCF8523_REG_OFFSET, &value); in pcf8523_rtc_read_offset()
358 struct pcf8523 *pcf8523 = dev_get_drvdata(dev); in pcf8523_rtc_set_offset() local
370 return regmap_write(pcf8523->regmap, PCF8523_REG_OFFSET, value); in pcf8523_rtc_set_offset()
418 struct pcf8523 *pcf8523; in pcf8523_probe() local
427 pcf8523 = devm_kzalloc(&client->dev, sizeof(struct pcf8523), GFP_KERNEL); in pcf8523_probe()
428 if (!pcf8523) in pcf8523_probe()
431 pcf8523->regmap = devm_regmap_init_i2c(client, ®map_config); in pcf8523_probe()
432 if (IS_ERR(pcf8523->regmap)) in pcf8523_probe()
433 return PTR_ERR(pcf8523->regmap); in pcf8523_probe()
435 i2c_set_clientdata(client, pcf8523); in pcf8523_probe()
440 pcf8523->rtc = rtc; in pcf8523_probe()
442 err = pcf8523_load_capacitance(pcf8523, client->dev.of_node); in pcf8523_probe()
447 err = regmap_read(pcf8523->regmap, PCF8523_REG_SECONDS, &value); in pcf8523_probe()
452 err = regmap_read(pcf8523->regmap, PCF8523_REG_CONTROL3, &value); in pcf8523_probe()
457 err = regmap_write(pcf8523->regmap, PCF8523_REG_CONTROL3, in pcf8523_probe()
476 err = regmap_write(pcf8523->regmap, PCF8523_TMR_CLKOUT_CTRL, 0x38); in pcf8523_probe()
483 dev_name(&rtc->dev), pcf8523); in pcf8523_probe()