Re: Platform device id



On Sat, 08 Sep 2007, Jean Delvare wrote:
This more general than just the platform bus. It's how the Linux 2.6
device driver model is designed.

No issues about that. It is just that the platform bus sucks a bit if you
need to "abuse it" (no wonder!) to hang various different devices that are
provided *or* driven by the same module.

There are alternatives to the way hdaps and thinkpad_acpi instantiate
their devices:


* These drivers use DMI to find out whether they run on supported
hardware. The same detection code could be moved to a separate driver

Actually, DMI is a hint for autoloading, only. They do probe the
hardware/firmware for the needed functionality to know for sure.

(possibly the same one for all DMI-detected devices) and that separate
driver would instantiate the devices as needed. Then the usual
hotplug/coldplug rules apply.

That could work, yes.

* Detection could be moved to user-space entirely, then we would only
need a way to instantiate these specific devices from user-space. This
exists in other areas (scsi, network) for quite some times already so
it shouldn't be too difficult.

Don't like that one, sorry. Detection often needs the kind of access to
hardware that is better off contained in the kernel.

2. The fact that a module that has a number of different devices has to
register itself a number of times as a driver, if it wants to name the
devices something different...

Sounds like you have a design issue here to start with. Supporting
several significantly different devices in the same module is not
something that we do usually.

I will see what I can do about breaking it up in various modules. But this
can be unoptimal. If I took it too seriously, thinkpad-acpi would break into
at least five different modules, if not more, and at least one or two
modules would need to be there for the common code. There has to be a
middle ground somewhere, I think.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Start menu, taskbar, system tray gone - please help
    ... If you have added hardware or software immediately ... driver, use Driver Roll Back to revert to the previous ... If the computer is connected to a network, ... is enough available disk space on the hard disk drive for ...
    (microsoft.public.windowsxp.general)
  • Re: Open Source Leaving Microsoft Sitting on the Fence? Very Long.
    ... >>design of automobile control systems. ... > etc. is the responsibility of the driver, and I've rented vehicles in many ... > transmission than the car I rent in Phoenix or Orlando, ... > familiarize themself with the location of such controls and their operation, ...
    (comp.os.linux.misc)
  • Re: Open Source Leaving Microsoft Sitting on the Fence? Very Long.
    ... >>design of automobile control systems. ... > etc. is the responsibility of the driver, and I've rented vehicles in many ... > transmission than the car I rent in Phoenix or Orlando, ... > familiarize themself with the location of such controls and their operation, ...
    (comp.os.linux)
  • Re: Windows 7 USB Audio I/O Mystery
    ... described in Microsoft's "Universal Audio Architecture Hardware Design ... A driver talks to the hardware on one end and the operating system on the other. ... DVD recorder that insists on setting its clock to a timing signal that USED ...
    (rec.audio.pro)
  • Re: suspend to disk unreliable?
    ... choices to test hibernation in a safe environment. ... There's nothing save about turning off and on the hardware many times ... then it won't be possible to test suspend to disk. ... manufacturer has not provided you with any driver for that hardware. ...
    (Debian-User)