RE: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
Hi Geert and Alexandre, Thanks for the feedback. > -Original Message- > From: Alexandre Belloni > Sent: 21 November 2018 10:35 > To: Geert Uytterhoeven > Cc: Biju Das ; Alessandro Zummo > ; linux-...@vger.kernel.org; Simon Horman > ; Geert Uytterhoeven ; > Chris Paterson ; Fabrizio Castro > ; Linux-Renesas s...@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 > 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 > > > > 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.
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 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 > > 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
Re: [PATCH 2/4] rtc: pcf85363: Add support for NXP pcf85263 rtc
Hi Biju, On Mon, Nov 19, 2018 at 12:23 PM Biju Das 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 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 -- ge...@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