Lines Matching defs:nct3018y
41 struct nct3018y {
120 struct nct3018y *nct3018y = i2c_get_clientdata(dev_id);
121 struct i2c_client *client = nct3018y->client;
127 err = nct3018y_get_alarm_mode(nct3018y->client, &alarm_enable, &alarm_flag);
134 rtc_update_irq(nct3018y->rtc, 1, RTC_IRQF | RTC_AF);
135 nct3018y_set_alarm_mode(nct3018y->client, 0);
144 * In the routines that deal directly with the nct3018y hardware, we use
312 #define clkout_hw_to_nct3018y(_hw) container_of(_hw, struct nct3018y, clkout_hw)
324 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
325 struct i2c_client *client = nct3018y->client;
351 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
352 struct i2c_client *client = nct3018y->client;
371 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
372 struct i2c_client *client = nct3018y->client;
399 struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
400 struct i2c_client *client = nct3018y->client;
419 static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y)
421 struct i2c_client *client = nct3018y->client;
426 init.name = "nct3018y-clkout";
431 nct3018y->clkout_hw.init = &init;
437 clk = devm_clk_register(&client->dev, &nct3018y->clkout_hw);
457 struct nct3018y *nct3018y;
465 nct3018y = devm_kzalloc(&client->dev, sizeof(struct nct3018y),
467 if (!nct3018y)
470 i2c_set_clientdata(client, nct3018y);
471 nct3018y->client = client;
496 nct3018y->rtc = devm_rtc_allocate_device(&client->dev);
497 if (IS_ERR(nct3018y->rtc))
498 return PTR_ERR(nct3018y->rtc);
500 nct3018y->rtc->ops = &nct3018y_rtc_ops;
501 nct3018y->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
502 nct3018y->rtc->range_max = RTC_TIMESTAMP_END_2099;
508 "nct3018y", client);
514 clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, nct3018y->rtc->features);
515 clear_bit(RTC_FEATURE_ALARM, nct3018y->rtc->features);
520 nct3018y_clkout_register_clk(nct3018y);
523 return devm_rtc_register_device(nct3018y->rtc);
527 { "nct3018y", 0 },
533 { .compatible = "nuvoton,nct3018y" },
540 .name = "rtc-nct3018y",