* [PATCH 0/3] rtc: rtc-s3c: Fix and Update s3c_rtc_setaie()
@ 2010-11-16 0:02 Kukjin Kim
2010-11-16 0:02 ` [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie Kukjin Kim
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Kukjin Kim @ 2010-11-16 0:02 UTC (permalink / raw)
To: linux-arm-kernel
This patch includes fixing s3c_rtc_setaie() function for Samsung SoCs.
[PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie
[PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie
[PATCH 3/3] rtc: rtc-s3c: Change set alarm interrupt method in s3c_rtc_setaie
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie 2010-11-16 0:02 [PATCH 0/3] rtc: rtc-s3c: Fix and Update s3c_rtc_setaie() Kukjin Kim @ 2010-11-16 0:02 ` Kukjin Kim 2010-11-16 1:30 ` Kyungmin Park 2010-11-16 0:02 ` [PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie Kukjin Kim 2010-11-16 0:02 ` [PATCH 3/3] rtc: rtc-s3c: Change set alarm interrupt method " Kukjin Kim 2 siblings, 1 reply; 6+ messages in thread From: Kukjin Kim @ 2010-11-16 0:02 UTC (permalink / raw) To: linux-arm-kernel According to struct rtc_class_ops, this patch fixes return type and argument of s3c_rtc_setaie(). int (*alarm_irq_enable)(struct device *, unsigned int enabled); Cc: Ben Dooks <ben-linux@fluff.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- drivers/rtc/rtc-s3c.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index cf953ec..e2636ff 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -76,19 +76,20 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id) return IRQ_HANDLED; } -/* Update control registers */ -static void s3c_rtc_setaie(int to) +static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) { unsigned int tmp; - pr_debug("%s: aie=%d\n", __func__, to); + pr_debug("%s: aie=%d\n", __func__, enabled); tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; - if (to) + if (enabled) tmp |= S3C2410_RTCALM_ALMEN; writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); + + return 0; } static int s3c_rtc_setpie(struct device *dev, int enabled) @@ -308,7 +309,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) writeb(alrm_en, base + S3C2410_RTCALM); - s3c_rtc_setaie(alrm->enabled); + s3c_rtc_setaie(dev, alrm->enabled); return 0; } @@ -440,7 +441,7 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev) rtc_device_unregister(rtc); s3c_rtc_setpie(&dev->dev, 0); - s3c_rtc_setaie(0); + s3c_rtc_setaie(&dev->dev, 0); clk_disable(rtc_clk); clk_put(rtc_clk); -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie 2010-11-16 0:02 ` [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie Kukjin Kim @ 2010-11-16 1:30 ` Kyungmin Park 0 siblings, 0 replies; 6+ messages in thread From: Kyungmin Park @ 2010-11-16 1:30 UTC (permalink / raw) To: linux-arm-kernel Hi, It's same patch early. I used the email address by ./script/get_maintainer.sh http://groups.google.com/group/linux.kernel/browse_thread/thread/953c417a31756ab9?pli=1 Thank you, Kyungmin Park On Tue, Nov 16, 2010 at 9:02 AM, Kukjin Kim <kgene.kim@samsung.com> wrote: > According to struct rtc_class_ops, this patch fixes return type > and argument of s3c_rtc_setaie(). > > ?int (*alarm_irq_enable)(struct device *, unsigned int enabled); > > Cc: Ben Dooks <ben-linux@fluff.org> > Cc: Wan ZongShun <mcuos.com@gmail.com> > Cc: Alessandro Zummo <a.zummo@towertech.it> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> > --- > ?drivers/rtc/rtc-s3c.c | ? 13 +++++++------ > ?1 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c > index cf953ec..e2636ff 100644 > --- a/drivers/rtc/rtc-s3c.c > +++ b/drivers/rtc/rtc-s3c.c > @@ -76,19 +76,20 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id) > ? ? ? ?return IRQ_HANDLED; > ?} > > -/* Update control registers */ > -static void s3c_rtc_setaie(int to) > +static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) > ?{ > ? ? ? ?unsigned int tmp; > > - ? ? ? pr_debug("%s: aie=%d\n", __func__, to); > + ? ? ? pr_debug("%s: aie=%d\n", __func__, enabled); > > ? ? ? ?tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; > > - ? ? ? if (to) > + ? ? ? if (enabled) > ? ? ? ? ? ? ? ?tmp |= S3C2410_RTCALM_ALMEN; > > ? ? ? ?writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); > + > + ? ? ? return 0; > ?} > > ?static int s3c_rtc_setpie(struct device *dev, int enabled) > @@ -308,7 +309,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) > > ? ? ? ?writeb(alrm_en, base + S3C2410_RTCALM); > > - ? ? ? s3c_rtc_setaie(alrm->enabled); > + ? ? ? s3c_rtc_setaie(dev, alrm->enabled); > > ? ? ? ?return 0; > ?} > @@ -440,7 +441,7 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev) > ? ? ? ?rtc_device_unregister(rtc); > > ? ? ? ?s3c_rtc_setpie(&dev->dev, 0); > - ? ? ? s3c_rtc_setaie(0); > + ? ? ? s3c_rtc_setaie(&dev->dev, 0); > > ? ? ? ?clk_disable(rtc_clk); > ? ? ? ?clk_put(rtc_clk); > -- > 1.6.2.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at ?http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie 2010-11-16 0:02 [PATCH 0/3] rtc: rtc-s3c: Fix and Update s3c_rtc_setaie() Kukjin Kim 2010-11-16 0:02 ` [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie Kukjin Kim @ 2010-11-16 0:02 ` Kukjin Kim 2015-05-02 14:00 ` [2/3] " Alexandre Belloni 2010-11-16 0:02 ` [PATCH 3/3] rtc: rtc-s3c: Change set alarm interrupt method " Kukjin Kim 2 siblings, 1 reply; 6+ messages in thread From: Kukjin Kim @ 2010-11-16 0:02 UTC (permalink / raw) To: linux-arm-kernel This patch adds spin_lock_irq() and spin_unlock_irq() during alarm interrupt configuration to avoid interrupt missing. Cc: Ben Dooks <ben-linux@fluff.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- drivers/rtc/rtc-s3c.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index e2636ff..bb88027 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -82,12 +82,14 @@ static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) pr_debug("%s: aie=%d\n", __func__, enabled); + spin_lock_irq(&s3c_rtc_pie_lock); tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; if (enabled) tmp |= S3C2410_RTCALM_ALMEN; writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); + spin_unlock_irq(&s3c_rtc_pie_lock); return 0; } -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie 2010-11-16 0:02 ` [PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie Kukjin Kim @ 2015-05-02 14:00 ` Alexandre Belloni 0 siblings, 0 replies; 6+ messages in thread From: Alexandre Belloni @ 2015-05-02 14:00 UTC (permalink / raw) To: linux-arm-kernel Hi Kukjin, On 16/11/2010 at 09:02:53 +0900, Kukjin Kim wrote : > This patch adds spin_lock_irq() and spin_unlock_irq() during > alarm interrupt configuration to avoid interrupt missing. > > Cc: Ben Dooks <ben-linux@fluff.org> > Cc: Wan ZongShun <mcuos.com@gmail.com> > Cc: Alessandro Zummo <a.zummo@towertech.it> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> This patch never made it in the mainline, is it still necessary? > --- > drivers/rtc/rtc-s3c.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c > index e2636ff..bb88027 100644 > --- a/drivers/rtc/rtc-s3c.c > +++ b/drivers/rtc/rtc-s3c.c > @@ -82,12 +82,14 @@ static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) > > pr_debug("%s: aie=%d\n", __func__, enabled); > > + spin_lock_irq(&s3c_rtc_pie_lock); > tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; > > if (enabled) > tmp |= S3C2410_RTCALM_ALMEN; > > writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); > + spin_unlock_irq(&s3c_rtc_pie_lock); > > return 0; > } -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] rtc: rtc-s3c: Change set alarm interrupt method in s3c_rtc_setaie 2010-11-16 0:02 [PATCH 0/3] rtc: rtc-s3c: Fix and Update s3c_rtc_setaie() Kukjin Kim 2010-11-16 0:02 ` [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie Kukjin Kim 2010-11-16 0:02 ` [PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie Kukjin Kim @ 2010-11-16 0:02 ` Kukjin Kim 2 siblings, 0 replies; 6+ messages in thread From: Kukjin Kim @ 2010-11-16 0:02 UTC (permalink / raw) To: linux-arm-kernel This patch changes method of setting alarm interrupt. Cc: Ben Dooks <ben-linux@fluff.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> --- drivers/rtc/rtc-s3c.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index bb88027..1ccf81c 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -83,10 +83,12 @@ static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) pr_debug("%s: aie=%d\n", __func__, enabled); spin_lock_irq(&s3c_rtc_pie_lock); - tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; + tmp = readb(s3c_rtc_base + S3C2410_RTCALM); if (enabled) tmp |= S3C2410_RTCALM_ALMEN; + else + tmp &= ~S3C2410_RTCALM_ALMEN; writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); spin_unlock_irq(&s3c_rtc_pie_lock); -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-02 14:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-11-16 0:02 [PATCH 0/3] rtc: rtc-s3c: Fix and Update s3c_rtc_setaie() Kukjin Kim 2010-11-16 0:02 ` [PATCH 1/3] rtc: rtc-s3c: Fix return type and argument of s3c_rtc_setaie Kukjin Kim 2010-11-16 1:30 ` Kyungmin Park 2010-11-16 0:02 ` [PATCH 2/3] rtc: rtc-s3c: Add spin_lock_irq in s3c_rtc_setaie Kukjin Kim 2015-05-02 14:00 ` [2/3] " Alexandre Belloni 2010-11-16 0:02 ` [PATCH 3/3] rtc: rtc-s3c: Change set alarm interrupt method " Kukjin Kim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).