public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [Resending PATCH 1/2] driver:twl4030-rtc specific code
@ 2007-12-17  5:52 Girish
  2007-12-17 18:59 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Girish @ 2007-12-17  5:52 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-omap-open-source

This patch adds rtc-twl4030 driver specific code.

Signed-off-by: Girish S G <girishsg@ti.com>
---
 drivers/rtc/rtc-twl4030.c |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

Index: linux-omap-dec10/drivers/rtc/rtc-twl4030.c
===================================================================
--- linux-omap-dec10.orig/drivers/rtc/rtc-twl4030.c	2007-12-13 12:08:18.000000000 +0530
+++ linux-omap-dec10/drivers/rtc/rtc-twl4030.c	2007-12-13 16:24:41.428526658 +0530
@@ -353,6 +353,26 @@
 	return ret;
 }
 
+/*
+ * We will just handle setting the frequency and make use the framework for
+ * reading the periodic interupts.
+ * @freq: Current periodic IRQ freq
+ */
+static int twl4030_rtc_irq_set_freq(struct device *dev, int freq)
+{
+	struct rtc_device *rtc = dev_get_drvdata(dev);
+
+	if (freq < 0 || freq > 3)
+		return -EINVAL;
+
+	rtc->irq_freq = freq;
+
+	/* set rtc irq freq to user defined value */
+	set_rtc_irq_bit(freq);
+
+	return 0;
+}
+
 #ifdef	CONFIG_RTC_INTF_DEV
 
 static int twl4030_rtc_ioctl(struct device *dev, unsigned int cmd,
@@ -364,12 +384,18 @@
 		return twl4030_rtc_alarm_irq_set_state(dev, 0);
 	case RTC_AIE_ON:
 		return twl4030_rtc_alarm_irq_set_state(dev, 1);
+
 	case RTC_UIE_OFF:
+		/* Fall Through */
+	case RTC_PIE_OFF:
 		/* Mask ints from RTC updates.  */
 		return twl4030_rtc_irq_set_state(dev, 0);
 	case RTC_UIE_ON:
+		/* Fall Through */
+	case RTC_PIE_ON:
 		/* Allow ints for RTC updates.  */
 		return twl4030_rtc_irq_set_state(dev, 1);
+
 	case RTC_EPOCH_READ:
 		return put_user(epoch, (unsigned long *)arg);
 	case RTC_EPOCH_SET:	
@@ -456,11 +482,12 @@
 }
 
 static struct rtc_class_ops twl4030_rtc_ops = {
-	.ioctl = twl4030_rtc_ioctl,
-	.read_time = twl4030_rtc_read_time,
-	.set_time = twl4030_rtc_set_time,
-	.read_alarm = twl4030_rtc_read_alarm,
-	.set_alarm = twl4030_rtc_set_alarm,
+	.ioctl		= twl4030_rtc_ioctl,
+	.read_time	= twl4030_rtc_read_time,
+	.set_time	= twl4030_rtc_set_time,
+	.read_alarm	= twl4030_rtc_read_alarm,
+	.set_alarm	= twl4030_rtc_set_alarm,
+	.irq_set_freq	= twl4030_rtc_irq_set_freq,
 };
 
 static int __devinit twl4030_rtc_probe(struct platform_device *pdev)
@@ -486,6 +513,9 @@
 
 	}
 
+	/* Set the irq freq to every second */
+	rtc->irq_freq = 0;
+
 	platform_set_drvdata(pdev, rtc);
 
 	ret = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
@@ -577,6 +607,7 @@
 		pdata->exit();
 
 	rtc_device_unregister(rtc);
+	platform_set_drvdata(pdev, NULL);
 	return 0;
 } 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Resending PATCH 1/2] driver:twl4030-rtc specific code
  2007-12-17  5:52 [Resending PATCH 1/2] driver:twl4030-rtc specific code Girish
@ 2007-12-17 18:59 ` Tony Lindgren
  2007-12-18  5:45   ` Girish
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2007-12-17 18:59 UTC (permalink / raw)
  To: Girish; +Cc: linux-omap, linux-omap-open-source

* Girish <girishsg@ti.com> [071216 21:53]:
> This patch adds rtc-twl4030 driver specific code.

Almost ready.. Just few more things:

- Please changes spaces to tabs to follow the CodingStyle
- Please change the subject to say "RTC: twl4030-rtc specific code"

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Resending PATCH 1/2] driver:twl4030-rtc specific code
  2007-12-17 18:59 ` Tony Lindgren
@ 2007-12-18  5:45   ` Girish
  2007-12-18  5:50     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Girish @ 2007-12-18  5:45 UTC (permalink / raw)
  To: 'Tony Lindgren'; +Cc: linux-omap, linux-omap-open-source

 
Hi Tony,

>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com] 

>
>* Girish <girishsg@ti.com> [071216 21:53]:
>> This patch adds rtc-twl4030 driver specific code.
>
>Almost ready.. Just few more things:
>
>- Please changes spaces to tabs to follow the CodingStyle

These spaces din't figure out when I ran checkpatch script, does checkpatch needs an upgrade for such kind of space checks? If yes I
can try  sending a patch to the maintainer. 

>- Please change the subject to say "RTC: twl4030-rtc specific code"

I'll resend the patch with above comments fixed.

Thanks,
Girish

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Resending PATCH 1/2] driver:twl4030-rtc specific code
  2007-12-18  5:45   ` Girish
@ 2007-12-18  5:50     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2007-12-18  5:50 UTC (permalink / raw)
  To: Girish; +Cc: linux-omap, linux-omap-open-source

* Girish <girishsg@ti.com> [071217 21:45]:
>  
> Hi Tony,
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony@atomide.com] 
> 
> >
> >* Girish <girishsg@ti.com> [071216 21:53]:
> >> This patch adds rtc-twl4030 driver specific code.
> >
> >Almost ready.. Just few more things:
> >
> >- Please changes spaces to tabs to follow the CodingStyle
> 
> These spaces din't figure out when I ran checkpatch script, does checkpatch needs an upgrade for such kind of space checks? If yes I
> can try  sending a patch to the maintainer. 

Yeah, checkpatch does not check for that.. I guess it could check for
double spaces and warn about them. Might be a pain to include all the
rules for it though.

> >- Please change the subject to say "RTC: twl4030-rtc specific code"
> 
> I'll resend the patch with above comments fixed.

Thanks, that saves me some re-editing :)

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-18  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17  5:52 [Resending PATCH 1/2] driver:twl4030-rtc specific code Girish
2007-12-17 18:59 ` Tony Lindgren
2007-12-18  5:45   ` Girish
2007-12-18  5:50     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox