diff options
Diffstat (limited to 'drivers/rtc/rtc-pcf85063.c')
-rw-r--r-- | drivers/rtc/rtc-pcf85063.c | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c index e19cf2adbc35..aef6c1ee8bb0 100644 --- a/drivers/rtc/rtc-pcf85063.c +++ b/drivers/rtc/rtc-pcf85063.c @@ -311,14 +311,6 @@ static const struct rtc_class_ops pcf85063_rtc_ops = { .set_time = pcf85063_rtc_set_time, .read_offset = pcf85063_read_offset, .set_offset = pcf85063_set_offset, - .ioctl = pcf85063_ioctl, -}; - -static const struct rtc_class_ops pcf85063_rtc_ops_alarm = { - .read_time = pcf85063_rtc_read_time, - .set_time = pcf85063_rtc_set_time, - .read_offset = pcf85063_read_offset, - .set_offset = pcf85063_set_offset, .read_alarm = pcf85063_rtc_read_alarm, .set_alarm = pcf85063_rtc_set_alarm, .alarm_irq_enable = pcf85063_rtc_alarm_irq_enable, @@ -509,15 +501,6 @@ static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063) } #endif -static const struct pcf85063_config pcf85063a_config = { - .regmap = { - .reg_bits = 8, - .val_bits = 8, - .max_register = 0x11, - }, - .has_alarms = 1, -}; - static const struct pcf85063_config pcf85063tp_config = { .regmap = { .reg_bits = 8, @@ -526,16 +509,6 @@ static const struct pcf85063_config pcf85063tp_config = { }, }; -static const struct pcf85063_config rv8263_config = { - .regmap = { - .reg_bits = 8, - .val_bits = 8, - .max_register = 0x11, - }, - .has_alarms = 1, - .force_cap_7000 = 1, -}; - static int pcf85063_probe(struct i2c_client *client) { struct pcf85063 *pcf85063; @@ -587,6 +560,7 @@ static int pcf85063_probe(struct i2c_client *client) pcf85063->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; pcf85063->rtc->range_max = RTC_TIMESTAMP_END_2099; pcf85063->rtc->uie_unsupported = 1; + clear_bit(RTC_FEATURE_ALARM, pcf85063->rtc->features); if (config->has_alarms && client->irq > 0) { err = devm_request_threaded_irq(&client->dev, client->irq, @@ -597,7 +571,7 @@ static int pcf85063_probe(struct i2c_client *client) dev_warn(&pcf85063->rtc->dev, "unable to request IRQ, alarms disabled\n"); } else { - pcf85063->rtc->ops = &pcf85063_rtc_ops_alarm; + set_bit(RTC_FEATURE_ALARM, pcf85063->rtc->features); device_init_wakeup(&client->dev, true); err = dev_pm_set_wake_irq(&client->dev, client->irq); if (err) @@ -618,6 +592,25 @@ static int pcf85063_probe(struct i2c_client *client) } #ifdef CONFIG_OF +static const struct pcf85063_config pcf85063a_config = { + .regmap = { + .reg_bits = 8, + .val_bits = 8, + .max_register = 0x11, + }, + .has_alarms = 1, +}; + +static const struct pcf85063_config rv8263_config = { + .regmap = { + .reg_bits = 8, + .val_bits = 8, + .max_register = 0x11, + }, + .has_alarms = 1, + .force_cap_7000 = 1, +}; + static const struct of_device_id pcf85063_of_match[] = { { .compatible = "nxp,pcf85063", .data = &pcf85063tp_config }, { .compatible = "nxp,pcf85063tp", .data = &pcf85063tp_config }, |