nct3018y
struct nct3018y *nct3018y = i2c_get_clientdata(dev_id);
struct i2c_client *client = nct3018y->client;
err = nct3018y_get_alarm_mode(nct3018y->client, &alarm_enable, &alarm_flag);
rtc_update_irq(nct3018y->rtc, 1, RTC_IRQF | RTC_AF);
nct3018y_set_alarm_mode(nct3018y->client, 0);
struct nct3018y *nct3018y = dev_get_drvdata(dev);
if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y && !(flags & NCT3018Y_BIT_TWO)) {
if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y)
#define clkout_hw_to_nct3018y(_hw) container_of(_hw, struct nct3018y, clkout_hw)
struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
struct i2c_client *client = nct3018y->client;
struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
struct i2c_client *client = nct3018y->client;
struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
struct i2c_client *client = nct3018y->client;
struct nct3018y *nct3018y = clkout_hw_to_nct3018y(hw);
struct i2c_client *client = nct3018y->client;
static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y)
struct i2c_client *client = nct3018y->client;
nct3018y->clkout_hw.init = &init;
clk = devm_clk_register(&client->dev, &nct3018y->clkout_hw);
struct nct3018y *nct3018y;
nct3018y = devm_kzalloc(&client->dev, sizeof(struct nct3018y),
if (!nct3018y)
i2c_set_clientdata(client, nct3018y);
nct3018y->client = client;
nct3018y->part_num = i2c_smbus_read_byte_data(client, NCT3018Y_REG_PART);
if (nct3018y->part_num < 0) {
return nct3018y->part_num;
nct3018y->part_num &= 0x03; /* Part number is corresponding to bit 0 and 1 */
if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) {
nct3018y->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(nct3018y->rtc))
return PTR_ERR(nct3018y->rtc);
nct3018y->rtc->ops = &nct3018y_rtc_ops;
nct3018y->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
nct3018y->rtc->range_max = RTC_TIMESTAMP_END_2099;
clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, nct3018y->rtc->features);
clear_bit(RTC_FEATURE_ALARM, nct3018y->rtc->features);
nct3018y_clkout_register_clk(nct3018y);
return devm_rtc_register_device(nct3018y->rtc);