[PATCH] add RTC_AIE_[ON,OFF] to the pcf50606 and pcf50633
Holger Freyther
zecke at openmoko.org
Wed Mar 19 21:38:04 CET 2008
Hey,
the legacy application 'atd' from Russ Nelson/Nils Faerber, used by Qtopia, to
schedule alarms currently fails to start as the the above ioctl is failing.
The other drivers in drivers/rtc implement the above ioctl and we can
implement it too.
The code to mask/unmask the RTC alarm is copied from the set_alarm routine and
adapted to use the reg_set_bit_mask and reg_set_clear_mask.
It is compiling, so it must work. Please welcome me the lkml way ;)
Signed-Off-by: Holger Hans Peter Freyther <zecke at openmoko.org>
Index: linux-2.6.24/drivers/i2c/chips/pcf50606.c
===================================================================
--- linux-2.6.24.orig/drivers/i2c/chips/pcf50606.c 2008-03-19
21:04:56.000000000 +0100
+++ linux-2.6.24/drivers/i2c/chips/pcf50606.c 2008-03-19 21:27:44.000000000
+0100
@@ -1184,7 +1184,17 @@
{
struct i2c_client *client = to_i2c_client(dev);
struct pcf50606_data *pcf = i2c_get_clientdata(client);
+
switch (cmd) {
+ case RTC_AIE_OFF:
+ /* disable the alarm interrupt */
+ reg_set_bit_mask(pcf, PCF50606_REG_INT1M,
+ PCF50606_INT1_ALARM, PCF50606_INT1_ALARM);
+ return 0;
+ case RTC_AIE_ON:
+ /* enable the alarm interrupt */
+ reg_clear_bits(pcf, PCF50606_REG_INT1M, PCF50606_INT1_ALARM);
+ return 0;
case RTC_PIE_OFF:
/* disable periodic interrupt (hz tick) */
pcf->flags &= ~PCF50606_F_RTC_SECOND;
Index: linux-2.6.24/drivers/i2c/chips/pcf50633.c
===================================================================
--- linux-2.6.24.orig/drivers/i2c/chips/pcf50633.c 2008-03-19
21:05:00.000000000 +0100
+++ linux-2.6.24/drivers/i2c/chips/pcf50633.c 2008-03-19 21:28:31.000000000
+0100
@@ -1288,7 +1288,17 @@
{
struct i2c_client *client = to_i2c_client(dev);
struct pcf50633_data *pcf = i2c_get_clientdata(client);
+
switch (cmd) {
+ case RTC_AIE_OFF:
+ /* disable the alarm interrupt */
+ reg_set_bit_mask(pcf, PCF50633_REG_INT1M,
+ PCF50633_INT1_ALARM, PCF50633_INT1_ALARM);
+ return 0;
+ case RTC_AIE_ON:
+ /* enable the alarm interrupt */
+ reg_clear_bits(pcf, PCF50633_REG_INT1M, PCF50633_INT1_ALARM);
+ return 0;
case RTC_PIE_OFF:
/* disable periodic interrupt (hz tick) */
pcf->flags &= ~PCF50633_F_RTC_SECOND;
More information about the openmoko-kernel
mailing list