aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/driver-model/platform.txt40
-rw-r--r--Documentation/firmware_class/README2
-rw-r--r--Documentation/firmware_class/firmware_sample_driver.c2
-rw-r--r--Documentation/firmware_class/firmware_sample_firmware_class.c4
4 files changed, 44 insertions, 4 deletions
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt
index 19c4a6e13676..2a97320ee17f 100644
--- a/Documentation/driver-model/platform.txt
+++ b/Documentation/driver-model/platform.txt
@@ -96,6 +96,46 @@ System setup also associates those clocks with the device, so that that
96calls to clk_get(&pdev->dev, clock_name) return them as needed. 96calls to clk_get(&pdev->dev, clock_name) return them as needed.
97 97
98 98
99Legacy Drivers: Device Probing
100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101Some drivers are not fully converted to the driver model, because they take
102on a non-driver role: the driver registers its platform device, rather than
103leaving that for system infrastructure. Such drivers can't be hotplugged
104or coldplugged, since those mechanisms require device creation to be in a
105different system component than the driver.
106
107The only "good" reason for this is to handle older system designs which, like
108original IBM PCs, rely on error-prone "probe-the-hardware" models for hardware
109configuration. Newer systems have largely abandoned that model, in favor of
110bus-level support for dynamic configuration (PCI, USB), or device tables
111provided by the boot firmware (e.g. PNPACPI on x86). There are too many
112conflicting options about what might be where, and even educated guesses by
113an operating system will be wrong often enough to make trouble.
114
115This style of driver is discouraged. If you're updating such a driver,
116please try to move the device enumeration to a more appropriate location,
117outside the driver. This will usually be cleanup, since such drivers
118tend to already have "normal" modes, such as ones using device nodes that
119were created by PNP or by platform device setup.
120
121None the less, there are some APIs to support such legacy drivers. Avoid
122using these calls except with such hotplug-deficient drivers.
123
124 struct platform_device *platform_device_alloc(
125 char *name, unsigned id);
126
127You can use platform_device_alloc() to dynamically allocate a device, which
128you will then initialize with resources and platform_device_register().
129A better solution is usually:
130
131 struct platform_device *platform_device_register_simple(
132 char *name, unsigned id,
133 struct resource *res, unsigned nres);
134
135You can use platform_device_register_simple() as a one-step call to allocate
136and register a device.
137
138
99Device Naming and Driver Binding 139Device Naming and Driver Binding
100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101The platform_device.dev.bus_id is the canonical name for the devices. 141The platform_device.dev.bus_id is the canonical name for the devices.
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index e9cc8bb26f7d..c3480aa66ba8 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -1,7 +1,7 @@
1 1
2 request_firmware() hotplug interface: 2 request_firmware() hotplug interface:
3 ------------------------------------ 3 ------------------------------------
4 Copyright (C) 2003 Manuel Estrada Sainz <ranty@debian.org> 4 Copyright (C) 2003 Manuel Estrada Sainz
5 5
6 Why: 6 Why:
7 --- 7 ---
diff --git a/Documentation/firmware_class/firmware_sample_driver.c b/Documentation/firmware_class/firmware_sample_driver.c
index 87feccdb5c9f..6865cbe075ec 100644
--- a/Documentation/firmware_class/firmware_sample_driver.c
+++ b/Documentation/firmware_class/firmware_sample_driver.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * firmware_sample_driver.c - 2 * firmware_sample_driver.c -
3 * 3 *
4 * Copyright (c) 2003 Manuel Estrada Sainz <ranty@debian.org> 4 * Copyright (c) 2003 Manuel Estrada Sainz
5 * 5 *
6 * Sample code on how to use request_firmware() from drivers. 6 * Sample code on how to use request_firmware() from drivers.
7 * 7 *
diff --git a/Documentation/firmware_class/firmware_sample_firmware_class.c b/Documentation/firmware_class/firmware_sample_firmware_class.c
index 9e1b0e4051cd..4994f1f28f8c 100644
--- a/Documentation/firmware_class/firmware_sample_firmware_class.c
+++ b/Documentation/firmware_class/firmware_sample_firmware_class.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * firmware_sample_firmware_class.c - 2 * firmware_sample_firmware_class.c -
3 * 3 *
4 * Copyright (c) 2003 Manuel Estrada Sainz <ranty@debian.org> 4 * Copyright (c) 2003 Manuel Estrada Sainz
5 * 5 *
6 * NOTE: This is just a probe of concept, if you think that your driver would 6 * NOTE: This is just a probe of concept, if you think that your driver would
7 * be well served by this mechanism please contact me first. 7 * be well served by this mechanism please contact me first.
@@ -19,7 +19,7 @@
19#include <linux/firmware.h> 19#include <linux/firmware.h>
20 20
21 21
22MODULE_AUTHOR("Manuel Estrada Sainz <ranty@debian.org>"); 22MODULE_AUTHOR("Manuel Estrada Sainz");
23MODULE_DESCRIPTION("Hackish sample for using firmware class directly"); 23MODULE_DESCRIPTION("Hackish sample for using firmware class directly");
24MODULE_LICENSE("GPL"); 24MODULE_LICENSE("GPL");
25 25