[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPXgP13-5URbxH9u344CnreRP2v9VR-ADcQRUBA5AdNj26P+LA@mail.gmail.com>
Date: Sat, 3 Mar 2012 12:43:34 +0100
From: Kay Sievers <kay.sievers@...y.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Federico Vaga <federico.vaga@...il.com>,
Alessandro Rubini <rubini@...dd.com>,
linux-kernel@...r.kernel.org
Subject: Re: How to make a bus with heterogeneous devices?
On Fri, Mar 2, 2012 at 23:38, Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
> On Fri, Mar 02, 2012 at 11:18:59AM +0100, Federico Vaga wrote:
>> Maybe I'm missing something.
>
> I think you are.
>
> Kay, you know this area of the driver core better than I do at the
> moment, given your most recent changes here. Any reason why Alessandro
> and Federico can't do the same thing that the sysdev rework did for
> their devices here?
Maybe I miss something but it sounds not that different from USB.
You have a bus that enumerates devices and a "bus driver" creates a
generic device on that bus for everything it finds. These devices stay
generic, do not have type-specific attributes, but export matches
again to bind other device-specific drivers, which create _new_ child
devices below the generic ones with the proper attributes matching
their individual type of devices. So every "logical" device is always
represented by one generic device and one type-specific child device.
All these devices, the generic ones and the type-specific ones can be
on the same bus (struct bus_type) when they get a "struct device_type"
assigned which carries the device-type specific set of attributes.
It's like USB, where we get a plain "usb_device" for every device
connected, then we look at each device to find out how many
"usb_interface" childs we need to create, and every interface device
offers again matches for more drivers again, like tty, storage, video,
... to bind to as child devices.
Wouldn't that work?
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists