Skip to contentSkip to conversation

rtc: rtc-isl12057: fixes and alarm support

PATCH New Arnaud Ebalard 4 participants 19 messages Nov 5, 2014 – Nov 7, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover rtc: rtc-isl12057: fixes and alarm support

Hi,

This series includes three patches for Intersil ISL12057 driver.

- first patch is a fix for masking issues which dates back to driver inclusion. Even if those issues are not critical per se, the patch is a good candidate for stable down to 3.14.

- second patch fixes remaining places where 'isl' is used instead of the expected NASDAQ symbol for Intersil (i.e. isil) after commit 7a6540ca856ae ("ARM: mvebu: Change vendor prefix for Intersil Corporation to isil").

- third patch provides alarm support for Intersil ISL12057. This support was not added when the driver was initially pushed in 3.14 kernel due to the inability to check interrupt support. After some soldering, this tests have been performed.

Comments are welcome,

Cheers,

a+

Arnaud Ebalard (3):
rtc: rtc-isl12057: fix masking of register values
rtc: rtc-isl12057: fix isil vs isl naming for intersil
rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

 .../devicetree/bindings/i2c/trivial-devices.txt    |   2 +-
 .../devicetree/bindings/vendor-prefixes.txt        |   2 +-
 drivers/rtc/rtc-isl12057.c                         | 319 ++++++++++++++++++++-
 3 files changed, 309 insertions(+), 14 deletions(-)
Signature · 1 line
2.1.1
#1 lore raw

PATCH 1/3 rtc: rtc-isl12057: fix masking of register values

When Intersil ISL12057 support was added by commit 70e123373c05 ("rtc:
Add support for Intersil ISL12057 I2C RTC chip"), two masks for time registers values imported from the device were either wrong or omitted, leading to additional bits from those registers to impact read values:

- mask for hour register value when reading it in AM/PM mode. As AM/PM mode is not the usual mode used by the driver, this error would only have an impact on an externally configured RTC hour later read by the driver.
- mask for month value. The lack of masking would provide an erroneous value if century bit is set.

This patch fixes those two masks.

Fixes 70e123373c05 ("rtc: Add support for Intersil ISL12057 I2C RTC chip")
---
 drivers/rtc/rtc-isl12057.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-isl12057.c +3 -3
index 455b601d731d..8132fbc7e10a 100644
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
 
 	if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
-		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f);
+		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
 		if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
 			tm->tm_hour += 12;
 	} else {					    /* 24 hour mode */
@@ -96,8 +96,8 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	}
 
 	tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
-	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
-	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */
+	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1;  /* starts at 1 */
+	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
 	tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
 }
 
Signature · 1 line
2.1.1
#2 lore raw

PATCH 1/3 rtc: rtc-isl12057: fix masking of register values

Hello Arnaud,

Quoted 35 lines · Arnaud Ebalard

When Intersil ISL12057 support was added by commit 70e123373c05 ("rtc:
Add support for Intersil ISL12057 I2C RTC chip"), two masks for time registers values imported from the device were either wrong or omitted, leading to additional bits from those registers to impact read values:

- mask for hour register value when reading it in AM/PM mode. As AM/PM mode is not the usual mode used by the driver, this error would only have an impact on an externally configured RTC hour later read by the driver.
- mask for month value. The lack of masking would provide an erroneous value if century bit is set.

This patch fixes those two masks.

Fixes 70e123373c05 ("rtc: Add support for Intersil ISL12057 I2C RTC chip")
---
 drivers/rtc/rtc-isl12057.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-isl12057.c +1 -1
index 455b601d731d..8132fbc7e10a 100644
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
 
 	if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
-		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f);
+		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
 		if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
 			tm->tm_hour += 12;
 	} else {					    /* 24 hour mode */

drivers/rtc/rtc-isl12057.c static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs) · line 99

Quoted 5 lines
drivers/rtc/rtc-isl12057.c +1 -1
@@ -96,8 +96,8 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	}
 
 	tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
-	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
+	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1;  /* starts at 1 */

unrelated change?

drivers/rtc/rtc-isl12057.c static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs) · line 102

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +1 -1
-	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */
+	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
 	tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
 }

This patch definitly improves the driver, still I see room for more improvement (all but the first issue are unrelated to this patch):

- There is a century bit in the RTC_MO driver that is now correctly masked to determine the month. Shouldn't it be used to flag if year is >= 2100? That seems to match the hardware leap year handling. (I.e. it considers RTC_YR=0 not to be a leap year iff RTC_MO_CENTURY is set.)

- I wonder how tm_wday should be handled. It seems to be hardly used by callers of rtc_read_time. Is it better to report the hardware state here or the weekday matching year/month/day?

- IMHO the probe function shouldn't clear the OSCILLATOR FAILURE BIT (OSF). It's an indicator that the stored time is wrong. Instead this bit should be evaluated in the read_time callback. (If it's set, return -ENODATA.) And only clear the bit in .set_time when the registers were updated. I think most drivers get that wrong.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

PATCH 1/3 rtc: rtc-isl12057: fix masking of register values

Hi,

Quoted 40 lines · Uwe Kleine-K?nig

Hello Arnaud,

Quoted 37 lines · Arnaud Ebalard

When Intersil ISL12057 support was added by commit 70e123373c05 ("rtc:
Add support for Intersil ISL12057 I2C RTC chip"), two masks for time registers values imported from the device were either wrong or omitted, leading to additional bits from those registers to impact read values:

- mask for hour register value when reading it in AM/PM mode. As AM/PM mode is not the usual mode used by the driver, this error would only have an impact on an externally configured RTC hour later read by the driver.
- mask for month value. The lack of masking would provide an erroneous value if century bit is set.

This patch fixes those two masks.

Fixes 70e123373c05 ("rtc: Add support for Intersil ISL12057 I2C RTC chip")
---
 drivers/rtc/rtc-isl12057.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-isl12057.c +1 -1
index 455b601d731d..8132fbc7e10a 100644
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
 
 	if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
-		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f);
+		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
 		if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
 			tm->tm_hour += 12;
 	} else {					    /* 24 hour mode */
@@ -96,8 +96,8 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	}
 
Quoted 4 lines

drivers/rtc/rtc-isl12057.c static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs) · line 99

Quoted 3 lines
drivers/rtc/rtc-isl12057.c +1 -1
 	tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
-	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
+	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1;  /* starts at 1 */

unrelated change?

yep, will remove it.

Quoted 17 lines

drivers/rtc/rtc-isl12057.c static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs) · line 102

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +1 -1
-	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */
+	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
 	tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
 }

This patch definitly improves the driver, still I see room for more improvement (all but the first issue are unrelated to this patch):

- There is a century bit in the RTC_MO driver that is now correctly masked to determine the month. Shouldn't it be used to flag if year is >= 2100? That seems to match the hardware leap year handling. (I.e. it considers RTC_YR=0 not to be a leap year iff RTC_MO_CENTURY is set.)

- I wonder how tm_wday should be handled. It seems to be hardly used by callers of rtc_read_time. Is it better to report the hardware state here or the weekday matching year/month/day?

Quoted 5 lines

- IMHO the probe function shouldn't clear the OSCILLATOR FAILURE BIT (OSF). It's an indicator that the stored time is wrong. Instead this bit should be evaluated in the read_time callback. (If it's set, return -ENODATA.) And only clear the bit in .set_time when the registers were updated. I think most drivers get that wrong.

Thanks for your feedback. I will take a look at those after alarm support is ok.

Cheers,

a+

#4 lore raw

PATCH 2/3 rtc: rtc-isl12057: fix isil vs isl naming for intersil

In reply to Arnaud Ebalard

When Intersil ISL12057 driver was introduced by commit 70e123373c05 (rtc: Add support for Intersil ISL12057 I2C RTC chip), the vendor prefix 'isl' was used instead of the expected 'isil' (Intersil NASDAQ symbol). Recently, a patch from Philip Zabel (7a6540ca856a,
ARM: mvebu: Change vendor prefix for Intersil Corporation to isil) fixed that prefix in ReadyNAS devices .dts files (AFAICT, the only kernel users at the moment).

That patch completes that work to change the remaining values in:

- Intersil ISL12057 driver (compatible string) and also associated Documentation/devicetree/bindings/i2c/trivial-devices.txt file to reflect the changes introduced by previous commit from Philip

- Documentation/devicetree/bindings/vendor-prefixes.txt files to avoid future mistakes

---
 Documentation/devicetree/bindings/i2c/trivial-devices.txt | 2 +-
 Documentation/devicetree/bindings/vendor-prefixes.txt     | 2 +-
 drivers/rtc/rtc-isl12057.c                                | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -1
index fbde415078e6..edac97c0f756 100644
@@ -55,7 +55,7 @@ fsl,sgtl5000		SGTL5000: Ultra Low-Power Audio Codec
 gmt,g751		G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
 infineon,slb9635tt	Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
 infineon,slb9645tt	Infineon SLB9645 I2C TPM (new protocol, max 400khz)
-isl,isl12057		Intersil ISL12057 I2C RTC Chip
+isil,isl12057		Intersil ISL12057 I2C RTC Chip
 maxim,ds1050		5 Bit Programmable, Pulse-Width Modulator
 maxim,max1237		Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
 maxim,max6625		9-Bit/12-Bit Temperature Sensors with I?C-Compatible Serial Interface
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -1
index 723999d73744..84193ecdc41c 100644
@@ -77,7 +77,7 @@ innolux	Innolux Corporation
 intel	Intel Corporation
 intercontrol	Inter Control Group
 isee	ISEE 2007 S.L.
-isl	Intersil
+isil	Intersil
 karo	Ka-Ro electronics GmbH
 keymile	Keymile GmbH
 lacie	LaCie
drivers/rtc/rtc-isl12057.c +1 -1
index 8132fbc7e10a..adb0646236b1 100644
@@ -279,7 +279,7 @@ static int isl12057_probe(struct i2c_client *client,
 
 #ifdef CONFIG_OF
 static const struct of_device_id isl12057_dt_match[] = {
-	{ .compatible = "isl,isl12057" },
+	{ .compatible = "isil,isl12057" },
 	{ },
 };
 #endif
Signature · 1 line
2.1.1
#5 lore raw

PATCH 2/3 rtc: rtc-isl12057: fix isil vs isl naming for intersil

Quoted 7 lines · Arnaud Ebalard

When Intersil ISL12057 driver was introduced by commit 70e123373c05 (rtc: Add support for Intersil ISL12057 I2C RTC chip), the vendor prefix 'isl' was used instead of the expected 'isil' (Intersil NASDAQ symbol). Recently, a patch from Philip Zabel (7a6540ca856a,
ARM: mvebu: Change vendor prefix for Intersil Corporation to isil) fixed that prefix in ReadyNAS devices .dts files (AFAICT, the only kernel users at the moment).

They may be the only in kernel users but someone with an out of tree DT
may be using the existing prefix, we shouldn't break compatibility with
them so we should support both compatible strings even if we want to
deprecate the isl, one.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141106/78ac7a76/attachment-0001.sig>

#6 lore raw

PATCH 2/3 rtc: rtc-isl12057: fix isil vs isl naming for intersil

Hi Mark,

Quoted 10 lines · Mark Brown
Quoted 7 lines · Arnaud Ebalard

When Intersil ISL12057 driver was introduced by commit 70e123373c05 (rtc: Add support for Intersil ISL12057 I2C RTC chip), the vendor prefix 'isl' was used instead of the expected 'isil' (Intersil NASDAQ symbol). Recently, a patch from Philip Zabel (7a6540ca856a,
ARM: mvebu: Change vendor prefix for Intersil Corporation to isil) fixed that prefix in ReadyNAS devices .dts files (AFAICT, the only kernel users at the moment).

Quoted 4 lines

They may be the only in kernel users but someone with an out of tree DT may be using the existing prefix, we shouldn't break compatibility with them so we should support both compatible strings even if we want to deprecate the isl, one.

Updating the patch in the following way should make it possible to support out-of-tree users while avoiding additional uses of 'isl':

- have two compatible entries in isl12057_dt_match struct instead of one i.e.:

    static const struct of_device_id isl12057_dt_match[] = {
   	{ .compatible = "isl,isl12057" },
   	{ .compatible = "isil,isl12057" },
    	{ },
    };

I think it matches the situation we have.

- keeping the updates I had for trivial-devices.txt and vendor-prefixes.txt files.

Thoughts?

Cheers,

a+

#7 lore raw

PATCH 2/3 rtc: rtc-isl12057: fix isil vs isl naming for intersil

Hello Arnaud,

Quoted 22 lines · Arnaud Ebalard
Quoted 10 lines · Mark Brown
Quoted 7 lines · Arnaud Ebalard

When Intersil ISL12057 driver was introduced by commit 70e123373c05 (rtc: Add support for Intersil ISL12057 I2C RTC chip), the vendor prefix 'isl' was used instead of the expected 'isil' (Intersil NASDAQ symbol). Recently, a patch from Philip Zabel (7a6540ca856a,
ARM: mvebu: Change vendor prefix for Intersil Corporation to isil) fixed that prefix in ReadyNAS devices .dts files (AFAICT, the only kernel users at the moment).

Quoted 4 lines

They may be the only in kernel users but someone with an out of tree DT may be using the existing prefix, we shouldn't break compatibility with them so we should support both compatible strings even if we want to deprecate the isl, one.

Updating the patch in the following way should make it possible to support out-of-tree users while avoiding additional uses of 'isl':

- have two compatible entries in isl12057_dt_match struct instead of one i.e.:

Quoted 7 lines
    static const struct of_device_id isl12057_dt_match[] = {
   	{ .compatible = "isl,isl12057" },
   	{ .compatible = "isil,isl12057" },
    	{ },
    };

I think it matches the situation we have.

This should work. I suggest to add a comment to the obsolete one to state not to use it for new boards.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#8 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

In reply to Arnaud Ebalard

This patch adds alarm support to Intersil ISL12057 driver. This allows to configure the chip to generate an interrupt when the alarm matches current time value. Alarm can be programmed up to one month in the future.

The patch was tested on a Netgear ReadyNAS 102 after some soldering of the IRQ#2 pin of the RTC chip to a MPP line of the SoC (the one used usually handles the reset button). By default, on this device, the interrupt line of the RTC chip is not directly connected to the SoC but to a PMIC which handles powering of the device upon alarm when it is off.

The test was performed using a modified .dts file reflecting this change and rtc-test.c program available in Documentation/rtc.txt. This test program ran as expected, which validates alarm supports, including interrupt support. Additional tests were performed on an unmodified ReadyNAS 102 to validate the ability to wake up the device based on a configured alarm value.

As a side note, the ISL12057 remains in the list of trivial devices, i.e. no specific DT binding being added by this patch: i2c core automatically handles extraction of IRQ line info from .dts file. For instance, if one wants to reference the interrupt line for the alarm in its .dts file, adding interrupt and interrupt-parent properties should work as expected:

          isl12057: isl12057 at 68 {
                  compatible = "isil,isl12057";
                  interrupt-parent = <&gpio0>;
                  interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
                  reg = <0x68>;
          };
---
 .../devicetree/bindings/i2c/trivial-devices.txt    |   2 +-
 drivers/rtc/rtc-isl12057.c                         | 311 ++++++++++++++++++++-
 2 files changed, 304 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -1
index edac97c0f756..f716e7da44a9 100644
@@ -55,7 +55,7 @@ fsl,sgtl5000		SGTL5000: Ultra Low-Power Audio Codec
 gmt,g751		G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
 infineon,slb9635tt	Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
 infineon,slb9645tt	Infineon SLB9645 I2C TPM (new protocol, max 400khz)
-isil,isl12057		Intersil ISL12057 I2C RTC Chip
+isil,isl12057		Intersil ISL12057 I2C RTC/Alarm Chip
 maxim,ds1050		5 Bit Programmable, Pulse-Width Modulator
 maxim,max1237		Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
 maxim,max6625		9-Bit/12-Bit Temperature Sensors with I?C-Compatible Serial Interface
drivers/rtc/rtc-isl12057.c +303 -8

376 lines not on this page · raw message

Signature · 1 line
2.1.1
#9 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 167

Quoted 3 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +3 -0
+static int _isl12057_rtc_toggle_alarm(struct device *dev, int enable)
+{
+	struct isl12057_rtc_data *data = dev_get_drvdata(dev);

I can't help but think that toggle is a confusing name for this. enable?

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 174

Quoted 5 lines
drivers/rtc/rtc-isl12057.c +5 -0
+	ret = regmap_update_bits(data->regmap, ISL12057_REG_INT,
+				 ISL12057_REG_INT_A1IE,
+				 enable ? ISL12057_REG_INT_A1IE : 0);
+	if (ret)
+		dev_err(dev, "%s: writing INT failed\n", __func__);

It's generally helpful to log the error code as well.

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 161

Quoted 11 lines
drivers/rtc/rtc-isl12057.c +1 -3
+static int _isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
 	struct isl12057_rtc_data *data = dev_get_drvdata(dev);
 	u8 regs[ISL12057_RTC_SEC_LEN];
 	int ret;
 
-	mutex_lock(&data->lock);
 	ret = regmap_bulk_read(data->regmap, ISL12057_REG_RTC_SC, regs,
 			       ISL12057_RTC_SEC_LEN);
-	mutex_unlock(&data->lock);
-

This is a perfectly sensible change (there's no need for the lock, regmap locks the physical I/O and there's no other interaction) but it's not related to enabling alarm functionality so should be in a separate patch.

drivers/rtc/rtc-isl12057.c static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm) · line 216

Quoted 8 lines
drivers/rtc/rtc-isl12057.c +8 -0
+static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+	struct isl12057_rtc_data *data = dev_get_drvdata(dev);
+	int ret;
+
+	mutex_lock(&data->lock);
+	ret = _isl12057_rtc_read_time(dev, tm);
+	mutex_unlock(&data->lock);

Why lock? I guess this is due to the above change but it seems better to just not lock since it's redundant.

drivers/rtc/rtc-isl12057.c static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm) · line 311

Quoted 11 lines
drivers/rtc/rtc-isl12057.c +11 -0
+	ret = rtc_tm_to_time(&rtc_tm, &rtc_secs);
+	if (ret)
+		goto err_unlock;
+
+	ret = rtc_tm_to_time(alarm_tm, &alarm_secs);
+	if (ret)
+		goto err_unlock;
+
+	/* If alarm time is before current time, disable the alarm */
+	if (!alarm->enabled || alarm_secs <= rtc_secs) {
+		enable = 0;

Shouldn't there be some margin for time rolling forwards when checking for alarm times in the past (or just refuse to set them, I've not checked if this is following existing practice for RTC drivers)?

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +4 -0
+	if (client->irq > 0) {
+		ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
+						isl12057_rtc_interrupt,
+						IRQF_SHARED|IRQF_ONESHOT,

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 517

Quoted 10 lines
drivers/rtc/rtc-isl12057.c +10 -0
+						DRV_NAME, client);
+		if (!ret) {
+			device_init_wakeup(&client->dev, true);
+		} else {
+			dev_err(dev, "irq %d unavailable, no alarm support\n",
+				client->irq);
+			client->irq = 0;
+		}
+	}
+

None of the alarm functionality checks to see if there's actually an IRQ
- is that OK? I'd at least expect the alarm interrupt enable call to check if the interrupt is wired up.

It's also bad form to overwrite client->irq - it's possible a future probe might work (eg, if the driver for the interrupt controller gets loaded). Ideally we'd handle deferred probe, though I don't think the interrupt core supports that yet.

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 536

Quoted 3 lines
drivers/rtc/rtc-isl12057.c +3 -0
+err:
+	if (client->irq > 0)
+		free_irq(client->irq, client);

The whole point with devm_ is that you don't need to manually free
anything, remove this (and the entire remove function).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141106/4b2c7d8e/attachment.sig>

#10 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

Quoted 9 lines · Mark Brown

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 167

Quoted 3 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +3 -0
+static int _isl12057_rtc_toggle_alarm(struct device *dev, int enable)
+{
+	struct isl12057_rtc_data *data = dev_get_drvdata(dev);

I can't help but think that toggle is a confusing name for this. enable?

If I recall correctly we had this argument before. Problem is that the function can also _disable_ the alarm, so to name it enable is just as misleading or confusing. update_alarm, maybe ?

Guenter

#11 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

Quoted 8 lines · Guenter Roeck
Quoted 2 lines · Mark Brown

I can't help but think that toggle is a confusing name for this. enable?

If I recall correctly we had this argument before. Problem is that the function can also _disable_ the alarm, so to name it enable is just as misleading or confusing. update_alarm, maybe ?

update seems reasonable, yes. toggle I'd expect to invert the state.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141106/f4bbde01/attachment.sig>

#12 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

In reply to Mark Brown

Hi,

Quoted 8 lines · Mark Brown

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 167

Quoted 3 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +3 -0
+static int _isl12057_rtc_toggle_alarm(struct device *dev, int enable)
+{
+	struct isl12057_rtc_data *data = dev_get_drvdata(dev);

I can't help but think that toggle is a confusing name for this. enable?

I'll fix the name to use update_alarm, as proposed by Guenter.

Quoted 7 lines

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 174

Quoted 5 lines
drivers/rtc/rtc-isl12057.c +5 -0
+	ret = regmap_update_bits(data->regmap, ISL12057_REG_INT,
+				 ISL12057_REG_INT_A1IE,
+				 enable ? ISL12057_REG_INT_A1IE : 0);
+	if (ret)
+		dev_err(dev, "%s: writing INT failed\n", __func__);

It's generally helpful to log the error code as well.

WILCO

Quoted 17 lines

drivers/rtc/rtc-isl12057.c static int isl12057_i2c_validate_chip(struct regmap *regmap) · line 161

Quoted 11 lines
drivers/rtc/rtc-isl12057.c +1 -3
+static int _isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm)
 {
 	struct isl12057_rtc_data *data = dev_get_drvdata(dev);
 	u8 regs[ISL12057_RTC_SEC_LEN];
 	int ret;
 
-	mutex_lock(&data->lock);
 	ret = regmap_bulk_read(data->regmap, ISL12057_REG_RTC_SC, regs,
 			       ISL12057_RTC_SEC_LEN);
-	mutex_unlock(&data->lock);
-

This is a perfectly sensible change (there's no need for the lock, regmap locks the physical I/O and there's no other interaction) but it's not related to enabling alarm functionality so should be in a separate patch.

Quoted 11 lines

drivers/rtc/rtc-isl12057.c static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm) · line 216

Quoted 8 lines
drivers/rtc/rtc-isl12057.c +8 -0
+static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+	struct isl12057_rtc_data *data = dev_get_drvdata(dev);
+	int ret;
+
+	mutex_lock(&data->lock);
+	ret = _isl12057_rtc_read_time(dev, tm);
+	mutex_unlock(&data->lock);

Why lock? I guess this is due to the above change but it seems better to just not lock since it's redundant.

I am aware regmap has an inner lock to protect access. But later in the patch, there are functions (e.g. isl12057_rtc_set_alarm()) which need to do various consecutive accesses to the device; the main purpose of the mutex is to protect those multiple accesses. In those functions, I cannot call functions which do try and get the lock, hence the creation of an underscore version (_isl12057_rtc_read_time()) which does not lock.

That being said, regarding isl12057_rtc_read_time() (the version I declare in rtc_ops structure), I agree that it does not need to get the lock as it only reads (and does not modify the device) and the regmap inner lock protection is ok in that context. As it is the only one to be in that case (read_alarm() is more complex and needs the lock).

Quoted 7 lines
Quoted 7 lines
drivers/rtc/rtc-isl12057.c +7 -0
+	ret = rtc_tm_to_time(&rtc_tm, &rtc_secs);
+	if (ret)
+		goto err_unlock;
+
+	ret = rtc_tm_to_time(alarm_tm, &alarm_secs);
+	if (ret)
+		goto err_unlock;
Quoted 8 lines

drivers/rtc/rtc-isl12057.c static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm) · line 311

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +4 -0
+
+	/* If alarm time is before current time, disable the alarm */
+	if (!alarm->enabled || alarm_secs <= rtc_secs) {
+		enable = 0;

Shouldn't there be some margin for time rolling forwards when checking for alarm times in the past (or just refuse to set them, I've not checked if this is following existing practice for RTC drivers)?

No strong feeling on that point. ISL12008 on which this driver is based has a similar logic.

Quoted 10 lines
Quoted 10 lines
drivers/rtc/rtc-isl12057.c +10 -0
+	if (client->irq > 0) {
+		ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
+						isl12057_rtc_interrupt,
+						IRQF_SHARED|IRQF_ONESHOT,
+						DRV_NAME, client);
+		if (!ret) {
+			device_init_wakeup(&client->dev, true);
+		} else {
+			dev_err(dev, "irq %d unavailable, no alarm support\n",
+				client->irq);
Quoted 8 lines

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 517

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +4 -0
+			client->irq = 0;
+		}
+	}
+

None of the alarm functionality checks to see if there's actually an IRQ
- is that OK? I'd at least expect the alarm interrupt enable call to check if the interrupt is wired up.

I can add those check BUT I would like some directions in order to support the following use case too.

Current three in-tree users of ISL12057 are NAS devices (Netgear ReadyNAS 102, 104 and 2120). All of them *do not have* the interrupt pin of the RTC chip connected to an interrupt line of the SoC. Nonetheless, the IRQ line of the chip being connected to a PMIC on the board (TI TPS65251 [1] on ReadyNAS 102 and 104, I do not know for ReadyNAS 2120). When the device is off and the alarm rings, the device gets powered on. AFAICT, the IRQ coming on the TPS65251 is not replicated on any line of the SoC.

I think it's possible w/ some soldering to get somewhere where the RTC framework wants me to be and finish the alarm part to have it merged upstream but that's of limited interest if in-tree user cannot use it to fit their need, i.e. configure an alarm value and enable the associated interrupt which is routed externally, i.e. not visible by the SoC.

FWIW, we had a similar discussion a while ago, during driver inclusion:

http://marc.info/?l=devicetree&m=138109313118504&w=2

Uwe, any idea?

Quoted 4 lines

It's also bad form to overwrite client->irq - it's possible a future probe might work (eg, if the driver for the interrupt controller gets loaded). Ideally we'd handle deferred probe, though I don't think the interrupt core supports that yet.

I'll add a field in my private structure to reference the irq, modify it at will and leave client->irq alone.

Quoted 6 lines

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 536

Quoted 3 lines
drivers/rtc/rtc-isl12057.c +3 -0
+err:
+	if (client->irq > 0)
+		free_irq(client->irq, client);

The whole point with devm_ is that you don't need to manually free anything, remove this (and the entire remove function).

good point. I'll remove the free_irq() call. I'll keep remove function though for other reasons; I think I will need to have a conditional call to device_init_wakeup() in it.

a+

[1]: http://natisbad.org/NAS/refs/tps65251.pdf

#13 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

Hi,

Quoted 19 lines · Arnaud Ebalard
Quoted 17 lines · Mark Brown

drivers/rtc/rtc-isl12057.c static int isl12057_rtc_read_time(struct device *dev, struct rtc_time *tm) · line 311

Quoted 11 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +11 -0
+	ret = rtc_tm_to_time(&rtc_tm, &rtc_secs);
+	if (ret)
+		goto err_unlock;
+
+	ret = rtc_tm_to_time(alarm_tm, &alarm_secs);
+	if (ret)
+		goto err_unlock;
+
+	/* If alarm time is before current time, disable the alarm */
+	if (!alarm->enabled || alarm_secs <= rtc_secs) {
+		enable = 0;

Shouldn't there be some margin for time rolling forwards when checking for alarm times in the past (or just refuse to set them, I've not checked if this is following existing practice for RTC drivers)?

Quoted 2 lines

No strong feeling on that point. ISL12008 on which this driver is based has a similar logic.

Some time ago I already had the feeling that there is much "rank growth" in the rtc drivers. I guess this is because maintenance of the rtc subsystem isn't optimal and there are no guidelines (at least I'm not aware of any) about detail questions.

Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
drivers/rtc/rtc-isl12057.c +10 -0
+	if (client->irq > 0) {
+		ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
+						isl12057_rtc_interrupt,
+						IRQF_SHARED|IRQF_ONESHOT,
+						DRV_NAME, client);
+		if (!ret) {
+			device_init_wakeup(&client->dev, true);
+		} else {
+			dev_err(dev, "irq %d unavailable, no alarm support\n",
+				client->irq);
Quoted 8 lines

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 517

Quoted 4 lines
drivers/rtc/rtc-isl12057.c +4 -0
+			client->irq = 0;
+		}
+	}
+

None of the alarm functionality checks to see if there's actually an IRQ
- is that OK? I'd at least expect the alarm interrupt enable call to check if the interrupt is wired up.

Quoted 5 lines

I can add those check BUT I would like some directions in order to support the following use case too.

Current three in-tree users of ISL12057 are NAS devices (Netgear ReadyNAS 102, 104 and 2120). All of them *do not have* the interrupt pin

I assume you don't have schematics of the devices, right? If so, do you think it might be worth to try to get them from Netgear? Just to make sure that there really is no pin connected to the SoC.

Quoted 3 lines

of the RTC chip connected to an interrupt line of the SoC. Nonetheless, the IRQ line of the chip being connected to a PMIC on the board (TI TPS65251 [1] on ReadyNAS 102 and 104, I do not know for ReadyNAS

Looking over the manual it seems there is no way to let the PMIC forward the irq either.

Quoted 9 lines

2120). When the device is off and the alarm rings, the device gets powered on. AFAICT, the IRQ coming on the TPS65251 is not replicated on any line of the SoC.

I think it's possible w/ some soldering to get somewhere where the RTC framework wants me to be and finish the alarm part to have it merged upstream but that's of limited interest if in-tree user cannot use it to fit their need, i.e. configure an alarm value and enable the associated interrupt which is routed externally, i.e. not visible by the SoC.

Do you need to enable the irq somewhere else (apart from in the RTC device)? I guess not.

Quoted 5 lines

FWIW, we had a similar discussion a while ago, during driver inclusion:

http://marc.info/?l=devicetree&m=138109313118504&w=2

Uwe, any idea?

What is the problem of a not-wired-up irq line? Does the rtc framework need to change to allow setting an alarm without the irq line being hooked up? Is it "only" that the alarm is missed? Irq polling probably isn't sensible?

I assume it's not that unusual that an rtc irq doesn't trigger a system irq, so having that supported nicely would be great.

Looking through the rtc's datasheet, the device is a tad more complicated than the current driver handles. There are two irq lines and three functions that can be routed through these (alarm1, alarm2 and clkout; not all combinations are possible).

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#14 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

Hi Uwe,

Thanks for your support.

Quoted 6 lines · Uwe Kleine-K?nig
Quoted 2 lines

No strong feeling on that point. ISL12008 on which this driver is based has a similar logic.

Some time ago I already had the feeling that there is much "rank growth" in the rtc drivers. I guess this is because maintenance of the rtc subsystem isn't optimal and there are no guidelines (at least I'm not aware of any) about detail questions.

I had that feeling too when I pushed the ISL12057 driver.

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

None of the alarm functionality checks to see if there's actually an IRQ
- is that OK? I'd at least expect the alarm interrupt enable call to check if the interrupt is wired up.

Quoted 8 lines
Quoted 5 lines

I can add those check BUT I would like some directions in order to support the following use case too.

Current three in-tree users of ISL12057 are NAS devices (Netgear ReadyNAS 102, 104 and 2120). All of them *do not have* the interrupt pin

I assume you don't have schematics of the devices, right? If so, do you think it might be worth to try to get them from Netgear? Just to make sure that there really is no pin connected to the SoC.

I'll ask but I am skeptical: I already tested all the MPP of the SoC so unless I missed something, it's unlikely.

Quoted 10 lines
Quoted 3 lines

of the RTC chip connected to an interrupt line of the SoC. Nonetheless, the IRQ line of the chip being connected to a PMIC on the board (TI TPS65251 [1] on ReadyNAS 102 and 104, I do not know for ReadyNAS

Looking over the manual it seems there is no way to let the PMIC forward the irq either.

Quoted 4 lines

2120). When the device is off and the alarm rings, the device gets powered on. AFAICT, the IRQ coming on the TPS65251 is not replicated on any line of the SoC.

Quoted 7 lines
Quoted 5 lines

I think it's possible w/ some soldering to get somewhere where the RTC framework wants me to be and finish the alarm part to have it merged upstream but that's of limited interest if in-tree user cannot use it to fit their need, i.e. configure an alarm value and enable the associated interrupt which is routed externally, i.e. not visible by the SoC.

Do you need to enable the irq somewhere else (apart from in the RTC device)? I guess not.

This is the problem: I just need to enable the interrupt in the ISL12057 (flag in regs) but w/o dealing with SoC/system interrupt, i.e. w/o having a client->irq passed to the driver. In current RTC framework, alarm support requires a client->irq and a working interrupt line w/ the SoC.

Quoted 8 lines
Quoted 5 lines

FWIW, we had a similar discussion a while ago, during driver inclusion:

http://marc.info/?l=devicetree&m=138109313118504&w=2

Uwe, any idea?

What is the problem of a not-wired-up irq line? Does the rtc framework need to change to allow setting an alarm without the irq line being hooked up?

yes.

Quoted 1 line

Is it "only" that the alarm is missed?

In practice, yes. But RTC framework does not support that. Or maybe there is some trick a maintainer would be aware of to support that scenario. Something involving:

- returning some specific value in alarm_irq_enable handler
- calling device_init_wakeup(dev, true); w/o having an IRQ line
- extend workaround started in c9f5c7e7a84f and 4a649903f91232 and expose those via dt
- ...

Quoted 4 lines

Irq polling probably isn't sensible?

I assume it's not that unusual that an rtc irq doesn't trigger a system irq, so having that supported nicely would be great.

Now, we're two to think that way ;-)

Quoted 4 lines

Looking through the rtc's datasheet, the device is a tad more complicated than the current driver handles. There are two irq lines and three functions that can be routed through these (alarm1, alarm2 and clkout; not all combinations are possible).

Yes, but I wanted to handle the problem at hand before soldering IRQ#1 on my RN102 and add more feature.

a+

#15 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

In reply to Uwe Kleine-König
Quoted 5 lines · Uwe Kleine-K?nig
Quoted 4 lines · Arnaud Ebalard

Mark Brown <[email protected]> writes:

FWIW, we had a similar discussion a while ago, during driver inclusion:

Quoted 8 lines
Quoted 3 lines

http://marc.info/?l=devicetree&m=138109313118504&w=2

Uwe, any idea?

What is the problem of a not-wired-up irq line? Does the rtc framework need to change to allow setting an alarm without the irq line being hooked up? Is it "only" that the alarm is missed? Irq polling probably isn't sensible?

The problem is that we've got operations like alarm_irq_enable() which probably shouldn't be reporting success if we don't have an interrupt line. Setting the alarm with no interrupt might still be useful but that at least ought to fail I'd expect.

Quoted 4 lines

I assume it's not that unusual that an rtc irq doesn't trigger a system irq, so having that supported nicely would be great.

Quoted 12 lines

Looking through the rtc's datasheet, the device is a tad more complicated than the current driver handles. There are two irq lines and three functions that can be routed through these (alarm1, alarm2 and clkout; not all combinations are possible).

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141107/ec400187/attachment.sig>

#16 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

In reply to Arnaud Ebalard
Quoted 9 lines · Arnaud Ebalard
Quoted 3 lines · Mark Brown

None of the alarm functionality checks to see if there's actually an IRQ
- is that OK? I'd at least expect the alarm interrupt enable call to check if the interrupt is wired up.

I can add those check BUT I would like some directions in order to support the following use case too.

Quoted 8 lines

Current three in-tree users of ISL12057 are NAS devices (Netgear ReadyNAS 102, 104 and 2120). All of them *do not have* the interrupt pin of the RTC chip connected to an interrupt line of the SoC. Nonetheless, the IRQ line of the chip being connected to a PMIC on the board (TI TPS65251 [1] on ReadyNAS 102 and 104, I do not know for ReadyNAS 2120). When the device is off and the alarm rings, the device gets powered on. AFAICT, the IRQ coming on the TPS65251 is not replicated on any line of the SoC.

It's OK to support not having the interrupt, the point is that if there
isn't an interrupt the driver shouldn't support operations which rely on
the interrupt to succeed - things like enabling the alarm IRQ for
example.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141107/f0d88edf/attachment.sig>

#17 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

In reply to Arnaud Ebalard

Hello,

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 551

Quoted 4 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +4 -0
+#ifdef CONFIG_PM_SLEEP
+static int isl12057_rtc_suspend(struct device *dev)
+{
+	struct isl12057_rtc_data *rtc_data = dev_get_drvdata(&client->dev);

drivers/rtc/rtc-isl12057.c: In function 'isl12057_rtc_suspend':
drivers/rtc/rtc-isl12057.c:551:56: error: 'client' undeclared (first use in this function)

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 557

Quoted 6 lines
drivers/rtc/rtc-isl12057.c +5 -0
+
+	if (device_may_wakeup(dev))
+		return enable_irq_wake(rtc_data->irq);
+
+	return 0;
 }

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#18 lore raw

PATCH 3/3 rtc: rtc-isl12057: add alarm support to Intersil ISL12057 RTC driver

Hi Uwe,

Quoted 8 lines · Uwe Kleine-K?nig

drivers/rtc/rtc-isl12057.c static int isl12057_probe(struct i2c_client *client, · line 551

Quoted 4 lines · Arnaud Ebalard
drivers/rtc/rtc-isl12057.c +4 -0
+#ifdef CONFIG_PM_SLEEP
+static int isl12057_rtc_suspend(struct device *dev)
+{
+	struct isl12057_rtc_data *rtc_data = dev_get_drvdata(&client->dev);

drivers/rtc/rtc-isl12057.c: In function 'isl12057_rtc_suspend':
drivers/rtc/rtc-isl12057.c:551:56: error: 'client' undeclared (first use in this function)

I guess I forgot to do a git commit after my last quilt refresh before pushing the patches. Sorry for that.

Cheers,

a+