Re: Inquiry about new RTC driver PCF2131

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi deee Ho Hugo,

On 12/9/21 21:52, Hugo Villeneuve wrote:
> Hi,
> I am currently developping a new RTC driver for the NXP PCF2131 chip.
> 
> This RTC is very similar in functionality to the PCF2127/29.
> 
> Basically it:
>    -supports two new control registers at offsets 4 and 5
>    -supports a new reset register
>    -supports 4 tamper detection functions instead of 1
>    -has no nvmem (like the PCF2129)
>    -has two output interrupt pins
> 
> Because of that, most of the register addresses are very different, although they still follow the same layout. For example, the tamper registers have a different base address, but the offsets are all the same.
> 
> I would like to modify the existing PCF2127 driver to add support for this new RTC, instead of simply copying (forking) the PCF2127 driver. I think that it would ease the maintenance in the long term.
> 
> I am curious to hear the RTC maintainers view on that proposition.

I am no maintainer and you didn't ask for an opinion of a random guy 
from the street - yet, I will give you one. Regard the opinion as best 
as you wish.

As and example, the RTC driver for RTC IP in the ROHM bd70528 PMIC was 
extended to support also the BD71828 and BD71815. They all have fairly 
identical control logic - although there are also differences. IMHO, the 
code duplication must be avoided as long as the end result stays 
reasonable clear. It tends to be a trade-off as supporting multiple ICs 
usually add extra complexity - but if you get away with it by just 
adding few offsets to registers to cover th edifferent base-addresses - 
then I'd say the thing does not warrant own driver but should be merged 
in same driver. (Please, note my note as I noted I am no maintainer - 
but just an irresponsible guy who msy be shouting things that pop into 
his head).

> 
> Here is a link to the datasheets of the two chips:
> 
>      https://www.nxp.com/docs/en/data-sheet/PCF2131DS.pdf
>      https://www.nxp.com/docs/en/data-sheet/PCF2127.pdf
> 

I didn't really take a look at the data-sheets but just responded based 
on your explanation that the register layouts are largely identical with 
just different base-addresses.

Best Regards
	--Matti Vaittinen

-- 
The Linux Kernel guy at ROHM Semiconductors

Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~ this year is the year of a signature writers block ~~




[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux