Re: [PATCH RFC] Update documentation for KSZ DSA drivers so that new drivers can be added

From: Pavel Machek
Date: Fri Sep 08 2017 - 17:50:48 EST


On Fri 2017-09-08 21:01:22, Andrew Lunn wrote:
> > > So i would suggest one driver supporting all the different devices.
> >
> > There will be 5 drivers to support these devices:
> >
> > ksz9477.c - KSZ9893/KSZ9897/KSZ9567/KSZ9566/KSZ9477
> > ksz8795.c - KSZ8795/KSZ8795/KSZ8765
> > ksz8895.c - KSZ8895/KSZ8864
> > ksz8863.c - KSZ8863/KSZ8873
> > ksz8463.c - KSZ8463
> >
> > These chips have different SPI access mechanisms, MIB counter reading,
> > and register set. These can be combined into one single driver using
> > function pointers, at least for ksz8795/ksz8895/ksz8863/ksz8463. My
> > only concern is the memory footprint. The customer may not want a
> > big driver to cover all the switches while only one is used.
>
> If memory footprint is your problem, make it a compile time choice
> which devices are supported within the one driver. In practice, you
> will find most distributions just enable them all.

I have to side with Tristram here. The register layouts are so
different that single driver does not make sense.

What could make sense is single function, compiled 5 times, based on
different includes; same source code but 5 different binaries.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature