struct s3c_rtc *info = (struct s3c_rtc *)id;
if (info->data->irq_handler)
- info->data->irq_handler(info, S3C2410_INTP_TIC);
+ info->data->irq_handler(info, S3C2410_INTP_TIC_0);
return IRQ_HANDLED;
}
con &= ~S3C2410_RTCCON_RTCEN;
writew(con, info->base + S3C2410_RTCCON);
- con = readb(info->base + S3C2410_TICNT);
+ con = readb(info->base + S3C2410_TICNT_0);
con &= ~S3C2410_TICNT_ENABLE;
- writeb(con, info->base + S3C2410_TICNT);
+ writeb(con, info->base + S3C2410_TICNT_0);
}
static void s3c6410_rtc_disable(struct s3c_rtc *info)
unsigned int con;
con = readw(info->base + S3C2410_RTCCON);
- con &= ~S3C64XX_RTCCON_TICEN;
+ con &= ~S3C64XX_RTCCON_TICEN_0;
con &= ~S3C2410_RTCCON_RTCEN;
writew(con, info->base + S3C2410_RTCCON);
}
unsigned int tmp = 0;
int val;
- tmp = readb(info->base + S3C2410_TICNT);
+ tmp = readb(info->base + S3C2410_TICNT_0);
tmp &= S3C2410_TICNT_ENABLE;
val = (info->rtc->max_user_freq / freq) - 1;
tmp |= val;
- writel(tmp, info->base + S3C2410_TICNT);
+ writel(tmp, info->base + S3C2410_TICNT_0);
}
static void s3c2416_rtc_setfreq(struct s3c_rtc *info, int freq)
unsigned int tmp = 0;
int val;
- tmp = readb(info->base + S3C2410_TICNT);
+ tmp = readb(info->base + S3C2410_TICNT_0);
tmp &= S3C2410_TICNT_ENABLE;
val = (info->rtc->max_user_freq / freq) - 1;
writel(S3C2416_TICNT2_PART(val), info->base + S3C2416_TICNT2);
- writel(tmp, info->base + S3C2410_TICNT);
+ writel(tmp, info->base + S3C2410_TICNT_0);
}
static void s3c2443_rtc_setfreq(struct s3c_rtc *info, int freq)
unsigned int tmp = 0;
int val;
- tmp = readb(info->base + S3C2410_TICNT);
+ tmp = readb(info->base + S3C2410_TICNT_0);
tmp &= S3C2410_TICNT_ENABLE;
val = (info->rtc->max_user_freq / freq) - 1;
tmp |= S3C2443_TICNT_PART(val);
writel(S3C2443_TICNT1_PART(val), info->base + S3C2443_TICNT1);
- writel(tmp, info->base + S3C2410_TICNT);
+ writel(tmp, info->base + S3C2410_TICNT_0);
}
static void s3c6410_rtc_setfreq(struct s3c_rtc *info, int freq)
int val;
val = (info->rtc->max_user_freq / freq) - 1;
- writel(val, info->base + S3C2410_TICNT);
+ writel(val, info->base + S3C2410_TICNT_0);
}
static void s3c24xx_rtc_enable_tick(struct s3c_rtc *info, struct seq_file *seq)
{
unsigned int ticnt;
- ticnt = readb(info->base + S3C2410_TICNT);
+ ticnt = readb(info->base + S3C2410_TICNT_0);
ticnt &= S3C2410_TICNT_ENABLE;
seq_printf(seq, "periodic_IRQ\t: %s\n", ticnt ? "yes" : "no");
unsigned int con;
con = readw(info->base + S3C2410_RTCCON);
- con |= S3C2443_RTCCON_TICSEL;
+ con |= S3C2443_RTCCON_TICSEL_0;
writew(con, info->base + S3C2410_RTCCON);
}
unsigned int ticnt;
ticnt = readw(info->base + S3C2410_RTCCON);
- ticnt &= S3C64XX_RTCCON_TICEN;
+ ticnt &= S3C64XX_RTCCON_TICEN_0;
seq_printf(seq, "periodic_IRQ\t: %s\n", ticnt ? "yes" : "no");
}
static void s3c24xx_rtc_save_tick_cnt(struct s3c_rtc *info)
{
- info->ticnt_save = readb(info->base + S3C2410_TICNT);
+ info->ticnt_save = readb(info->base + S3C2410_TICNT_0);
}
static void s3c24xx_rtc_restore_tick_cnt(struct s3c_rtc *info)
{
- writeb(info->ticnt_save, info->base + S3C2410_TICNT);
+ writeb(info->ticnt_save, info->base + S3C2410_TICNT_0);
}
static void s3c6410_rtc_save_tick_cnt(struct s3c_rtc *info)
{
info->ticnt_en_save = readw(info->base + S3C2410_RTCCON);
- info->ticnt_en_save &= S3C64XX_RTCCON_TICEN;
- info->ticnt_save = readl(info->base + S3C2410_TICNT);
+ info->ticnt_en_save &= S3C64XX_RTCCON_TICEN_0;
+ info->ticnt_save = readl(info->base + S3C2410_TICNT_0);
}
static void s3c6410_rtc_restore_tick_cnt(struct s3c_rtc *info)
{
unsigned int con;
- writel(info->ticnt_save, info->base + S3C2410_TICNT);
+ writel(info->ticnt_save, info->base + S3C2410_TICNT_0);
if (info->ticnt_en_save) {
con = readw(info->base + S3C2410_RTCCON);
writew(con | info->ticnt_en_save, info->base + S3C2410_RTCCON);
#define S3C2410_RTCREG(x) (x)
#define S3C2410_INTP S3C2410_RTCREG(0x30)
#define S3C2410_INTP_ALM (1 << 1)
-#define S3C2410_INTP_TIC (1 << 0)
+#define S3C2410_INTP_TIC_0 (1 << 0)
+#define S3C2410_INTP_TIC_1 (1 << 2)
#define S3C2410_RTCCON S3C2410_RTCREG(0x40)
#define S3C2410_RTCCON_RTCEN (1 << 0)
#define S3C2410_RTCCON_CNTSEL (1 << 2)
#define S3C2410_RTCCON_CLKRST (1 << 3)
-#define S3C2443_RTCCON_TICSEL (1 << 4)
-#define S3C64XX_RTCCON_TICEN (1 << 8)
+#define S3C2443_RTCCON_TICSEL_0 (1 << 4)
+#define S3C64XX_RTCCON_TICEN_0 (1 << 8)
+#define S3C2443_RTCCON_TICSEL_1 (1 << 10)
+#define S3C64XX_RTCCON_TICEN_1 (1 << 14)
-#define S3C2410_TICNT S3C2410_RTCREG(0x44)
+#define S3C2410_TICNT_0 S3C2410_RTCREG(0x44)
+#define S3C2410_TICNT_1 S3C2410_RTCREG(0x48)
#define S3C2410_TICNT_ENABLE (1 << 7)
/* S3C2443: tick count is 15 bit wide