RE: prevent auto binding for some platform devices

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

 



Hi,
    I think with 2.6.18 or so onwards, there are two entries under /sys/bus/<bus_type>/
drivers_autoprobe, drivers_probe. (Here bus_type is platform, usb, pci, etc...)
By default drivers_autoprobe is 1. You need to disable autprobing of the driver by writing a 0 to that entry.
Once you do that you need to write the name of the device that you want the driver to bind to in the drivers_probe entry.

Hope this is useful.

Thanks,
-Romit



>-----Original Message-----
>From: linux-embedded-owner@xxxxxxxxxxxxxxx [mailto:linux-embedded-
>owner@xxxxxxxxxxxxxxx] On Behalf Of Uwe Kleine-König
>Sent: Monday, July 21, 2008 12:12 PM
>To: linux-embedded@xxxxxxxxxxxxxxx
>Subject: RFC: prevent auto binding for some platform devices
>
>Hello,
>
>I have an emedded machine here on my desk and want to stop some
>driver/device pairs from binding.  There are two types of reason for it:
>
>  a) pin muxing doesn't allow attaching e.g. spi and serial at the same
>     time.  In this case I want a defined "winner" that doesn't depend
>     on link (or module load) order.
>
>  b) the devboard has attached an led on a line that is also available
>     on a header.  So I don't want to bind the led driver by default
>     because there might be another device connected to the gpio line.
>     Still I want to provide the led device and driver such that
>     userspace can bind these two via sysfs and use it.
>
>I think a patch would be easy:
>
>  - add a flag to struct device(?) settable by platform code that would
>    indicate that the device should not autoprobe.
>
>  - change bus_attach_device to check that flag and only call
>    device_attach if it's not set.
>
>Would this be sensible?  Would it help anyone else?
>
>Best regards
>Uwe
>
>--
>Uwe Kleine-König, Software Engineer
>Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
>Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
>--
>To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux