All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>
To: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Cc: "linux-embedded@vger.kernel.org" <linux-embedded@vger.kernel.org>
Subject: Re: RFC: prevent auto binding for some platform devices
Date: Mon, 21 Jul 2008 09:44:45 +0200	[thread overview]
Message-ID: <20080721074445.GA30156@digi.com> (raw)
In-Reply-To: <f19298770807210038u76b62f28uea55a631f7e13834@mail.gmail.com>

Hello Alexey,

Alexey Zaytsev wrote:
> [Sorry, probably a gmail web-interface bug?]
> 
> On Mon, Jul 21, 2008 at 10:42 AM, Uwe Kleine-König
> <Uwe.Kleine-Koenig@digi.com> wrote:
> > 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?
> 
> How about simply not registering the missing devices in your
> board setup code?
They are not missing.  In the a) case above they just conflict and I
want to provide a way to change the default from userspace.  E.g.

	echo "serialdevice.1" > /sys/bus/platform/drivers/serialdriver/unbind
	echo "spidevice.1" > /sys/bus/platform/drivers/spidriver/bind

and for b) I want to be able to enable the led if nothing else is
connected to the line.

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

  reply	other threads:[~2008-07-21  7:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21  6:42 RFC: prevent auto binding for some platform devices Uwe Kleine-König
2008-07-21  7:24 ` Dasgupta, Romit
2008-07-21  7:33   ` Uwe Kleine-König
2008-07-21  7:31 ` RFC: " Alexey Zaytsev
2008-07-21  7:38 ` Alexey Zaytsev
2008-07-21  7:44   ` Uwe Kleine-König [this message]
2008-07-21  7:44 ` Ben Nizette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080721074445.GA30156@digi.com \
    --to=uwe.kleine-koenig@digi.com \
    --cc=alexey.zaytsev@gmail.com \
    --cc=linux-embedded@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.