Lines Matching refs:sd3078
39 struct sd3078 { struct
52 static void sd3078_enable_reg_write(struct sd3078 *sd3078) in sd3078_enable_reg_write() argument
54 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL2, in sd3078_enable_reg_write()
56 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL1, in sd3078_enable_reg_write()
58 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL1, in sd3078_enable_reg_write()
72 static void sd3078_disable_reg_write(struct sd3078 *sd3078) in sd3078_disable_reg_write() argument
74 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL1, in sd3078_disable_reg_write()
76 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL1, in sd3078_disable_reg_write()
78 regmap_update_bits(sd3078->regmap, SD3078_REG_CTRL2, in sd3078_disable_reg_write()
88 struct sd3078 *sd3078 = i2c_get_clientdata(client); in sd3078_rtc_read_time() local
91 ret = regmap_bulk_read(sd3078->regmap, SD3078_REG_SC, rtc_data, in sd3078_rtc_read_time()
126 struct sd3078 *sd3078 = i2c_get_clientdata(client); in sd3078_rtc_set_time() local
138 sd3078_enable_reg_write(sd3078); in sd3078_rtc_set_time()
141 ret = regmap_bulk_write(sd3078->regmap, SD3078_REG_SC, rtc_data, in sd3078_rtc_set_time()
149 sd3078_disable_reg_write(sd3078); in sd3078_rtc_set_time()
169 struct sd3078 *sd3078; in sd3078_probe() local
174 sd3078 = devm_kzalloc(&client->dev, sizeof(*sd3078), GFP_KERNEL); in sd3078_probe()
175 if (!sd3078) in sd3078_probe()
178 sd3078->regmap = devm_regmap_init_i2c(client, ®map_config); in sd3078_probe()
179 if (IS_ERR(sd3078->regmap)) { in sd3078_probe()
181 return PTR_ERR(sd3078->regmap); in sd3078_probe()
184 i2c_set_clientdata(client, sd3078); in sd3078_probe()
186 sd3078->rtc = devm_rtc_allocate_device(&client->dev); in sd3078_probe()
187 if (IS_ERR(sd3078->rtc)) in sd3078_probe()
188 return PTR_ERR(sd3078->rtc); in sd3078_probe()
190 sd3078->rtc->ops = &sd3078_rtc_ops; in sd3078_probe()
191 sd3078->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; in sd3078_probe()
192 sd3078->rtc->range_max = RTC_TIMESTAMP_END_2099; in sd3078_probe()
194 ret = devm_rtc_register_device(sd3078->rtc); in sd3078_probe()
198 sd3078_enable_reg_write(sd3078); in sd3078_probe()