rtc: add support for NXP PCF85363 real-time clock
Subsystems (2)
PATCH 1/1 rtc: add support for NXP PCF85363 real-time clock
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmem
--- Documentation/devicetree/bindings/rtc/pcf85363.txt | 16 ++ drivers/rtc/Kconfig | 12 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 219 +++++++++++++++++++++ 4 files changed, 248 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.c
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +16 -0
@@ -0,0 +1,16 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip. + +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>; +}; + +Note that alarms are not yet supported, so a specifier for +"interrupts" will be ignored.
drivers/rtc/Kconfig +12 -0
@@ -433,6 +433,18 @@ config RTC_DRV_PCF85063 This driver can also be built as a module. If so, the module will be called rtc-pcf85063. +config RTC_DRV_PCF85363 + tristate "NXP PCF85363" + depends on I2C + help + If you say yes here you get support for the PCF85363 RTC chip. + + This driver can also be built as a module. If so, the module + will be called rtc-pcf85363. + + The nvmem interface will be named pcf85363-#, where # is the + zero-based instance number. + config RTC_DRV_PCF8563 tristate "Philips PCF8563/Epson RTC8564" help
drivers/rtc/Makefile +1 -0
@@ -113,6 +113,7 @@ obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o +obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
drivers/rtc/rtc-pcf85363.c new file +219 -0
219 lines not on this page · raw message
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1507578100-2148-1-git-send-email-eric-SeqgQ6RdavfQT0dZR+AlfA@public.gmane.org
Hi Eric,
drivers/rtc/Kconfig config RTC_DRV_PCF85063 · line 438
Quoted 3 lines · Eric Nelson
drivers/rtc/Kconfig +3
-0+config RTC_DRV_PCF85363 + tristate "NXP PCF85363" + depends on I2C
It seems you missed a dependency on REGMAP_I2C.
drivers/rtc/rtc-pcf85363.c line 205
Quoted 5 lines
drivers/rtc/rtc-pcf85363.c new file +5
-0+static const struct i2c_device_id pcf85363_id[] = { + {"pcf85363" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, pcf85363_id);
Even though the driver can probe via the i2c device id, it is recommended to explicitly pass the compatible string:
static const struct of_device_id pcf85363_dt_match[] = { { .compatible = "nxp,pcf85363" },
{ },
See this previous discussion:
https://www.spinics.net/lists/devicetree/msg195176.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAOMZO5C_boginn88C7zgXSBaikx==5FHJrgaE1ewYUyUgGfnFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Hi Fabio,
Quoted 10 lines · Fabio Estevam
Hi Eric,
drivers/rtc/Kconfig config RTC_DRV_PCF85063 · line 438
Quoted 3 lines · Eric Nelson
drivers/rtc/Kconfig +3
-0+config RTC_DRV_PCF85363 + tristate "NXP PCF85363" + depends on I2CIt seems you missed a dependency on
REGMAP_I2C.
Nice catch. Thanks.
Quoted 9 lines
drivers/rtc/rtc-pcf85363.c line 205
Quoted 5 lines
drivers/rtc/rtc-pcf85363.c new file +5
-0+static const struct i2c_device_id pcf85363_id[] = { + {"pcf85363" ,0 }, + { } +}; +MODULE_DEVICE_TABLE (i2c, pcf85363_id);Even though the driver can probe via the i2c device id, it is recommended to explicitly pass the compatible string:
Quoted 7 lines
static const struct
of_device_idpcf85363_dt_match[] = { { .compatible = "nxp,pcf85363" },
{ },See this previous discussion:
https://www.spinics.net/lists/devicetree/msg195176.html
Thanks for that, too.
I'll fix this up in V2.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 rtc: add support for NXP PCF85363 real-time clock
In reply to a message not in the archiveNote that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmem
---
V2 addresses a couple of issues highlighted by Fabio Estevam
1. Kconfig updated to select REGMAP_I2C
2. Switch to of_device_id from i2c_device_id for driver matching
Documentation/devicetree/bindings/rtc/pcf85363.txt | 16 ++ drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 251 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.c
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +16 -0
@@ -0,0 +1,16 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip. + +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>; +}; + +Note that alarms are not yet supported, so a specifier for +"interrupts" will be ignored.
drivers/rtc/Kconfig +13 -0
@@ -433,6 +433,19 @@ config RTC_DRV_PCF85063 This driver can also be built as a module. If so, the module will be called rtc-pcf85063. +config RTC_DRV_PCF85363 + tristate "NXP PCF85363" + depends on I2C + select REGMAP_I2C + help + If you say yes here you get support for the PCF85363 RTC chip. + + This driver can also be built as a module. If so, the module + will be called rtc-pcf85363. + + The nvmem interface will be named pcf85363-#, where # is the + zero-based instance number. + config RTC_DRV_PCF8563 tristate "Philips PCF8563/Epson RTC8564" help
drivers/rtc/Makefile +1 -0
@@ -113,6 +113,7 @@ obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o +obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
drivers/rtc/rtc-pcf85363.c new file +221 -0
221 lines not on this page · raw message
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1507737390-27818-1-git-send-email-eric-SeqgQ6RdavfQT0dZR+AlfA@public.gmane.org
Fabio Estevam
Reviewed-byQuoted 8 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 33 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>---
V2 addresses a couple of issues highlighted by Fabio Estevam
1.Kconfigupdated to selectREGMAP_I2C
2. Switch toof_device_idfromi2c_device_idfor driver matchingDocumentation/devicetree/bindings/rtc/pcf85363.txt | 16 ++ drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 251 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.cDocumentation/devicetree/bindings/rtc/pcf85363.txt new file +6
-0@@ -0,0 +1,16 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip.
Documentation/devicetree/bindings/rtc/pcf85363.txt line 16
Quoted 10 lines
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +10
-0+ +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>; +}; + +Note that alarms are not yet supported, so a specifier for +"interrupts" will be ignored.
Irrelevant to the binding. That's a driver feature (or lack of). If the device has an interrupt line, you should document it. It can be optional though.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Rob,
Quoted 40 lines · Rob Herring
Quoted 39 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>---
V2 addresses a couple of issues highlighted by Fabio Estevam
1.Kconfigupdated to selectREGMAP_I2C
2. Switch toof_device_idfromi2c_device_idfor driver matchingDocumentation/devicetree/bindings/rtc/pcf85363.txt | 16 ++ drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 251 insertions(+)create mode 100644
Documentation/devicetree/bindings/rtc/pcf85363.txtcreate mode 100644drivers/rtc/rtc-pcf85363.cDocumentation/devicetree/bindings/rtc/pcf85363.txt new file +12
-0@@ -0,0 +1,16 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip. + +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>;
Quoted 9 lines
Documentation/devicetree/bindings/rtc/pcf85363.txt line 16
Quoted 4 lines
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +4
-0+}; + +Note that alarms are not yet supported, so a specifier for +"interrupts" will be ignored.Irrelevant to the binding. That's a driver feature (or lack of). If the device has an interrupt line, you should document it. It can be optional though.
That's what I was attempting do do in an awkward way.
Since the driver doesn't support interrupts or alarms at the moment, I'll remove this note.
The chip does have an interrupt pin, but the board I have doesn't have it connected.
Regards,
Eric
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20602538-2164-e85c-33b6-31c99dfa8a5e-SeqgQ6RdavfQT0dZR+AlfA@public.gmane.org
Quoted 59 lines · Eric Nelson
Hi Rob,
Quoted 45 lines · Rob Herring
Quoted 43 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>---
V2 addresses a couple of issues highlighted by Fabio Estevam
1.Kconfigupdated to selectREGMAP_I2C
2. Switch toof_device_idfromi2c_device_idfor driver matchingDocumentation/devicetree/bindings/rtc/pcf85363.txt | 16 ++ drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 251 insertions(+)create mode 100644
Documentation/devicetree/bindings/rtc/pcf85363.txtcreate mode 100644drivers/rtc/rtc-pcf85363.cDocumentation/devicetree/bindings/rtc/pcf85363.txt new file +13
-0@@ -0,0 +1,16 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip. + +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>; +};Quoted 9 lines
Documentation/devicetree/bindings/rtc/pcf85363.txt line 16
Quoted 3 lines
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +3
-0+ +Note that alarms are not yet supported, so a specifier for +"interrupts" will be ignored.Irrelevant to the binding. That's a driver feature (or lack of). If the device has an interrupt line, you should document it. It can be optional though.
Quoted 7 lines
That's what I was attempting do do in an awkward way.
Since the driver doesn't support interrupts or alarms at the moment, I'll remove this note.
The chip does have an interrupt pin, but the board I have doesn't have it connected.
Then just document "interrupts" as optional.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAL_Jsq+QQK=NTMBwk=h0uszLW0uSiEd1fmF09USRNFM-2VgiSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
PATCH v3 1/1 rtc: add support for NXP PCF85363 real-time clock
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmem
---
V2 addresses a couple of issues highlighted by Fabio Estevam
1. Kconfig updated to select REGMAP_I2C
2. Switch to of_device_id from i2c_device_id for driver matching
V3 adds interrupts as an optional property in device tree bindings
drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 252 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.c
Documentation/devicetree/bindings/rtc/pcf85363.txt new file +17 -0
@@ -0,0 +1,17 @@ +NXP PCF85363 Real Time Clock +============================ + +Required properties: +- compatible: Should contain "nxp,pcf85363". +- reg: I2C address for chip. + +Optional properties: +- interrupts: IRQ line for the RTC (not implemented). + +Example: + +pcf85363: pcf85363@51 { + compatible = "nxp,pcf85363"; + reg = <0x51>; +}; +
drivers/rtc/Kconfig +13 -0
@@ -433,6 +433,19 @@ config RTC_DRV_PCF85063 This driver can also be built as a module. If so, the module will be called rtc-pcf85063. +config RTC_DRV_PCF85363 + tristate "NXP PCF85363" + depends on I2C + select REGMAP_I2C + help + If you say yes here you get support for the PCF85363 RTC chip. + + This driver can also be built as a module. If so, the module + will be called rtc-pcf85363. + + The nvmem interface will be named pcf85363-#, where # is the + zero-based instance number. + config RTC_DRV_PCF8563 tristate "Philips PCF8563/Epson RTC8564" help
drivers/rtc/Makefile +1 -0
@@ -113,6 +113,7 @@ obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o +obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
drivers/rtc/rtc-pcf85363.c new file +221 -0
221 lines not on this page · raw message
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1509548480-29472-1-git-send-email-eric-SeqgQ6RdavfQT0dZR+AlfA@public.gmane.org
Rob Herring
Acked-byQuoted 14 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>---
V2 addresses a couple of issues highlighted by Fabio Estevam
1.Kconfigupdated to selectREGMAP_I2C
2. Switch toof_device_idfromi2c_device_idfor driver matching
Quoted 8 lines
V3 adds interrupts as an optional property in device tree bindings
drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 252 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.c
For the binding:
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 14 lines · Eric Nelson
Note that alarms are not currently implemented.
64 bytes of nvmem is supported and exposed in sysfs (# is the instance number, starting with 0):
/sys/bus/nvmem/devices/pcf85363-#/nvmemSigned-off-by Eric Nelson <[email protected]>Reviewed-by Fabio Estevam <[email protected]>---
V2 addresses a couple of issues highlighted by Fabio Estevam
1.Kconfigupdated to selectREGMAP_I2C
2. Switch toof_device_idfromi2c_device_idfor driver matching
Quoted 9 lines
V3 adds interrupts as an optional property in device tree bindings
drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 252 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/pcf85363.txt create mode 100644 drivers/rtc/rtc-pcf85363.c
I've tested it (thanks to Fabio, I received one a few weeks ago)
Applied with the following change:
drivers/rtc/rtc-pcf85363.c +0 -1
@@ -194,7 +194,6 @@ static int pcf85363_probe(struct i2c_client *client, pcf85363->nvmem_cfg.reg_write = pcf85363_nvram_write; pcf85363->nvmem_cfg.priv = pcf85363; pcf85363->rtc->nvmem_config = &pcf85363->nvmem_cfg; - pcf85363->rtc->nvram_old_abi = true; pcf85363->rtc->ops = &rtc_ops;return rtc_register_device (pcf85363->rtc);
nvram_old_abi must not be used for new drivers and will generate warning when the (undocumented) ABI is used anyway.
Signature · 7 lines
Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20171104160836.bah5su2ld5ckycr3-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org
Quoted 1 line · Alexandre Belloni
On 01/11/2017 at 08:01:20 -0700, Eric Nelson wrote:
<snip>
Quoted 26 lines
Quoted 10 lines
V3 adds interrupts as an optional property in device tree bindings
drivers/rtc/Kconfig | 13 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-pcf85363.c | 221 +++++++++++++++++++++ 4 files changed, 252 insertions(+)create mode 100644
Documentation/devicetree/bindings/rtc/pcf85363.txtcreate mode 100644drivers/rtc/rtc-pcf85363.cI've tested it (thanks to Fabio, I received one a few weeks ago)
Applied with the following change:
drivers/rtc/rtc-pcf85363.c +0
-1@@ -194,7 +194,6 @@ static int pcf85363_probe(struct i2c_client *client, pcf85363->nvmem_cfg.reg_write = pcf85363_nvram_write; pcf85363->nvmem_cfg.priv = pcf85363; pcf85363->rtc->nvmem_config = &pcf85363->nvmem_cfg; - pcf85363->rtc->nvram_old_abi = true; pcf85363->rtc->ops = &rtc_ops;return rtc_register_device (pcf85363->rtc);
Quoted 3 lines
nvram_old_abimust not be used for new drivers and will generate warning when the (undocumented) ABI is used anyway.
Thanks Alexandre (and Fabio).
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html