diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-09-23 04:23:04 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-09-23 04:23:04 -0700 |
| commit | f6bec0e641f80b097536fc4f8a1d8e7d2cc5c30b (patch) | |
| tree | 4bb4a9f9c1a8a2da19661cbeb4d0811a7840f434 /include | |
| parent | d668723c965730a4d3518f28fb8334e0fa65cbb0 (diff) | |
driver model: add better platform device support.
Platform devices are devices commonly found on the motherboard of systems. This
includes legacy devices (serial ports, floppy controllers, parallel ports, etc)
and host bridges to peripheral buses.
We already had a platform bus type, which gives a way to group platform devices
and drivers, and allow each to be bound to each other dynamically. Though before,
it didn't do anything. It still doesn't do much, but we now have:
- struct platform_device, which generically describes platform deviecs. This only
includes a name and id in addition to a struct device, but more may be added later.
- implelemnt platform_device_register() and platform_device_unregister() to handle
adding and removing these devices.
- Create legacy_bus - a default parent device for legacy devices.
- Change the floppy driver to define a platform_device (instead of a sys_device).
In driverfs, this gives us now:
a# tree -d /sys/bus/platform/
/sys/bus/platform/
|-- devices
| `-- floppy0 -> ../../../root/legacy/floppy0
`-- drivers
and
# tree -d /sys/root/legacy/
/sys/root/legacy/
`-- floppy0
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 53a71f85ae59..6053349e4303 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -402,7 +402,17 @@ extern void sys_device_unregister(struct sys_device *); extern struct bus_type system_bus_type; /* drivers/base/platform.c */ -extern struct bus_type platform_bus; + +struct platform_device { + char * name; + u32 id; + struct device dev; +}; + +extern int platform_device_register(struct platform_device *); +extern void platform_device_unregister(struct platform_device *); + +extern struct bus_type platform_bus_type; /* drivers/base/power.c */ extern int device_suspend(u32 state, u32 level); |
