Hi Frank-Christian,

Third option sounds better, since the difference is only the number of outputs.

You don't need to preserve the old pca9635pw_register(), you can
change it directly to pca963x_register() and change all the boards
that use the pca9635pw_register() to pca963x_register(...,
TYPE_PCA9635/MODEL_PCA9635).

BR,

Alan

On 5/17/21, Frank-Christian Kruegel <nu...@istda.com> wrote:
> Hi.
>
> I'm writing several drivers for my custom hardware. One is for a PCA9633
> LED driver. I can use the pca9635pw driver for this and modify it so it
> can be used with PCA9633 (4 outputs), PCA9634 (8 outputs), and PCA9635
> (16 outputs) by adding an additional parameter to the driver initalize
> function. However, this would break existing code.
>
> Since I'd like to give my work back to the community I'd like to ask how
> I should handle this situation:
>
> - clone the existing driver and modify it and keep the original driver
> for existing projects
> - modify the existing driver and ignore the compatibility issues
> - provide a new pca963x_register(..., type) and add something like
> int pca9635pw_register(...)
> {
>    return pca963x_register(..., TYPE_PCA9635);
> }
>
> What is the preferred way?
>
> Frank-Christian
>

Reply via email to