All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jason Kridner <jkridner@beagleboard.org>
Cc: Russ Dill <Russ.Dill@ti.com>,
	balbi@ti.com, Pantelis Antoniou <panto@antoniou-consulting.com>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org,
	Koen Kooi <koen@dominion.thruhere.net>,
	Matt Porter <mporter@ti.com>,
	linux-omap@vger.kernel.org, Kevin Hilman <khilman@ti.com>,
	Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 0/3] capebus moving omap_devices to mach-omap2
Date: Fri, 2 Nov 2012 16:28:24 +0000	[thread overview]
Message-ID: <20121102162824.3dc3d535@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <CA+T6QPkWLXx6-Bh-4VdsdoHypHNkJ4hTdkk-rqUEyGEswpW6fQ@mail.gmail.com>

> Further, it is critical to enable hardware vendors to avoid writing
> any code for which there are existing drivers.

Which is why you don't want to create a new bus type for it.

> Capebus seems to me to provide this solution fairly well. I don't
> believe the SFI approach covers the most critical aspects of hotplug
> behaviour.

I think you missed the point - it just an example of doing this not one
I'd suggest using directly.

> >> > your ->detect() method should take care of that.
> >>
> >> There isn't some magical serial number in I²C devices that a
> >> ->detect() method can read and the implementation of I²C is somewhat
> >
> > It doesn't matter.
> >
> > What you are basically talking about is
> >
> >
> >         cape layer
> >                 - wtf is this
> >                 - how do I plumb it
> >
> >                 - create device nodes with correct name for
> >                   binding, address etc on the right bus
> >
> >
> >         i2c layer
> >                 - ooh a new i2c device
> >                 - probe as indicated by device name
> >                 - attach correct driver
> 
> Many of the devices cannot be probed.

Look more closely at the code I pointed you at. I wonder if have a
differing understanding of the word "probe" in this situation. In the
Linux space the driver bindings call the matching probe function based
upon the device structure.

In Linux the probe method does not mean "scan the bus and enumerate/detect
the devices"

If an i²c bus is thrown a device which has an address and a matching name
the only thing it will attempt to do is to call the probe method of the
device driver matching that name on the given i²c address. In other words
its a "probe" in the sense of "I've been told there is one of your
widgets here, please take a look" not a "probe" in the sense of "scan 255
i²c addresses and poke randomly at them"

SFI for example creates entries for things like

	"type foo pressure sensor at 0x68 on bus 3"

and the core kernel i²c code will only call the "foo" drivers probe method
and only on bus 3 and only for address 0x68.

In your case you want to use your DT fragments or any other descriptor
format to do exactly the same. Not create a new bus but add a bunch of
devices to the existing busses.

It's like hot plugging a PCI card - you don't create a new PCI bus, you
add a device to the existing bus. In the PCI case the device has
properties that uniquely identify it from hardware level. In the i²c case
the properties come from your DT fragment or similar. The rest is the
same.

> I know I *am* the slow person in the room, but doesn't this approach
> require the code to be compiled into the kernel to support the devices
> ahead of time? While I think it might be reasonable to have hardware

The specific implementation in SFI does but thats a property of SFI. I'm
not trying to push SFI itself anywhere except over the edge of a very tall
cliff.

The point is that you can take a description of things like i²c devices
and have then properly identified on the existing busses using the
existing bus architecture just fine.

> developers provide DT fragments in their EEPROMs, there's no way to
> get them to submit code patches in order to get their hardware to
> work. They need to ship hardware that works with pre-existing
> software, since there will be hundreds of boards created by people
> with little to no previous Linux experience (akin to Arduino). I seem
> to be missing how that approach would get us there.

That is what I assume and what I believe can be provided without
inventing imaginary bus types.

Alan

  reply	other threads:[~2012-11-02 16:23 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 15:17 [PATCH 0/3] capebus moving omap_devices to mach-omap2 Pantelis Antoniou
2012-10-31 17:52 ` Tony Lindgren
2012-10-31 18:04   ` Pantelis Antoniou
2012-10-31 18:09     ` Tony Lindgren
2012-10-31 18:24       ` Pantelis Antoniou
2012-10-31 19:55       ` Benoit Cousson
2012-10-31 19:55         ` Benoit Cousson
2012-10-31 20:12         ` Pantelis Antoniou
2012-10-31 20:12           ` Pantelis Antoniou
2012-10-31 21:26           ` Tony Lindgren
2012-10-31 21:36             ` Pantelis Antoniou
2012-10-31 21:43               ` Tony Lindgren
2012-10-31 22:00                 ` Pantelis Antoniou
2012-10-31 22:16                   ` Tony Lindgren
2012-10-31 22:14               ` Felipe Balbi
2012-10-31 22:14                 ` Felipe Balbi
2012-11-01  7:02                 ` Pantelis Antoniou
2012-11-01  7:02                   ` Pantelis Antoniou
2012-11-01 10:23                   ` Cousson, Benoit
2012-11-01 10:23                     ` Cousson, Benoit
2012-11-01 10:39                     ` Pantelis Antoniou
2012-11-01 10:39                       ` Pantelis Antoniou
2012-11-01 11:04                       ` Felipe Balbi
2012-11-01 11:04                         ` Felipe Balbi
2012-11-01 11:26                         ` Pantelis Antoniou
2012-11-01 11:26                           ` Pantelis Antoniou
2012-11-01 12:40                           ` Felipe Balbi
2012-11-01 12:40                             ` Felipe Balbi
2012-11-01 12:57                             ` Pantelis Antoniou
2012-11-01 12:57                               ` Pantelis Antoniou
2012-11-01 13:16                               ` Felipe Balbi
2012-11-01 13:16                                 ` Felipe Balbi
2012-11-01 13:35                                 ` Pantelis Antoniou
2012-11-01 13:35                                   ` Pantelis Antoniou
2012-11-01 13:51                                   ` Alan Cox
2012-11-01 13:51                                     ` Alan Cox
2012-11-01 13:59                                     ` Pantelis Antoniou
2012-11-01 13:59                                       ` Pantelis Antoniou
2012-11-01 22:05                                       ` Felipe Balbi
2012-11-01 22:05                                         ` Felipe Balbi
2012-11-01 23:49                                         ` Russ Dill
2012-11-02  8:57                                           ` Felipe Balbi
2012-11-02  8:57                                             ` Felipe Balbi
2012-11-02  9:42                                             ` Russ Dill
2012-11-02 10:39                                               ` Koen Kooi
2012-11-02 10:39                                                 ` Koen Kooi
2012-11-02 11:00                                               ` Felipe Balbi
2012-11-02 11:00                                                 ` Felipe Balbi
2012-11-02 16:44                                                 ` Russ Dill
2012-11-02 11:21                                           ` Alan Cox
2012-11-02 12:32                                             ` Pantelis Antoniou
2012-11-05  0:37                                               ` Grant Likely
2012-11-05 15:37                                                 ` Pantelis Antoniou
2012-11-05 15:37                                                   ` Pantelis Antoniou
2012-11-05 19:10                                                   ` Grant Likely
2012-11-05 19:54                                                     ` Pantelis Antoniou
2012-11-05 19:54                                                       ` Pantelis Antoniou
2012-11-05 20:14                                                       ` Grant Likely
2012-11-05 22:59                                                         ` Joel A Fernandes
2012-11-05 23:58                                                           ` Grant Likely
2012-11-05 23:58                                                             ` Grant Likely
2012-11-06  3:06                                                             ` Joel A Fernandes
2012-11-06  8:14                                                               ` Pantelis Antoniou
2012-11-06  8:14                                                                 ` Pantelis Antoniou
2012-11-06 11:16                                                                 ` Grant Likely
2012-11-06 13:54                                                                   ` Pantelis Antoniou
2012-11-06 13:54                                                                     ` Pantelis Antoniou
2012-11-02 16:07                                             ` Jason Kridner
2012-11-02 16:07                                               ` Jason Kridner
2012-11-02 16:28                                               ` Alan Cox [this message]
2012-11-05  1:05                                               ` Grant Likely
2012-11-01 11:26                       ` Cousson, Benoit
2012-11-01 11:26                         ` Cousson, Benoit
2012-11-01 11:39                         ` Pantelis Antoniou
2012-11-01 11:39                           ` Pantelis Antoniou
2012-11-01 12:00                         ` Koen Kooi
2012-11-01 12:00                           ` Koen Kooi
2012-11-01 13:06                           ` Felipe Balbi
2012-11-01 13:06                             ` Felipe Balbi
2012-11-01 13:33                             ` Koen Kooi
2012-11-01 13:33                               ` Koen Kooi
2012-11-02  8:15                           ` Cousson, Benoit
2012-11-02  8:15                             ` Cousson, Benoit
2012-11-02  8:43                             ` Pantelis Antoniou
2012-11-03  8:23                               ` Kevin Hilman
2012-11-05  0:22                               ` Grant Likely
2012-11-05  0:22                                 ` Grant Likely
2012-11-05 13:25                                 ` Pantelis Antoniou
2012-11-05 13:25                                   ` Pantelis Antoniou
2012-11-05 14:34                                   ` Grant Likely
2012-11-05 15:34                                     ` Tony Lindgren
2012-11-05 15:34                                       ` Tony Lindgren
2012-11-05 15:56                                     ` Rob Herring
2012-11-05 15:56                                       ` Rob Herring
2012-11-05 19:40                                       ` Grant Likely
2012-11-01 15:18 ` [PATCH 1/3] omap-device: Remove __init from omap_device_build family functions Pantelis Antoniou
2012-11-01 15:18 ` [PATCH 2/3] da8xx-dt: Create da8xx DT adapter device Pantelis Antoniou
2012-11-01 14:36   ` Tomi Valkeinen
2012-11-01 14:38     ` Pantelis Antoniou
2012-11-01 15:18 ` [PATCH 3/3] ti-tscadc-dt: Create ti-tscadc-dt " Pantelis Antoniou
2012-11-01 18:50 [PATCH 0/3] capebus moving omap_devices to mach-omap2 Jason Kridner
2012-11-01 19:07 ` Tony Lindgren
2012-11-02  9:26 ` Cousson, Benoit
2012-11-02  9:26   ` Cousson, Benoit
2012-11-02 10:19   ` Koen Kooi
2012-11-02 10:19     ` Koen Kooi
2012-11-05  0:32     ` Grant Likely

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=20121102162824.3dc3d535@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=Russ.Dill@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=jkridner@beagleboard.org \
    --cc=khilman@ti.com \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mporter@ti.com \
    --cc=panto@antoniou-consulting.com \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    /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.