On Fri, Mar 20, 2015 at 11:28:21AM -0700, Steve B wrote:
> On Fri, Mar 20, 2015 at 11:16 AM, Gilles Chanteperdrix <
> [email protected]> wrote:
> 
> > On Fri, Mar 20, 2015 at 10:42:05AM -0700, Steve B wrote:
> > > Michael,
> > > At least for the Beaglebone Black case, it is looking like you will have
> > a
> > > good and simple way of picking which driver you load.
> > > I am working on getting the driver integrated to the Xenomai tree and in
> > > the process making minor tweaks.. by changing the "compatibility" string
> > to
> > > something unique it looks like you can match the CAN device to the driver
> > > in your device tree overlay. Should be no more having to load the
> > original
> > > driver first.
> > >
> > > I have a bit of an issue that I'm trying to work around with splitting
> > the
> > > driver into the multiple source files, but once I get that sorted out it
> > > should be ready to work that way!
> >
> > From what I understood, the device tree is a description of the
> > hardware, so the compatibility string describes what hardware a
> > board/controller is based on. So, it does not make sense to change
> > the compatibility string to change the driver used. This is contrary
> > to the spirit of the device tree. A device tree is supposed to be OS
> > independent, the device tree files licenses for instance, have been
> > chosen to not prevent a device tree file from being used with BSD.
> >
> > --
> >                                             Gilles.
> >
> 
> OK, sorry if I have it backwards. But if I have both drivers in my kernel
> build and they both have the same compatibility string, they both get
> loaded when I load my device tree overlay. In that case how are we supposed
> to specify which one gets loaded?

Loading a driver, but not initializing it is not a problem. I
believe the kernel will not start two drivers for the same device.
At least that is the way it works with other buses (like PCIe or USB).

You can unbind a device to a driver with sysfs files. Then bind the
device to another driver. I do not know if you can do this with
kernel command line arguments.

See for instance:
https://lwn.net/Articles/143397/

-- 
                                            Gilles.

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to