Question on supporting multiple HW versions with a single driver (warning: long post)

Bruce_Leonard at selinc.com Bruce_Leonard at selinc.com
Wed Feb 9 03:59:05 EST 2011


Ah, okay.  Taking a look at that it makes sense now.  Thanks to both of 
you for the help.

Bruce



From:
Bill Gatliff <bgat at billgatliff.com>
To:
Bruce_Leonard at selinc.com
Cc:
David Gibson <david at gibson.dropbear.id.au>, linuxppc-dev at lists.ozlabs.org
Date:
02/07/2011 09:13 PM
Subject:
Re: Question on supporting multiple HW versions with a single driver 
(warning: long post)



Guys:


I think the Silicon Motion SM501 driver might provide a useful
example, since the chip comes in both memory-mapped and PCI versions.
Unfortunately the chip is implemented as a multi-function driver
(mfd), so the code is not un-complicated.  Still fairly
straightforward and well-written once you learn your way around it,
though.

Basically, it implements a core set of functionality to talk to the
actual chip registers, which is bus-agnostic.  Then the bus-specific
drivers use these functions when they actually want to touch the chip
itself.  In other words, exactly what David suggested.


b.g.


On Mon, Feb 7, 2011 at 8:37 PM,  <Bruce_Leonard at selinc.com> wrote:
>>
>> There are a number of drivers which already have this sort of dual bus
>> binding.
>>
>
> Thanks for the feedback David, I appreciate it.  Could you point me to 
one
> of those drivers that has "this sort of dual bus binding" so can see an
> example of what I'm trying to do?
>
> Bruce
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



-- 
Bill Gatliff
bgat at billgatliff.com




More information about the Linuxppc-dev mailing list