diff options
author | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-04-11 10:41:07 +0300 |
---|---|---|
committer | José Pekkarinen <jose.pekkarinen@nokia.com> | 2016-04-13 08:17:18 +0300 |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/rtc/rtc-s3c.c | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/rtc/rtc-s3c.c')
-rw-r--r-- | kernel/drivers/rtc/rtc-s3c.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/kernel/drivers/rtc/rtc-s3c.c b/kernel/drivers/rtc/rtc-s3c.c index c5a2523b0..ffb860d18 100644 --- a/kernel/drivers/rtc/rtc-s3c.c +++ b/kernel/drivers/rtc/rtc-s3c.c @@ -302,6 +302,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) struct s3c_rtc *info = dev_get_drvdata(dev); struct rtc_time *tm = &alrm->time; unsigned int alrm_en; + int year = tm->tm_year - 100; dev_dbg(dev, "s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", alrm->enabled, @@ -328,6 +329,21 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) writeb(bin2bcd(tm->tm_hour), info->base + S3C2410_ALMHOUR); } + if (year < 100 && year >= 0) { + alrm_en |= S3C2410_RTCALM_YEAREN; + writeb(bin2bcd(year), info->base + S3C2410_ALMYEAR); + } + + if (tm->tm_mon < 12 && tm->tm_mon >= 0) { + alrm_en |= S3C2410_RTCALM_MONEN; + writeb(bin2bcd(tm->tm_mon + 1), info->base + S3C2410_ALMMON); + } + + if (tm->tm_mday <= 31 && tm->tm_mday >= 1) { + alrm_en |= S3C2410_RTCALM_DAYEN; + writeb(bin2bcd(tm->tm_mday), info->base + S3C2410_ALMDATE); + } + dev_dbg(dev, "setting S3C2410_RTCALM to %08x\n", alrm_en); writeb(alrm_en, info->base + S3C2410_RTCALM); @@ -422,8 +438,9 @@ static int s3c_rtc_remove(struct platform_device *pdev) s3c_rtc_setaie(info->dev, 0); + if (info->data->needs_src_clk) + clk_unprepare(info->rtc_src_clk); clk_unprepare(info->rtc_clk); - info->rtc_clk = NULL; return 0; } @@ -494,6 +511,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) if (IS_ERR(info->rtc_src_clk)) { dev_err(&pdev->dev, "failed to find rtc source clock\n"); + clk_disable_unprepare(info->rtc_clk); return PTR_ERR(info->rtc_src_clk); } clk_prepare_enable(info->rtc_src_clk); @@ -784,18 +802,6 @@ static struct s3c_rtc_data const s3c6410_rtc_data = { .disable = s3c6410_rtc_disable, }; -static struct s3c_rtc_data const exynos3250_rtc_data = { - .max_user_freq = 32768, - .needs_src_clk = 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", @@ -811,7 +817,7 @@ static const struct of_device_id s3c_rtc_dt_match[] = { .data = (void *)&s3c6410_rtc_data, }, { .compatible = "samsung,exynos3250-rtc", - .data = (void *)&exynos3250_rtc_data, + .data = (void *)&s3c6410_rtc_data, }, { /* sentinel */ }, }; |