Lines Matching full:nct3018y

43 struct nct3018y {  struct
123 struct nct3018y *nct3018y = i2c_get_clientdata(dev_id); in nct3018y_irq() local
124 struct i2c_client *client = nct3018y->client; in nct3018y_irq()
130 err = nct3018y_get_alarm_mode(nct3018y->client, &alarm_enable, &alarm_flag); in nct3018y_irq()
137 rtc_update_irq(nct3018y->rtc, 1, RTC_IRQF | RTC_AF); in nct3018y_irq()
138 nct3018y_set_alarm_mode(nct3018y->client, 0); in nct3018y_irq()
147 * In the routines that deal directly with the nct3018y hardware, we use
183 struct nct3018y *nct3018y = dev_get_drvdata(dev); in nct3018y_rtc_set_time() local
195 if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y && !(flags & NCT3018Y_BIT_TWO)) { in nct3018y_rtc_set_time()
239 if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) in nct3018y_rtc_set_time()
346 #define clkout_hw_to_nct3018y(_hw) container_of(_hw, struct nct3018y, clkout_hw)
358 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw); in nct3018y_clkout_recalc_rate() local
359 struct i2c_client *client = nct3018y->client; in nct3018y_clkout_recalc_rate()
385 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw); in nct3018y_clkout_set_rate() local
386 struct i2c_client *client = nct3018y->client; in nct3018y_clkout_set_rate()
405 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw); in nct3018y_clkout_control() local
406 struct i2c_client *client = nct3018y->client; in nct3018y_clkout_control()
433 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw); in nct3018y_clkout_is_prepared() local
434 struct i2c_client *client = nct3018y->client; in nct3018y_clkout_is_prepared()
453 static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y) in nct3018y_clkout_register_clk() argument
455 struct i2c_client *client = nct3018y->client; in nct3018y_clkout_register_clk()
460 init.name = "nct3018y-clkout"; in nct3018y_clkout_register_clk()
465 nct3018y->clkout_hw.init = &init; in nct3018y_clkout_register_clk()
471 clk = devm_clk_register(&client->dev, &nct3018y->clkout_hw); in nct3018y_clkout_register_clk()
491 struct nct3018y *nct3018y; in nct3018y_probe() local
499 nct3018y = devm_kzalloc(&client->dev, sizeof(struct nct3018y), in nct3018y_probe()
501 if (!nct3018y) in nct3018y_probe()
504 i2c_set_clientdata(client, nct3018y); in nct3018y_probe()
505 nct3018y->client = client; in nct3018y_probe()
516 nct3018y->part_num = i2c_smbus_read_byte_data(client, NCT3018Y_REG_PART); in nct3018y_probe()
517 if (nct3018y->part_num < 0) { in nct3018y_probe()
519 return nct3018y->part_num; in nct3018y_probe()
521 nct3018y->part_num &= 0x03; /* Part number is corresponding to bit 0 and 1 */ in nct3018y_probe()
522 if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) { in nct3018y_probe()
539 nct3018y->rtc = devm_rtc_allocate_device(&client->dev); in nct3018y_probe()
540 if (IS_ERR(nct3018y->rtc)) in nct3018y_probe()
541 return PTR_ERR(nct3018y->rtc); in nct3018y_probe()
543 nct3018y->rtc->ops = &nct3018y_rtc_ops; in nct3018y_probe()
544 nct3018y->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; in nct3018y_probe()
545 nct3018y->rtc->range_max = RTC_TIMESTAMP_END_2099; in nct3018y_probe()
551 "nct3018y", client); in nct3018y_probe()
557 clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, nct3018y->rtc->features); in nct3018y_probe()
558 clear_bit(RTC_FEATURE_ALARM, nct3018y->rtc->features); in nct3018y_probe()
563 nct3018y_clkout_register_clk(nct3018y); in nct3018y_probe()
566 return devm_rtc_register_device(nct3018y->rtc); in nct3018y_probe()
570 { "nct3018y" },
576 { .compatible = "nuvoton,nct3018y" },
583 .name = "rtc-nct3018y",
594 MODULE_DESCRIPTION("Nuvoton NCT3018Y RTC driver");