Skip to contentSkip to conversation

rtc: max77686: Add support for MAX20024/MAX77620 RTC IP

PATCH In review Laxman Dewangan 3 participants 5 messages Mar 2, 2016

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

PATCH v2 1/2 rtc: max77686: Add support for MAX20024/MAX77620 RTC IP

Maxim Semiconductor's PMIC MAX77686 has RTC IP which is reused in the MAX77620/MAX20024 PMICs.

Add support for these devices in MAX77686 RTC driver. This device does not have RTC alarm pending status outside of RTC IP. The RTC IP is having separate I2C address for its register access.

---
Changes from V1:
- Remove macro and use value directly.
- Handle error returned from platform_get_irq()
- Remove compatible for max77620.
- Cleanup like indenting.

 drivers/rtc/Kconfig        |  4 ++--
 drivers/rtc/rtc-max77686.c | 47 +++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 5 deletions(-)
drivers/rtc/Kconfig +2 -2
index 08df14b..1c8dadc 100644
@@ -326,10 +326,10 @@ config RTC_DRV_MAX8997
 
 config RTC_DRV_MAX77686
 	tristate "Maxim MAX77686"
-	depends on MFD_MAX77686
+	depends on MFD_MAX77686 || MFD_MAX77620
 	help
 	  If you say yes here you will get support for the
-	  RTC of Maxim MAX77686 PMIC.
+	  RTC of Maxim MAX77686/MAX77620/MAX77802 PMIC.
 
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-max77686.
drivers/rtc/rtc-max77686.c +44 -3

96 lines not on this page · raw message

Signature · 12 lines
2.1.4

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
#1 lore raw

PATCH v2 2/2 rtc: max77686: Use REGMAP_IRQ_REG for regmap-rtc-irqs initialisation

Use macro REGMAP_IRQ_REG from regmap.h to initialise the regmap irq table for max77686 to have better coding style and improve readability.

---
Changes from V1:
- Added information in commit message for answering why it is done.

 drivers/rtc/rtc-max77686.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/rtc/rtc-max77686.c +6 -6
index 9cd4c4f..182fdd0 100644
@@ -171,12 +171,12 @@ static const unsigned int max77686_map[REG_RTC_END] = {
 
 static const struct regmap_irq max77686_rtc_irqs[] = {
 	/* RTC interrupts */
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_RTC60S_MSK, },
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_RTCA1_MSK, },
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_RTCA2_MSK, },
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_SMPL_MSK, },
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_RTC1S_MSK, },
-	{ .reg_offset = 0, .mask = MAX77686_RTCINT_WTSR_MSK, },
+	REGMAP_IRQ_REG(0, 0, MAX77686_RTCINT_RTC60S_MSK),
+	REGMAP_IRQ_REG(1, 0, MAX77686_RTCINT_RTCA1_MSK),
+	REGMAP_IRQ_REG(2, 0, MAX77686_RTCINT_RTCA2_MSK),
+	REGMAP_IRQ_REG(3, 0, MAX77686_RTCINT_SMPL_MSK),
+	REGMAP_IRQ_REG(4, 0, MAX77686_RTCINT_RTC1S_MSK),
+	REGMAP_IRQ_REG(5, 0, MAX77686_RTCINT_WTSR_MSK),
 };
 
 static const struct regmap_irq_chip max77686_rtc_irq_chip = {
Signature · 12 lines
2.1.4

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
Reviewed-by on v2 2/2
#2 lore raw

Re: [PATCH V2 2/2] rtc: max77686: Use REGMAP_IRQ_REG for regmap-rtc-irqs initialisation

Quoted 4 lines · Laxman Dewangan

Use macro REGMAP_IRQ_REG from regmap.h to initialise the regmap irq table for max77686 to have better coding style and improve readability.

Quoted 8 lines

---
Changes from V1:
- Added information in commit message for answering why it is done.

 drivers/rtc/rtc-max77686.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Best regards,
Krzysztof

Signature · 9 lines
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
Reviewed-by on v2 1/2
#3 lore raw
In reply to Laxman Dewangan
Quoted 16 lines · Laxman Dewangan

Maxim Semiconductor's PMIC MAX77686 has RTC IP which is reused in the MAX77620/MAX20024 PMICs.

Add support for these devices in MAX77686 RTC driver. This device does not have RTC alarm pending status outside of RTC IP. The RTC IP is having separate I2C address for its register access.

---
Changes from V1:
- Remove macro and use value directly.
- Handle error returned from platform_get_irq()
- Remove compatible for max77620.
- Cleanup like indenting.

Quoted 4 lines
 drivers/rtc/Kconfig        |  4 ++--
 drivers/rtc/rtc-max77686.c | 47 +++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 5 deletions(-)

Best regards,
Krzysztof

Signature · 9 lines
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
#4 lore raw
In reply to Laxman Dewangan
Quoted 16 lines · Laxman Dewangan

Maxim Semiconductor's PMIC MAX77686 has RTC IP which is reused in the MAX77620/MAX20024 PMICs.

Add support for these devices in MAX77686 RTC driver. This device does not have RTC alarm pending status outside of RTC IP. The RTC IP is having separate I2C address for its register access.

---
Changes from V1:
- Remove macro and use value directly.
- Handle error returned from platform_get_irq()
- Remove compatible for max77620.
- Cleanup like indenting.

Quoted 4 lines
 drivers/rtc/Kconfig        |  4 ++--
 drivers/rtc/rtc-max77686.c | 47 +++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 46 insertions(+), 5 deletions(-)

Both applied, thanks.

Signature · 14 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.