struct s3c_rtc_data {
int max_user_freq;
bool needs_src_clk;
+ bool clock_ctrl_disable;
void (*irq_handler) (struct s3c_rtc *info, int mask);
void (*set_freq) (struct s3c_rtc *info, int freq);
unsigned long irq_flags;
int ret = 0;
+ if (info->data->clock_ctrl_disable)
+ return;
+
spin_lock_irqsave(&info->alarm_clk_lock, irq_flags);
if (info->clk_disabled) {
{
unsigned long irq_flags;
+ if (info->data->clock_ctrl_disable)
+ return;
+
spin_lock_irqsave(&info->alarm_clk_lock, irq_flags);
if (!info->clk_disabled) {
if (info->data->needs_src_clk)
s3c_rtc_setaie(info->dev, 0);
+ if (info->data->clock_ctrl_disable)
+ return 0;
+
if (info->data->needs_src_clk)
clk_unprepare(info->rtc_src_clk);
clk_unprepare(info->rtc_clk);
if (IS_ERR(info->base))
return PTR_ERR(info->base);
- info->rtc_clk = devm_clk_get(&pdev->dev, "rtc");
- if (IS_ERR(info->rtc_clk)) {
- ret = PTR_ERR(info->rtc_clk);
- if (ret != -EPROBE_DEFER)
+ if (!info->data->clock_ctrl_disable) {
+ info->rtc_clk = devm_clk_get(&pdev->dev, "rtc");
+ if (IS_ERR(info->rtc_clk)) {
dev_err(&pdev->dev, "failed to find rtc clock\n");
- else
- dev_dbg(&pdev->dev, "probe deferred due to missing rtc clk\n");
- return ret;
- }
- ret = clk_prepare_enable(info->rtc_clk);
- if (ret)
- return ret;
+ return PTR_ERR(info->rtc_clk);
+ }
+ clk_prepare_enable(info->rtc_clk);
- if (info->data->needs_src_clk) {
- info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
- if (IS_ERR(info->rtc_src_clk)) {
- ret = PTR_ERR(info->rtc_src_clk);
- if (ret != -EPROBE_DEFER)
+ if (info->data->needs_src_clk) {
+ info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
+ if (IS_ERR(info->rtc_src_clk)) {
dev_err(&pdev->dev,
"failed to find rtc source clock\n");
- else
- dev_dbg(&pdev->dev,
- "probe deferred due to missing rtc src clk\n");
- goto err_src_clk;
+ clk_disable_unprepare(info->rtc_clk);
+ return PTR_ERR(info->rtc_src_clk);
+ }
+ clk_prepare_enable(info->rtc_src_clk);
}
- ret = clk_prepare_enable(info->rtc_src_clk);
- if (ret)
- goto err_src_clk;
}
-
/* check to see if everything is setup correctly */
if (info->data->enable)
info->data->enable(info);
if (info->data->disable)
info->data->disable(info);
+ if (info->data->clock_ctrl_disable)
+ return ret;
+
if (info->data->needs_src_clk)
clk_disable_unprepare(info->rtc_src_clk);
err_src_clk:
.disable = s3c6410_rtc_disable,
};
+static struct s3c_rtc_data const exynos8_rtc_data = {
+ .max_user_freq = 32768,
+ .clock_ctrl_disable = true,
+ .irq_handler = s3c6410_rtc_irq,
+ .set_freq = s3c6410_rtc_setfreq,
+ .enable_tick = s3c6410_rtc_enable_tick,
+ .save_tick_cnt = s3c6410_rtc_save_tick_cnt,
+ .restore_tick_cnt = s3c6410_rtc_restore_tick_cnt,
+ .enable = s3c24xx_rtc_enable,
+ .disable = s3c6410_rtc_disable,
+};
+
static const struct of_device_id s3c_rtc_dt_match[] = {
{
.compatible = "samsung,s3c2410-rtc",
}, {
.compatible = "samsung,exynos3250-rtc",
.data = &s3c6410_rtc_data,
+ }, {
+ .compatible = "samsung,exynos8-rtc",
+ .data = (void *)&exynos8_rtc_data,
},
+
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);