linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH  0/4] Add NXP pcf85263 real-time clock support
@ 2018-11-19 11:15 Biju Das
  2018-11-19 11:15 ` [PATCH 1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock Biju Das
  2018-11-19 11:15 ` [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc Biju Das
  0 siblings, 2 replies; 9+ messages in thread
From: Biju Das @ 2018-11-19 11:15 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland
  Cc: Biju Das, linux-rtc, devicetree, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Fabrizio Castro,
	linux-renesas-soc

This patch set aims to add support for NXP pcf85263 real-time clock. 
pcf85263 rtc is compatible with pcf85363 rtc except that pcf85363 has
64 bytes additional RAM. 

1 byte of nvmem is supported in pcf85263 and is exposed through sysfs.

The details of pcf85363 and pcf85263 can be found in the below
data sheets.

https://www.nxp.com/docs/en/data-sheet/PCF85363A.pdf

https://www.nxp.com/docs/en/data-sheet/PCF85263A.pdf


This patch is tested against linux-next and renesas-dev.

Biju Das (4):
  dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  rtc: pcf85363: Add support for NXP pcf85263 rtc
  ARM: shmobile: Enable NXP pcf85363 rtc in shmobile_defconfig
  ARM: dts: iwg23s-sbc: Enable RTC

 Documentation/devicetree/bindings/rtc/pcf85363.txt |  4 +-
 arch/arm/boot/dts/r8a77470-iwg23s-sbc.dts          | 18 +++++++++
 arch/arm/configs/shmobile_defconfig                |  1 +
 drivers/rtc/rtc-pcf85363.c                         | 44 +++++++++++++++++++---
 4 files changed, 60 insertions(+), 7 deletions(-)

-- 
2.7.4


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

* [PATCH  1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  2018-11-19 11:15 [PATCH 0/4] Add NXP pcf85263 real-time clock support Biju Das
@ 2018-11-19 11:15 ` Biju Das
  2018-11-21 10:04   ` Simon Horman
  2018-11-19 11:15 ` [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc Biju Das
  1 sibling, 1 reply; 9+ messages in thread
From: Biju Das @ 2018-11-19 11:15 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland
  Cc: Biju Das, linux-rtc, devicetree, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Fabrizio Castro,
	linux-renesas-soc

This patch adds binding for NXP pcf85263 real-time clock. pcf85263 rtc is
compatible with pcf85363 rtc except that pcf85363 has 64 bytes additional
RAM.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 Documentation/devicetree/bindings/rtc/pcf85363.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/pcf85363.txt b/Documentation/devicetree/bindings/rtc/pcf85363.txt
index 76fdabc..94adc1c 100644
--- a/Documentation/devicetree/bindings/rtc/pcf85363.txt
+++ b/Documentation/devicetree/bindings/rtc/pcf85363.txt
@@ -1,8 +1,8 @@
-NXP PCF85363 Real Time Clock
+NXP PCF85263/PCF85363 Real Time Clock
 ============================
 
 Required properties:
-- compatible: Should contain "nxp,pcf85363".
+- compatible: Should contain "nxp,pcf85263" or "nxp,pcf85363".
 - reg: I2C address for chip.
 
 Optional properties:
-- 
2.7.4


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

* [PATCH  2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
  2018-11-19 11:15 [PATCH 0/4] Add NXP pcf85263 real-time clock support Biju Das
  2018-11-19 11:15 ` [PATCH 1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock Biju Das
@ 2018-11-19 11:15 ` Biju Das
  2018-11-21 10:23   ` Geert Uytterhoeven
  1 sibling, 1 reply; 9+ messages in thread
From: Biju Das @ 2018-11-19 11:15 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: Biju Das, linux-rtc, Simon Horman, Geert Uytterhoeven,
	Chris Paterson, Fabrizio Castro, linux-renesas-soc

Add support for NXP pcf85263 real-time clock. pcf85263 rtc is compatible
with pcf85363,except that pcf85363 has additional 64 bytes of RAM.

1 byte of nvmem is supported and exposed in sysfs (# is the instance
number,starting with 0): /sys/bus/nvmem/devices/pcf85263-#/nvmem

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/rtc/rtc-pcf85363.c | 44 +++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index c04a1ed..6996aa5 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -311,7 +311,30 @@ static int pcf85363_nvram_write(void *priv, unsigned int offset, void *val,
 				 val, bytes);
 }
 
-static const struct regmap_config regmap_config = {
+static int pcf85263_nvram_read(void *priv, unsigned int offset, void *val,
+			       size_t bytes)
+{
+	struct pcf85363 *pcf85363 = priv;
+
+	return regmap_read(pcf85363->regmap, CTRL_RAMBYTE, val);
+}
+
+static int pcf85263_nvram_write(void *priv, unsigned int offset, void *val,
+				size_t bytes)
+{
+	struct pcf85363 *pcf85363 = priv;
+
+	return regmap_write(pcf85363->regmap, CTRL_RAMBYTE,
+				*((unsigned int *)val));
+}
+
+static const struct regmap_config pcf_85263_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = 0x2f,
+};
+
+static const struct regmap_config pcf_85363_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.max_register = 0x7f,
@@ -321,6 +344,7 @@ static int pcf85363_probe(struct i2c_client *client,
 			  const struct i2c_device_id *id)
 {
 	struct pcf85363 *pcf85363;
+	const struct regmap_config *regmap_config = &pcf_85363_regmap_config;
 	struct nvmem_config nvmem_cfg = {
 		.name = "pcf85363-",
 		.word_size = 1,
@@ -339,7 +363,16 @@ static int pcf85363_probe(struct i2c_client *client,
 	if (!pcf85363)
 		return -ENOMEM;
 
-	pcf85363->regmap = devm_regmap_init_i2c(client, &regmap_config);
+	if (of_device_get_match_data(&client->dev) ==
+					&pcf_85263_regmap_config) {
+		regmap_config = &pcf_85263_regmap_config;
+		nvmem_cfg.name = "pcf85263-";
+		nvmem_cfg.size = 1;
+		nvmem_cfg.reg_read = pcf85263_nvram_read;
+		nvmem_cfg.reg_write = pcf85263_nvram_write;
+	}
+
+	pcf85363->regmap = devm_regmap_init_i2c(client, regmap_config);
 	if (IS_ERR(pcf85363->regmap)) {
 		dev_err(&client->dev, "regmap allocation failed\n");
 		return PTR_ERR(pcf85363->regmap);
@@ -377,8 +410,9 @@ static int pcf85363_probe(struct i2c_client *client,
 }
 
 static const struct of_device_id dev_ids[] = {
-	{ .compatible = "nxp,pcf85363" },
-	{}
+	{ .compatible = "nxp,pcf85263", .data = &pcf_85263_regmap_config },
+	{ .compatible = "nxp,pcf85363", .data = &pcf_85363_regmap_config },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, dev_ids);
 
@@ -393,5 +427,5 @@ static struct i2c_driver pcf85363_driver = {
 module_i2c_driver(pcf85363_driver);
 
 MODULE_AUTHOR("Eric Nelson");
-MODULE_DESCRIPTION("pcf85363 I2C RTC driver");
+MODULE_DESCRIPTION("pcf85263/pcf85363 I2C RTC driver");
 MODULE_LICENSE("GPL");
-- 
2.7.4


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

* Re: [PATCH  1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  2018-11-19 11:15 ` [PATCH 1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock Biju Das
@ 2018-11-21 10:04   ` Simon Horman
  2018-11-21 10:09     ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2018-11-21 10:04 UTC (permalink / raw)
  To: Biju Das
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	linux-rtc, devicetree, Geert Uytterhoeven, Chris Paterson,
	Fabrizio Castro, linux-renesas-soc

On Mon, Nov 19, 2018 at 11:15:05AM +0000, Biju Das wrote:
> This patch adds binding for NXP pcf85263 real-time clock. pcf85263 rtc is
> compatible with pcf85363 rtc except that pcf85363 has 64 bytes additional
> RAM.

How about this:

This patch adds binding for the NXP pcf85263 real-time clock.

The pcf85263 RTC is compatible with the pcf85363 RTC. The difference
between the parts is except that the pcf85363 has 64 bytes more RAM.

> Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> ---
>  Documentation/devicetree/bindings/rtc/pcf85363.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/pcf85363.txt b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> index 76fdabc..94adc1c 100644
> --- a/Documentation/devicetree/bindings/rtc/pcf85363.txt
> +++ b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> @@ -1,8 +1,8 @@
> -NXP PCF85363 Real Time Clock
> +NXP PCF85263/PCF85363 Real Time Clock
>  ============================
>  
>  Required properties:
> -- compatible: Should contain "nxp,pcf85363".
> +- compatible: Should contain "nxp,pcf85263" or "nxp,pcf85363".
>  - reg: I2C address for chip.
>  
>  Optional properties:
> -- 
> 2.7.4
> 

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

* Re: [PATCH  1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  2018-11-21 10:04   ` Simon Horman
@ 2018-11-21 10:09     ` Simon Horman
  2018-11-22  9:31       ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2018-11-21 10:09 UTC (permalink / raw)
  To: Biju Das
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	linux-rtc, devicetree, Geert Uytterhoeven, Chris Paterson,
	Fabrizio Castro, linux-renesas-soc

On Wed, Nov 21, 2018 at 11:04:52AM +0100, Simon Horman wrote:
> On Mon, Nov 19, 2018 at 11:15:05AM +0000, Biju Das wrote:
> > This patch adds binding for NXP pcf85263 real-time clock. pcf85263 rtc is
> > compatible with pcf85363 rtc except that pcf85363 has 64 bytes additional
> > RAM.
> 
> How about this:
> 
> This patch adds binding for the NXP pcf85263 real-time clock.
> 
> The pcf85263 RTC is compatible with the pcf85363 RTC. The difference
> between the parts is except that the pcf85363 has 64 bytes more RAM.

The pcf85263 anRTC is compatible with the pcf85363 RTC.

The difference between the pcf85263 and pcf85363 RTS is that the latter has
64 bytes more RAM. This renders them incompatible from a DT point of view.

> 
> > Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> > ---
> >  Documentation/devicetree/bindings/rtc/pcf85363.txt | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/rtc/pcf85363.txt b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > index 76fdabc..94adc1c 100644
> > --- a/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > +++ b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > @@ -1,8 +1,8 @@
> > -NXP PCF85363 Real Time Clock
> > +NXP PCF85263/PCF85363 Real Time Clock
> >  ============================
> >  
> >  Required properties:
> > -- compatible: Should contain "nxp,pcf85363".
> > +- compatible: Should contain "nxp,pcf85263" or "nxp,pcf85363".
> >  - reg: I2C address for chip.
> >  
> >  Optional properties:
> > -- 
> > 2.7.4
> > 
> 

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

* Re: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
  2018-11-19 11:15 ` [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc Biju Das
@ 2018-11-21 10:23   ` Geert Uytterhoeven
  2018-11-21 10:35     ` Alexandre Belloni
  0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2018-11-21 10:23 UTC (permalink / raw)
  To: Biju Das
  Cc: Alessandro Zummo, Alexandre Belloni, linux-rtc, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Fabrizio Castro,
	Linux-Renesas

Hi Biju,

On Mon, Nov 19, 2018 at 12:23 PM Biju Das <biju.das@bp.renesas.com> wrote:
> Add support for NXP pcf85263 real-time clock. pcf85263 rtc is compatible
> with pcf85363,except that pcf85363 has additional 64 bytes of RAM.
>
> 1 byte of nvmem is supported and exposed in sysfs (# is the instance
> number,starting with 0): /sys/bus/nvmem/devices/pcf85263-#/nvmem
>
> Signed-off-by: Biju Das <biju.das@bp.renesas.com>

Thanks for your patch!

> --- a/drivers/rtc/rtc-pcf85363.c
> +++ b/drivers/rtc/rtc-pcf85363.c
> @@ -311,7 +311,30 @@ static int pcf85363_nvram_write(void *priv, unsigned int offset, void *val,
>                                  val, bytes);
>  }
>
> -static const struct regmap_config regmap_config = {
> +static int pcf85263_nvram_read(void *priv, unsigned int offset, void *val,
> +                              size_t bytes)
> +{
> +       struct pcf85363 *pcf85363 = priv;
> +
> +       return regmap_read(pcf85363->regmap, CTRL_RAMBYTE, val);
> +}

AFAIU without reading the datasheet, the pcf85363 also has this RAMBYTE
register. Would it make sense to expose the contents on both parts?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
  2018-11-21 10:23   ` Geert Uytterhoeven
@ 2018-11-21 10:35     ` Alexandre Belloni
  2018-11-22  9:40       ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Belloni @ 2018-11-21 10:35 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Biju Das, Alessandro Zummo, linux-rtc, Simon Horman,
	Geert Uytterhoeven, Chris Paterson, Fabrizio Castro,
	Linux-Renesas

On 21/11/2018 11:23:08+0100, Geert Uytterhoeven wrote:
> Hi Biju,
> 
> On Mon, Nov 19, 2018 at 12:23 PM Biju Das <biju.das@bp.renesas.com> wrote:
> > Add support for NXP pcf85263 real-time clock. pcf85263 rtc is compatible
> > with pcf85363,except that pcf85363 has additional 64 bytes of RAM.
> >
> > 1 byte of nvmem is supported and exposed in sysfs (# is the instance
> > number,starting with 0): /sys/bus/nvmem/devices/pcf85263-#/nvmem
> >
> > Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/rtc/rtc-pcf85363.c
> > +++ b/drivers/rtc/rtc-pcf85363.c
> > @@ -311,7 +311,30 @@ static int pcf85363_nvram_write(void *priv, unsigned int offset, void *val,
> >                                  val, bytes);
> >  }
> >
> > -static const struct regmap_config regmap_config = {
> > +static int pcf85263_nvram_read(void *priv, unsigned int offset, void *val,
> > +                              size_t bytes)
> > +{
> > +       struct pcf85363 *pcf85363 = priv;
> > +
> > +       return regmap_read(pcf85363->regmap, CTRL_RAMBYTE, val);
> > +}
> 
> AFAIU without reading the datasheet, the pcf85363 also has this RAMBYTE
> register. Would it make sense to expose the contents on both parts?
> 

Yes it has. This series allows calling rtc_nvmem_register() multiple
times from the same driver:

http://patchwork.ozlabs.org/project/rtc-linux/list/?series=75212


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* RE: [PATCH  1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  2018-11-21 10:09     ` Simon Horman
@ 2018-11-22  9:31       ` Biju Das
  0 siblings, 0 replies; 9+ messages in thread
From: Biju Das @ 2018-11-22  9:31 UTC (permalink / raw)
  To: Simon Horman
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	linux-rtc, devicetree, Geert Uytterhoeven, Chris Paterson,
	Fabrizio Castro, linux-renesas-soc

Hello Simon,

Thanks for the feedback.

> -----Original Message-----
> From: Simon Horman <horms@verge.net.au>
> Sent: 21 November 2018 10:10
> To: Biju Das <biju.das@bp.renesas.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Rob Herring <robh+dt@kernel.org>;
> Mark Rutland <mark.rutland@arm.com>; linux-rtc@vger.kernel.org;
> devicetree@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>; Chris Paterson
> <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro@bp.renesas.com>; linux-renesas-soc@vger.kernel.org
> Subject: Re: [PATCH 1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-
> time clock
>
> On Wed, Nov 21, 2018 at 11:04:52AM +0100, Simon Horman wrote:
> > On Mon, Nov 19, 2018 at 11:15:05AM +0000, Biju Das wrote:
> > > This patch adds binding for NXP pcf85263 real-time clock. pcf85263
> > > rtc is compatible with pcf85363 rtc except that pcf85363 has 64
> > > bytes additional RAM.
> >
> > How about this:
> >
> > This patch adds binding for the NXP pcf85263 real-time clock.
> >
> > The pcf85263 RTC is compatible with the pcf85363 RTC. The difference
> > between the parts is except that the pcf85363 has 64 bytes more RAM.
>
> The pcf85263 anRTC is compatible with the pcf85363 RTC.
>
> The difference between the pcf85263 and pcf85363 RTS is that the latter has
> 64 bytes more RAM. This renders them incompatible from a DT point of view.

Will send V2 with the below changes.

This patch adds binding for the NXP pcf85263 real-time clock.

The pcf85263 RTC is compatible with the pcf85363 RTC. The difference
between the parts is except that the pcf85363 has 64 bytes more RAM.

The pcf85263 RTC is compatible with the pcf85363 RTC.

The difference between the pcf85263 and pcf85363 RTC is that the latter has
64 bytes more RAM. This renders them incompatible from a DT point of view.


Regards,
Biju
> >
> > > Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> > > ---
> > >  Documentation/devicetree/bindings/rtc/pcf85363.txt | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > > b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > > index 76fdabc..94adc1c 100644
> > > --- a/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > > +++ b/Documentation/devicetree/bindings/rtc/pcf85363.txt
> > > @@ -1,8 +1,8 @@
> > > -NXP PCF85363 Real Time Clock
> > > +NXP PCF85263/PCF85363 Real Time Clock
> > >  ============================
> > >
> > >  Required properties:
> > > -- compatible: Should contain "nxp,pcf85363".
> > > +- compatible: Should contain "nxp,pcf85263" or "nxp,pcf85363".
> > >  - reg: I2C address for chip.
> > >
> > >  Optional properties:
> > > --
> > > 2.7.4
> > >
> >



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
  2018-11-21 10:35     ` Alexandre Belloni
@ 2018-11-22  9:40       ` Biju Das
  0 siblings, 0 replies; 9+ messages in thread
From: Biju Das @ 2018-11-22  9:40 UTC (permalink / raw)
  To: Alexandre Belloni, Geert Uytterhoeven
  Cc: Alessandro Zummo, linux-rtc, Simon Horman, Geert Uytterhoeven,
	Chris Paterson, Fabrizio Castro, Linux-Renesas

Hi Geert and Alexandre,

Thanks for the feedback.

> -----Original Message-----
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Sent: 21 November 2018 10:35
> To: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Biju Das <biju.das@bp.renesas.com>; Alessandro Zummo
> <a.zummo@towertech.it>; linux-rtc@vger.kernel.org; Simon Horman
> <horms@verge.net.au>; Geert Uytterhoeven <geert+renesas@glider.be>;
> Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro
> <fabrizio.castro@bp.renesas.com>; Linux-Renesas <linux-renesas-
> soc@vger.kernel.org>
> Subject: Re: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
>
> On 21/11/2018 11:23:08+0100, Geert Uytterhoeven wrote:
> > Hi Biju,
> >
> > On Mon, Nov 19, 2018 at 12:23 PM Biju Das <biju.das@bp.renesas.com>
> wrote:
> > > Add support for NXP pcf85263 real-time clock. pcf85263 rtc is
> > > compatible with pcf85363,except that pcf85363 has additional 64 bytes of
> RAM.
> > >
> > > 1 byte of nvmem is supported and exposed in sysfs (# is the instance
> > > number,starting with 0): /sys/bus/nvmem/devices/pcf85263-#/nvmem
> > >
> > > Signed-off-by: Biju Das <biju.das@bp.renesas.com>
> >
> > Thanks for your patch!
> >
> > > --- a/drivers/rtc/rtc-pcf85363.c
> > > +++ b/drivers/rtc/rtc-pcf85363.c
> > > @@ -311,7 +311,30 @@ static int pcf85363_nvram_write(void *priv,
> unsigned int offset, void *val,
> > >                                  val, bytes);  }
> > >
> > > -static const struct regmap_config regmap_config = {
> > > +static int pcf85263_nvram_read(void *priv, unsigned int offset, void
> *val,
> > > +                              size_t bytes) {
> > > +       struct pcf85363 *pcf85363 = priv;
> > > +
> > > +       return regmap_read(pcf85363->regmap, CTRL_RAMBYTE, val); }
> >
> > AFAIU without reading the datasheet, the pcf85363 also has this
> > RAMBYTE register. Would it make sense to expose the contents on both
> parts?

>
> Yes it has. This series allows calling rtc_nvmem_register() multiple times from
> the same driver:
>
> http://patchwork.ozlabs.org/project/rtc-linux/list/?series=75212

Will check and send v2,

1) For pcf85363, calling rtc_nvmem_register  twice (1 with 64 bytes and another with 1 byte)

2) For pcf85263, calling rtc_nvmem_register   ( with 1 byte)

Regards,
Biju





Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

end of thread, other threads:[~2018-11-22  9:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 11:15 [PATCH 0/4] Add NXP pcf85263 real-time clock support Biju Das
2018-11-19 11:15 ` [PATCH 1/4] dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock Biju Das
2018-11-21 10:04   ` Simon Horman
2018-11-21 10:09     ` Simon Horman
2018-11-22  9:31       ` Biju Das
2018-11-19 11:15 ` [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc Biju Das
2018-11-21 10:23   ` Geert Uytterhoeven
2018-11-21 10:35     ` Alexandre Belloni
2018-11-22  9:40       ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).