aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-01-06 16:34:21 -0500
committerLen Brown <len.brown@intel.com>2006-01-06 16:34:21 -0500
commit25da0974601fc8096461f3d3f7ca3aab8e79adfb (patch)
treef9b3c1bfbc63fdb6a94e82177b8c3ae891125422 /Documentation
parent036d25f79ddfbc9878da24ef8e468a6d22caa605 (diff)
parentd99cf9d679a520d67f81d805b7cb91c68e1847f0 (diff)
Auto-update from upstream
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DocBook/usb.tmpl1
-rw-r--r--Documentation/SubmittingPatches4
-rw-r--r--Documentation/block/biodoc.txt12
-rw-r--r--Documentation/cpu-freq/governors.txt62
-rw-r--r--Documentation/feature-removal-schedule.txt11
-rw-r--r--Documentation/filesystems/00-INDEX8
-rw-r--r--Documentation/filesystems/configfs/configfs.txt434
-rw-r--r--Documentation/filesystems/configfs/configfs_example.c474
-rw-r--r--Documentation/filesystems/dlmfs.txt130
-rw-r--r--Documentation/filesystems/ocfs2.txt55
-rw-r--r--Documentation/filesystems/vfs.txt5
-rw-r--r--Documentation/kbuild/modules.txt24
-rw-r--r--Documentation/kernel-parameters.txt8
-rw-r--r--Documentation/keys.txt18
-rw-r--r--Documentation/md.txt120
-rw-r--r--Documentation/networking/gianfar.txt72
-rw-r--r--Documentation/networking/ip-sysctl.txt23
-rw-r--r--Documentation/pcmcia/driver-changes.txt11
-rw-r--r--Documentation/power/interface.txt11
-rw-r--r--Documentation/power/swsusp.txt5
-rw-r--r--Documentation/powerpc/eeh-pci-error-recovery.txt31
-rw-r--r--Documentation/scsi/ChangeLog.megaraid35
-rw-r--r--Documentation/scsi/scsi_mid_low_api.txt39
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt194
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl592
-rw-r--r--Documentation/sound/alsa/Procfile.txt16
-rw-r--r--Documentation/sound/alsa/hda_codec.txt14
-rw-r--r--Documentation/sysrq.txt6
28 files changed, 2009 insertions, 406 deletions
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl
index 15ce0f21e5e0..320af25de3a2 100644
--- a/Documentation/DocBook/usb.tmpl
+++ b/Documentation/DocBook/usb.tmpl
@@ -253,6 +253,7 @@
253!Edrivers/usb/core/urb.c 253!Edrivers/usb/core/urb.c
254!Edrivers/usb/core/message.c 254!Edrivers/usb/core/message.c
255!Edrivers/usb/core/file.c 255!Edrivers/usb/core/file.c
256!Edrivers/usb/core/driver.c
256!Edrivers/usb/core/usb.c 257!Edrivers/usb/core/usb.c
257!Edrivers/usb/core/hub.c 258!Edrivers/usb/core/hub.c
258 </chapter> 259 </chapter>
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 237d54c44bc5..1d47e6c09dc6 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -158,7 +158,7 @@ Even if the maintainer did not respond in step #4, make sure to ALWAYS
158copy the maintainer when you change their code. 158copy the maintainer when you change their code.
159 159
160For small patches you may want to CC the Trivial Patch Monkey 160For small patches you may want to CC the Trivial Patch Monkey
161trivial@rustcorp.com.au set up by Rusty Russell; which collects "trivial" 161trivial@kernel.org managed by Adrian Bunk; which collects "trivial"
162patches. Trivial patches must qualify for one of the following rules: 162patches. Trivial patches must qualify for one of the following rules:
163 Spelling fixes in documentation 163 Spelling fixes in documentation
164 Spelling fixes which could break grep(1). 164 Spelling fixes which could break grep(1).
@@ -171,7 +171,7 @@ patches. Trivial patches must qualify for one of the following rules:
171 since people copy, as long as it's trivial) 171 since people copy, as long as it's trivial)
172 Any fix by the author/maintainer of the file. (ie. patch monkey 172 Any fix by the author/maintainer of the file. (ie. patch monkey
173 in re-transmission mode) 173 in re-transmission mode)
174URL: <http://www.kernel.org/pub/linux/kernel/people/rusty/trivial/> 174URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/>
175 175
176 176
177 177
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt
index 0fe01c805480..8e63831971d5 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.txt
@@ -31,7 +31,7 @@ The following people helped with review comments and inputs for this
31document: 31document:
32 Christoph Hellwig <hch@infradead.org> 32 Christoph Hellwig <hch@infradead.org>
33 Arjan van de Ven <arjanv@redhat.com> 33 Arjan van de Ven <arjanv@redhat.com>
34 Randy Dunlap <rddunlap@osdl.org> 34 Randy Dunlap <rdunlap@xenotime.net>
35 Andre Hedrick <andre@linux-ide.org> 35 Andre Hedrick <andre@linux-ide.org>
36 36
37The following people helped with fixes/contributions to the bio patches 37The following people helped with fixes/contributions to the bio patches
@@ -263,14 +263,8 @@ A flag in the bio structure, BIO_BARRIER is used to identify a barrier i/o.
263The generic i/o scheduler would make sure that it places the barrier request and 263The generic i/o scheduler would make sure that it places the barrier request and
264all other requests coming after it after all the previous requests in the 264all other requests coming after it after all the previous requests in the
265queue. Barriers may be implemented in different ways depending on the 265queue. Barriers may be implemented in different ways depending on the
266driver. A SCSI driver for example could make use of ordered tags to 266driver. For more details regarding I/O barriers, please read barrier.txt
267preserve the necessary ordering with a lower impact on throughput. For IDE 267in this directory.
268this might be two sync cache flush: a pre and post flush when encountering
269a barrier write.
270
271There is a provision for queues to indicate what kind of barriers they
272can provide. This is as of yet unmerged, details will be added here once it
273is in the kernel.
274 268
2751.2.2 Request Priority/Latency 2691.2.2 Request Priority/Latency
276 270
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index 933fae74c337..f4b8dc4237e6 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -27,6 +27,7 @@ Contents:
272.2 Powersave 272.2 Powersave
282.3 Userspace 282.3 Userspace
292.4 Ondemand 292.4 Ondemand
302.5 Conservative
30 31
313. The Governor Interface in the CPUfreq Core 323. The Governor Interface in the CPUfreq Core
32 33
@@ -110,9 +111,64 @@ directory.
110 111
111The CPUfreq govenor "ondemand" sets the CPU depending on the 112The CPUfreq govenor "ondemand" sets the CPU depending on the
112current usage. To do this the CPU must have the capability to 113current usage. To do this the CPU must have the capability to
113switch the frequency very fast. 114switch the frequency very quickly. There are a number of sysfs file
114 115accessible parameters:
115 116
117sampling_rate: measured in uS (10^-6 seconds), this is how often you
118want the kernel to look at the CPU usage and to make decisions on
119what to do about the frequency. Typically this is set to values of
120around '10000' or more.
121
122show_sampling_rate_(min|max): the minimum and maximum sampling rates
123available that you may set 'sampling_rate' to.
124
125up_threshold: defines what the average CPU usaged between the samplings
126of 'sampling_rate' needs to be for the kernel to make a decision on
127whether it should increase the frequency. For example when it is set
128to its default value of '80' it means that between the checking
129intervals the CPU needs to be on average more than 80% in use to then
130decide that the CPU frequency needs to be increased.
131
132sampling_down_factor: this parameter controls the rate that the CPU
133makes a decision on when to decrease the frequency. When set to its
134default value of '5' it means that at 1/5 the sampling_rate the kernel
135makes a decision to lower the frequency. Five "lower rate" decisions
136have to be made in a row before the CPU frequency is actually lower.
137If set to '1' then the frequency decreases as quickly as it increases,
138if set to '2' it decreases at half the rate of the increase.
139
140ignore_nice_load: this parameter takes a value of '0' or '1', when set
141to '0' (its default) then all processes are counted towards towards the
142'cpu utilisation' value. When set to '1' then processes that are
143run with a 'nice' value will not count (and thus be ignored) in the
144overal usage calculation. This is useful if you are running a CPU
145intensive calculation on your laptop that you do not care how long it
146takes to complete as you can 'nice' it and prevent it from taking part
147in the deciding process of whether to increase your CPU frequency.
148
149
1502.5 Conservative
151----------------
152
153The CPUfreq governor "conservative", much like the "ondemand"
154governor, sets the CPU depending on the current usage. It differs in
155behaviour in that it gracefully increases and decreases the CPU speed
156rather than jumping to max speed the moment there is any load on the
157CPU. This behaviour more suitable in a battery powered environment.
158The governor is tweaked in the same manner as the "ondemand" governor
159through sysfs with the addition of:
160
161freq_step: this describes what percentage steps the cpu freq should be
162increased and decreased smoothly by. By default the cpu frequency will
163increase in 5% chunks of your maximum cpu frequency. You can change this
164value to anywhere between 0 and 100 where '0' will effectively lock your
165CPU at a speed regardless of its load whilst '100' will, in theory, make
166it behave identically to the "ondemand" governor.
167
168down_threshold: same as the 'up_threshold' found for the "ondemand"
169governor but for the opposite direction. For example when set to its
170default value of '20' it means that if the CPU usage needs to be below
17120% between samples to have the frequency decreased.
116 172
1173. The Governor Interface in the CPUfreq Core 1733. The Governor Interface in the CPUfreq Core
118============================================= 174=============================================
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 9b743198f77a..8ae8dad8e150 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -47,17 +47,6 @@ Who: Paul E. McKenney <paulmck@us.ibm.com>
47 47
48--------------------------- 48---------------------------
49 49
50What: IEEE1394 Audio and Music Data Transmission Protocol driver,
51 Connection Management Procedures driver
52When: November 2005
53Files: drivers/ieee1394/{amdtp,cmp}*
54Why: These are incomplete, have never worked, and are better implemented
55 in userland via raw1394 (see http://freebob.sourceforge.net/ for
56 example.)
57Who: Jody McIntyre <scjody@steamballoon.com>
58
59---------------------------
60
61What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN 50What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN
62When: November 2005 51When: November 2005
63Why: Deprecated in favour of the new ioctl-based rawiso interface, which is 52Why: Deprecated in favour of the new ioctl-based rawiso interface, which is
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index bcfbab899b37..74052d22d868 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -12,14 +12,16 @@ cifs.txt
12 - description of the CIFS filesystem 12 - description of the CIFS filesystem
13coda.txt 13coda.txt
14 - description of the CODA filesystem. 14 - description of the CODA filesystem.
15configfs/
16 - directory containing configfs documentation and example code.
15cramfs.txt 17cramfs.txt
16 - info on the cram filesystem for small storage (ROMs etc) 18 - info on the cram filesystem for small storage (ROMs etc)
17devfs/ 19devfs/
18 - directory containing devfs documentation. 20 - directory containing devfs documentation.
21dlmfs.txt
22 - info on the userspace interface to the OCFS2 DLM.
19ext2.txt 23ext2.txt
20 - info, mount options and specifications for the Ext2 filesystem. 24 - info, mount options and specifications for the Ext2 filesystem.
21fat_cvf.txt
22 - info on the Compressed Volume Files extension to the FAT filesystem
23hpfs.txt 25hpfs.txt
24 - info and mount options for the OS/2 HPFS. 26 - info and mount options for the OS/2 HPFS.
25isofs.txt 27isofs.txt
@@ -32,6 +34,8 @@ ntfs.txt
32 - info and mount options for the NTFS filesystem (Windows NT). 34 - info and mount options for the NTFS filesystem (Windows NT).
33proc.txt 35proc.txt
34 - info on Linux's /proc filesystem. 36 - info on Linux's /proc filesystem.
37ocfs2.txt
38 - info and mount options for the OCFS2 clustered filesystem.
35romfs.txt 39romfs.txt
36 - Description of the ROMFS filesystem. 40 - Description of the ROMFS filesystem.
37smbfs.txt 41smbfs.txt
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
new file mode 100644
index 000000000000..c4ff96b7c4e0
--- /dev/null
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -0,0 +1,434 @@
1
2configfs - Userspace-driven kernel object configuation.
3
4Joel Becker <joel.becker@oracle.com>
5
6Updated: 31 March 2005
7
8Copyright (c) 2005 Oracle Corporation,
9 Joel Becker <joel.becker@oracle.com>
10
11
12[What is configfs?]
13
14configfs is a ram-based filesystem that provides the converse of
15sysfs's functionality. Where sysfs is a filesystem-based view of
16kernel objects, configfs is a filesystem-based manager of kernel
17objects, or config_items.
18
19With sysfs, an object is created in kernel (for example, when a device
20is discovered) and it is registered with sysfs. Its attributes then
21appear in sysfs, allowing userspace to read the attributes via
22readdir(3)/read(2). It may allow some attributes to be modified via
23write(2). The important point is that the object is created and
24destroyed in kernel, the kernel controls the lifecycle of the sysfs
25representation, and sysfs is merely a window on all this.
26
27A configfs config_item is created via an explicit userspace operation:
28mkdir(2). It is destroyed via rmdir(2). The attributes appear at
29mkdir(2) time, and can be read or modified via read(2) and write(2).
30As with sysfs, readdir(3) queries the list of items and/or attributes.
31symlink(2) can be used to group items together. Unlike sysfs, the
32lifetime of the representation is completely driven by userspace. The
33kernel modules backing the items must respond to this.
34
35Both sysfs and configfs can and should exist together on the same
36system. One is not a replacement for the other.
37
38[Using configfs]
39
40configfs can be compiled as a module or into the kernel. You can access
41it by doing
42
43 mount -t configfs none /config
44
45The configfs tree will be empty unless client modules are also loaded.
46These are modules that register their item types with configfs as
47subsystems. Once a client subsystem is loaded, it will appear as a
48subdirectory (or more than one) under /config. Like sysfs, the
49configfs tree is always there, whether mounted on /config or not.
50
51An item is created via mkdir(2). The item's attributes will also
52appear at this time. readdir(3) can determine what the attributes are,
53read(2) can query their default values, and write(2) can store new
54values. Like sysfs, attributes should be ASCII text files, preferably
55with only one value per file. The same efficiency caveats from sysfs
56apply. Don't mix more than one attribute in one attribute file.
57
58Like sysfs, configfs expects write(2) to store the entire buffer at
59once. When writing to configfs attributes, userspace processes should
60first read the entire file, modify the portions they wish to change, and
61then write the entire buffer back. Attribute files have a maximum size
62of one page (PAGE_SIZE, 4096 on i386).
63
64When an item needs to be destroyed, remove it with rmdir(2). An
65item cannot be destroyed if any other item has a link to it (via
66symlink(2)). Links can be removed via unlink(2).
67
68[Configuring FakeNBD: an Example]
69
70Imagine there's a Network Block Device (NBD) driver that allows you to
71access remote block devices. Call it FakeNBD. FakeNBD uses configfs
72for its configuration. Obviously, there will be a nice program that
73sysadmins use to configure FakeNBD, but somehow that program has to tell
74the driver about it. Here's where configfs comes in.
75
76When the FakeNBD driver is loaded, it registers itself with configfs.
77readdir(3) sees this just fine:
78
79 # ls /config
80 fakenbd
81
82A fakenbd connection can be created with mkdir(2). The name is
83arbitrary, but likely the tool will make some use of the name. Perhaps
84it is a uuid or a disk name:
85
86 # mkdir /config/fakenbd/disk1
87 # ls /config/fakenbd/disk1
88 target device rw
89
90The target attribute contains the IP address of the server FakeNBD will
91connect to. The device attribute is the device on the server.
92Predictably, the rw attribute determines whether the connection is
93read-only or read-write.
94
95 # echo 10.0.0.1 > /config/fakenbd/disk1/target
96 # echo /dev/sda1 > /config/fakenbd/disk1/device
97 # echo 1 > /config/fakenbd/disk1/rw
98
99That's it. That's all there is. Now the device is configured, via the
100shell no less.
101
102[Coding With configfs]
103
104Every object in configfs is a config_item. A config_item reflects an
105object in the subsystem. It has attributes that match values on that
106object. configfs handles the filesystem representation of that object
107and its attributes, allowing the subsystem to ignore all but the
108basic show/store interaction.
109
110Items are created and destroyed inside a config_group. A group is a
111collection of items that share the same attributes and operations.
112Items are created by mkdir(2) and removed by rmdir(2), but configfs
113handles that. The group has a set of operations to perform these tasks
114
115A subsystem is the top level of a client module. During initialization,
116the client module registers the subsystem with configfs, the subsystem
117appears as a directory at the top of the configfs filesystem. A
118subsystem is also a config_group, and can do everything a config_group
119can.
120
121[struct config_item]
122
123 struct config_item {
124 char *ci_name;
125 char ci_namebuf[UOBJ_NAME_LEN];
126 struct kref ci_kref;
127 struct list_head ci_entry;
128 struct config_item *ci_parent;
129 struct config_group *ci_group;
130 struct config_item_type *ci_type;
131 struct dentry *ci_dentry;
132 };
133
134 void config_item_init(struct config_item *);
135 void config_item_init_type_name(struct config_item *,
136 const char *name,
137 struct config_item_type *type);
138 struct config_item *config_item_get(struct config_item *);
139 void config_item_put(struct config_item *);
140
141Generally, struct config_item is embedded in a container structure, a
142structure that actually represents what the subsystem is doing. The
143config_item portion of that structure is how the object interacts with
144configfs.
145
146Whether statically defined in a source file or created by a parent
147config_group, a config_item must have one of the _init() functions
148called on it. This initializes the reference count and sets up the
149appropriate fields.
150
151All users of a config_item should have a reference on it via
152config_item_get(), and drop the reference when they are done via
153config_item_put().
154
155By itself, a config_item cannot do much more than appear in configfs.
156Usually a subsystem wants the item to display and/or store attributes,
157among other things. For that, it needs a type.
158
159[struct config_item_type]
160
161 struct configfs_item_operations {
162 void (*release)(struct config_item *);
163 ssize_t (*show_attribute)(struct config_item *,
164 struct configfs_attribute *,
165 char *);
166 ssize_t (*store_attribute)(struct config_item *,
167 struct configfs_attribute *,
168 const char *, size_t);
169 int (*allow_link)(struct config_item *src,
170 struct config_item *target);
171 int (*drop_link)(struct config_item *src,
172 struct config_item *target);
173 };
174
175 struct config_item_type {
176 struct module *ct_owner;
177 struct configfs_item_operations *ct_item_ops;
178 struct configfs_group_operations *ct_group_ops;
179 struct configfs_attribute **ct_attrs;
180 };
181
182The most basic function of a config_item_type is to define what
183operations can be performed on a config_item. All items that have been
184allocated dynamically will need to provide the ct_item_ops->release()
185method. This method is called when the config_item's reference count
186reaches zero. Items that wish to display an attribute need to provide
187the ct_item_ops->show_attribute() method. Similarly, storing a new
188attribute value uses the store_attribute() method.
189
190[struct configfs_attribute]
191
192 struct configfs_attribute {
193 char *ca_name;
194 struct module *ca_owner;
195 mode_t ca_mode;
196 };
197
198When a config_item wants an attribute to appear as a file in the item's
199configfs directory, it must define a configfs_attribute describing it.
200It then adds the attribute to the NULL-terminated array
201config_item_type->ct_attrs. When the item appears in configfs, the
202attribute file will appear with the configfs_attribute->ca_name
203filename. configfs_attribute->ca_mode specifies the file permissions.
204
205If an attribute is readable and the config_item provides a
206ct_item_ops->show_attribute() method, that method will be called
207whenever userspace asks for a read(2) on the attribute. The converse
208will happen for write(2).
209
210[struct config_group]
211
212A config_item cannot live in a vaccum. The only way one can be created
213is via mkdir(2) on a config_group. This will trigger creation of a
214child item.
215
216 struct config_group {
217 struct config_item cg_item;
218 struct list_head cg_children;
219 struct configfs_subsystem *cg_subsys;
220 struct config_group **default_groups;
221 };
222
223 void config_group_init(struct config_group *group);
224 void config_group_init_type_name(struct config_group *group,
225 const char *name,
226 struct config_item_type *type);
227
228
229The config_group structure contains a config_item. Properly configuring
230that item means that a group can behave as an item in its own right.
231However, it can do more: it can create child items or groups. This is
232accomplished via the group operations specified on the group's
233config_item_type.
234
235 struct configfs_group_operations {
236 struct config_item *(*make_item)(struct config_group *group,
237 const char *name);
238 struct config_group *(*make_group)(struct config_group *group,
239 const char *name);
240 int (*commit_item)(struct config_item *item);
241 void (*drop_item)(struct config_group *group,
242 struct config_item *item);
243 };
244
245A group creates child items by providing the
246ct_group_ops->make_item() method. If provided, this method is called from mkdir(2) in the group's directory. The subsystem allocates a new
247config_item (or more likely, its container structure), initializes it,
248and returns it to configfs. Configfs will then populate the filesystem
249tree to reflect the new item.
250
251If the subsystem wants the child to be a group itself, the subsystem
252provides ct_group_ops->make_group(). Everything else behaves the same,
253using the group _init() functions on the group.
254
255Finally, when userspace calls rmdir(2) on the item or group,
256ct_group_ops->drop_item() is called. As a config_group is also a
257config_item, it is not necessary for a seperate drop_group() method.
258The subsystem must config_item_put() the reference that was initialized
259upon item allocation. If a subsystem has no work to do, it may omit
260the ct_group_ops->drop_item() method, and configfs will call
261config_item_put() on the item on behalf of the subsystem.
262
263IMPORTANT: drop_item() is void, and as such cannot fail. When rmdir(2)
264is called, configfs WILL remove the item from the filesystem tree
265(assuming that it has no children to keep it busy). The subsystem is
266responsible for responding to this. If the subsystem has references to
267the item in other threads, the memory is safe. It may take some time
268for the item to actually disappear from the subsystem's usage. But it
269is gone from configfs.
270
271A config_group cannot be removed while it still has child items. This
272is implemented in the configfs rmdir(2) code. ->drop_item() will not be
273called, as the item has not been dropped. rmdir(2) will fail, as the
274directory is not empty.
275
276[struct configfs_subsystem]
277
278A subsystem must register itself, ususally at module_init time. This
279tells configfs to make the subsystem appear in the file tree.
280
281 struct configfs_subsystem {
282 struct config_group su_group;
283 struct semaphore su_sem;
284 };
285
286 int configfs_register_subsystem(struct configfs_subsystem *subsys);
287 void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
288
289 A subsystem consists of a toplevel config_group and a semaphore.
290The group is where child config_items are created. For a subsystem,
291this group is usually defined statically. Before calling
292configfs_register_subsystem(), the subsystem must have initialized the
293group via the usual group _init() functions, and it must also have
294initialized the semaphore.
295 When the register call returns, the subsystem is live, and it
296will be visible via configfs. At that point, mkdir(2) can be called and
297the subsystem must be ready for it.
298
299[An Example]
300
301The best example of these basic concepts is the simple_children
302subsystem/group and the simple_child item in configfs_example.c It
303shows a trivial object displaying and storing an attribute, and a simple
304group creating and destroying these children.
305
306[Hierarchy Navigation and the Subsystem Semaphore]
307
308There is an extra bonus that configfs provides. The config_groups and
309config_items are arranged in a hierarchy due to the fact that they
310appear in a filesystem. A subsystem is NEVER to touch the filesystem
311parts, but the subsystem might be interested in this hierarchy. For
312this reason, the hierarchy is mirrored via the config_group->cg_children
313and config_item->ci_parent structure members.
314
315A subsystem can navigate the cg_children list and the ci_parent pointer
316to see the tree created by the subsystem. This can race with configfs'
317management of the hierarchy, so configfs uses the subsystem semaphore to
318protect modifications. Whenever a subsystem wants to navigate the
319hierarchy, it must do so under the protection of the subsystem
320semaphore.
321
322A subsystem will be prevented from acquiring the semaphore while a newly
323allocated item has not been linked into this hierarchy. Similarly, it
324will not be able to acquire the semaphore while a dropping item has not
325yet been unlinked. This means that an item's ci_parent pointer will
326never be NULL while the item is in configfs, and that an item will only
327be in its parent's cg_children list for the same duration. This allows
328a subsystem to trust ci_parent and cg_children while they hold the
329semaphore.
330
331[Item Aggregation Via symlink(2)]
332
333configfs provides a simple group via the group->item parent/child
334relationship. Often, however, a larger environment requires aggregation
335outside of the parent/child connection. This is implemented via
336symlink(2).
337
338A config_item may provide the ct_item_ops->allow_link() and
339ct_item_ops->drop_link() methods. If the ->allow_link() method exists,
340symlink(2) may be called with the config_item as the source of the link.
341These links are only allowed between configfs config_items. Any
342symlink(2) attempt outside the configfs filesystem will be denied.
343
344When symlink(2) is called, the source config_item's ->allow_link()
345method is called with itself and a target item. If the source item
346allows linking to target item, it returns 0. A source item may wish to
347reject a link if it only wants links to a certain type of object (say,
348in its own subsystem).
349
350When unlink(2) is called on the symbolic link, the source item is
351notified via the ->drop_link() method. Like the ->drop_item() method,
352this is a void function and cannot return failure. The subsystem is
353responsible for responding to the change.
354
355A config_item cannot be removed while it links to any other item, nor
356can it be removed while an item links to it. Dangling symlinks are not
357allowed in configfs.
358
359[Automatically Created Subgroups]
360
361A new config_group may want to have two types of child config_items.
362While this could be codified by magic names in ->make_item(), it is much
363more explicit to have a method whereby userspace sees this divergence.
364
365Rather than have a group where some items behave differently than
366others, configfs provides a method whereby one or many subgroups are
367automatically created inside the parent at its creation. Thus,
368mkdir("parent) results in "parent", "parent/subgroup1", up through
369"parent/subgroupN". Items of type 1 can now be created in
370"parent/subgroup1", and items of type N can be created in
371"parent/subgroupN".
372
373These automatic subgroups, or default groups, do not preclude other
374children of the parent group. If ct_group_ops->make_group() exists,
375other child groups can be created on the parent group directly.
376
377A configfs subsystem specifies default groups by filling in the
378NULL-terminated array default_groups on the config_group structure.
379Each group in that array is populated in the configfs tree at the same
380time as the parent group. Similarly, they are removed at the same time
381as the parent. No extra notification is provided. When a ->drop_item()
382method call notifies the subsystem the parent group is going away, it
383also means every default group child associated with that parent group.
384
385As a consequence of this, default_groups cannot be removed directly via
386rmdir(2). They also are not considered when rmdir(2) on the parent
387group is checking for children.
388
389[Committable Items]
390
391NOTE: Committable items are currently unimplemented.
392
393Some config_items cannot have a valid initial state. That is, no
394default values can be specified for the item's attributes such that the
395item can do its work. Userspace must configure one or more attributes,
396after which the subsystem can start whatever entity this item
397represents.
398
399Consider the FakeNBD device from above. Without a target address *and*
400a target device, the subsystem has no idea what block device to import.
401The simple example assumes that the subsystem merely waits until all the
402appropriate attributes are configured, and then connects. This will,
403indeed, work, but now every attribute store must check if the attributes
404are initialized. Every attribute store must fire off the connection if
405that condition is met.
406
407Far better would be an explicit action notifying the subsystem that the
408config_item is ready to go. More importantly, an explicit action allows
409the subsystem to provide feedback as to whether the attibutes are
410initialized in a way that makes sense. configfs provides this as
411committable items.
412
413configfs still uses only normal filesystem operations. An item is
414committed via rename(2). The item is moved from a directory where it
415can be modified to a directory where it cannot.
416
417Any group that provides the ct_group_ops->commit_item() method has
418committable items. When this group appears in configfs, mkdir(2) will
419not work directly in the group. Instead, the group will have two
420subdirectories: "live" and "pending". The "live" directory does not
421support mkdir(2) or rmdir(2) either. It only allows rename(2). The
422"pending" directory does allow mkdir(2) and rmdir(2). An item is
423created in the "pending" directory. Its attributes can be modified at
424will. Userspace commits the item by renaming it into the "live"
425directory. At this point, the subsystem recieves the ->commit_item()
426callback. If all required attributes are filled to satisfaction, the
427method returns zero and the item is moved to the "live" directory.
428
429As rmdir(2) does not work in the "live" directory, an item must be
430shutdown, or "uncommitted". Again, this is done via rename(2), this
431time from the "live" directory back to the "pending" one. The subsystem
432is notified by the ct_group_ops->uncommit_object() method.
433
434
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c
new file mode 100644
index 000000000000..f3c6e4946f98
--- /dev/null
+++ b/Documentation/filesystems/configfs/configfs_example.c
@@ -0,0 +1,474 @@
1/*
2 * vim: noexpandtab ts=8 sts=0 sw=8:
3 *
4 * configfs_example.c - This file is a demonstration module containing
5 * a number of configfs subsystems.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 021110-1307, USA.
21 *
22 * Based on sysfs:
23 * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
24 *
25 * configfs Copyright (C) 2005 Oracle. All rights reserved.
26 */
27
28#include <linux/init.h>
29#include <linux/module.h>
30#include <linux/slab.h>
31
32#include <linux/configfs.h>
33
34
35
36/*
37 * 01-childless
38 *
39 * This first example is a childless subsystem. It cannot create
40 * any config_items. It just has attributes.
41 *
42 * Note that we are enclosing the configfs_subsystem inside a container.
43 * This is not necessary if a subsystem has no attributes directly
44 * on the subsystem. See the next example, 02-simple-children, for
45 * such a subsystem.
46 */
47
48struct childless {
49 struct configfs_subsystem subsys;
50 int showme;
51 int storeme;
52};
53
54struct childless_attribute {
55 struct configfs_attribute attr;
56 ssize_t (*show)(struct childless *, char *);
57 ssize_t (*store)(struct childless *, const char *, size_t);
58};
59
60static inline struct childless *to_childless(struct config_item *item)
61{
62 return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL;
63}
64
65static ssize_t childless_showme_read(struct childless *childless,
66 char *page)
67{
68 ssize_t pos;
69
70 pos = sprintf(page, "%d\n", childless->showme);
71 childless->showme++;
72
73 return pos;
74}
75
76static ssize_t childless_storeme_read(struct childless *childless,
77 char *page)
78{
79 return sprintf(page, "%d\n", childless->storeme);
80}
81
82static ssize_t childless_storeme_write(struct childless *childless,
83 const char *page,
84 size_t count)
85{
86 unsigned long tmp;
87 char *p = (char *) page;
88
89 tmp = simple_strtoul(p, &p, 10);
90 if (!p || (*p && (*p != '\n')))
91 return -EINVAL;
92
93 if (tmp > INT_MAX)
94 return -ERANGE;
95
96 childless->storeme = tmp;
97
98 return count;
99}
100
101static ssize_t childless_description_read(struct childless *childless,
102 char *page)
103{
104 return sprintf(page,
105"[01-childless]\n"
106"\n"
107"The childless subsystem is the simplest possible subsystem in\n"
108"configfs. It does not support the creation of child config_items.\n"
109"It only has a few attributes. In fact, it isn't much different\n"
110"than a directory in /proc.\n");
111}
112
113static struct childless_attribute childless_attr_showme = {
114 .attr = { .ca_owner = THIS_MODULE, .ca_name = "showme", .ca_mode = S_IRUGO },
115 .show = childless_showme_read,
116};
117static struct childless_attribute childless_attr_storeme = {
118 .attr = { .ca_owner = THIS_MODULE, .ca_name = "storeme", .ca_mode = S_IRUGO | S_IWUSR },
119 .show = childless_storeme_read,
120 .store = childless_storeme_write,
121};
122static struct childless_attribute childless_attr_description = {
123 .attr = { .ca_owner = THIS_MODULE, .ca_name = "description", .ca_mode = S_IRUGO },
124 .show = childless_description_read,
125};
126
127static struct configfs_attribute *childless_attrs[] = {
128 &childless_attr_showme.attr,
129 &childless_attr_storeme.attr,
130 &childless_attr_description.attr,
131 NULL,
132};
133
134static ssize_t childless_attr_show(struct config_item *item,
135 struct configfs_attribute *attr,
136 char *page)
137{
138 struct childless *childless = to_childless(item);
139 struct childless_attribute *childless_attr =
140 container_of(attr, struct childless_attribute, attr);
141 ssize_t ret = 0;
142
143 if (childless_attr->show)
144 ret = childless_attr->show(childless, page);
145 return ret;
146}
147
148static ssize_t childless_attr_store(struct config_item *item,
149 struct configfs_attribute *attr,
150 const char *page, size_t count)
151{
152 struct childless *childless = to_childless(item);
153 struct childless_attribute *childless_attr =
154 container_of(attr, struct childless_attribute, attr);
155 ssize_t ret = -EINVAL;
156
157 if (childless_attr->store)
158 ret = childless_attr->store(childless, page, count);
159 return ret;
160}
161
162static struct configfs_item_operations childless_item_ops = {
163 .show_attribute = childless_attr_show,
164 .store_attribute = childless_attr_store,
165};
166
167static struct config_item_type childless_type = {
168 .ct_item_ops = &childless_item_ops,
169 .ct_attrs = childless_attrs,
170 .ct_owner = THIS_MODULE,
171};
172
173static struct childless childless_subsys = {
174 .subsys = {
175 .su_group = {
176 .cg_item = {
177 .ci_namebuf = "01-childless",
178 .ci_type = &childless_type,
179 },
180 },
181 },
182};
183
184
185/* ----------------------------------------------------------------- */
186
187/*
188 * 02-simple-children
189 *
190 * This example merely has a simple one-attribute child. Note that
191 * there is no extra attribute structure, as the child's attribute is
192 * known from the get-go. Also, there is no container for the
193 * subsystem, as it has no attributes of its own.
194 */
195
196struct simple_child {
197 struct config_item item;
198 int storeme;
199};
200
201static inline struct simple_child *to_simple_child(struct config_item *item)
202{
203 return item ? container_of(item, struct simple_child, item) : NULL;
204}
205
206static struct configfs_attribute simple_child_attr_storeme = {
207 .ca_owner = THIS_MODULE,
208 .ca_name = "storeme",
209 .ca_mode = S_IRUGO | S_IWUSR,
210};
211
212static struct configfs_attribute *simple_child_attrs[] = {
213 &simple_child_attr_storeme,
214 NULL,
215};
216
217static ssize_t simple_child_attr_show(struct config_item *item,
218 struct configfs_attribute *attr,
219 char *page)
220{
221 ssize_t count;
222 struct simple_child *simple_child = to_simple_child(item);
223
224 count = sprintf(page, "%d\n", simple_child->storeme);
225
226 return count;
227}
228
229static ssize_t simple_child_attr_store(struct config_item *item,
230 struct configfs_attribute *attr,
231 const char *page, size_t count)
232{
233 struct simple_child *simple_child = to_simple_child(item);
234 unsigned long tmp;
235 char *p = (char *) page;
236
237 tmp = simple_strtoul(p, &p, 10);
238 if (!p || (*p && (*p != '\n')))
239 return -EINVAL;
240
241 if (tmp > INT_MAX)
242 return -ERANGE;
243
244 simple_child->storeme = tmp;
245
246 return count;
247}
248
249static void simple_child_release(struct config_item *item)
250{
251 kfree(to_simple_child(item));
252}
253
254static struct configfs_item_operations simple_child_item_ops = {
255 .release = simple_child_release,
256 .show_attribute = simple_child_attr_show,
257 .store_attribute = simple_child_attr_store,
258};
259
260static struct config_item_type simple_child_type = {
261 .ct_item_ops = &simple_child_item_ops,
262 .ct_attrs = simple_child_attrs,
263 .ct_owner = THIS_MODULE,
264};
265
266
267static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
268{
269 struct simple_child *simple_child;
270
271 simple_child = kmalloc(sizeof(struct simple_child), GFP_KERNEL);
272 if (!simple_child)
273 return NULL;
274
275 memset(simple_child, 0, sizeof(struct simple_child));
276
277 config_item_init_type_name(&simple_child->item, name,
278 &simple_child_type);
279
280 simple_child->storeme = 0;
281
282 return &simple_child->item;
283}
284
285static struct configfs_attribute simple_children_attr_description = {
286 .ca_owner = THIS_MODULE,
287 .ca_name = "description",
288 .ca_mode = S_IRUGO,
289};
290
291static struct configfs_attribute *simple_children_attrs[] = {
292 &simple_children_attr_description,
293 NULL,
294};
295
296static ssize_t simple_children_attr_show(struct config_item *item,
297 struct configfs_attribute *attr,
298 char *page)
299{
300 return sprintf(page,
301"[02-simple-children]\n"
302"\n"
303"This subsystem allows the creation of child config_items. These\n"
304"items have only one attribute that is readable and writeable.\n");
305}
306
307static struct configfs_item_operations simple_children_item_ops = {
308 .show_attribute = simple_children_attr_show,
309};
310
311/*
312 * Note that, since no extra work is required on ->drop_item(),
313 * no ->drop_item() is provided.
314 */
315static struct configfs_group_operations simple_children_group_ops = {
316 .make_item = simple_children_make_item,
317};
318
319static struct config_item_type simple_children_type = {
320 .ct_item_ops = &simple_children_item_ops,
321 .ct_group_ops = &simple_children_group_ops,
322 .ct_attrs = simple_children_attrs,
323};
324
325static struct configfs_subsystem simple_children_subsys = {
326 .su_group = {
327 .cg_item = {
328 .ci_namebuf = "02-simple-children",
329 .ci_type = &simple_children_type,
330 },
331 },
332};
333
334
335/* ----------------------------------------------------------------- */
336
337/*
338 * 03-group-children
339 *
340 * This example reuses the simple_children group from above. However,
341 * the simple_children group is not the subsystem itself, it is a
342 * child of the subsystem. Creation of a group in the subsystem creates
343 * a new simple_children group. That group can then have simple_child
344 * children of its own.
345 */
346
347struct simple_children {
348 struct config_group group;
349};
350
351static struct config_group *group_children_make_group(struct config_group *group, const char *name)
352{
353 struct simple_children *simple_children;
354
355 simple_children = kmalloc(sizeof(struct simple_children),
356 GFP_KERNEL);
357 if (!simple_children)
358 return NULL;
359
360 memset(simple_children, 0, sizeof(struct simple_children));
361
362 config_group_init_type_name(&simple_children->group, name,
363 &simple_children_type);
364
365 return &simple_children->group;
366}
367
368static struct configfs_attribute group_children_attr_description = {
369 .ca_owner = THIS_MODULE,
370 .ca_name = "description",
371 .ca_mode = S_IRUGO,
372};
373
374static struct configfs_attribute *group_children_attrs[] = {
375 &group_children_attr_description,
376 NULL,
377};
378
379static ssize_t group_children_attr_show(struct config_item *item,
380 struct configfs_attribute *attr,
381 char *page)
382{
383 return sprintf(page,
384"[03-group-children]\n"
385"\n"
386"This subsystem allows the creation of child config_groups. These\n"
387"groups are like the subsystem simple-children.\n");
388}
389
390static struct configfs_item_operations group_children_item_ops = {
391 .show_attribute = group_children_attr_show,
392};
393
394/*
395 * Note that, since no extra work is required on ->drop_item(),
396 * no ->drop_item() is provided.
397 */
398static struct configfs_group_operations group_children_group_ops = {
399 .make_group = group_children_make_group,
400};
401
402static struct config_item_type group_children_type = {
403 .ct_item_ops = &group_children_item_ops,
404 .ct_group_ops = &group_children_group_ops,
405 .ct_attrs = group_children_attrs,
406};
407
408static struct configfs_subsystem group_children_subsys = {
409 .su_group = {
410 .cg_item = {
411 .ci_namebuf = "03-group-children",
412 .ci_type = &group_children_type,
413 },
414 },
415};
416
417/* ----------------------------------------------------------------- */
418
419/*
420 * We're now done with our subsystem definitions.
421 * For convenience in this module, here's a list of them all. It
422 * allows the init function to easily register them. Most modules
423 * will only have one subsystem, and will only call register_subsystem
424 * on it directly.
425 */
426static struct configfs_subsystem *example_subsys[] = {
427 &childless_subsys.subsys,
428 &simple_children_subsys,
429 &group_children_subsys,
430 NULL,
431};
432
433static int __init configfs_example_init(void)
434{
435 int ret;
436 int i;
437 struct configfs_subsystem *subsys;
438
439 for (i = 0; example_subsys[i]; i++) {
440 subsys = example_subsys[i];
441
442 config_group_init(&subsys->su_group);
443 init_MUTEX(&subsys->su_sem);
444 ret = configfs_register_subsystem(subsys);
445 if (ret) {
446 printk(KERN_ERR "Error %d while registering subsystem %s\n",
447 ret,
448 subsys->su_group.cg_item.ci_namebuf);
449 goto out_unregister;
450 }
451 }
452
453 return 0;
454
455out_unregister:
456 for (; i >= 0; i--) {
457 configfs_unregister_subsystem(example_subsys[i]);
458 }
459
460 return ret;
461}
462
463static void __exit configfs_example_exit(void)
464{
465 int i;
466
467 for (i = 0; example_subsys[i]; i++) {
468 configfs_unregister_subsystem(example_subsys[i]);
469 }
470}
471
472module_init(configfs_example_init);
473module_exit(configfs_example_exit);
474MODULE_LICENSE("GPL");
diff --git a/Documentation/filesystems/dlmfs.txt b/Documentation/filesystems/dlmfs.txt
new file mode 100644
index 000000000000..9afab845a906
--- /dev/null
+++ b/Documentation/filesystems/dlmfs.txt
@@ -0,0 +1,130 @@
1dlmfs
2==================
3A minimal DLM userspace interface implemented via a virtual file
4system.
5
6dlmfs is built with OCFS2 as it requires most of its infrastructure.
7
8Project web page: http://oss.oracle.com/projects/ocfs2
9Tools web page: http://oss.oracle.com/projects/ocfs2-tools
10OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
11
12All code copyright 2005 Oracle except when otherwise noted.
13
14CREDITS
15=======
16
17Some code taken from ramfs which is Copyright (C) 2000 Linus Torvalds
18and Transmeta Corp.
19
20Mark Fasheh <mark.fasheh@oracle.com>
21
22Caveats
23=======
24- Right now it only works with the OCFS2 DLM, though support for other
25 DLM implementations should not be a major issue.
26
27Mount options
28=============
29None
30
31Usage
32=====
33
34If you're just interested in OCFS2, then please see ocfs2.txt. The
35rest of this document will be geared towards those who want to use
36dlmfs for easy to setup and easy to use clustered locking in
37userspace.
38
39Setup
40=====
41
42dlmfs requires that the OCFS2 cluster infrastructure be in
43place. Please download ocfs2-tools from the above url and configure a
44cluster.
45
46You'll want to start heartbeating on a volume which all the nodes in
47your lockspace can access. The easiest way to do this is via
48ocfs2_hb_ctl (distributed with ocfs2-tools). Right now it requires
49that an OCFS2 file system be in place so that it can automatically
50find it's heartbeat area, though it will eventually support heartbeat
51against raw disks.
52
53Please see the ocfs2_hb_ctl and mkfs.ocfs2 manual pages distributed
54with ocfs2-tools.
55
56Once you're heartbeating, DLM lock 'domains' can be easily created /
57destroyed and locks within them accessed.
58
59Locking
60=======
61
62Users may access dlmfs via standard file system calls, or they can use
63'libo2dlm' (distributed with ocfs2-tools) which abstracts the file
64system calls and presents a more traditional locking api.
65
66dlmfs handles lock caching automatically for the user, so a lock
67request for an already acquired lock will not generate another DLM
68call. Userspace programs are assumed to handle their own local
69locking.
70
71Two levels of locks are supported - Shared Read, and Exlcusive.
72Also supported is a Trylock operation.
73
74For information on the libo2dlm interface, please see o2dlm.h,
75distributed with ocfs2-tools.
76
77Lock value blocks can be read and written to a resource via read(2)
78and write(2) against the fd obtained via your open(2) call. The
79maximum currently supported LVB length is 64 bytes (though that is an
80OCFS2 DLM limitation). Through this mechanism, users of dlmfs can share
81small amounts of data amongst their nodes.
82
83mkdir(2) signals dlmfs to join a domain (which will have the same name
84as the resulting directory)
85
86rmdir(2) signals dlmfs to leave the domain
87
88Locks for a given domain are represented by regular inodes inside the
89domain directory. Locking against them is done via the open(2) system
90call.
91
92The open(2) call will not return until your lock has been granted or
93an error has occurred, unless it has been instructed to do a trylock
94operation. If the lock succeeds, you'll get an fd.
95
96open(2) with O_CREAT to ensure the resource inode is created - dlmfs does
97not automatically create inodes for existing lock resources.
98
99Open Flag Lock Request Type
100--------- -----------------
101O_RDONLY Shared Read
102O_RDWR Exclusive
103
104Open Flag Resulting Locking Behavior
105--------- --------------------------
106O_NONBLOCK Trylock operation
107
108You must provide exactly one of O_RDONLY or O_RDWR.
109
110If O_NONBLOCK is also provided and the trylock operation was valid but
111could not lock the resource then open(2) will return ETXTBUSY.
112
113close(2) drops the lock associated with your fd.
114
115Modes passed to mkdir(2) or open(2) are adhered to locally. Chown is
116supported locally as well. This means you can use them to restrict
117access to the resources via dlmfs on your local node only.
118
119The resource LVB may be read from the fd in either Shared Read or
120Exclusive modes via the read(2) system call. It can be written via
121write(2) only when open in Exclusive mode.
122
123Once written, an LVB will be visible to other nodes who obtain Read
124Only or higher level locks on the resource.
125
126See Also
127========
128http://opendlm.sourceforge.net/cvsmirror/opendlm/docs/dlmbook_final.pdf
129
130For more information on the VMS distributed locking API.
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
new file mode 100644
index 000000000000..f2595caf052e
--- /dev/null
+++ b/Documentation/filesystems/ocfs2.txt
@@ -0,0 +1,55 @@
1OCFS2 filesystem
2==================
3OCFS2 is a general purpose extent based shared disk cluster file
4system with many similarities to ext3. It supports 64 bit inode
5numbers, and has automatically extending metadata groups which may
6also make it attractive for non-clustered use.
7
8You'll want to install the ocfs2-tools package in order to at least
9get "mount.ocfs2" and "ocfs2_hb_ctl".
10
11Project web page: http://oss.oracle.com/projects/ocfs2
12Tools web page: http://oss.oracle.com/projects/ocfs2-tools
13OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
14
15All code copyright 2005 Oracle except when otherwise noted.
16
17CREDITS:
18Lots of code taken from ext3 and other projects.
19
20Authors in alphabetical order:
21Joel Becker <joel.becker@oracle.com>
22Zach Brown <zach.brown@oracle.com>
23Mark Fasheh <mark.fasheh@oracle.com>
24Kurt Hackel <kurt.hackel@oracle.com>
25Sunil Mushran <sunil.mushran@oracle.com>
26Manish Singh <manish.singh@oracle.com>
27
28Caveats
29=======
30Features which OCFS2 does not support yet:
31 - sparse files
32 - extended attributes
33 - shared writeable mmap
34 - loopback is supported, but data written will not
35 be cluster coherent.
36 - quotas
37 - cluster aware flock
38 - Directory change notification (F_NOTIFY)
39 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
40 - POSIX ACLs
41 - readpages / writepages (not user visible)
42
43Mount options
44=============
45
46OCFS2 supports the following mount options:
47(*) == default
48
49barrier=1 This enables/disables barriers. barrier=0 disables it,
50 barrier=1 enables it.
51errors=remount-ro(*) Remount the filesystem read-only on an error.
52errors=panic Panic and halt the machine if an error occurs.
53intr (*) Allow signals to interrupt cluster operations.
54nointr Do not allow signals to interrupt cluster
55 operations.
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index ee4c0a8b8db7..e56e842847d3 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -162,9 +162,8 @@ get_sb() method fills in is the "s_op" field. This is a pointer to
162a "struct super_operations" which describes the next level of the 162a "struct super_operations" which describes the next level of the
163filesystem implementation. 163filesystem implementation.
164 164
165Usually, a filesystem uses generic one of the generic get_sb() 165Usually, a filesystem uses one of the generic get_sb() implementations
166implementations and provides a fill_super() method instead. The 166and provides a fill_super() method instead. The generic methods are:
167generic methods are:
168 167
169 get_sb_bdev: mount a filesystem residing on a block device 168 get_sb_bdev: mount a filesystem residing on a block device
170 169
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index c91caf7eb303..1c0db652b366 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -38,7 +38,7 @@ included in the kernel tree.
38What is covered within this file is mainly information to authors 38What is covered within this file is mainly information to authors
39of modules. The author of an external modules should supply 39of modules. The author of an external modules should supply
40a makefile that hides most of the complexity so one only has to type 40a makefile that hides most of the complexity so one only has to type
41'make' to buld the module. A complete example will be present in 41'make' to build the module. A complete example will be present in
42chapter ¤. Creating a kbuild file for an external module". 42chapter ¤. Creating a kbuild file for an external module".
43 43
44 44
@@ -69,7 +69,7 @@ when building an external module.
69 69
70--- 2.2 Available targets 70--- 2.2 Available targets
71 71
72 $KDIR refers to path to kernel source top-level directory 72 $KDIR refers to the path to the kernel source top-level directory
73 73
74 make -C $KDIR M=`pwd` 74 make -C $KDIR M=`pwd`
75 Will build the module(s) located in current directory. 75 Will build the module(s) located in current directory.
@@ -87,11 +87,11 @@ when building an external module.
87 make -C $KDIR M=$PWD modules_install 87 make -C $KDIR M=$PWD modules_install
88 Install the external module(s). 88 Install the external module(s).
89 Installation default is in /lib/modules/<kernel-version>/extra, 89 Installation default is in /lib/modules/<kernel-version>/extra,
90 but may be prefixed with INSTALL_MOD_PATH - see separate chater. 90 but may be prefixed with INSTALL_MOD_PATH - see separate chapter.
91 91
92 make -C $KDIR M=$PWD clean 92 make -C $KDIR M=$PWD clean
93 Remove all generated files for the module - the kernel 93 Remove all generated files for the module - the kernel
94 source directory is not moddified. 94 source directory is not modified.
95 95
96 make -C $KDIR M=`pwd` help 96 make -C $KDIR M=`pwd` help
97 help will list the available target when building external 97 help will list the available target when building external
@@ -99,7 +99,7 @@ when building an external module.
99 99
100--- 2.3 Available options: 100--- 2.3 Available options:
101 101
102 $KDIR refer to path to kernel src 102 $KDIR refers to the path to the kernel source top-level directory
103 103
104 make -C $KDIR 104 make -C $KDIR
105 Used to specify where to find the kernel source. 105 Used to specify where to find the kernel source.
@@ -206,11 +206,11 @@ following files:
206 206
207 KERNELDIR := /lib/modules/`uname -r`/build 207 KERNELDIR := /lib/modules/`uname -r`/build
208 all:: 208 all::
209 $(MAKE) -C $KERNELDIR M=`pwd` $@ 209 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
210 210
211 # Module specific targets 211 # Module specific targets
212 genbin: 212 genbin:
213 echo "X" > 8123_bini.o_shipped 213 echo "X" > 8123_bin.o_shipped
214 214
215 endif 215 endif
216 216
@@ -341,13 +341,13 @@ directory and therefore needs to deal with this in their kbuild file.
341 EXTRA_CFLAGS := -Iinclude 341 EXTRA_CFLAGS := -Iinclude
342 8123-y := 8123_if.o 8123_pci.o 8123_bin.o 342 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
343 343
344 Note that in the assingment there is no space between -I and the path. 344 Note that in the assignment there is no space between -I and the path.
345 This is a kbuild limitation and no space must be present. 345 This is a kbuild limitation: there must be no space present.
346 346
347 347
348=== 6. Module installation 348=== 6. Module installation
349 349
350Modules which are included in the kernel is installed in the directory: 350Modules which are included in the kernel are installed in the directory:
351 351
352 /lib/modules/$(KERNELRELEASE)/kernel 352 /lib/modules/$(KERNELRELEASE)/kernel
353 353
@@ -365,7 +365,7 @@ External modules are installed in the directory:
365 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel 365 => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel
366 366
367 INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the 367 INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the
368 example above be specified on the commandline when calling make. 368 example above be specified on the command line when calling make.
369 INSTALL_MOD_PATH has effect both when installing modules included in 369 INSTALL_MOD_PATH has effect both when installing modules included in
370 the kernel as well as when installing external modules. 370 the kernel as well as when installing external modules.
371 371
@@ -384,7 +384,7 @@ External modules are installed in the directory:
384 384
385=== 7. Module versioning 385=== 7. Module versioning
386 386
387Module versioning are enabled by the CONFIG_MODVERSIONS tag. 387Module versioning is enabled by the CONFIG_MODVERSIONS tag.
388 388
389Module versioning is used as a simple ABI consistency check. The Module 389Module versioning is used as a simple ABI consistency check. The Module
390versioning creates a CRC value of the full prototype for an exported symbol and 390versioning creates a CRC value of the full prototype for an exported symbol and
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6e9f1dc26884..06e362b2d5b8 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -633,6 +633,14 @@ running once the system is up.
633 inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver 633 inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver
634 Format: <irq> 634 Format: <irq>
635 635
636 combined_mode= [HW] control which driver uses IDE ports in combined
637 mode: legacy IDE driver, libata, or both
638 (in the libata case, libata.atapi_enabled=1 may be
639 useful as well). Note that using the ide or libata
640 options may affect your device naming (e.g. by
641 changing hdc to sdb).
642 Format: combined (default), ide, or libata
643
636 inttest= [IA64] 644 inttest= [IA64]
637 645
638 io7= [HW] IO7 for Marvel based alpha systems 646 io7= [HW] IO7 for Marvel based alpha systems
diff --git a/Documentation/keys.txt b/Documentation/keys.txt
index 31154882000a..6304db59bfe4 100644
--- a/Documentation/keys.txt
+++ b/Documentation/keys.txt
@@ -860,24 +860,6 @@ The structure has a number of fields, some of which are mandatory:
860 It is safe to sleep in this method. 860 It is safe to sleep in this method.
861 861
862 862
863 (*) int (*duplicate)(struct key *key, const struct key *source);
864
865 If this type of key can be duplicated, then this method should be
866 provided. It is called to copy the payload attached to the source into the
867 new key. The data length on the new key will have been updated and the
868 quota adjusted already.
869
870 This method will be called with the source key's semaphore read-locked to
871 prevent its payload from being changed, thus RCU constraints need not be
872 applied to the source key.
873
874 This method does not have to lock the destination key in order to attach a
875 payload. The fact that KEY_FLAG_INSTANTIATED is not set in key->flags
876 prevents anything else from gaining access to the key.
877
878 It is safe to sleep in this method.
879
880
881 (*) int (*update)(struct key *key, const void *data, size_t datalen); 863 (*) int (*update)(struct key *key, const void *data, size_t datalen);
882 864
883 If this type of key can be updated, then this method should be provided. 865 If this type of key can be updated, then this method should be provided.
diff --git a/Documentation/md.txt b/Documentation/md.txt
index 23e6cce40f9c..03a13c462cf2 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -51,6 +51,30 @@ superblock can be autodetected and run at boot time.
51The kernel parameter "raid=partitionable" (or "raid=part") means 51The kernel parameter "raid=partitionable" (or "raid=part") means
52that all auto-detected arrays are assembled as partitionable. 52that all auto-detected arrays are assembled as partitionable.
53 53
54Boot time assembly of degraded/dirty arrays
55-------------------------------------------
56
57If a raid5 or raid6 array is both dirty and degraded, it could have
58undetectable data corruption. This is because the fact that it is
59'dirty' means that the parity cannot be trusted, and the fact that it
60is degraded means that some datablocks are missing and cannot reliably
61be reconstructed (due to no parity).
62
63For this reason, md will normally refuse to start such an array. This
64requires the sysadmin to take action to explicitly start the array
65desipite possible corruption. This is normally done with
66 mdadm --assemble --force ....
67
68This option is not really available if the array has the root
69filesystem on it. In order to support this booting from such an
70array, md supports a module parameter "start_dirty_degraded" which,
71when set to 1, bypassed the checks and will allows dirty degraded
72arrays to be started.
73
74So, to boot with a root filesystem of a dirty degraded raid[56], use
75
76 md-mod.start_dirty_degraded=1
77
54 78
55Superblock formats 79Superblock formats
56------------------ 80------------------
@@ -141,6 +165,70 @@ All md devices contain:
141 in a fully functional array. If this is not yet known, the file 165 in a fully functional array. If this is not yet known, the file
142 will be empty. If an array is being resized (not currently 166 will be empty. If an array is being resized (not currently
143 possible) this will contain the larger of the old and new sizes. 167 possible) this will contain the larger of the old and new sizes.
168 Some raid level (RAID1) allow this value to be set while the
169 array is active. This will reconfigure the array. Otherwise
170 it can only be set while assembling an array.
171
172 chunk_size
173 This is the size if bytes for 'chunks' and is only relevant to
174 raid levels that involve striping (1,4,5,6,10). The address space
175 of the array is conceptually divided into chunks and consecutive
176 chunks are striped onto neighbouring devices.
177 The size should be atleast PAGE_SIZE (4k) and should be a power
178 of 2. This can only be set while assembling an array
179
180 component_size
181 For arrays with data redundancy (i.e. not raid0, linear, faulty,
182 multipath), all components must be the same size - or at least
183 there must a size that they all provide space for. This is a key
184 part or the geometry of the array. It is measured in sectors
185 and can be read from here. Writing to this value may resize
186 the array if the personality supports it (raid1, raid5, raid6),
187 and if the component drives are large enough.
188
189 metadata_version
190 This indicates the format that is being used to record metadata
191 about the array. It can be 0.90 (traditional format), 1.0, 1.1,
192 1.2 (newer format in varying locations) or "none" indicating that
193 the kernel isn't managing metadata at all.
194
195 level
196 The raid 'level' for this array. The name will often (but not
197 always) be the same as the name of the module that implements the
198 level. To be auto-loaded the module must have an alias
199 md-$LEVEL e.g. md-raid5
200 This can be written only while the array is being assembled, not
201 after it is started.
202
203 new_dev
204 This file can be written but not read. The value written should
205 be a block device number as major:minor. e.g. 8:0
206 This will cause that device to be attached to the array, if it is
207 available. It will then appear at md/dev-XXX (depending on the
208 name of the device) and further configuration is then possible.
209
210 sync_speed_min
211 sync_speed_max
212 This are similar to /proc/sys/dev/raid/speed_limit_{min,max}
213 however they only apply to the particular array.
214 If no value has been written to these, of if the word 'system'
215 is written, then the system-wide value is used. If a value,
216 in kibibytes-per-second is written, then it is used.
217 When the files are read, they show the currently active value
218 followed by "(local)" or "(system)" depending on whether it is
219 a locally set or system-wide value.
220
221 sync_completed
222 This shows the number of sectors that have been completed of
223 whatever the current sync_action is, followed by the number of
224 sectors in total that could need to be processed. The two
225 numbers are separated by a '/' thus effectively showing one
226 value, a fraction of the process that is complete.
227
228 sync_speed
229 This shows the current actual speed, in K/sec, of the current
230 sync_action. It is averaged over the last 30 seconds.
231
144 232
145As component devices are added to an md array, they appear in the 'md' 233As component devices are added to an md array, they appear in the 'md'
146directory as new directories named 234directory as new directories named
@@ -167,6 +255,38 @@ Each directory contains:
167 of being recoverred to 255 of being recoverred to
168 This list make grow in future. 256 This list make grow in future.
169 257
258 errors
259 An approximate count of read errors that have been detected on
260 this device but have not caused the device to be evicted from
261 the array (either because they were corrected or because they
262 happened while the array was read-only). When using version-1
263 metadata, this value persists across restarts of the array.
264
265 This value can be written while assembling an array thus
266 providing an ongoing count for arrays with metadata managed by
267 userspace.
268
269 slot
270 This gives the role that the device has in the array. It will
271 either be 'none' if the device is not active in the array
272 (i.e. is a spare or has failed) or an integer less than the
273 'raid_disks' number for the array indicating which possition
274 it currently fills. This can only be set while assembling an
275 array. A device for which this is set is assumed to be working.
276
277 offset
278 This gives the location in the device (in sectors from the
279 start) where data from the array will be stored. Any part of
280 the device before this offset us not touched, unless it is
281 used for storing metadata (Formats 1.1 and 1.2).
282
283 size
284 The amount of the device, after the offset, that can be used
285 for storage of data. This will normally be the same as the
286 component_size. This can be written while assembling an
287 array. If a value less than the current component_size is
288 written, component_size will be reduced to this value.
289
170 290
171An active md device will also contain and entry for each active device 291An active md device will also contain and entry for each active device
172in the array. These are named 292in the array. These are named
diff --git a/Documentation/networking/gianfar.txt b/Documentation/networking/gianfar.txt
new file mode 100644
index 000000000000..ad474ea07d07
--- /dev/null
+++ b/Documentation/networking/gianfar.txt
@@ -0,0 +1,72 @@
1The Gianfar Ethernet Driver
2Sysfs File description
3
4Author: Andy Fleming <afleming@freescale.com>
5Updated: 2005-07-28
6
7SYSFS
8
9Several of the features of the gianfar driver are controlled
10through sysfs files. These are:
11
12bd_stash:
13To stash RX Buffer Descriptors in the L2, echo 'on' or '1' to
14bd_stash, echo 'off' or '0' to disable
15
16rx_stash_len:
17To stash the first n bytes of the packet in L2, echo the number
18of bytes to buf_stash_len. echo 0 to disable.
19
20WARNING: You could really screw these up if you set them too low or high!
21fifo_threshold:
22To change the number of bytes the controller needs in the
23fifo before it starts transmission, echo the number of bytes to
24fifo_thresh. Range should be 0-511.
25
26fifo_starve:
27When the FIFO has less than this many bytes during a transmit, it
28enters starve mode, and increases the priority of TX memory
29transactions. To change, echo the number of bytes to
30fifo_starve. Range should be 0-511.
31
32fifo_starve_off:
33Once in starve mode, the FIFO remains there until it has this
34many bytes. To change, echo the number of bytes to
35fifo_starve_off. Range should be 0-511.
36
37CHECKSUM OFFLOADING
38
39The eTSEC controller (first included in parts from late 2005 like
40the 8548) has the ability to perform TCP, UDP, and IP checksums
41in hardware. The Linux kernel only offloads the TCP and UDP
42checksums (and always performs the pseudo header checksums), so
43the driver only supports checksumming for TCP/IP and UDP/IP
44packets. Use ethtool to enable or disable this feature for RX
45and TX.
46
47VLAN
48
49In order to use VLAN, please consult Linux documentation on
50configuring VLANs. The gianfar driver supports hardware insertion and
51extraction of VLAN headers, but not filtering. Filtering will be
52done by the kernel.
53
54MULTICASTING
55
56The gianfar driver supports using the group hash table on the
57TSEC (and the extended hash table on the eTSEC) for multicast
58filtering. On the eTSEC, the exact-match MAC registers are used
59before the hash tables. See Linux documentation on how to join
60multicast groups.
61
62PADDING
63
64The gianfar driver supports padding received frames with 2 bytes
65to align the IP header to a 16-byte boundary, when supported by
66hardware.
67
68ETHTOOL
69
70The gianfar driver supports the use of ethtool for many
71configuration options. You must run ethtool only on currently
72open interfaces. See ethtool documentation for details.
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index ebc09a159f62..2b7cf19a06ad 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -46,6 +46,29 @@ ipfrag_secret_interval - INTEGER
46 for the hash secret) for IP fragments. 46 for the hash secret) for IP fragments.
47 Default: 600 47 Default: 600
48 48
49ipfrag_max_dist - INTEGER
50 ipfrag_max_dist is a non-negative integer value which defines the
51 maximum "disorder" which is allowed among fragments which share a
52 common IP source address. Note that reordering of packets is
53 not unusual, but if a large number of fragments arrive from a source
54 IP address while a particular fragment queue remains incomplete, it
55 probably indicates that one or more fragments belonging to that queue
56 have been lost. When ipfrag_max_dist is positive, an additional check
57 is done on fragments before they are added to a reassembly queue - if
58 ipfrag_max_dist (or more) fragments have arrived from a particular IP
59 address between additions to any IP fragment queue using that source
60 address, it's presumed that one or more fragments in the queue are
61 lost. The existing fragment queue will be dropped, and a new one
62 started. An ipfrag_max_dist value of zero disables this check.
63
64 Using a very small value, e.g. 1 or 2, for ipfrag_max_dist can
65 result in unnecessarily dropping fragment queues when normal
66 reordering of packets occurs, which could lead to poor application
67 performance. Using a very large value, e.g. 50000, increases the
68 likelihood of incorrectly reassembling IP fragments that originate
69 from different IP datagrams, which could result in data corruption.
70 Default: 64
71
49INET peer storage: 72INET peer storage:
50 73
51inet_peer_threshold - INTEGER 74inet_peer_threshold - INTEGER
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 403e7b4dcdd4..97420f08c786 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,5 +1,16 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2 2
3* Unify detach and REMOVAL event code, as well as attach and INSERTION
4 code (as of 2.6.16)
5 void (*remove) (struct pcmcia_device *dev);
6 int (*probe) (struct pcmcia_device *dev);
7
8* Move suspend, resume and reset out of event handler (as of 2.6.16)
9 int (*suspend) (struct pcmcia_device *dev);
10 int (*resume) (struct pcmcia_device *dev);
11 should be initialized in struct pcmcia_driver, and handle
12 (SUSPEND == RESET_PHYSICAL) and (RESUME == CARD_RESET) events
13
3* event handler initialization in struct pcmcia_driver (as of 2.6.13) 14* event handler initialization in struct pcmcia_driver (as of 2.6.13)
4 The event handler is notified of all events, and must be initialized 15 The event handler is notified of all events, and must be initialized
5 as the event() callback in the driver's struct pcmcia_driver. 16 as the event() callback in the driver's struct pcmcia_driver.
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt
index f5ebda5f4276..bd4ffb5bd49a 100644
--- a/Documentation/power/interface.txt
+++ b/Documentation/power/interface.txt
@@ -41,3 +41,14 @@ to. Writing to this file will accept one of
41It will only change to 'firmware' or 'platform' if the system supports 41It will only change to 'firmware' or 'platform' if the system supports
42it. 42it.
43 43
44/sys/power/image_size controls the size of the image created by
45the suspend-to-disk mechanism. It can be written a string
46representing a non-negative integer that will be used as an upper
47limit of the image size, in megabytes. The suspend-to-disk mechanism will
48do its best to ensure the image size will not exceed that number. However,
49if this turns out to be impossible, it will try to suspend anyway using the
50smallest image possible. In particular, if "0" is written to this file, the
51suspend image will be as small as possible.
52
53Reading from this file will display the current image size limit, which
54is set to 500 MB by default.
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index b0d50840788e..cd0fcd89a6f0 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -27,6 +27,11 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state
27 27
28echo platform > /sys/power/disk; echo disk > /sys/power/state 28echo platform > /sys/power/disk; echo disk > /sys/power/state
29 29
30If you want to limit the suspend image size to N megabytes, do
31
32echo N > /sys/power/image_size
33
34before suspend (it is limited to 500 MB by default).
30 35
31Encrypted suspend image: 36Encrypted suspend image:
32------------------------ 37------------------------
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.txt
index e75d7474322c..67a11a36270c 100644
--- a/Documentation/powerpc/eeh-pci-error-recovery.txt
+++ b/Documentation/powerpc/eeh-pci-error-recovery.txt
@@ -115,7 +115,7 @@ Current PPC64 Linux EEH Implementation
115At this time, a generic EEH recovery mechanism has been implemented, 115At this time, a generic EEH recovery mechanism has been implemented,
116so that individual device drivers do not need to be modified to support 116so that individual device drivers do not need to be modified to support
117EEH recovery. This generic mechanism piggy-backs on the PCI hotplug 117EEH recovery. This generic mechanism piggy-backs on the PCI hotplug
118infrastructure, and percolates events up through the hotplug/udev 118infrastructure, and percolates events up through the userspace/udev
119infrastructure. Followiing is a detailed description of how this is 119infrastructure. Followiing is a detailed description of how this is
120accomplished. 120accomplished.
121 121
@@ -172,7 +172,7 @@ A handler for the EEH notifier_block events is implemented in
172drivers/pci/hotplug/pSeries_pci.c, called handle_eeh_events(). 172drivers/pci/hotplug/pSeries_pci.c, called handle_eeh_events().
173It saves the device BAR's and then calls rpaphp_unconfig_pci_adapter(). 173It saves the device BAR's and then calls rpaphp_unconfig_pci_adapter().
174This last call causes the device driver for the card to be stopped, 174This last call causes the device driver for the card to be stopped,
175which causes hotplug events to go out to user space. This triggers 175which causes uevents to go out to user space. This triggers
176user-space scripts that might issue commands such as "ifdown eth0" 176user-space scripts that might issue commands such as "ifdown eth0"
177for ethernet cards, and so on. This handler then sleeps for 5 seconds, 177for ethernet cards, and so on. This handler then sleeps for 5 seconds,
178hoping to give the user-space scripts enough time to complete. 178hoping to give the user-space scripts enough time to complete.
@@ -258,29 +258,30 @@ rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c
258 calls 258 calls
259 pci_destroy_dev (struct pci_dev *) { 259 pci_destroy_dev (struct pci_dev *) {
260 calls 260 calls
261 device_unregister (&dev->dev) { // in /drivers/base/core.c 261 device_unregister (&dev->dev) { // in /drivers/base/core.c
262 calls 262 calls
263 device_del(struct device * dev) { // in /drivers/base/core.c 263 device_del(struct device * dev) { // in /drivers/base/core.c
264 calls 264 calls
265 kobject_del() { //in /libs/kobject.c 265 kobject_del() { //in /libs/kobject.c
266 calls 266 calls
267 kobject_hotplug() { // in /libs/kobject.c 267 kobject_uevent() { // in /libs/kobject.c
268 calls 268 calls
269 kset_hotplug() { // in /lib/kobject.c 269 kset_uevent() { // in /lib/kobject.c
270 calls 270 calls
271 kset->hotplug_ops->hotplug() which is really just 271 kset->uevent_ops->uevent() // which is really just
272 a call to 272 a call to
273 dev_hotplug() { // in /drivers/base/core.c 273 dev_uevent() { // in /drivers/base/core.c
274 calls 274 calls
275 dev->bus->hotplug() which is really just a call to 275 dev->bus->uevent() which is really just a call to
276 pci_hotplug () { // in drivers/pci/hotplug.c 276 pci_uevent () { // in drivers/pci/hotplug.c
277 which prints device name, etc.... 277 which prints device name, etc....
278 } 278 }
279 } 279 }
280 then kset_hotplug() calls 280 then kobject_uevent() sends a netlink uevent to userspace
281 call_usermodehelper () with 281 --> userspace uevent
282 argv[0]=hotplug_path[] which is "/sbin/hotplug" 282 (during early boot, nobody listens to netlink events and
283 --> event to userspace, 283 kobject_uevent() executes uevent_helper[], which runs the
284 event process /sbin/hotplug)
284 } 285 }
285 } 286 }
286 kobject_del() then calls sysfs_remove_dir(), which would 287 kobject_del() then calls sysfs_remove_dir(), which would
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid
index 5331d91432c7..09f6300eda4b 100644
--- a/Documentation/scsi/ChangeLog.megaraid
+++ b/Documentation/scsi/ChangeLog.megaraid
@@ -1,3 +1,38 @@
1Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
4
51. Sorted out PCI IDs to remove megaraid support overlaps.
6 Based on the patch from Daniel, sorted out PCI IDs along with
7 charactor node name change from 'megadev' to 'megadev_legacy' to avoid
8 conflict.
9 ---
10 Hopefully we'll be getting the build restriction zapped much sooner,
11 but we should also be thinking about totally removing the hardware
12 support overlap in the megaraid drivers.
13
14 This patch pencils in a date of Feb 06 for this, and performs some
15 printk abuse in hope that existing legacy users might pick up on what's
16 going on.
17
18 Signed-off-by: Daniel Drake <dsd@gentoo.org>
19 ---
20
212. Fixed a issue: megaraid always fails to reset handler.
22 ---
23 I found that the megaraid driver always fails to reset the
24 adapter with the following message:
25 megaraid: resetting the host...
26 megaraid mbox: reset sequence completed successfully
27 megaraid: fast sync command timed out
28 megaraid: reservation reset failed
29 when the "Cluster mode" of the adapter BIOS is enabled.
30 So, whenever the reset occurs, the adapter goes to
31 offline and just become unavailable.
32
33 Jun'ichi Nomura [mailto:jnomura@mtc.biglobe.ne.jp]
34 ---
35
1Release Date : Mon Mar 07 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com> 36Release Date : Mon Mar 07 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) 37Current Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module) 38Older Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module)
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index 66565d42288f..8bbae3e1abdf 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -150,7 +150,8 @@ scsi devices of which only the first 2 respond:
150LLD mid level LLD 150LLD mid level LLD
151===-------------------=========--------------------===------ 151===-------------------=========--------------------===------
152scsi_host_alloc() --> 152scsi_host_alloc() -->
153scsi_add_host() --------+ 153scsi_add_host() ---->
154scsi_scan_host() -------+
154 | 155 |
155 slave_alloc() 156 slave_alloc()
156 slave_configure() --> scsi_adjust_queue_depth() 157 slave_configure() --> scsi_adjust_queue_depth()
@@ -196,7 +197,7 @@ of the issues involved. See the section on reference counting below.
196 197
197 198
198The hotplug concept may be extended to SCSI devices. Currently, when an 199The hotplug concept may be extended to SCSI devices. Currently, when an
199HBA is added, the scsi_add_host() function causes a scan for SCSI devices 200HBA is added, the scsi_scan_host() function causes a scan for SCSI devices
200attached to the HBA's SCSI transport. On newer SCSI transports the HBA 201attached to the HBA's SCSI transport. On newer SCSI transports the HBA
201may become aware of a new SCSI device _after_ the scan has completed. 202may become aware of a new SCSI device _after_ the scan has completed.
202An LLD can use this sequence to make the mid level aware of a SCSI device: 203An LLD can use this sequence to make the mid level aware of a SCSI device:
@@ -372,7 +373,7 @@ names all start with "scsi_".
372Summary: 373Summary:
373 scsi_activate_tcq - turn on tag command queueing 374 scsi_activate_tcq - turn on tag command queueing
374 scsi_add_device - creates new scsi device (lu) instance 375 scsi_add_device - creates new scsi device (lu) instance
375 scsi_add_host - perform sysfs registration and SCSI bus scan. 376 scsi_add_host - perform sysfs registration and set up transport class
376 scsi_adjust_queue_depth - change the queue depth on a SCSI device 377 scsi_adjust_queue_depth - change the queue depth on a SCSI device
377 scsi_assign_lock - replace default host_lock with given lock 378 scsi_assign_lock - replace default host_lock with given lock
378 scsi_bios_ptable - return copy of block device's partition table 379 scsi_bios_ptable - return copy of block device's partition table
@@ -386,6 +387,7 @@ Summary:
386 scsi_remove_device - detach and remove a SCSI device 387 scsi_remove_device - detach and remove a SCSI device
387 scsi_remove_host - detach and remove all SCSI devices owned by host 388 scsi_remove_host - detach and remove all SCSI devices owned by host
388 scsi_report_bus_reset - report scsi _bus_ reset observed 389 scsi_report_bus_reset - report scsi _bus_ reset observed
390 scsi_scan_host - scan SCSI bus
389 scsi_track_queue_full - track successive QUEUE_FULL events 391 scsi_track_queue_full - track successive QUEUE_FULL events
390 scsi_unblock_requests - allow further commands to be queued to given host 392 scsi_unblock_requests - allow further commands to be queued to given host
391 scsi_unregister - [calls scsi_host_put()] 393 scsi_unregister - [calls scsi_host_put()]
@@ -425,10 +427,10 @@ void scsi_activate_tcq(struct scsi_device *sdev, int depth)
425 * Might block: yes 427 * Might block: yes
426 * 428 *
427 * Notes: This call is usually performed internally during a scsi 429 * Notes: This call is usually performed internally during a scsi
428 * bus scan when an HBA is added (i.e. scsi_add_host()). So it 430 * bus scan when an HBA is added (i.e. scsi_scan_host()). So it
429 * should only be called if the HBA becomes aware of a new scsi 431 * should only be called if the HBA becomes aware of a new scsi
430 * device (lu) after scsi_add_host() has completed. If successful 432 * device (lu) after scsi_scan_host() has completed. If successful
431 * this call we lead to slave_alloc() and slave_configure() callbacks 433 * this call can lead to slave_alloc() and slave_configure() callbacks
432 * into the LLD. 434 * into the LLD.
433 * 435 *
434 * Defined in: drivers/scsi/scsi_scan.c 436 * Defined in: drivers/scsi/scsi_scan.c
@@ -439,7 +441,7 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost,
439 441
440 442
441/** 443/**
442 * scsi_add_host - perform sysfs registration and SCSI bus scan. 444 * scsi_add_host - perform sysfs registration and set up transport class
443 * @shost: pointer to scsi host instance 445 * @shost: pointer to scsi host instance
444 * @dev: pointer to struct device of type scsi class 446 * @dev: pointer to struct device of type scsi class
445 * 447 *
@@ -448,7 +450,11 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost,
448 * Might block: no 450 * Might block: no
449 * 451 *
450 * Notes: Only required in "hotplug initialization model" after a 452 * Notes: Only required in "hotplug initialization model" after a
451 * successful call to scsi_host_alloc(). 453 * successful call to scsi_host_alloc(). This function does not
454 * scan the bus; this can be done by calling scsi_scan_host() or
455 * in some other transport-specific way. The LLD must set up
456 * the transport template before calling this function and may only
457 * access the transport class data after this function has been called.
452 * 458 *
453 * Defined in: drivers/scsi/hosts.c 459 * Defined in: drivers/scsi/hosts.c
454 **/ 460 **/
@@ -559,7 +565,7 @@ void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
559 * area for the LLD's exclusive use. 565 * area for the LLD's exclusive use.
560 * Both associated refcounting objects have their refcount set to 1. 566 * Both associated refcounting objects have their refcount set to 1.
561 * Full registration (in sysfs) and a bus scan are performed later when 567 * Full registration (in sysfs) and a bus scan are performed later when
562 * scsi_add_host() is called. 568 * scsi_add_host() and scsi_scan_host() are called.
563 * 569 *
564 * Defined in: drivers/scsi/hosts.c . 570 * Defined in: drivers/scsi/hosts.c .
565 **/ 571 **/
@@ -699,6 +705,19 @@ void scsi_report_bus_reset(struct Scsi_Host * shost, int channel)
699 705
700 706
701/** 707/**
708 * scsi_scan_host - scan SCSI bus
709 * @shost: a pointer to a scsi host instance
710 *
711 * Might block: yes
712 *
713 * Notes: Should be called after scsi_add_host()
714 *
715 * Defined in: drivers/scsi/scsi_scan.c
716 **/
717void scsi_scan_host(struct Scsi_Host *shost)
718
719
720/**
702 * scsi_track_queue_full - track successive QUEUE_FULL events on given 721 * scsi_track_queue_full - track successive QUEUE_FULL events on given
703 * device to determine if and when there is a need 722 * device to determine if and when there is a need
704 * to adjust the queue depth on the device. 723 * to adjust the queue depth on the device.
@@ -1433,7 +1452,7 @@ The following people have contributed to this document:
1433 Christoph Hellwig <hch at infradead dot org> 1452 Christoph Hellwig <hch at infradead dot org>
1434 Doug Ledford <dledford at redhat dot com> 1453 Doug Ledford <dledford at redhat dot com>
1435 Andries Brouwer <Andries dot Brouwer at cwi dot nl> 1454 Andries Brouwer <Andries dot Brouwer at cwi dot nl>
1436 Randy Dunlap <rddunlap at osdl dot org> 1455 Randy Dunlap <rdunlap at xenotime dot net>
1437 Alan Stern <stern at rowland dot harvard dot edu> 1456 Alan Stern <stern at rowland dot harvard dot edu>
1438 1457
1439 1458
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 2f27f391c7cc..d2578013e829 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -105,7 +105,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
105 Each of top level sound card module takes the following options. 105 Each of top level sound card module takes the following options.
106 106
107 index - index (slot #) of sound card 107 index - index (slot #) of sound card
108 - Values: 0 through 7 or negative 108 - Values: 0 through 31 or negative
109 - If nonnegative, assign that index number 109 - If nonnegative, assign that index number
110 - if negative, interpret as a bitmask of permissible 110 - if negative, interpret as a bitmask of permissible
111 indices; the first free permitted index is assigned 111 indices; the first free permitted index is assigned
@@ -134,7 +134,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
134 dma2 - second DMA # for AD1816A chip (PnP setup) 134 dma2 - second DMA # for AD1816A chip (PnP setup)
135 clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz) 135 clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz)
136 136
137 Module supports up to 8 cards, autoprobe and PnP. 137 This module supports multiple cards, autoprobe and PnP.
138 138
139 Module snd-ad1848 139 Module snd-ad1848
140 ----------------- 140 -----------------
@@ -145,9 +145,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
145 irq - IRQ # for AD1848 chip 145 irq - IRQ # for AD1848 chip
146 dma1 - DMA # for AD1848 chip (0,1,3) 146 dma1 - DMA # for AD1848 chip (0,1,3)
147 147
148 Module supports up to 8 cards. This module does not support autoprobe 148 This module supports multiple cards. It does not support autoprobe
149 thus main port must be specified!!! Other ports are optional. 149 thus main port must be specified!!! Other ports are optional.
150 150
151 The power-management is supported.
152
151 Module snd-ad1889 153 Module snd-ad1889
152 ----------------- 154 -----------------
153 155
@@ -156,7 +158,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
156 ac97_quirk - AC'97 workaround for strange hardware 158 ac97_quirk - AC'97 workaround for strange hardware
157 See the description of intel8x0 module for details. 159 See the description of intel8x0 module for details.
158 160
159 This module supports up to 8 cards. 161 This module supports multiple cards.
160 162
161 Module snd-ali5451 163 Module snd-ali5451
162 ------------------ 164 ------------------
@@ -184,7 +186,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
184 mpu_irq - IRQ # for MPU-401 (PnP setup) 186 mpu_irq - IRQ # for MPU-401 (PnP setup)
185 fm_port - port # for OPL3 FM (PnP setup) 187 fm_port - port # for OPL3 FM (PnP setup)
186 188
187 Module supports up to 8 cards, autoprobe and PnP. 189 This module supports multiple cards, autoprobe and PnP.
190
191 The power-management is supported.
188 192
189 Module snd-als4000 193 Module snd-als4000
190 ------------------ 194 ------------------
@@ -194,7 +198,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
194 joystick_port - port # for legacy joystick support. 198 joystick_port - port # for legacy joystick support.
195 0 = disabled (default), 1 = auto-detect 199 0 = disabled (default), 1 = auto-detect
196 200
197 Module supports up to 8 cards, autoprobe and PnP. 201 This module supports multiple cards, autoprobe and PnP.
202
203 The power-management is supported.
198 204
199 Module snd-atiixp 205 Module snd-atiixp
200 ----------------- 206 -----------------
@@ -213,6 +219,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
213 implementation depends on the motherboard, and you'll need to 219 implementation depends on the motherboard, and you'll need to
214 choose the correct one via spdif_aclink module option. 220 choose the correct one via spdif_aclink module option.
215 221
222 The power-management is supported.
223
216 Module snd-atiixp-modem 224 Module snd-atiixp-modem
217 ----------------------- 225 -----------------------
218 226
@@ -223,6 +231,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
223 Note: The default index value of this module is -2, i.e. the first 231 Note: The default index value of this module is -2, i.e. the first
224 slot is excluded. 232 slot is excluded.
225 233
234 The power-management is supported.
235
226 Module snd-au8810, snd-au8820, snd-au8830 236 Module snd-au8810, snd-au8820, snd-au8830
227 ----------------------------------------- 237 -----------------------------------------
228 238
@@ -263,8 +273,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
263 dma1 - 1st DMA # for AZT2320 (WSS) chip (PnP setup) 273 dma1 - 1st DMA # for AZT2320 (WSS) chip (PnP setup)
264 dma2 - 2nd DMA # for AZT2320 (WSS) chip (PnP setup) 274 dma2 - 2nd DMA # for AZT2320 (WSS) chip (PnP setup)
265 275
266 Module supports up to 8 cards, PnP and autoprobe. 276 This module supports multiple cards, PnP and autoprobe.
267 277
278 The power-management is supported.
279
268 Module snd-azt3328 280 Module snd-azt3328
269 ------------------ 281 ------------------
270 282
@@ -272,7 +284,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
272 284
273 joystick - Enable joystick (default off) 285 joystick - Enable joystick (default off)
274 286
275 Module supports up to 8 cards. 287 This module supports multiple cards.
276 288
277 Module snd-bt87x 289 Module snd-bt87x
278 ---------------- 290 ----------------
@@ -282,7 +294,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
282 digital_rate - Override the default digital rate (Hz) 294 digital_rate - Override the default digital rate (Hz)
283 load_all - Load the driver even if the card model isn't known 295 load_all - Load the driver even if the card model isn't known
284 296
285 Module supports up to 8 cards. 297 This module supports multiple cards.
286 298
287 Note: The default index value of this module is -2, i.e. the first 299 Note: The default index value of this module is -2, i.e. the first
288 slot is excluded. 300 slot is excluded.
@@ -292,7 +304,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
292 304
293 Module for Creative Audigy LS and SB Live 24bit 305 Module for Creative Audigy LS and SB Live 24bit
294 306
295 Module supports up to 8 cards. 307 This module supports multiple cards.
296 308
297 309
298 Module snd-cmi8330 310 Module snd-cmi8330
@@ -308,7 +320,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
308 sbdma8 - 8bit DMA # for CMI8330 chip (SB16) 320 sbdma8 - 8bit DMA # for CMI8330 chip (SB16)
309 sbdma16 - 16bit DMA # for CMI8330 chip (SB16) 321 sbdma16 - 16bit DMA # for CMI8330 chip (SB16)
310 322
311 Module supports up to 8 cards and autoprobe. 323 This module supports multiple cards and autoprobe.
324
325 The power-management is supported.
312 326
313 Module snd-cmipci 327 Module snd-cmipci
314 ----------------- 328 -----------------
@@ -321,8 +335,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
321 (default = 1) 335 (default = 1)
322 joystick_port - Joystick port address (0 = disable, 1 = auto-detect) 336 joystick_port - Joystick port address (0 = disable, 1 = auto-detect)
323 337
324 Module supports autoprobe and multiple chips (max 8). 338 This module supports autoprobe and multiple cards.
325 339
340 The power-management is supported.
341
326 Module snd-cs4231 342 Module snd-cs4231
327 ----------------- 343 -----------------
328 344
@@ -335,7 +351,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
335 dma1 - first DMA # for CS4231 chip 351 dma1 - first DMA # for CS4231 chip
336 dma2 - second DMA # for CS4231 chip 352 dma2 - second DMA # for CS4231 chip
337 353
338 Module supports up to 8 cards. This module does not support autoprobe 354 This module supports multiple cards. This module does not support autoprobe
339 thus main port must be specified!!! Other ports are optional. 355 thus main port must be specified!!! Other ports are optional.
340 356
341 The power-management is supported. 357 The power-management is supported.
@@ -355,7 +371,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
355 dma2 - second DMA # for Yamaha CS4232 chip (0,1,3), -1 = disable 371 dma2 - second DMA # for Yamaha CS4232 chip (0,1,3), -1 = disable
356 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 372 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
357 373
358 Module supports up to 8 cards. This module does not support autoprobe 374 This module supports multiple cards. This module does not support autoprobe
359 thus main port must be specified!!! Other ports are optional. 375 thus main port must be specified!!! Other ports are optional.
360 376
361 The power-management is supported. 377 The power-management is supported.
@@ -376,7 +392,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
376 dma2 - second DMA # for CS4236 chip (0,1,3), -1 = disable 392 dma2 - second DMA # for CS4236 chip (0,1,3), -1 = disable
377 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 393 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
378 394
379 Module supports up to 8 cards. This module does not support autoprobe 395 This module supports multiple cards. This module does not support autoprobe
380 (if ISA PnP is not used) thus main port and control port must be 396 (if ISA PnP is not used) thus main port and control port must be
381 specified!!! Other ports are optional. 397 specified!!! Other ports are optional.
382 398
@@ -389,7 +405,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
389 405
390 dual_codec - Secondary codec ID (0 = disable, default) 406 dual_codec - Secondary codec ID (0 = disable, default)
391 407
392 Module supports up to 8 cards. 408 This module supports multiple cards.
393 409
394 The power-management is supported. 410 The power-management is supported.
395 411
@@ -403,13 +419,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
403 thinkpad - Force to enable Thinkpad's CLKRUN control. 419 thinkpad - Force to enable Thinkpad's CLKRUN control.
404 mmap_valid - Support OSS mmap mode (default = 0). 420 mmap_valid - Support OSS mmap mode (default = 0).
405 421
406 Module supports up to 8 cards and autoprobe. 422 This module supports multiple cards and autoprobe.
407 Usually external amp and CLKRUN controls are detected automatically 423 Usually external amp and CLKRUN controls are detected automatically
408 from PCI sub vendor/device ids. If they don't work, give the options 424 from PCI sub vendor/device ids. If they don't work, give the options
409 above explicitly. 425 above explicitly.
410 426
411 The power-management is supported. 427 The power-management is supported.
412 428
429 Module snd-cs5535audio
430 ----------------------
431
432 Module for multifunction CS5535 companion PCI device
433
434 This module supports multiple cards.
435
413 Module snd-dt019x 436 Module snd-dt019x
414 ----------------- 437 -----------------
415 438
@@ -423,9 +446,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
423 mpu_irq - IRQ # for MPU-401 (PnP setup) 446 mpu_irq - IRQ # for MPU-401 (PnP setup)
424 dma8 - DMA # (PnP setup) 447 dma8 - DMA # (PnP setup)
425 448
426 Module supports up to 8 cards. This module is enabled only with 449 This module supports multiple cards. This module is enabled only with
427 ISA PnP support. 450 ISA PnP support.
428 451
452 The power-management is supported.
453
429 Module snd-dummy 454 Module snd-dummy
430 ---------------- 455 ----------------
431 456
@@ -433,6 +458,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
433 or input, but you may use this module for any application which 458 or input, but you may use this module for any application which
434 requires a sound card (like RealPlayer). 459 requires a sound card (like RealPlayer).
435 460
461 The power-management is supported.
462
436 Module snd-emu10k1 463 Module snd-emu10k1
437 ------------------ 464 ------------------
438 465
@@ -450,7 +477,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
450 given in MB unit. Default value is 128. 477 given in MB unit. Default value is 128.
451 enable_ir - enable IR 478 enable_ir - enable IR
452 479
453 Module supports up to 8 cards and autoprobe. 480 This module supports multiple cards and autoprobe.
454 481
455 Input & Output configurations [extin/extout] 482 Input & Output configurations [extin/extout]
456 * Creative Card wo/Digital out [0x0003/0x1f03] 483 * Creative Card wo/Digital out [0x0003/0x1f03]
@@ -466,12 +493,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
466 * Creative Card 5.1 (c) 2003 [0x3fc3/0x7cff] 493 * Creative Card 5.1 (c) 2003 [0x3fc3/0x7cff]
467 * Creative Card all ins and outs [0x3fff/0x7fff] 494 * Creative Card all ins and outs [0x3fff/0x7fff]
468 495
496 The power-management is supported.
497
469 Module snd-emu10k1x 498 Module snd-emu10k1x
470 ------------------- 499 -------------------
471 500
472 Module for Creative Emu10k1X (SB Live Dell OEM version) 501 Module for Creative Emu10k1X (SB Live Dell OEM version)
473 502
474 Module supports up to 8 cards. 503 This module supports multiple cards.
475 504
476 Module snd-ens1370 505 Module snd-ens1370
477 ------------------ 506 ------------------
@@ -482,7 +511,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
482 511
483 joystick - Enable joystick (default off) 512 joystick - Enable joystick (default off)
484 513
485 Module supports up to 8 cards and autoprobe. 514 This module supports multiple cards and autoprobe.
486 515
487 Module snd-ens1371 516 Module snd-ens1371
488 ------------------ 517 ------------------
@@ -495,7 +524,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
495 joystick_port - port # for joystick (0x200,0x208,0x210,0x218), 524 joystick_port - port # for joystick (0x200,0x208,0x210,0x218),
496 0 = disable (default), 1 = auto-detect 525 0 = disable (default), 1 = auto-detect
497 526
498 Module supports up to 8 cards and autoprobe. 527 This module supports multiple cards and autoprobe.
499 528
500 Module snd-es968 529 Module snd-es968
501 ---------------- 530 ----------------
@@ -506,8 +535,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
506 irq - IRQ # for ES968 (SB8) chip (PnP setup) 535 irq - IRQ # for ES968 (SB8) chip (PnP setup)
507 dma1 - DMA # for ES968 (SB8) chip (PnP setup) 536 dma1 - DMA # for ES968 (SB8) chip (PnP setup)
508 537
509 Module supports up to 8 cards, PnP and autoprobe. 538 This module supports multiple cards, PnP and autoprobe.
510 539
540 The power-management is supported.
541
511 Module snd-es1688 542 Module snd-es1688
512 ----------------- 543 -----------------
513 544
@@ -519,7 +550,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
519 mpu_irq - IRQ # for MPU-401 port (5,7,9,10) 550 mpu_irq - IRQ # for MPU-401 port (5,7,9,10)
520 dma8 - DMA # for ES-1688 chip (0,1,3) 551 dma8 - DMA # for ES-1688 chip (0,1,3)
521 552
522 Module supports up to 8 cards and autoprobe (without MPU-401 port). 553 This module supports multiple cards and autoprobe (without MPU-401 port).
523 554
524 Module snd-es18xx 555 Module snd-es18xx
525 ----------------- 556 -----------------
@@ -534,8 +565,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
534 dma2 - first DMA # for ES-18xx chip (0,1,3) 565 dma2 - first DMA # for ES-18xx chip (0,1,3)
535 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 566 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
536 567
537 Module supports up to 8 cards ISA PnP and autoprobe (without MPU-401 port 568 This module supports multiple cards, ISA PnP and autoprobe (without MPU-401
538 if native ISA PnP routines are not used). 569 port if native ISA PnP routines are not used).
539 When dma2 is equal with dma1, the driver works as half-duplex. 570 When dma2 is equal with dma1, the driver works as half-duplex.
540 571
541 The power-management is supported. 572 The power-management is supported.
@@ -545,7 +576,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
545 576
546 Module for sound cards based on ESS Solo-1 (ES1938,ES1946) chips. 577 Module for sound cards based on ESS Solo-1 (ES1938,ES1946) chips.
547 578
548 Module supports up to 8 cards and autoprobe. 579 This module supports multiple cards and autoprobe.
580
581 The power-management is supported.
549 582
550 Module snd-es1968 583 Module snd-es1968
551 ----------------- 584 -----------------
@@ -561,7 +594,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
561 enable_mpu - enable MPU401 (0 = off, 1 = on, 2 = auto (default)) 594 enable_mpu - enable MPU401 (0 = off, 1 = on, 2 = auto (default))
562 joystick - enable joystick (default off) 595 joystick - enable joystick (default off)
563 596
564 Module supports up to 8 cards and autoprobe. 597 This module supports multiple cards and autoprobe.
565 598
566 The power-management is supported. 599 The power-management is supported.
567 600
@@ -577,8 +610,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
577 - High 16-bits are video (radio) device number + 1 610 - High 16-bits are video (radio) device number + 1
578 - example: 0x10002 (MediaForte 256-PCPR, device 1) 611 - example: 0x10002 (MediaForte 256-PCPR, device 1)
579 612
580 Module supports up to 8 cards and autoprobe. 613 This module supports multiple cards and autoprobe.
581 614
615 The power-management is supported.
616
582 Module snd-gusclassic 617 Module snd-gusclassic
583 --------------------- 618 ---------------------
584 619
@@ -592,7 +627,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
592 voices - GF1 voices limit (14-32) 627 voices - GF1 voices limit (14-32)
593 pcm_voices - reserved PCM voices 628 pcm_voices - reserved PCM voices
594 629
595 Module supports up to 8 cards and autoprobe. 630 This module supports multiple cards and autoprobe.
596 631
597 Module snd-gusextreme 632 Module snd-gusextreme
598 --------------------- 633 ---------------------
@@ -611,7 +646,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
611 voices - GF1 voices limit (14-32) 646 voices - GF1 voices limit (14-32)
612 pcm_voices - reserved PCM voices 647 pcm_voices - reserved PCM voices
613 648
614 Module supports up to 8 cards and autoprobe (without MPU-401 port). 649 This module supports multiple cards and autoprobe (without MPU-401 port).
615 650
616 Module snd-gusmax 651 Module snd-gusmax
617 ----------------- 652 -----------------
@@ -626,7 +661,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
626 voices - GF1 voices limit (14-32) 661 voices - GF1 voices limit (14-32)
627 pcm_voices - reserved PCM voices 662 pcm_voices - reserved PCM voices
628 663
629 Module supports up to 8 cards and autoprobe. 664 This module supports multiple cards and autoprobe.
630 665
631 Module snd-hda-intel 666 Module snd-hda-intel
632 -------------------- 667 --------------------
@@ -688,12 +723,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
688 (Usually SD_LPLIB register is more accurate than the 723 (Usually SD_LPLIB register is more accurate than the
689 position buffer.) 724 position buffer.)
690 725
726 The power-management is supported.
727
691 Module snd-hdsp 728 Module snd-hdsp
692 --------------- 729 ---------------
693 730
694 Module for RME Hammerfall DSP audio interface(s) 731 Module for RME Hammerfall DSP audio interface(s)
695 732
696 Module supports up to 8 cards. 733 This module supports multiple cards.
697 734
698 Note: The firmware data can be automatically loaded via hotplug 735 Note: The firmware data can be automatically loaded via hotplug
699 when CONFIG_FW_LOADER is set. Otherwise, you need to load 736 when CONFIG_FW_LOADER is set. Otherwise, you need to load
@@ -751,7 +788,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
751 cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transciever) 788 cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transciever)
752 in msec resolution, default value is 500 (0.5 sec) 789 in msec resolution, default value is 500 (0.5 sec)
753 790
754 Module supports up to 8 cards and autoprobe. Note: The consumer part 791 This module supports multiple cards and autoprobe. Note: The consumer part
755 is not used with all Envy24 based cards (for example in the MidiMan Delta 792 is not used with all Envy24 based cards (for example in the MidiMan Delta
756 serie). 793 serie).
757 794
@@ -787,7 +824,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
787 aureon71, universe, k8x800, phase22, phase28, ms300, 824 aureon71, universe, k8x800, phase22, phase28, ms300,
788 av710 825 av710
789 826
790 Module supports up to 8 cards and autoprobe. 827 This module supports multiple cards and autoprobe.
791 828
792 Note: The supported board is detected by reading EEPROM or PCI 829 Note: The supported board is detected by reading EEPROM or PCI
793 SSID (if EEPROM isn't available). You can override the 830 SSID (if EEPROM isn't available). You can override the
@@ -839,6 +876,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
839 Note: The default index value of this module is -2, i.e. the first 876 Note: The default index value of this module is -2, i.e. the first
840 slot is excluded. 877 slot is excluded.
841 878
879 The power-management is supported.
880
842 Module snd-interwave 881 Module snd-interwave
843 -------------------- 882 --------------------
844 883
@@ -855,7 +894,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
855 effect - 1 = InterWave effects enable (default 0); 894 effect - 1 = InterWave effects enable (default 0);
856 requires 8 voices 895 requires 8 voices
857 896
858 Module supports up to 8 cards, autoprobe and ISA PnP. 897 This module supports multiple cards, autoprobe and ISA PnP.
859 898
860 Module snd-interwave-stb 899 Module snd-interwave-stb
861 ------------------------ 900 ------------------------
@@ -875,14 +914,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
875 effect - 1 = InterWave effects enable (default 0); 914 effect - 1 = InterWave effects enable (default 0);
876 requires 8 voices 915 requires 8 voices
877 916
878 Module supports up to 8 cards, autoprobe and ISA PnP. 917 This module supports multiple cards, autoprobe and ISA PnP.
879 918
880 Module snd-korg1212 919 Module snd-korg1212
881 ------------------- 920 -------------------
882 921
883 Module for Korg 1212 IO PCI card 922 Module for Korg 1212 IO PCI card
884 923
885 Module supports up to 8 cards. 924 This module supports multiple cards.
886 925
887 Module snd-maestro3 926 Module snd-maestro3
888 ------------------- 927 -------------------
@@ -894,7 +933,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
894 -1 for default pin (8 for allegro, 1 for 933 -1 for default pin (8 for allegro, 1 for
895 others) 934 others)
896 935
897 Module supports autoprobe and multiple chips (max 8). 936 This module supports autoprobe and multiple chips.
898 937
899 Note: the binding of amplifier is dependent on hardware. 938 Note: the binding of amplifier is dependent on hardware.
900 If there is no sound even though all channels are unmuted, try to 939 If there is no sound even though all channels are unmuted, try to
@@ -909,7 +948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
909 948
910 Module for Digigram miXart8 sound cards. 949 Module for Digigram miXart8 sound cards.
911 950
912 Module supports multiple cards. 951 This module supports multiple cards.
913 Note: One miXart8 board will be represented as 4 alsa cards. 952 Note: One miXart8 board will be represented as 4 alsa cards.
914 See MIXART.txt for details. 953 See MIXART.txt for details.
915 954
@@ -928,7 +967,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
928 irq - IRQ number or -1 (disable) 967 irq - IRQ number or -1 (disable)
929 pnp - PnP detection - 0 = disable, 1 = enable (default) 968 pnp - PnP detection - 0 = disable, 1 = enable (default)
930 969
931 Module supports multiple devices (max 8) and PnP. 970 This module supports multiple devices and PnP.
932 971
933 Module snd-mtpav 972 Module snd-mtpav
934 ---------------- 973 ----------------
@@ -1014,7 +1053,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1014 dma2 - second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable 1053 dma2 - second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable
1015 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 1054 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
1016 1055
1017 Module supports up to 8 cards and ISA PnP. This module does not support 1056 This module supports multiple cards and ISA PnP. It does not support
1018 autoprobe (if ISA PnP is not used) thus all ports must be specified!!! 1057 autoprobe (if ISA PnP is not used) thus all ports must be specified!!!
1019 1058
1020 The power-management is supported. 1059 The power-management is supported.
@@ -1064,6 +1103,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1064 1103
1065 This module supports only one card, autoprobe and PnP. 1104 This module supports only one card, autoprobe and PnP.
1066 1105
1106 Module snd-pcxhr
1107 ----------------
1108
1109 Module for Digigram PCXHR boards
1110
1111 This module supports multiple cards.
1112
1067 Module snd-powermac (on ppc only) 1113 Module snd-powermac (on ppc only)
1068 --------------------------------- 1114 ---------------------------------
1069 1115
@@ -1084,20 +1130,22 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1084 1130
1085 For ARM architecture only. 1131 For ARM architecture only.
1086 1132
1133 The power-management is supported.
1134
1087 Module snd-rme32 1135 Module snd-rme32
1088 ---------------- 1136 ----------------
1089 1137
1090 Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32, 1138 Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32,
1091 Prodif96 and Prodif Gold) sound cards. 1139 Prodif96 and Prodif Gold) sound cards.
1092 1140
1093 Module supports up to 8 cards. 1141 This module supports multiple cards.
1094 1142
1095 Module snd-rme96 1143 Module snd-rme96
1096 ---------------- 1144 ----------------
1097 1145
1098 Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST sound cards. 1146 Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST sound cards.
1099 1147
1100 Module supports up to 8 cards. 1148 This module supports multiple cards.
1101 1149
1102 Module snd-rme9652 1150 Module snd-rme9652
1103 ------------------ 1151 ------------------
@@ -1107,7 +1155,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1107 precise_ptr - Enable precise pointer (doesn't work reliably). 1155 precise_ptr - Enable precise pointer (doesn't work reliably).
1108 (default = 0) 1156 (default = 0)
1109 1157
1110 Module supports up to 8 cards. 1158 This module supports multiple cards.
1111 1159
1112 Note: snd-page-alloc module does the job which snd-hammerfall-mem 1160 Note: snd-page-alloc module does the job which snd-hammerfall-mem
1113 module did formerly. It will allocate the buffers in advance 1161 module did formerly. It will allocate the buffers in advance
@@ -1124,6 +1172,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1124 Module supports only one card. 1172 Module supports only one card.
1125 Module has no enable and index options. 1173 Module has no enable and index options.
1126 1174
1175 The power-management is supported.
1176
1127 Module snd-sb8 1177 Module snd-sb8
1128 -------------- 1178 --------------
1129 1179
@@ -1135,8 +1185,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1135 irq - IRQ # for SB DSP chip (5,7,9,10) 1185 irq - IRQ # for SB DSP chip (5,7,9,10)
1136 dma8 - DMA # for SB DSP chip (1,3) 1186 dma8 - DMA # for SB DSP chip (1,3)
1137 1187
1138 Module supports up to 8 cards and autoprobe. 1188 This module supports multiple cards and autoprobe.
1139 1189
1190 The power-management is supported.
1191
1140 Module snd-sb16 and snd-sbawe 1192 Module snd-sb16 and snd-sbawe
1141 ----------------------------- 1193 -----------------------------
1142 1194
@@ -1155,7 +1207,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1155 csp - ASP/CSP chip support - 0 = disable (default), 1 = enable 1207 csp - ASP/CSP chip support - 0 = disable (default), 1 = enable
1156 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 1208 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
1157 1209
1158 Module supports up to 8 cards, autoprobe and ISA PnP. 1210 This module supports multiple cards, autoprobe and ISA PnP.
1159 1211
1160 Note: To use Vibra16X cards in 16-bit half duplex mode, you must 1212 Note: To use Vibra16X cards in 16-bit half duplex mode, you must
1161 disable 16bit DMA with dma16 = -1 module parameter. 1213 disable 16bit DMA with dma16 = -1 module parameter.
@@ -1163,6 +1215,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1163 half duplex mode through 8-bit DMA channel by disabling their 1215 half duplex mode through 8-bit DMA channel by disabling their
1164 16-bit DMA channel. 1216 16-bit DMA channel.
1165 1217
1218 The power-management is supported.
1219
1166 Module snd-sgalaxy 1220 Module snd-sgalaxy
1167 ------------------ 1221 ------------------
1168 1222
@@ -1173,7 +1227,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1173 irq - IRQ # (7,9,10,11) 1227 irq - IRQ # (7,9,10,11)
1174 dma1 - DMA # 1228 dma1 - DMA #
1175 1229
1176 Module supports up to 8 cards. 1230 This module supports multiple cards.
1231
1232 The power-management is supported.
1177 1233
1178 Module snd-sscape 1234 Module snd-sscape
1179 ----------------- 1235 -----------------
@@ -1185,7 +1241,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1185 mpu_irq - MPU-401 IRQ # (PnP setup) 1241 mpu_irq - MPU-401 IRQ # (PnP setup)
1186 dma - DMA # (PnP setup) 1242 dma - DMA # (PnP setup)
1187 1243
1188 Module supports up to 8 cards. ISA PnP must be enabled. 1244 This module supports multiple cards. ISA PnP must be enabled.
1189 You need sscape_ctl tool in alsa-tools package for loading 1245 You need sscape_ctl tool in alsa-tools package for loading
1190 the microcode. 1246 the microcode.
1191 1247
@@ -1194,21 +1250,21 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1194 1250
1195 Module for AMD7930 sound chips found on Sparcs. 1251 Module for AMD7930 sound chips found on Sparcs.
1196 1252
1197 Module supports up to 8 cards. 1253 This module supports multiple cards.
1198 1254
1199 Module snd-sun-cs4231 (on sparc only) 1255 Module snd-sun-cs4231 (on sparc only)
1200 ------------------------------------- 1256 -------------------------------------
1201 1257
1202 Module for CS4231 sound chips found on Sparcs. 1258 Module for CS4231 sound chips found on Sparcs.
1203 1259
1204 Module supports up to 8 cards. 1260 This module supports multiple cards.
1205 1261
1206 Module snd-sun-dbri (on sparc only) 1262 Module snd-sun-dbri (on sparc only)
1207 ----------------------------------- 1263 -----------------------------------
1208 1264
1209 Module for DBRI sound chips found on Sparcs. 1265 Module for DBRI sound chips found on Sparcs.
1210 1266
1211 Module supports up to 8 cards. 1267 This module supports multiple cards.
1212 1268
1213 Module snd-wavefront 1269 Module snd-wavefront
1214 -------------------- 1270 --------------------
@@ -1228,7 +1284,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1228 dma2 - DMA2 # for CS4232 PCM interface. 1284 dma2 - DMA2 # for CS4232 PCM interface.
1229 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) 1285 isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
1230 1286
1231 Module supports up to 8 cards and ISA PnP. 1287 This module supports multiple cards and ISA PnP.
1232 1288
1233 Module snd-sonicvibes 1289 Module snd-sonicvibes
1234 --------------------- 1290 ---------------------
@@ -1240,7 +1296,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1240 - SoundCard must have onboard SRAM for this. 1296 - SoundCard must have onboard SRAM for this.
1241 mge - Mic Gain Enable - 1 = enable, 0 = disable (default) 1297 mge - Mic Gain Enable - 1 = enable, 0 = disable (default)
1242 1298
1243 Module supports up to 8 cards and autoprobe. 1299 This module supports multiple cards and autoprobe.
1244 1300
1245 Module snd-serial-u16550 1301 Module snd-serial-u16550
1246 ------------------------ 1302 ------------------------
@@ -1259,7 +1315,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1259 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A, 1315 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A,
1260 3 = MS-124W M/B, 4 = Generic 1316 3 = MS-124W M/B, 4 = Generic
1261 1317
1262 Module supports up to 8 cards. This module does not support autoprobe 1318 This module supports multiple cards. This module does not support autoprobe
1263 thus the main port must be specified!!! Other options are optional. 1319 thus the main port must be specified!!! Other options are optional.
1264 1320
1265 Module snd-trident 1321 Module snd-trident
@@ -1278,7 +1334,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1278 pcm_channels - max channels (voices) reserved for PCM 1334 pcm_channels - max channels (voices) reserved for PCM
1279 wavetable_size - max wavetable size in kB (4-?kb) 1335 wavetable_size - max wavetable size in kB (4-?kb)
1280 1336
1281 Module supports up to 8 cards and autoprobe. 1337 This module supports multiple cards and autoprobe.
1282 1338
1283 The power-management is supported. 1339 The power-management is supported.
1284 1340
@@ -1290,14 +1346,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1290 vid - Vendor ID for the device (optional) 1346 vid - Vendor ID for the device (optional)
1291 pid - Product ID for the device (optional) 1347 pid - Product ID for the device (optional)
1292 1348
1293 This module supports up to 8 cards, autoprobe and hotplugging. 1349 This module supports multiple devices, autoprobe and hotplugging.
1294 1350
1295 Module snd-usb-usx2y 1351 Module snd-usb-usx2y
1296 -------------------- 1352 --------------------
1297 1353
1298 Module for Tascam USB US-122, US-224 and US-428 devices. 1354 Module for Tascam USB US-122, US-224 and US-428 devices.
1299 1355
1300 This module supports up to 8 cards, autoprobe and hotplugging. 1356 This module supports multiple devices, autoprobe and hotplugging.
1301 1357
1302 Note: you need to load the firmware via usx2yloader utility included 1358 Note: you need to load the firmware via usx2yloader utility included
1303 in alsa-tools and alsa-firmware packages. 1359 in alsa-tools and alsa-firmware packages.
@@ -1356,6 +1412,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1356 Note: for the MPU401 on VIA823x, use snd-mpu401 driver 1412 Note: for the MPU401 on VIA823x, use snd-mpu401 driver
1357 additionally. The mpu_port option is for VIA686 chips only. 1413 additionally. The mpu_port option is for VIA686 chips only.
1358 1414
1415 The power-management is supported.
1416
1359 Module snd-via82xx-modem 1417 Module snd-via82xx-modem
1360 ------------------------ 1418 ------------------------
1361 1419
@@ -1368,6 +1426,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1368 Note: The default index value of this module is -2, i.e. the first 1426 Note: The default index value of this module is -2, i.e. the first
1369 slot is excluded. 1427 slot is excluded.
1370 1428
1429 The power-management is supported.
1430
1371 Module snd-virmidi 1431 Module snd-virmidi
1372 ------------------ 1432 ------------------
1373 1433
@@ -1375,9 +1435,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1375 This module creates virtual rawmidi devices which communicate 1435 This module creates virtual rawmidi devices which communicate
1376 to the corresponding ALSA sequencer ports. 1436 to the corresponding ALSA sequencer ports.
1377 1437
1378 midi_devs - MIDI devices # (1-8, default=4) 1438 midi_devs - MIDI devices # (1-4, default=4)
1379 1439
1380 Module supports up to 8 cards. 1440 This module supports multiple cards.
1381 1441
1382 Module snd-vx222 1442 Module snd-vx222
1383 ---------------- 1443 ----------------
@@ -1387,7 +1447,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1387 mic - Enable Microphone on V222 Mic (NYI) 1447 mic - Enable Microphone on V222 Mic (NYI)
1388 ibl - Capture IBL size. (default = 0, minimum size) 1448 ibl - Capture IBL size. (default = 0, minimum size)
1389 1449
1390 Module supports up to 8 cards. 1450 This module supports multiple cards.
1391 1451
1392 When the driver is compiled as a module and the hotplug firmware 1452 When the driver is compiled as a module and the hotplug firmware
1393 is supported, the firmware data is loaded via hotplug automatically. 1453 is supported, the firmware data is loaded via hotplug automatically.
@@ -1406,6 +1466,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1406 size is chosen. The possible IBL values can be found in 1466 size is chosen. The possible IBL values can be found in
1407 /proc/asound/cardX/vx-status proc file. 1467 /proc/asound/cardX/vx-status proc file.
1408 1468
1469 The power-management is supported.
1470
1409 Module snd-vxpocket 1471 Module snd-vxpocket
1410 ------------------- 1472 -------------------
1411 1473
@@ -1413,7 +1475,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1413 1475
1414 ibl - Capture IBL size. (default = 0, minimum size) 1476 ibl - Capture IBL size. (default = 0, minimum size)
1415 1477
1416 Module supports up to 8 cards. The module is compiled only when 1478 This module supports multiple cards. The module is compiled only when
1417 PCMCIA is supported on kernel. 1479 PCMCIA is supported on kernel.
1418 1480
1419 With the older 2.6.x kernel, to activate the driver via the card 1481 With the older 2.6.x kernel, to activate the driver via the card
@@ -1434,6 +1496,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1434 Note2: snd-vxp440 driver is merged to snd-vxpocket driver since 1496 Note2: snd-vxp440 driver is merged to snd-vxpocket driver since
1435 ALSA 1.0.10. 1497 ALSA 1.0.10.
1436 1498
1499 The power-management is supported.
1500
1437 Module snd-ymfpci 1501 Module snd-ymfpci
1438 ----------------- 1502 -----------------
1439 1503
@@ -1447,7 +1511,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1447 1 (auto-detect) 1511 1 (auto-detect)
1448 rear_switch - enable shared rear/line-in switch (bool) 1512 rear_switch - enable shared rear/line-in switch (bool)
1449 1513
1450 Module supports autoprobe and multiple chips (max 8). 1514 This module supports autoprobe and multiple chips.
1451 1515
1452 The power-management is supported. 1516 The power-management is supported.
1453 1517
@@ -1458,6 +1522,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1458 1522
1459 Note: the driver is build only when CONFIG_ISA is set. 1523 Note: the driver is build only when CONFIG_ISA is set.
1460 1524
1525 The power-management is supported.
1526
1461 1527
1462AC97 Quirk Option 1528AC97 Quirk Option
1463================= 1529=================
@@ -1474,7 +1540,7 @@ the proper value with this option.
1474 1540
1475The following strings are accepted: 1541The following strings are accepted:
1476 - default Don't override the default setting 1542 - default Don't override the default setting
1477 - disable Disable the quirk 1543 - none Disable the quirk
1478 - hp_only Bind Master and Headphone controls as a single control 1544 - hp_only Bind Master and Headphone controls as a single control
1479 - swap_hp Swap headphone and master controls 1545 - swap_hp Swap headphone and master controls
1480 - swap_surround Swap master and surround controls 1546 - swap_surround Swap master and surround controls
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 260334c98d95..4963d83d1511 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -18,8 +18,8 @@
18 </affiliation> 18 </affiliation>
19 </author> 19 </author>
20 20
21 <date>October 6, 2005</date> 21 <date>November 17, 2005</date>
22 <edition>0.3.5</edition> 22 <edition>0.3.6</edition>
23 23
24 <abstract> 24 <abstract>
25 <para> 25 <para>
@@ -403,9 +403,8 @@
403 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 403 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
404 404
405 /* definition of the chip-specific record */ 405 /* definition of the chip-specific record */
406 typedef struct snd_mychip mychip_t; 406 struct mychip {
407 struct snd_mychip { 407 struct snd_card *card;
408 snd_card_t *card;
409 // rest of implementation will be in the section 408 // rest of implementation will be in the section
410 // "PCI Resource Managements" 409 // "PCI Resource Managements"
411 }; 410 };
@@ -413,7 +412,7 @@
413 /* chip-specific destructor 412 /* chip-specific destructor
414 * (see "PCI Resource Managements") 413 * (see "PCI Resource Managements")
415 */ 414 */
416 static int snd_mychip_free(mychip_t *chip) 415 static int snd_mychip_free(struct mychip *chip)
417 { 416 {
418 .... // will be implemented later... 417 .... // will be implemented later...
419 } 418 }
@@ -421,22 +420,21 @@
421 /* component-destructor 420 /* component-destructor
422 * (see "Management of Cards and Components") 421 * (see "Management of Cards and Components")
423 */ 422 */
424 static int snd_mychip_dev_free(snd_device_t *device) 423 static int snd_mychip_dev_free(struct snd_device *device)
425 { 424 {
426 mychip_t *chip = device->device_data; 425 return snd_mychip_free(device->device_data);
427 return snd_mychip_free(chip);
428 } 426 }
429 427
430 /* chip-specific constructor 428 /* chip-specific constructor
431 * (see "Management of Cards and Components") 429 * (see "Management of Cards and Components")
432 */ 430 */
433 static int __devinit snd_mychip_create(snd_card_t *card, 431 static int __devinit snd_mychip_create(struct snd_card *card,
434 struct pci_dev *pci, 432 struct pci_dev *pci,
435 mychip_t **rchip) 433 struct mychip **rchip)
436 { 434 {
437 mychip_t *chip; 435 struct mychip *chip;
438 int err; 436 int err;
439 static snd_device_ops_t ops = { 437 static struct snd_device_ops ops = {
440 .dev_free = snd_mychip_dev_free, 438 .dev_free = snd_mychip_dev_free,
441 }; 439 };
442 440
@@ -474,8 +472,8 @@
474 const struct pci_device_id *pci_id) 472 const struct pci_device_id *pci_id)
475 { 473 {
476 static int dev; 474 static int dev;
477 snd_card_t *card; 475 struct snd_card *card;
478 mychip_t *chip; 476 struct mychip *chip;
479 int err; 477 int err;
480 478
481 /* (1) */ 479 /* (1) */
@@ -582,7 +580,7 @@
582 <informalexample> 580 <informalexample>
583 <programlisting> 581 <programlisting>
584<![CDATA[ 582<![CDATA[
585 snd_card_t *card; 583 struct snd_card *card;
586 .... 584 ....
587 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); 585 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
588]]> 586]]>
@@ -605,7 +603,7 @@
605 <informalexample> 603 <informalexample>
606 <programlisting> 604 <programlisting>
607<![CDATA[ 605<![CDATA[
608 mychip_t *chip; 606 struct mychip *chip;
609 .... 607 ....
610 if ((err = snd_mychip_create(card, pci, &chip)) < 0) { 608 if ((err = snd_mychip_create(card, pci, &chip)) < 0) {
611 snd_card_free(card); 609 snd_card_free(card);
@@ -806,7 +804,7 @@
806 <informalexample> 804 <informalexample>
807 <programlisting> 805 <programlisting>
808<![CDATA[ 806<![CDATA[
809 snd_card_t *card; 807 struct snd_card *card;
810 card = snd_card_new(index, id, module, extra_size); 808 card = snd_card_new(index, id, module, extra_size);
811]]> 809]]>
812 </programlisting> 810 </programlisting>
@@ -830,7 +828,7 @@
830 <para> 828 <para>
831 After the card is created, you can attach the components 829 After the card is created, you can attach the components
832 (devices) to the card instance. On ALSA driver, a component is 830 (devices) to the card instance. On ALSA driver, a component is
833 represented as a <type>snd_device_t</type> object. 831 represented as a struct <structname>snd_device</structname> object.
834 A component can be a PCM instance, a control interface, a raw 832 A component can be a PCM instance, a control interface, a raw
835 MIDI interface, etc. Each of such instances has one component 833 MIDI interface, etc. Each of such instances has one component
836 entry. 834 entry.
@@ -891,14 +889,11 @@
891 The chip-specific information, e.g. the i/o port address, its 889 The chip-specific information, e.g. the i/o port address, its
892 resource pointer, or the irq number, is stored in the 890 resource pointer, or the irq number, is stored in the
893 chip-specific record. 891 chip-specific record.
894 Usually, the chip-specific record is typedef'ed as
895 <type>xxx_t</type> like the following:
896 892
897 <informalexample> 893 <informalexample>
898 <programlisting> 894 <programlisting>
899<![CDATA[ 895<![CDATA[
900 typedef struct snd_mychip mychip_t; 896 struct mychip {
901 struct snd_mychip {
902 .... 897 ....
903 }; 898 };
904]]> 899]]>
@@ -918,12 +913,12 @@
918 <informalexample> 913 <informalexample>
919 <programlisting> 914 <programlisting>
920<![CDATA[ 915<![CDATA[
921 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(mychip_t)); 916 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct mychip));
922]]> 917]]>
923 </programlisting> 918 </programlisting>
924 </informalexample> 919 </informalexample>
925 920
926 whether <type>mychip_t</type> is the type of the chip record. 921 whether struct <structname>mychip</structname> is the type of the chip record.
927 </para> 922 </para>
928 923
929 <para> 924 <para>
@@ -932,7 +927,7 @@
932 <informalexample> 927 <informalexample>
933 <programlisting> 928 <programlisting>
934<![CDATA[ 929<![CDATA[
935 mychip_t *chip = (mychip_t *)card->private_data; 930 struct mychip *chip = (struct mychip *)card->private_data;
936]]> 931]]>
937 </programlisting> 932 </programlisting>
938 </informalexample> 933 </informalexample>
@@ -954,8 +949,8 @@
954 <informalexample> 949 <informalexample>
955 <programlisting> 950 <programlisting>
956<![CDATA[ 951<![CDATA[
957 snd_card_t *card; 952 struct snd_card *card;
958 mychip_t *chip; 953 struct mychip *chip;
959 card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL); 954 card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
960 ..... 955 .....
961 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 956 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -971,8 +966,8 @@
971 <informalexample> 966 <informalexample>
972 <programlisting> 967 <programlisting>
973<![CDATA[ 968<![CDATA[
974 struct snd_mychip { 969 struct mychip {
975 snd_card_t *card; 970 struct snd_card *card;
976 .... 971 ....
977 }; 972 };
978]]> 973]]>
@@ -1000,7 +995,7 @@
1000 <informalexample> 995 <informalexample>
1001 <programlisting> 996 <programlisting>
1002<![CDATA[ 997<![CDATA[
1003 static snd_device_ops_t ops = { 998 static struct snd_device_ops ops = {
1004 .dev_free = snd_mychip_dev_free, 999 .dev_free = snd_mychip_dev_free,
1005 }; 1000 };
1006 .... 1001 ....
@@ -1018,10 +1013,9 @@
1018 <informalexample> 1013 <informalexample>
1019 <programlisting> 1014 <programlisting>
1020<![CDATA[ 1015<![CDATA[
1021 static int snd_mychip_dev_free(snd_device_t *device) 1016 static int snd_mychip_dev_free(struct snd_device *device)
1022 { 1017 {
1023 mychip_t *chip = device->device_data; 1018 return snd_mychip_free(device->device_data);
1024 return snd_mychip_free(chip);
1025 } 1019 }
1026]]> 1020]]>
1027 </programlisting> 1021 </programlisting>
@@ -1087,15 +1081,15 @@
1087 <title>PCI Resource Managements Example</title> 1081 <title>PCI Resource Managements Example</title>
1088 <programlisting> 1082 <programlisting>
1089<![CDATA[ 1083<![CDATA[
1090 struct snd_mychip { 1084 struct mychip {
1091 snd_card_t *card; 1085 struct snd_card *card;
1092 struct pci_dev *pci; 1086 struct pci_dev *pci;
1093 1087
1094 unsigned long port; 1088 unsigned long port;
1095 int irq; 1089 int irq;
1096 }; 1090 };
1097 1091
1098 static int snd_mychip_free(mychip_t *chip) 1092 static int snd_mychip_free(struct mychip *chip)
1099 { 1093 {
1100 /* disable hardware here if any */ 1094 /* disable hardware here if any */
1101 .... // (not implemented in this document) 1095 .... // (not implemented in this document)
@@ -1113,13 +1107,13 @@
1113 } 1107 }
1114 1108
1115 /* chip-specific constructor */ 1109 /* chip-specific constructor */
1116 static int __devinit snd_mychip_create(snd_card_t *card, 1110 static int __devinit snd_mychip_create(struct snd_card *card,
1117 struct pci_dev *pci, 1111 struct pci_dev *pci,
1118 mychip_t **rchip) 1112 struct mychip **rchip)
1119 { 1113 {
1120 mychip_t *chip; 1114 struct mychip *chip;
1121 int err; 1115 int err;
1122 static snd_device_ops_t ops = { 1116 static struct snd_device_ops ops = {
1123 .dev_free = snd_mychip_dev_free, 1117 .dev_free = snd_mychip_dev_free,
1124 }; 1118 };
1125 1119
@@ -1155,8 +1149,7 @@
1155 } 1149 }
1156 chip->port = pci_resource_start(pci, 0); 1150 chip->port = pci_resource_start(pci, 0);
1157 if (request_irq(pci->irq, snd_mychip_interrupt, 1151 if (request_irq(pci->irq, snd_mychip_interrupt,
1158 SA_INTERRUPT|SA_SHIRQ, "My Chip", 1152 SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
1159 (void *)chip)) {
1160 printk(KERN_ERR "cannot grab irq %d\n", pci->irq); 1153 printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
1161 snd_mychip_free(chip); 1154 snd_mychip_free(chip);
1162 return -EBUSY; 1155 return -EBUSY;
@@ -1268,14 +1261,14 @@
1268 1261
1269 <para> 1262 <para>
1270 Now assume that this PCI device has an I/O port with 8 bytes 1263 Now assume that this PCI device has an I/O port with 8 bytes
1271 and an interrupt. Then <type>mychip_t</type> will have the 1264 and an interrupt. Then struct <structname>mychip</structname> will have the
1272 following fields: 1265 following fields:
1273 1266
1274 <informalexample> 1267 <informalexample>
1275 <programlisting> 1268 <programlisting>
1276<![CDATA[ 1269<![CDATA[
1277 struct snd_mychip { 1270 struct mychip {
1278 snd_card_t *card; 1271 struct snd_card *card;
1279 1272
1280 unsigned long port; 1273 unsigned long port;
1281 int irq; 1274 int irq;
@@ -1330,8 +1323,7 @@
1330 <programlisting> 1323 <programlisting>
1331<![CDATA[ 1324<![CDATA[
1332 if (request_irq(pci->irq, snd_mychip_interrupt, 1325 if (request_irq(pci->irq, snd_mychip_interrupt,
1333 SA_INTERRUPT|SA_SHIRQ, "My Chip", 1326 SA_INTERRUPT|SA_SHIRQ, "My Chip", chip)) {
1334 (void *)chip)) {
1335 printk(KERN_ERR "cannot grab irq %d\n", pci->irq); 1327 printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
1336 snd_mychip_free(chip); 1328 snd_mychip_free(chip);
1337 return -EBUSY; 1329 return -EBUSY;
@@ -1372,7 +1364,7 @@
1372 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 1364 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
1373 struct pt_regs *regs) 1365 struct pt_regs *regs)
1374 { 1366 {
1375 mychip_t *chip = dev_id; 1367 struct mychip *chip = dev_id;
1376 .... 1368 ....
1377 return IRQ_HANDLED; 1369 return IRQ_HANDLED;
1378 } 1370 }
@@ -1487,7 +1479,7 @@
1487 <informalexample> 1479 <informalexample>
1488 <programlisting> 1480 <programlisting>
1489<![CDATA[ 1481<![CDATA[
1490 struct snd_mychip { 1482 struct mychip {
1491 .... 1483 ....
1492 unsigned long iobase_phys; 1484 unsigned long iobase_phys;
1493 void __iomem *iobase_virt; 1485 void __iomem *iobase_virt;
@@ -1517,7 +1509,7 @@
1517 <informalexample> 1509 <informalexample>
1518 <programlisting> 1510 <programlisting>
1519<![CDATA[ 1511<![CDATA[
1520 static int snd_mychip_free(mychip_t *chip) 1512 static int snd_mychip_free(struct mychip *chip)
1521 { 1513 {
1522 .... 1514 ....
1523 if (chip->iobase_virt) 1515 if (chip->iobase_virt)
@@ -1537,7 +1529,7 @@
1537 <title>Registration of Device Struct</title> 1529 <title>Registration of Device Struct</title>
1538 <para> 1530 <para>
1539 At some point, typically after calling <function>snd_device_new()</function>, 1531 At some point, typically after calling <function>snd_device_new()</function>,
1540 you need to register the <structname>struct device</structname> of the chip 1532 you need to register the struct <structname>device</structname> of the chip
1541 you're handling for udev and co. ALSA provides a macro for compatibility with 1533 you're handling for udev and co. ALSA provides a macro for compatibility with
1542 older kernels. Simply call like the following: 1534 older kernels. Simply call like the following:
1543 <informalexample> 1535 <informalexample>
@@ -1739,7 +1731,7 @@
1739 .... 1731 ....
1740 1732
1741 /* hardware definition */ 1733 /* hardware definition */
1742 static snd_pcm_hardware_t snd_mychip_playback_hw = { 1734 static struct snd_pcm_hardware snd_mychip_playback_hw = {
1743 .info = (SNDRV_PCM_INFO_MMAP | 1735 .info = (SNDRV_PCM_INFO_MMAP |
1744 SNDRV_PCM_INFO_INTERLEAVED | 1736 SNDRV_PCM_INFO_INTERLEAVED |
1745 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1737 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1758,7 +1750,7 @@
1758 }; 1750 };
1759 1751
1760 /* hardware definition */ 1752 /* hardware definition */
1761 static snd_pcm_hardware_t snd_mychip_capture_hw = { 1753 static struct snd_pcm_hardware snd_mychip_capture_hw = {
1762 .info = (SNDRV_PCM_INFO_MMAP | 1754 .info = (SNDRV_PCM_INFO_MMAP |
1763 SNDRV_PCM_INFO_INTERLEAVED | 1755 SNDRV_PCM_INFO_INTERLEAVED |
1764 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1756 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1777,10 +1769,10 @@
1777 }; 1769 };
1778 1770
1779 /* open callback */ 1771 /* open callback */
1780 static int snd_mychip_playback_open(snd_pcm_substream_t *substream) 1772 static int snd_mychip_playback_open(struct snd_pcm_substream *substream)
1781 { 1773 {
1782 mychip_t *chip = snd_pcm_substream_chip(substream); 1774 struct mychip *chip = snd_pcm_substream_chip(substream);
1783 snd_pcm_runtime_t *runtime = substream->runtime; 1775 struct snd_pcm_runtime *runtime = substream->runtime;
1784 1776
1785 runtime->hw = snd_mychip_playback_hw; 1777 runtime->hw = snd_mychip_playback_hw;
1786 // more hardware-initialization will be done here 1778 // more hardware-initialization will be done here
@@ -1788,19 +1780,19 @@
1788 } 1780 }
1789 1781
1790 /* close callback */ 1782 /* close callback */
1791 static int snd_mychip_playback_close(snd_pcm_substream_t *substream) 1783 static int snd_mychip_playback_close(struct snd_pcm_substream *substream)
1792 { 1784 {
1793 mychip_t *chip = snd_pcm_substream_chip(substream); 1785 struct mychip *chip = snd_pcm_substream_chip(substream);
1794 // the hardware-specific codes will be here 1786 // the hardware-specific codes will be here
1795 return 0; 1787 return 0;
1796 1788
1797 } 1789 }
1798 1790
1799 /* open callback */ 1791 /* open callback */
1800 static int snd_mychip_capture_open(snd_pcm_substream_t *substream) 1792 static int snd_mychip_capture_open(struct snd_pcm_substream *substream)
1801 { 1793 {
1802 mychip_t *chip = snd_pcm_substream_chip(substream); 1794 struct mychip *chip = snd_pcm_substream_chip(substream);
1803 snd_pcm_runtime_t *runtime = substream->runtime; 1795 struct snd_pcm_runtime *runtime = substream->runtime;
1804 1796
1805 runtime->hw = snd_mychip_capture_hw; 1797 runtime->hw = snd_mychip_capture_hw;
1806 // more hardware-initialization will be done here 1798 // more hardware-initialization will be done here
@@ -1808,33 +1800,33 @@
1808 } 1800 }
1809 1801
1810 /* close callback */ 1802 /* close callback */
1811 static int snd_mychip_capture_close(snd_pcm_substream_t *substream) 1803 static int snd_mychip_capture_close(struct snd_pcm_substream *substream)
1812 { 1804 {
1813 mychip_t *chip = snd_pcm_substream_chip(substream); 1805 struct mychip *chip = snd_pcm_substream_chip(substream);
1814 // the hardware-specific codes will be here 1806 // the hardware-specific codes will be here
1815 return 0; 1807 return 0;
1816 1808
1817 } 1809 }
1818 1810
1819 /* hw_params callback */ 1811 /* hw_params callback */
1820 static int snd_mychip_pcm_hw_params(snd_pcm_substream_t *substream, 1812 static int snd_mychip_pcm_hw_params(struct snd_pcm_substream *substream,
1821 snd_pcm_hw_params_t * hw_params) 1813 struct snd_pcm_hw_params *hw_params)
1822 { 1814 {
1823 return snd_pcm_lib_malloc_pages(substream, 1815 return snd_pcm_lib_malloc_pages(substream,
1824 params_buffer_bytes(hw_params)); 1816 params_buffer_bytes(hw_params));
1825 } 1817 }
1826 1818
1827 /* hw_free callback */ 1819 /* hw_free callback */
1828 static int snd_mychip_pcm_hw_free(snd_pcm_substream_t *substream) 1820 static int snd_mychip_pcm_hw_free(struct snd_pcm_substream *substream)
1829 { 1821 {
1830 return snd_pcm_lib_free_pages(substream); 1822 return snd_pcm_lib_free_pages(substream);
1831 } 1823 }
1832 1824
1833 /* prepare callback */ 1825 /* prepare callback */
1834 static int snd_mychip_pcm_prepare(snd_pcm_substream_t *substream) 1826 static int snd_mychip_pcm_prepare(struct snd_pcm_substream *substream)
1835 { 1827 {
1836 mychip_t *chip = snd_pcm_substream_chip(substream); 1828 struct mychip *chip = snd_pcm_substream_chip(substream);
1837 snd_pcm_runtime_t *runtime = substream->runtime; 1829 struct snd_pcm_runtime *runtime = substream->runtime;
1838 1830
1839 /* set up the hardware with the current configuration 1831 /* set up the hardware with the current configuration
1840 * for example... 1832 * for example...
@@ -1849,7 +1841,7 @@
1849 } 1841 }
1850 1842
1851 /* trigger callback */ 1843 /* trigger callback */
1852 static int snd_mychip_pcm_trigger(snd_pcm_substream_t *substream, 1844 static int snd_mychip_pcm_trigger(struct snd_pcm_substream *substream,
1853 int cmd) 1845 int cmd)
1854 { 1846 {
1855 switch (cmd) { 1847 switch (cmd) {
@@ -1866,9 +1858,9 @@
1866 1858
1867 /* pointer callback */ 1859 /* pointer callback */
1868 static snd_pcm_uframes_t 1860 static snd_pcm_uframes_t
1869 snd_mychip_pcm_pointer(snd_pcm_substream_t *substream) 1861 snd_mychip_pcm_pointer(struct snd_pcm_substream *substream)
1870 { 1862 {
1871 mychip_t *chip = snd_pcm_substream_chip(substream); 1863 struct mychip *chip = snd_pcm_substream_chip(substream);
1872 unsigned int current_ptr; 1864 unsigned int current_ptr;
1873 1865
1874 /* get the current hardware pointer */ 1866 /* get the current hardware pointer */
@@ -1877,7 +1869,7 @@
1877 } 1869 }
1878 1870
1879 /* operators */ 1871 /* operators */
1880 static snd_pcm_ops_t snd_mychip_playback_ops = { 1872 static struct snd_pcm_ops snd_mychip_playback_ops = {
1881 .open = snd_mychip_playback_open, 1873 .open = snd_mychip_playback_open,
1882 .close = snd_mychip_playback_close, 1874 .close = snd_mychip_playback_close,
1883 .ioctl = snd_pcm_lib_ioctl, 1875 .ioctl = snd_pcm_lib_ioctl,
@@ -1889,7 +1881,7 @@
1889 }; 1881 };
1890 1882
1891 /* operators */ 1883 /* operators */
1892 static snd_pcm_ops_t snd_mychip_capture_ops = { 1884 static struct snd_pcm_ops snd_mychip_capture_ops = {
1893 .open = snd_mychip_capture_open, 1885 .open = snd_mychip_capture_open,
1894 .close = snd_mychip_capture_close, 1886 .close = snd_mychip_capture_close,
1895 .ioctl = snd_pcm_lib_ioctl, 1887 .ioctl = snd_pcm_lib_ioctl,
@@ -1905,9 +1897,9 @@
1905 */ 1897 */
1906 1898
1907 /* create a pcm device */ 1899 /* create a pcm device */
1908 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 1900 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
1909 { 1901 {
1910 snd_pcm_t *pcm; 1902 struct snd_pcm *pcm;
1911 int err; 1903 int err;
1912 1904
1913 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, 1905 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
@@ -1944,9 +1936,9 @@
1944 <informalexample> 1936 <informalexample>
1945 <programlisting> 1937 <programlisting>
1946<![CDATA[ 1938<![CDATA[
1947 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 1939 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
1948 { 1940 {
1949 snd_pcm_t *pcm; 1941 struct snd_pcm *pcm;
1950 int err; 1942 int err;
1951 1943
1952 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, 1944 if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
@@ -1989,13 +1981,13 @@
1989 specify more numbers, but they must be handled properly in 1981 specify more numbers, but they must be handled properly in
1990 open/close, etc. callbacks. When you need to know which 1982 open/close, etc. callbacks. When you need to know which
1991 substream you are referring to, then it can be obtained from 1983 substream you are referring to, then it can be obtained from
1992 <type>snd_pcm_substream_t</type> data passed to each callback 1984 struct <structname>snd_pcm_substream</structname> data passed to each callback
1993 as follows: 1985 as follows:
1994 1986
1995 <informalexample> 1987 <informalexample>
1996 <programlisting> 1988 <programlisting>
1997<![CDATA[ 1989<![CDATA[
1998 snd_pcm_substream_t *substream; 1990 struct snd_pcm_substream *substream;
1999 int index = substream->number; 1991 int index = substream->number;
2000]]> 1992]]>
2001 </programlisting> 1993 </programlisting>
@@ -2024,7 +2016,7 @@
2024 <informalexample> 2016 <informalexample>
2025 <programlisting> 2017 <programlisting>
2026<![CDATA[ 2018<![CDATA[
2027 static snd_pcm_ops_t snd_mychip_playback_ops = { 2019 static struct snd_pcm_ops snd_mychip_playback_ops = {
2028 .open = snd_mychip_pcm_open, 2020 .open = snd_mychip_pcm_open,
2029 .close = snd_mychip_pcm_close, 2021 .close = snd_mychip_pcm_close,
2030 .ioctl = snd_pcm_lib_ioctl, 2022 .ioctl = snd_pcm_lib_ioctl,
@@ -2102,18 +2094,18 @@
2102 <title>PCM Instance with a Destructor</title> 2094 <title>PCM Instance with a Destructor</title>
2103 <programlisting> 2095 <programlisting>
2104<![CDATA[ 2096<![CDATA[
2105 static void mychip_pcm_free(snd_pcm_t *pcm) 2097 static void mychip_pcm_free(struct snd_pcm *pcm)
2106 { 2098 {
2107 mychip_t *chip = snd_pcm_chip(pcm); 2099 struct mychip *chip = snd_pcm_chip(pcm);
2108 /* free your own data */ 2100 /* free your own data */
2109 kfree(chip->my_private_pcm_data); 2101 kfree(chip->my_private_pcm_data);
2110 // do what you like else 2102 // do what you like else
2111 .... 2103 ....
2112 } 2104 }
2113 2105
2114 static int __devinit snd_mychip_new_pcm(mychip_t *chip) 2106 static int __devinit snd_mychip_new_pcm(struct mychip *chip)
2115 { 2107 {
2116 snd_pcm_t *pcm; 2108 struct snd_pcm *pcm;
2117 .... 2109 ....
2118 /* allocate your own data */ 2110 /* allocate your own data */
2119 chip->my_private_pcm_data = kmalloc(...); 2111 chip->my_private_pcm_data = kmalloc(...);
@@ -2149,7 +2141,7 @@
2149<![CDATA[ 2141<![CDATA[
2150struct _snd_pcm_runtime { 2142struct _snd_pcm_runtime {
2151 /* -- Status -- */ 2143 /* -- Status -- */
2152 snd_pcm_substream_t *trigger_master; 2144 struct snd_pcm_substream *trigger_master;
2153 snd_timestamp_t trigger_tstamp; /* trigger timestamp */ 2145 snd_timestamp_t trigger_tstamp; /* trigger timestamp */
2154 int overrange; 2146 int overrange;
2155 snd_pcm_uframes_t avail_max; 2147 snd_pcm_uframes_t avail_max;
@@ -2192,8 +2184,8 @@ struct _snd_pcm_runtime {
2192 snd_pcm_sync_id_t sync; /* hardware synchronization ID */ 2184 snd_pcm_sync_id_t sync; /* hardware synchronization ID */
2193 2185
2194 /* -- mmap -- */ 2186 /* -- mmap -- */
2195 volatile snd_pcm_mmap_status_t *status; 2187 volatile struct snd_pcm_mmap_status *status;
2196 volatile snd_pcm_mmap_control_t *control; 2188 volatile struct snd_pcm_mmap_control *control;
2197 atomic_t mmap_count; 2189 atomic_t mmap_count;
2198 2190
2199 /* -- locking / scheduling -- */ 2191 /* -- locking / scheduling -- */
@@ -2204,15 +2196,15 @@ struct _snd_pcm_runtime {
2204 2196
2205 /* -- private section -- */ 2197 /* -- private section -- */
2206 void *private_data; 2198 void *private_data;
2207 void (*private_free)(snd_pcm_runtime_t *runtime); 2199 void (*private_free)(struct snd_pcm_runtime *runtime);
2208 2200
2209 /* -- hardware description -- */ 2201 /* -- hardware description -- */
2210 snd_pcm_hardware_t hw; 2202 struct snd_pcm_hardware hw;
2211 snd_pcm_hw_constraints_t hw_constraints; 2203 struct snd_pcm_hw_constraints hw_constraints;
2212 2204
2213 /* -- interrupt callbacks -- */ 2205 /* -- interrupt callbacks -- */
2214 void (*transfer_ack_begin)(snd_pcm_substream_t *substream); 2206 void (*transfer_ack_begin)(struct snd_pcm_substream *substream);
2215 void (*transfer_ack_end)(snd_pcm_substream_t *substream); 2207 void (*transfer_ack_end)(struct snd_pcm_substream *substream);
2216 2208
2217 /* -- timer -- */ 2209 /* -- timer -- */
2218 unsigned int timer_resolution; /* timer resolution */ 2210 unsigned int timer_resolution; /* timer resolution */
@@ -2226,7 +2218,7 @@ struct _snd_pcm_runtime {
2226 2218
2227#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 2219#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
2228 /* -- OSS things -- */ 2220 /* -- OSS things -- */
2229 snd_pcm_oss_runtime_t oss; 2221 struct snd_pcm_oss_runtime oss;
2230#endif 2222#endif
2231}; 2223};
2232]]> 2224]]>
@@ -2252,7 +2244,7 @@ struct _snd_pcm_runtime {
2252 <section id="pcm-interface-runtime-hw"> 2244 <section id="pcm-interface-runtime-hw">
2253 <title>Hardware Description</title> 2245 <title>Hardware Description</title>
2254 <para> 2246 <para>
2255 The hardware descriptor (<type>snd_pcm_hardware_t</type>) 2247 The hardware descriptor (struct <structname>snd_pcm_hardware</structname>)
2256 contains the definitions of the fundamental hardware 2248 contains the definitions of the fundamental hardware
2257 configuration. Above all, you'll need to define this in 2249 configuration. Above all, you'll need to define this in
2258 <link linkend="pcm-interface-operators-open-callback"><citetitle> 2250 <link linkend="pcm-interface-operators-open-callback"><citetitle>
@@ -2267,7 +2259,7 @@ struct _snd_pcm_runtime {
2267 <informalexample> 2259 <informalexample>
2268 <programlisting> 2260 <programlisting>
2269<![CDATA[ 2261<![CDATA[
2270 snd_pcm_runtime_t *runtime = substream->runtime; 2262 struct snd_pcm_runtime *runtime = substream->runtime;
2271 ... 2263 ...
2272 runtime->hw = snd_mychip_playback_hw; /* common definition */ 2264 runtime->hw = snd_mychip_playback_hw; /* common definition */
2273 if (chip->model == VERY_OLD_ONE) 2265 if (chip->model == VERY_OLD_ONE)
@@ -2282,7 +2274,7 @@ struct _snd_pcm_runtime {
2282 <informalexample> 2274 <informalexample>
2283 <programlisting> 2275 <programlisting>
2284<![CDATA[ 2276<![CDATA[
2285 static snd_pcm_hardware_t snd_mychip_playback_hw = { 2277 static struct snd_pcm_hardware snd_mychip_playback_hw = {
2286 .info = (SNDRV_PCM_INFO_MMAP | 2278 .info = (SNDRV_PCM_INFO_MMAP |
2287 SNDRV_PCM_INFO_INTERLEAVED | 2279 SNDRV_PCM_INFO_INTERLEAVED |
2288 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2280 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -2337,9 +2329,14 @@ struct _snd_pcm_runtime {
2337 <constant>PAUSE</constant> bit means that the pcm supports the 2329 <constant>PAUSE</constant> bit means that the pcm supports the
2338 <quote>pause</quote> operation, while the 2330 <quote>pause</quote> operation, while the
2339 <constant>RESUME</constant> bit means that the pcm supports 2331 <constant>RESUME</constant> bit means that the pcm supports
2340 the <quote>suspend/resume</quote> operation. If these flags 2332 the full <quote>suspend/resume</quote> operation.
2341 are set, the <structfield>trigger</structfield> callback below 2333 If <constant>PAUSE</constant> flag is set,
2342 must handle the corresponding commands. 2334 the <structfield>trigger</structfield> callback below
2335 must handle the corresponding (pause push/release) commands.
2336 The suspend/resume trigger commands can be defined even without
2337 <constant>RESUME</constant> flag. See <link
2338 linkend="power-management"><citetitle>
2339 Power Management</citetitle></link> section for details.
2343 </para> 2340 </para>
2344 2341
2345 <para> 2342 <para>
@@ -2512,7 +2509,7 @@ struct _snd_pcm_runtime {
2512 <title>Running Status</title> 2509 <title>Running Status</title>
2513 <para> 2510 <para>
2514 The running status can be referred via <constant>runtime-&gt;status</constant>. 2511 The running status can be referred via <constant>runtime-&gt;status</constant>.
2515 This is the pointer to <type>snd_pcm_mmap_status_t</type> 2512 This is the pointer to struct <structname>snd_pcm_mmap_status</structname>
2516 record. For example, you can get the current DMA hardware 2513 record. For example, you can get the current DMA hardware
2517 pointer via <constant>runtime-&gt;status-&gt;hw_ptr</constant>. 2514 pointer via <constant>runtime-&gt;status-&gt;hw_ptr</constant>.
2518 </para> 2515 </para>
@@ -2520,7 +2517,7 @@ struct _snd_pcm_runtime {
2520 <para> 2517 <para>
2521 The DMA application pointer can be referred via 2518 The DMA application pointer can be referred via
2522 <constant>runtime-&gt;control</constant>, which points 2519 <constant>runtime-&gt;control</constant>, which points
2523 <type>snd_pcm_mmap_control_t</type> record. 2520 struct <structname>snd_pcm_mmap_control</structname> record.
2524 However, accessing directly to this value is not recommended. 2521 However, accessing directly to this value is not recommended.
2525 </para> 2522 </para>
2526 </section> 2523 </section>
@@ -2542,9 +2539,9 @@ struct _snd_pcm_runtime {
2542 <informalexample> 2539 <informalexample>
2543 <programlisting> 2540 <programlisting>
2544<![CDATA[ 2541<![CDATA[
2545 static int snd_xxx_open(snd_pcm_substream_t *substream) 2542 static int snd_xxx_open(struct snd_pcm_substream *substream)
2546 { 2543 {
2547 my_pcm_data_t *data; 2544 struct my_pcm_data *data;
2548 .... 2545 ....
2549 data = kmalloc(sizeof(*data), GFP_KERNEL); 2546 data = kmalloc(sizeof(*data), GFP_KERNEL);
2550 substream->runtime->private_data = data; 2547 substream->runtime->private_data = data;
@@ -2586,7 +2583,7 @@ struct _snd_pcm_runtime {
2586 2583
2587 <para> 2584 <para>
2588 The callback function takes at least the argument with 2585 The callback function takes at least the argument with
2589 <type>snd_pcm_substream_t</type> pointer. For retrieving the 2586 <structname>snd_pcm_substream</structname> pointer. For retrieving the
2590 chip record from the given substream instance, you can use the 2587 chip record from the given substream instance, you can use the
2591 following macro. 2588 following macro.
2592 2589
@@ -2594,7 +2591,7 @@ struct _snd_pcm_runtime {
2594 <programlisting> 2591 <programlisting>
2595<![CDATA[ 2592<![CDATA[
2596 int xxx() { 2593 int xxx() {
2597 mychip_t *chip = snd_pcm_substream_chip(substream); 2594 struct mychip *chip = snd_pcm_substream_chip(substream);
2598 .... 2595 ....
2599 } 2596 }
2600]]> 2597]]>
@@ -2616,7 +2613,7 @@ struct _snd_pcm_runtime {
2616 <informalexample> 2613 <informalexample>
2617 <programlisting> 2614 <programlisting>
2618<![CDATA[ 2615<![CDATA[
2619 static int snd_xxx_open(snd_pcm_substream_t *substream); 2616 static int snd_xxx_open(struct snd_pcm_substream *substream);
2620]]> 2617]]>
2621 </programlisting> 2618 </programlisting>
2622 </informalexample> 2619 </informalexample>
@@ -2631,10 +2628,10 @@ struct _snd_pcm_runtime {
2631 <informalexample> 2628 <informalexample>
2632 <programlisting> 2629 <programlisting>
2633<![CDATA[ 2630<![CDATA[
2634 static int snd_xxx_open(snd_pcm_substream_t *substream) 2631 static int snd_xxx_open(struct snd_pcm_substream *substream)
2635 { 2632 {
2636 mychip_t *chip = snd_pcm_substream_chip(substream); 2633 struct mychip *chip = snd_pcm_substream_chip(substream);
2637 snd_pcm_runtime_t *runtime = substream->runtime; 2634 struct snd_pcm_runtime *runtime = substream->runtime;
2638 2635
2639 runtime->hw = snd_mychip_playback_hw; 2636 runtime->hw = snd_mychip_playback_hw;
2640 return 0; 2637 return 0;
@@ -2667,7 +2664,7 @@ struct _snd_pcm_runtime {
2667 <informalexample> 2664 <informalexample>
2668 <programlisting> 2665 <programlisting>
2669<![CDATA[ 2666<![CDATA[
2670 static int snd_xxx_close(snd_pcm_substream_t *substream); 2667 static int snd_xxx_close(struct snd_pcm_substream *substream);
2671]]> 2668]]>
2672 </programlisting> 2669 </programlisting>
2673 </informalexample> 2670 </informalexample>
@@ -2682,7 +2679,7 @@ struct _snd_pcm_runtime {
2682 <informalexample> 2679 <informalexample>
2683 <programlisting> 2680 <programlisting>
2684<![CDATA[ 2681<![CDATA[
2685 static int snd_xxx_close(snd_pcm_substream_t *substream) 2682 static int snd_xxx_close(struct snd_pcm_substream *substream)
2686 { 2683 {
2687 .... 2684 ....
2688 kfree(substream->runtime->private_data); 2685 kfree(substream->runtime->private_data);
@@ -2709,8 +2706,8 @@ struct _snd_pcm_runtime {
2709 <informalexample> 2706 <informalexample>
2710 <programlisting> 2707 <programlisting>
2711<![CDATA[ 2708<![CDATA[
2712 static int snd_xxx_hw_params(snd_pcm_substream_t * substream, 2709 static int snd_xxx_hw_params(struct snd_pcm_substream *substream,
2713 snd_pcm_hw_params_t * hw_params); 2710 struct snd_pcm_hw_params *hw_params);
2714]]> 2711]]>
2715 </programlisting> 2712 </programlisting>
2716 </informalexample> 2713 </informalexample>
@@ -2785,7 +2782,7 @@ struct _snd_pcm_runtime {
2785 <informalexample> 2782 <informalexample>
2786 <programlisting> 2783 <programlisting>
2787<![CDATA[ 2784<![CDATA[
2788 static int snd_xxx_hw_free(snd_pcm_substream_t * substream); 2785 static int snd_xxx_hw_free(struct snd_pcm_substream *substream);
2789]]> 2786]]>
2790 </programlisting> 2787 </programlisting>
2791 </informalexample> 2788 </informalexample>
@@ -2820,7 +2817,7 @@ struct _snd_pcm_runtime {
2820 <informalexample> 2817 <informalexample>
2821 <programlisting> 2818 <programlisting>
2822<![CDATA[ 2819<![CDATA[
2823 static int snd_xxx_prepare(snd_pcm_substream_t * substream); 2820 static int snd_xxx_prepare(struct snd_pcm_substream *substream);
2824]]> 2821]]>
2825 </programlisting> 2822 </programlisting>
2826 </informalexample> 2823 </informalexample>
@@ -2869,7 +2866,7 @@ struct _snd_pcm_runtime {
2869 <informalexample> 2866 <informalexample>
2870 <programlisting> 2867 <programlisting>
2871<![CDATA[ 2868<![CDATA[
2872 static int snd_xxx_trigger(snd_pcm_substream_t * substream, int cmd); 2869 static int snd_xxx_trigger(struct snd_pcm_substream *substream, int cmd);
2873]]> 2870]]>
2874 </programlisting> 2871 </programlisting>
2875 </informalexample> 2872 </informalexample>
@@ -2911,8 +2908,8 @@ struct _snd_pcm_runtime {
2911 </para> 2908 </para>
2912 2909
2913 <para> 2910 <para>
2914 When the pcm supports the suspend/resume operation 2911 When the pcm supports the suspend/resume operation,
2915 (i.e. <constant>SNDRV_PCM_INFO_RESUME</constant> flag is set), 2912 regardless of full or partial suspend/resume support,
2916 <constant>SUSPEND</constant> and <constant>RESUME</constant> 2913 <constant>SUSPEND</constant> and <constant>RESUME</constant>
2917 commands must be handled, too. 2914 commands must be handled, too.
2918 These commands are issued when the power-management status is 2915 These commands are issued when the power-management status is
@@ -2921,6 +2918,8 @@ struct _snd_pcm_runtime {
2921 do suspend and resume of the pcm substream, and usually, they 2918 do suspend and resume of the pcm substream, and usually, they
2922 are identical with <constant>STOP</constant> and 2919 are identical with <constant>STOP</constant> and
2923 <constant>START</constant> commands, respectively. 2920 <constant>START</constant> commands, respectively.
2921 See <link linkend="power-management"><citetitle>
2922 Power Management</citetitle></link> section for details.
2924 </para> 2923 </para>
2925 2924
2926 <para> 2925 <para>
@@ -2939,7 +2938,7 @@ struct _snd_pcm_runtime {
2939 <informalexample> 2938 <informalexample>
2940 <programlisting> 2939 <programlisting>
2941<![CDATA[ 2940<![CDATA[
2942 static snd_pcm_uframes_t snd_xxx_pointer(snd_pcm_substream_t * substream) 2941 static snd_pcm_uframes_t snd_xxx_pointer(struct snd_pcm_substream *substream)
2943]]> 2942]]>
2944 </programlisting> 2943 </programlisting>
2945 </informalexample> 2944 </informalexample>
@@ -3067,7 +3066,7 @@ struct _snd_pcm_runtime {
3067 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 3066 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
3068 struct pt_regs *regs) 3067 struct pt_regs *regs)
3069 { 3068 {
3070 mychip_t *chip = dev_id; 3069 struct mychip *chip = dev_id;
3071 spin_lock(&chip->lock); 3070 spin_lock(&chip->lock);
3072 .... 3071 ....
3073 if (pcm_irq_invoked(chip)) { 3072 if (pcm_irq_invoked(chip)) {
@@ -3111,7 +3110,7 @@ struct _snd_pcm_runtime {
3111 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id, 3110 static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
3112 struct pt_regs *regs) 3111 struct pt_regs *regs)
3113 { 3112 {
3114 mychip_t *chip = dev_id; 3113 struct mychip *chip = dev_id;
3115 spin_lock(&chip->lock); 3114 spin_lock(&chip->lock);
3116 .... 3115 ....
3117 if (pcm_irq_invoked(chip)) { 3116 if (pcm_irq_invoked(chip)) {
@@ -3221,13 +3220,13 @@ struct _snd_pcm_runtime {
3221<![CDATA[ 3220<![CDATA[
3222 static unsigned int rates[] = 3221 static unsigned int rates[] =
3223 {4000, 10000, 22050, 44100}; 3222 {4000, 10000, 22050, 44100};
3224 static snd_pcm_hw_constraint_list_t constraints_rates = { 3223 static struct snd_pcm_hw_constraint_list constraints_rates = {
3225 .count = ARRAY_SIZE(rates), 3224 .count = ARRAY_SIZE(rates),
3226 .list = rates, 3225 .list = rates,
3227 .mask = 0, 3226 .mask = 0,
3228 }; 3227 };
3229 3228
3230 static int snd_mychip_pcm_open(snd_pcm_substream_t *substream) 3229 static int snd_mychip_pcm_open(struct snd_pcm_substream *substream)
3231 { 3230 {
3232 int err; 3231 int err;
3233 .... 3232 ....
@@ -3249,19 +3248,20 @@ struct _snd_pcm_runtime {
3249 You can even define your own constraint rules. 3248 You can even define your own constraint rules.
3250 For example, let's suppose my_chip can manage a substream of 1 channel 3249 For example, let's suppose my_chip can manage a substream of 1 channel
3251 if and only if the format is S16_LE, otherwise it supports any format 3250 if and only if the format is S16_LE, otherwise it supports any format
3252 specified in the <type>snd_pcm_hardware_t</type> stucture (or in any 3251 specified in the <structname>snd_pcm_hardware</structname> stucture (or in any
3253 other constraint_list). You can build a rule like this: 3252 other constraint_list). You can build a rule like this:
3254 3253
3255 <example> 3254 <example>
3256 <title>Example of Hardware Constraints for Channels</title> 3255 <title>Example of Hardware Constraints for Channels</title>
3257 <programlisting> 3256 <programlisting>
3258<![CDATA[ 3257<![CDATA[
3259 static int hw_rule_format_by_channels(snd_pcm_hw_params_t *params, 3258 static int hw_rule_format_by_channels(struct snd_pcm_hw_params *params,
3260 snd_pcm_hw_rule_t *rule) 3259 struct snd_pcm_hw_rule *rule)
3261 { 3260 {
3262 snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 3261 struct snd_interval *c = hw_param_interval(params,
3263 snd_mask_t *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 3262 SNDRV_PCM_HW_PARAM_CHANNELS);
3264 snd_mask_t fmt; 3263 struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
3264 struct snd_mask fmt;
3265 3265
3266 snd_mask_any(&fmt); /* Init the struct */ 3266 snd_mask_any(&fmt); /* Init the struct */
3267 if (c->min < 2) { 3267 if (c->min < 2) {
@@ -3298,12 +3298,13 @@ struct _snd_pcm_runtime {
3298 <title>Example of Hardware Constraints for Channels</title> 3298 <title>Example of Hardware Constraints for Channels</title>
3299 <programlisting> 3299 <programlisting>
3300<![CDATA[ 3300<![CDATA[
3301 static int hw_rule_channels_by_format(snd_pcm_hw_params_t *params, 3301 static int hw_rule_channels_by_format(struct snd_pcm_hw_params *params,
3302 snd_pcm_hw_rule_t *rule) 3302 struct snd_pcm_hw_rule *rule)
3303 { 3303 {
3304 snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 3304 struct snd_interval *c = hw_param_interval(params,
3305 snd_mask_t *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 3305 SNDRV_PCM_HW_PARAM_CHANNELS);
3306 snd_interval_t ch; 3306 struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
3307 struct snd_interval ch;
3307 3308
3308 snd_interval_any(&ch); 3309 snd_interval_any(&ch);
3309 if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) { 3310 if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) {
@@ -3376,13 +3377,13 @@ struct _snd_pcm_runtime {
3376 callbacks: <structfield>info</structfield>, 3377 callbacks: <structfield>info</structfield>,
3377 <structfield>get</structfield> and 3378 <structfield>get</structfield> and
3378 <structfield>put</structfield>. Then, define a 3379 <structfield>put</structfield>. Then, define a
3379 <type>snd_kcontrol_new_t</type> record, such as: 3380 struct <structname>snd_kcontrol_new</structname> record, such as:
3380 3381
3381 <example> 3382 <example>
3382 <title>Definition of a Control</title> 3383 <title>Definition of a Control</title>
3383 <programlisting> 3384 <programlisting>
3384<![CDATA[ 3385<![CDATA[
3385 static snd_kcontrol_new_t my_control __devinitdata = { 3386 static struct snd_kcontrol_new my_control __devinitdata = {
3386 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3387 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3387 .name = "PCM Playback Switch", 3388 .name = "PCM Playback Switch",
3388 .index = 0, 3389 .index = 0,
@@ -3599,7 +3600,7 @@ struct _snd_pcm_runtime {
3599 <para> 3600 <para>
3600 The <structfield>info</structfield> callback is used to get 3601 The <structfield>info</structfield> callback is used to get
3601 the detailed information of this control. This must store the 3602 the detailed information of this control. This must store the
3602 values of the given <type>snd_ctl_elem_info_t</type> 3603 values of the given struct <structname>snd_ctl_elem_info</structname>
3603 object. For example, for a boolean control with a single 3604 object. For example, for a boolean control with a single
3604 element will be: 3605 element will be:
3605 3606
@@ -3607,8 +3608,8 @@ struct _snd_pcm_runtime {
3607 <title>Example of info callback</title> 3608 <title>Example of info callback</title>
3608 <programlisting> 3609 <programlisting>
3609<![CDATA[ 3610<![CDATA[
3610 static int snd_myctl_info(snd_kcontrol_t *kcontrol, 3611 static int snd_myctl_info(struct snd_kcontrol *kcontrol,
3611 snd_ctl_elem_info_t *uinfo) 3612 struct snd_ctl_elem_info *uinfo)
3612 { 3613 {
3613 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 3614 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
3614 uinfo->count = 1; 3615 uinfo->count = 1;
@@ -3642,8 +3643,8 @@ struct _snd_pcm_runtime {
3642 <informalexample> 3643 <informalexample>
3643 <programlisting> 3644 <programlisting>
3644<![CDATA[ 3645<![CDATA[
3645 static int snd_myctl_info(snd_kcontrol_t *kcontrol, 3646 static int snd_myctl_info(struct snd_kcontrol *kcontrol,
3646 snd_ctl_elem_info_t *uinfo) 3647 struct snd_ctl_elem_info *uinfo)
3647 { 3648 {
3648 static char *texts[4] = { 3649 static char *texts[4] = {
3649 "First", "Second", "Third", "Fourth" 3650 "First", "Second", "Third", "Fourth"
@@ -3678,10 +3679,10 @@ struct _snd_pcm_runtime {
3678 <title>Example of get callback</title> 3679 <title>Example of get callback</title>
3679 <programlisting> 3680 <programlisting>
3680<![CDATA[ 3681<![CDATA[
3681 static int snd_myctl_get(snd_kcontrol_t *kcontrol, 3682 static int snd_myctl_get(struct snd_kcontrol *kcontrol,
3682 snd_ctl_elem_value_t *ucontrol) 3683 struct snd_ctl_elem_value *ucontrol)
3683 { 3684 {
3684 mychip_t *chip = snd_kcontrol_chip(kcontrol); 3685 struct mychip *chip = snd_kcontrol_chip(kcontrol);
3685 ucontrol->value.integer.value[0] = get_some_value(chip); 3686 ucontrol->value.integer.value[0] = get_some_value(chip);
3686 return 0; 3687 return 0;
3687 } 3688 }
@@ -3717,8 +3718,8 @@ struct _snd_pcm_runtime {
3717 <informalexample> 3718 <informalexample>
3718 <programlisting> 3719 <programlisting>
3719<![CDATA[ 3720<![CDATA[
3720 static int snd_sbmixer_get_single(snd_kcontrol_t *kcontrol, 3721 static int snd_sbmixer_get_single(struct snd_kcontrol *kcontrol,
3721 snd_ctl_elem_value_t *ucontrol) 3722 struct snd_ctl_elem_value *ucontrol)
3722 { 3723 {
3723 int reg = kcontrol->private_value & 0xff; 3724 int reg = kcontrol->private_value & 0xff;
3724 int shift = (kcontrol->private_value >> 16) & 0xff; 3725 int shift = (kcontrol->private_value >> 16) & 0xff;
@@ -3754,10 +3755,10 @@ struct _snd_pcm_runtime {
3754 <title>Example of put callback</title> 3755 <title>Example of put callback</title>
3755 <programlisting> 3756 <programlisting>
3756<![CDATA[ 3757<![CDATA[
3757 static int snd_myctl_put(snd_kcontrol_t *kcontrol, 3758 static int snd_myctl_put(struct snd_kcontrol *kcontrol,
3758 snd_ctl_elem_value_t *ucontrol) 3759 struct snd_ctl_elem_value *ucontrol)
3759 { 3760 {
3760 mychip_t *chip = snd_kcontrol_chip(kcontrol); 3761 struct mychip *chip = snd_kcontrol_chip(kcontrol);
3761 int changed = 0; 3762 int changed = 0;
3762 if (chip->current_value != 3763 if (chip->current_value !=
3763 ucontrol->value.integer.value[0]) { 3764 ucontrol->value.integer.value[0]) {
@@ -3814,7 +3815,7 @@ struct _snd_pcm_runtime {
3814 </informalexample> 3815 </informalexample>
3815 3816
3816 where <parameter>my_control</parameter> is the 3817 where <parameter>my_control</parameter> is the
3817 <type>snd_kcontrol_new_t</type> object defined above, and chip 3818 struct <structname>snd_kcontrol_new</structname> object defined above, and chip
3818 is the object pointer to be passed to 3819 is the object pointer to be passed to
3819 kcontrol-&gt;private_data 3820 kcontrol-&gt;private_data
3820 which can be referred in callbacks. 3821 which can be referred in callbacks.
@@ -3822,7 +3823,7 @@ struct _snd_pcm_runtime {
3822 3823
3823 <para> 3824 <para>
3824 <function>snd_ctl_new1()</function> allocates a new 3825 <function>snd_ctl_new1()</function> allocates a new
3825 <type>snd_kcontrol_t</type> instance (that's why the definition 3826 <structname>snd_kcontrol</structname> instance (that's why the definition
3826 of <parameter>my_control</parameter> can be with 3827 of <parameter>my_control</parameter> can be with
3827 <parameter>__devinitdata</parameter> 3828 <parameter>__devinitdata</parameter>
3828 prefix), and <function>snd_ctl_add</function> assigns the given 3829 prefix), and <function>snd_ctl_add</function> assigns the given
@@ -3849,7 +3850,7 @@ struct _snd_pcm_runtime {
3849 control id pointer for the notification. The event-mask 3850 control id pointer for the notification. The event-mask
3850 specifies the types of notification, for example, in the above 3851 specifies the types of notification, for example, in the above
3851 example, the change of control values is notified. 3852 example, the change of control values is notified.
3852 The id pointer is the pointer of <type>snd_ctl_elem_id_t</type> 3853 The id pointer is the pointer of struct <structname>snd_ctl_elem_id</structname>
3853 to be notified. 3854 to be notified.
3854 You can find some examples in <filename>es1938.c</filename> or 3855 You can find some examples in <filename>es1938.c</filename> or
3855 <filename>es1968.c</filename> for hardware volume interrupts. 3856 <filename>es1968.c</filename> for hardware volume interrupts.
@@ -3882,35 +3883,35 @@ struct _snd_pcm_runtime {
3882 <title>Example of AC97 Interface</title> 3883 <title>Example of AC97 Interface</title>
3883 <programlisting> 3884 <programlisting>
3884<![CDATA[ 3885<![CDATA[
3885 struct snd_mychip { 3886 struct mychip {
3886 .... 3887 ....
3887 ac97_t *ac97; 3888 struct snd_ac97 *ac97;
3888 .... 3889 ....
3889 }; 3890 };
3890 3891
3891 static unsigned short snd_mychip_ac97_read(ac97_t *ac97, 3892 static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97,
3892 unsigned short reg) 3893 unsigned short reg)
3893 { 3894 {
3894 mychip_t *chip = ac97->private_data; 3895 struct mychip *chip = ac97->private_data;
3895 .... 3896 ....
3896 // read a register value here from the codec 3897 // read a register value here from the codec
3897 return the_register_value; 3898 return the_register_value;
3898 } 3899 }
3899 3900
3900 static void snd_mychip_ac97_write(ac97_t *ac97, 3901 static void snd_mychip_ac97_write(struct snd_ac97 *ac97,
3901 unsigned short reg, unsigned short val) 3902 unsigned short reg, unsigned short val)
3902 { 3903 {
3903 mychip_t *chip = ac97->private_data; 3904 struct mychip *chip = ac97->private_data;
3904 .... 3905 ....
3905 // write the given register value to the codec 3906 // write the given register value to the codec
3906 } 3907 }
3907 3908
3908 static int snd_mychip_ac97(mychip_t *chip) 3909 static int snd_mychip_ac97(struct mychip *chip)
3909 { 3910 {
3910 ac97_bus_t *bus; 3911 struct snd_ac97_bus *bus;
3911 ac97_template_t ac97; 3912 struct snd_ac97_template ac97;
3912 int err; 3913 int err;
3913 static ac97_bus_ops_t ops = { 3914 static struct snd_ac97_bus_ops ops = {
3914 .write = snd_mychip_ac97_write, 3915 .write = snd_mychip_ac97_write,
3915 .read = snd_mychip_ac97_read, 3916 .read = snd_mychip_ac97_read,
3916 }; 3917 };
@@ -3937,8 +3938,8 @@ struct _snd_pcm_runtime {
3937 <informalexample> 3938 <informalexample>
3938 <programlisting> 3939 <programlisting>
3939<![CDATA[ 3940<![CDATA[
3940 ac97_bus_t *bus; 3941 struct snd_ac97_bus *bus;
3941 static ac97_bus_ops_t ops = { 3942 static struct snd_ac97_bus_ops ops = {
3942 .write = snd_mychip_ac97_write, 3943 .write = snd_mychip_ac97_write,
3943 .read = snd_mychip_ac97_read, 3944 .read = snd_mychip_ac97_read,
3944 }; 3945 };
@@ -3952,13 +3953,14 @@ struct _snd_pcm_runtime {
3952 </para> 3953 </para>
3953 3954
3954 <para> 3955 <para>
3955 And then call <function>snd_ac97_mixer()</function> with an <type>ac97_template_t</type> 3956 And then call <function>snd_ac97_mixer()</function> with an
3957 struct <structname>snd_ac97_template</structname>
3956 record together with the bus pointer created above. 3958 record together with the bus pointer created above.
3957 3959
3958 <informalexample> 3960 <informalexample>
3959 <programlisting> 3961 <programlisting>
3960<![CDATA[ 3962<![CDATA[
3961 ac97_template_t ac97; 3963 struct snd_ac97_template ac97;
3962 int err; 3964 int err;
3963 3965
3964 memset(&ac97, 0, sizeof(ac97)); 3966 memset(&ac97, 0, sizeof(ac97));
@@ -3995,10 +3997,10 @@ struct _snd_pcm_runtime {
3995 <informalexample> 3997 <informalexample>
3996 <programlisting> 3998 <programlisting>
3997<![CDATA[ 3999<![CDATA[
3998 static unsigned short snd_mychip_ac97_read(ac97_t *ac97, 4000 static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97,
3999 unsigned short reg) 4001 unsigned short reg)
4000 { 4002 {
4001 mychip_t *chip = ac97->private_data; 4003 struct mychip *chip = ac97->private_data;
4002 .... 4004 ....
4003 return the_register_value; 4005 return the_register_value;
4004 } 4006 }
@@ -4016,7 +4018,7 @@ struct _snd_pcm_runtime {
4016 <informalexample> 4018 <informalexample>
4017 <programlisting> 4019 <programlisting>
4018<![CDATA[ 4020<![CDATA[
4019 static void snd_mychip_ac97_write(ac97_t *ac97, 4021 static void snd_mychip_ac97_write(struct snd_ac97 *ac97,
4020 unsigned short reg, unsigned short val) 4022 unsigned short reg, unsigned short val)
4021]]> 4023]]>
4022 </programlisting> 4024 </programlisting>
@@ -4163,7 +4165,7 @@ struct _snd_pcm_runtime {
4163 <title>Multiple Codecs</title> 4165 <title>Multiple Codecs</title>
4164 <para> 4166 <para>
4165 When there are several codecs on the same card, you need to 4167 When there are several codecs on the same card, you need to
4166 call <function>snd_ac97_new()</function> multiple times with 4168 call <function>snd_ac97_mixer()</function> multiple times with
4167 ac97.num=1 or greater. The <structfield>num</structfield> field 4169 ac97.num=1 or greater. The <structfield>num</structfield> field
4168 specifies the codec 4170 specifies the codec
4169 number. 4171 number.
@@ -4212,7 +4214,7 @@ struct _snd_pcm_runtime {
4212 <informalexample> 4214 <informalexample>
4213 <programlisting> 4215 <programlisting>
4214<![CDATA[ 4216<![CDATA[
4215 snd_rawmidi_t *rmidi; 4217 struct snd_rawmidi *rmidi;
4216 snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, integrated, 4218 snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, integrated,
4217 irq, irq_flags, &rmidi); 4219 irq, irq_flags, &rmidi);
4218]]> 4220]]>
@@ -4253,17 +4255,17 @@ struct _snd_pcm_runtime {
4253 Usually, the port address corresponds to the command port and 4255 Usually, the port address corresponds to the command port and
4254 port + 1 corresponds to the data port. If not, you may change 4256 port + 1 corresponds to the data port. If not, you may change
4255 the <structfield>cport</structfield> field of 4257 the <structfield>cport</structfield> field of
4256 <type>mpu401_t</type> manually 4258 struct <structname>snd_mpu401</structname> manually
4257 afterward. However, <type>mpu401_t</type> pointer is not 4259 afterward. However, <structname>snd_mpu401</structname> pointer is not
4258 returned explicitly by 4260 returned explicitly by
4259 <function>snd_mpu401_uart_new()</function>. You need to cast 4261 <function>snd_mpu401_uart_new()</function>. You need to cast
4260 rmidi-&gt;private_data to 4262 rmidi-&gt;private_data to
4261 <type>mpu401_t</type> explicitly, 4263 <structname>snd_mpu401</structname> explicitly,
4262 4264
4263 <informalexample> 4265 <informalexample>
4264 <programlisting> 4266 <programlisting>
4265<![CDATA[ 4267<![CDATA[
4266 mpu401_t *mpu; 4268 struct snd_mpu401 *mpu;
4267 mpu = rmidi->private_data; 4269 mpu = rmidi->private_data;
4268]]> 4270]]>
4269 </programlisting> 4271 </programlisting>
@@ -4359,7 +4361,7 @@ struct _snd_pcm_runtime {
4359 <informalexample> 4361 <informalexample>
4360 <programlisting> 4362 <programlisting>
4361<![CDATA[ 4363<![CDATA[
4362 snd_rawmidi_t *rmidi; 4364 struct snd_rawmidi *rmidi;
4363 err = snd_rawmidi_new(chip->card, "MyMIDI", 0, outs, ins, &rmidi); 4365 err = snd_rawmidi_new(chip->card, "MyMIDI", 0, outs, ins, &rmidi);
4364 if (err < 0) 4366 if (err < 0)
4365 return err; 4367 return err;
@@ -4419,7 +4421,7 @@ struct _snd_pcm_runtime {
4419 <informalexample> 4421 <informalexample>
4420 <programlisting> 4422 <programlisting>
4421<![CDATA[ 4423<![CDATA[
4422 static snd_rawmidi_ops_t snd_mymidi_output_ops = { 4424 static struct snd_rawmidi_ops snd_mymidi_output_ops = {
4423 .open = snd_mymidi_output_open, 4425 .open = snd_mymidi_output_open,
4424 .close = snd_mymidi_output_close, 4426 .close = snd_mymidi_output_close,
4425 .trigger = snd_mymidi_output_trigger, 4427 .trigger = snd_mymidi_output_trigger,
@@ -4439,9 +4441,9 @@ struct _snd_pcm_runtime {
4439 <programlisting> 4441 <programlisting>
4440<![CDATA[ 4442<![CDATA[
4441 struct list_head *list; 4443 struct list_head *list;
4442 snd_rawmidi_substream_t *substream; 4444 struct snd_rawmidi_substream *substream;
4443 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { 4445 list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
4444 substream = list_entry(list, snd_rawmidi_substream_t, list); 4446 substream = list_entry(list, struct snd_rawmidi_substream, list);
4445 sprintf(substream->name, "My MIDI Port %d", substream->number + 1); 4447 sprintf(substream->name, "My MIDI Port %d", substream->number + 1);
4446 } 4448 }
4447 /* same for SNDRV_RAWMIDI_STREAM_INPUT */ 4449 /* same for SNDRV_RAWMIDI_STREAM_INPUT */
@@ -4463,12 +4465,12 @@ struct _snd_pcm_runtime {
4463 4465
4464 <para> 4466 <para>
4465 If there is more than one port, your callbacks can determine the 4467 If there is more than one port, your callbacks can determine the
4466 port index from the snd_rawmidi_substream_t data passed to each 4468 port index from the struct snd_rawmidi_substream data passed to each
4467 callback: 4469 callback:
4468 <informalexample> 4470 <informalexample>
4469 <programlisting> 4471 <programlisting>
4470<![CDATA[ 4472<![CDATA[
4471 snd_rawmidi_substream_t *substream; 4473 struct snd_rawmidi_substream *substream;
4472 int index = substream->number; 4474 int index = substream->number;
4473]]> 4475]]>
4474 </programlisting> 4476 </programlisting>
@@ -4481,7 +4483,7 @@ struct _snd_pcm_runtime {
4481 <informalexample> 4483 <informalexample>
4482 <programlisting> 4484 <programlisting>
4483<![CDATA[ 4485<![CDATA[
4484 static int snd_xxx_open(snd_rawmidi_substream_t *substream); 4486 static int snd_xxx_open(struct snd_rawmidi_substream *substream);
4485]]> 4487]]>
4486 </programlisting> 4488 </programlisting>
4487 </informalexample> 4489 </informalexample>
@@ -4499,7 +4501,7 @@ struct _snd_pcm_runtime {
4499 <informalexample> 4501 <informalexample>
4500 <programlisting> 4502 <programlisting>
4501<![CDATA[ 4503<![CDATA[
4502 static int snd_xxx_close(snd_rawmidi_substream_t *substream); 4504 static int snd_xxx_close(struct snd_rawmidi_substream *substream);
4503]]> 4505]]>
4504 </programlisting> 4506 </programlisting>
4505 </informalexample> 4507 </informalexample>
@@ -4522,7 +4524,7 @@ struct _snd_pcm_runtime {
4522 <informalexample> 4524 <informalexample>
4523 <programlisting> 4525 <programlisting>
4524<![CDATA[ 4526<![CDATA[
4525 static void snd_xxx_output_trigger(snd_rawmidi_substream_t *substream, int up); 4527 static void snd_xxx_output_trigger(struct snd_rawmidi_substream *substream, int up);
4526]]> 4528]]>
4527 </programlisting> 4529 </programlisting>
4528 </informalexample> 4530 </informalexample>
@@ -4547,7 +4549,7 @@ struct _snd_pcm_runtime {
4547<![CDATA[ 4549<![CDATA[
4548 unsigned char data; 4550 unsigned char data;
4549 while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) { 4551 while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) {
4550 if (mychip_try_to_transmit(data)) 4552 if (snd_mychip_try_to_transmit(data))
4551 snd_rawmidi_transmit_ack(substream, 1); 4553 snd_rawmidi_transmit_ack(substream, 1);
4552 else 4554 else
4553 break; /* hardware FIFO full */ 4555 break; /* hardware FIFO full */
@@ -4564,11 +4566,11 @@ struct _snd_pcm_runtime {
4564 <informalexample> 4566 <informalexample>
4565 <programlisting> 4567 <programlisting>
4566<![CDATA[ 4568<![CDATA[
4567 while (mychip_transmit_possible()) { 4569 while (snd_mychip_transmit_possible()) {
4568 unsigned char data; 4570 unsigned char data;
4569 if (snd_rawmidi_transmit(substream, &data, 1) != 1) 4571 if (snd_rawmidi_transmit(substream, &data, 1) != 1)
4570 break; /* no more data */ 4572 break; /* no more data */
4571 mychip_transmit(data); 4573 snd_mychip_transmit(data);
4572 } 4574 }
4573]]> 4575]]>
4574 </programlisting> 4576 </programlisting>
@@ -4603,7 +4605,7 @@ struct _snd_pcm_runtime {
4603 <informalexample> 4605 <informalexample>
4604 <programlisting> 4606 <programlisting>
4605<![CDATA[ 4607<![CDATA[
4606 static void snd_xxx_input_trigger(snd_rawmidi_substream_t *substream, int up); 4608 static void snd_xxx_input_trigger(struct snd_rawmidi_substream *substream, int up);
4607]]> 4609]]>
4608 </programlisting> 4610 </programlisting>
4609 </informalexample> 4611 </informalexample>
@@ -4647,7 +4649,7 @@ struct _snd_pcm_runtime {
4647 <informalexample> 4649 <informalexample>
4648 <programlisting> 4650 <programlisting>
4649<![CDATA[ 4651<![CDATA[
4650 static void snd_xxx_drain(snd_rawmidi_substream_t *substream); 4652 static void snd_xxx_drain(struct snd_rawmidi_substream *substream);
4651]]> 4653]]>
4652 </programlisting> 4654 </programlisting>
4653 </informalexample> 4655 </informalexample>
@@ -4661,7 +4663,7 @@ struct _snd_pcm_runtime {
4661 4663
4662 <para> 4664 <para>
4663 This callback is optional. If you do not set 4665 This callback is optional. If you do not set
4664 <structfield>drain</structfield> in the snd_rawmidi_ops_t 4666 <structfield>drain</structfield> in the struct snd_rawmidi_ops
4665 structure, ALSA will simply wait for 50&nbsp;milliseconds 4667 structure, ALSA will simply wait for 50&nbsp;milliseconds
4666 instead. 4668 instead.
4667 </para> 4669 </para>
@@ -4703,7 +4705,7 @@ struct _snd_pcm_runtime {
4703 <informalexample> 4705 <informalexample>
4704 <programlisting> 4706 <programlisting>
4705<![CDATA[ 4707<![CDATA[
4706 opl3_t *opl3; 4708 struct snd_opl3 *opl3;
4707 snd_opl3_create(card, lport, rport, OPL3_HW_OPL3_XXX, 4709 snd_opl3_create(card, lport, rport, OPL3_HW_OPL3_XXX,
4708 integrated, &opl3); 4710 integrated, &opl3);
4709]]> 4711]]>
@@ -4736,7 +4738,7 @@ struct _snd_pcm_runtime {
4736 <informalexample> 4738 <informalexample>
4737 <programlisting> 4739 <programlisting>
4738<![CDATA[ 4740<![CDATA[
4739 opl3_t *opl3; 4741 struct snd_opl3 *opl3;
4740 snd_opl3_new(card, OPL3_HW_OPL3_XXX, &opl3); 4742 snd_opl3_new(card, OPL3_HW_OPL3_XXX, &opl3);
4741]]> 4743]]>
4742 </programlisting> 4744 </programlisting>
@@ -4767,7 +4769,7 @@ struct _snd_pcm_runtime {
4767 <informalexample> 4769 <informalexample>
4768 <programlisting> 4770 <programlisting>
4769<![CDATA[ 4771<![CDATA[
4770 snd_hwdep_t *opl3hwdep; 4772 struct snd_hwdep *opl3hwdep;
4771 snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep); 4773 snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep);
4772]]> 4774]]>
4773 </programlisting> 4775 </programlisting>
@@ -4804,7 +4806,7 @@ struct _snd_pcm_runtime {
4804 <informalexample> 4806 <informalexample>
4805 <programlisting> 4807 <programlisting>
4806<![CDATA[ 4808<![CDATA[
4807 snd_hwdep_t *hw; 4809 struct snd_hwdep *hw;
4808 snd_hwdep_new(card, "My HWDEP", 0, &hw); 4810 snd_hwdep_new(card, "My HWDEP", 0, &hw);
4809]]> 4811]]>
4810 </programlisting> 4812 </programlisting>
@@ -4823,7 +4825,7 @@ struct _snd_pcm_runtime {
4823 <informalexample> 4825 <informalexample>
4824 <programlisting> 4826 <programlisting>
4825<![CDATA[ 4827<![CDATA[
4826 mydata_t *p = kmalloc(sizeof(*p), GFP_KERNEL); 4828 struct mydata *p = kmalloc(sizeof(*p), GFP_KERNEL);
4827 hw->private_data = p; 4829 hw->private_data = p;
4828 hw->private_free = mydata_free; 4830 hw->private_free = mydata_free;
4829]]> 4831]]>
@@ -4835,9 +4837,9 @@ struct _snd_pcm_runtime {
4835 <informalexample> 4837 <informalexample>
4836 <programlisting> 4838 <programlisting>
4837<![CDATA[ 4839<![CDATA[
4838 static void mydata_free(snd_hwdep_t *hw) 4840 static void mydata_free(struct snd_hwdep *hw)
4839 { 4841 {
4840 mydata_t *p = hw->private_data; 4842 struct mydata *p = hw->private_data;
4841 kfree(p); 4843 kfree(p);
4842 } 4844 }
4843]]> 4845]]>
@@ -5061,9 +5063,9 @@ struct _snd_pcm_runtime {
5061 <informalexample> 5063 <informalexample>
5062 <programlisting> 5064 <programlisting>
5063<![CDATA[ 5065<![CDATA[
5064 static int playback_copy(snd_pcm_substream_t *substream, int channel, 5066 static int playback_copy(struct snd_pcm_substream *substream, int channel,
5065 snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count); 5067 snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count);
5066 static int capture_copy(snd_pcm_substream_t *substream, int channel, 5068 static int capture_copy(struct snd_pcm_substream *substream, int channel,
5067 snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count); 5069 snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count);
5068]]> 5070]]>
5069 </programlisting> 5071 </programlisting>
@@ -5144,7 +5146,7 @@ struct _snd_pcm_runtime {
5144 <informalexample> 5146 <informalexample>
5145 <programlisting> 5147 <programlisting>
5146<![CDATA[ 5148<![CDATA[
5147 static int silence(snd_pcm_substream_t *substream, int channel, 5149 static int silence(struct snd_pcm_substream *substream, int channel,
5148 snd_pcm_uframes_t pos, snd_pcm_uframes_t count); 5150 snd_pcm_uframes_t pos, snd_pcm_uframes_t count);
5149]]> 5151]]>
5150 </programlisting> 5152 </programlisting>
@@ -5211,7 +5213,7 @@ struct _snd_pcm_runtime {
5211 <informalexample> 5213 <informalexample>
5212 <programlisting> 5214 <programlisting>
5213<![CDATA[ 5215<![CDATA[
5214 snd_pcm_sgbuf_t *sgbuf = (snd_pcm_sgbuf_t*)substream->dma_private; 5216 struct snd_sg_buf *sgbuf = (struct snd_sg_buf_t*)substream->dma_private;
5215]]> 5217]]>
5216 </programlisting> 5218 </programlisting>
5217 </informalexample> 5219 </informalexample>
@@ -5266,7 +5268,7 @@ struct _snd_pcm_runtime {
5266 #include <linux/vmalloc.h> 5268 #include <linux/vmalloc.h>
5267 5269
5268 /* get the physical page pointer on the given offset */ 5270 /* get the physical page pointer on the given offset */
5269 static struct page *mychip_page(snd_pcm_substream_t *substream, 5271 static struct page *mychip_page(struct snd_pcm_substream *substream,
5270 unsigned long offset) 5272 unsigned long offset)
5271 { 5273 {
5272 void *pageptr = substream->runtime->dma_area + offset; 5274 void *pageptr = substream->runtime->dma_area + offset;
@@ -5301,7 +5303,7 @@ struct _snd_pcm_runtime {
5301 <informalexample> 5303 <informalexample>
5302 <programlisting> 5304 <programlisting>
5303<![CDATA[ 5305<![CDATA[
5304 snd_info_entry_t *entry; 5306 struct snd_info_entry *entry;
5305 int err = snd_card_proc_new(card, "my-file", &entry); 5307 int err = snd_card_proc_new(card, "my-file", &entry);
5306]]> 5308]]>
5307 </programlisting> 5309 </programlisting>
@@ -5345,8 +5347,8 @@ struct _snd_pcm_runtime {
5345 <informalexample> 5347 <informalexample>
5346 <programlisting> 5348 <programlisting>
5347<![CDATA[ 5349<![CDATA[
5348 static void my_proc_read(snd_info_entry_t *entry, 5350 static void my_proc_read(struct snd_info_entry *entry,
5349 snd_info_buffer_t *buffer); 5351 struct snd_info_buffer *buffer);
5350]]> 5352]]>
5351 </programlisting> 5353 </programlisting>
5352 </informalexample> 5354 </informalexample>
@@ -5361,10 +5363,10 @@ struct _snd_pcm_runtime {
5361 <informalexample> 5363 <informalexample>
5362 <programlisting> 5364 <programlisting>
5363<![CDATA[ 5365<![CDATA[
5364 static void my_proc_read(snd_info_entry_t *entry, 5366 static void my_proc_read(struct snd_info_entry *entry,
5365 snd_info_buffer_t *buffer) 5367 struct snd_info_buffer *buffer)
5366 { 5368 {
5367 chip_t *chip = entry->private_data; 5369 struct my_chip *chip = entry->private_data;
5368 5370
5369 snd_iprintf(buffer, "This is my chip!\n"); 5371 snd_iprintf(buffer, "This is my chip!\n");
5370 snd_iprintf(buffer, "Port = %ld\n", chip->port); 5372 snd_iprintf(buffer, "Port = %ld\n", chip->port);
@@ -5453,7 +5455,7 @@ struct _snd_pcm_runtime {
5453 <informalexample> 5455 <informalexample>
5454 <programlisting> 5456 <programlisting>
5455<![CDATA[ 5457<![CDATA[
5456 static long my_file_io_read(snd_info_entry_t *entry, 5458 static long my_file_io_read(struct snd_info_entry *entry,
5457 void *file_private_data, 5459 void *file_private_data,
5458 struct file *file, 5460 struct file *file,
5459 char *buf, 5461 char *buf,
@@ -5488,22 +5490,60 @@ struct _snd_pcm_runtime {
5488 <constant>CONFIG_PM</constant>. 5490 <constant>CONFIG_PM</constant>.
5489 </para> 5491 </para>
5490 5492
5493 <para>
5494 If the driver supports the suspend/resume
5495 <emphasis>fully</emphasis>, that is, the device can be
5496 properly resumed to the status at the suspend is called,
5497 you can set <constant>SNDRV_PCM_INFO_RESUME</constant> flag
5498 to pcm info field. Usually, this is possible when the
5499 registers of ths chip can be safely saved and restored to the
5500 RAM. If this is set, the trigger callback is called with
5501 <constant>SNDRV_PCM_TRIGGER_RESUME</constant> after resume
5502 callback is finished.
5503 </para>
5504
5505 <para>
5506 Even if the driver doesn't support PM fully but only the
5507 partial suspend/resume is possible, it's still worthy to
5508 implement suspend/resume callbacks. In such a case, applications
5509 would reset the status by calling
5510 <function>snd_pcm_prepare()</function> and restart the stream
5511 appropriately. Hence, you can define suspend/resume callbacks
5512 below but don't set <constant>SNDRV_PCM_INFO_RESUME</constant>
5513 info flag to the PCM.
5514 </para>
5515
5516 <para>
5517 Note that the trigger with SUSPEND can be always called when
5518 <function>snd_pcm_suspend_all</function> is called,
5519 regardless of <constant>SNDRV_PCM_INFO_RESUME</constant> flag.
5520 The <constant>RESUME</constant> flag affects only the behavior
5521 of <function>snd_pcm_resume()</function>.
5522 (Thus, in theory,
5523 <constant>SNDRV_PCM_TRIGGER_RESUME</constant> isn't needed
5524 to be handled in the trigger callback when no
5525 <constant>SNDRV_PCM_INFO_RESUME</constant> flag is set. But,
5526 it's better to keep it for compatibility reason.)
5527 </para>
5491 <para> 5528 <para>
5492 ALSA provides the common power-management layer. Each card driver 5529 In the earlier version of ALSA drivers, a common
5493 needs to have only low-level suspend and resume callbacks. 5530 power-management layer was provided, but it has been removed.
5531 The driver needs to define the suspend/resume hooks according to
5532 the bus the device is assigned. In the case of PCI driver, the
5533 callbacks look like below:
5494 5534
5495 <informalexample> 5535 <informalexample>
5496 <programlisting> 5536 <programlisting>
5497<![CDATA[ 5537<![CDATA[
5498 #ifdef CONFIG_PM 5538 #ifdef CONFIG_PM
5499 static int snd_my_suspend(snd_card_t *card, pm_message_t state) 5539 static int snd_my_suspend(struct pci_dev *pci, pm_message_t state)
5500 { 5540 {
5501 .... // do things for suspsend 5541 .... /* do things for suspsend */
5502 return 0; 5542 return 0;
5503 } 5543 }
5504 static int snd_my_resume(snd_card_t *card) 5544 static int snd_my_resume(struct pci_dev *pci)
5505 { 5545 {
5506 .... // do things for suspsend 5546 .... /* do things for suspsend */
5507 return 0; 5547 return 0;
5508 } 5548 }
5509 #endif 5549 #endif
@@ -5516,11 +5556,18 @@ struct _snd_pcm_runtime {
5516 The scheme of the real suspend job is as following. 5556 The scheme of the real suspend job is as following.
5517 5557
5518 <orderedlist> 5558 <orderedlist>
5519 <listitem><para>Retrieve the chip data from pm_private_data field.</para></listitem> 5559 <listitem><para>Retrieve the card and the chip data.</para></listitem>
5560 <listitem><para>Call <function>snd_power_change_state()</function> with
5561 <constant>SNDRV_CTL_POWER_D3hot</constant> to change the
5562 power status.</para></listitem>
5520 <listitem><para>Call <function>snd_pcm_suspend_all()</function> to suspend the running PCM streams.</para></listitem> 5563 <listitem><para>Call <function>snd_pcm_suspend_all()</function> to suspend the running PCM streams.</para></listitem>
5564 <listitem><para>If AC97 codecs are used, call
5565 <function>snd_ac97_resume()</function> for each codec.</para></listitem>
5521 <listitem><para>Save the register values if necessary.</para></listitem> 5566 <listitem><para>Save the register values if necessary.</para></listitem>
5522 <listitem><para>Stop the hardware if necessary.</para></listitem> 5567 <listitem><para>Stop the hardware if necessary.</para></listitem>
5523 <listitem><para>Disable the PCI device by calling <function>pci_disable_device()</function>.</para></listitem> 5568 <listitem><para>Disable the PCI device by calling
5569 <function>pci_disable_device()</function>. Then, call
5570 <function>pci_save_state()</function> at last.</para></listitem>
5524 </orderedlist> 5571 </orderedlist>
5525 </para> 5572 </para>
5526 5573
@@ -5530,18 +5577,24 @@ struct _snd_pcm_runtime {
5530 <informalexample> 5577 <informalexample>
5531 <programlisting> 5578 <programlisting>
5532<![CDATA[ 5579<![CDATA[
5533 static int mychip_suspend(snd_card_t *card, pm_message_t state) 5580 static int mychip_suspend(strut pci_dev *pci, pm_message_t state)
5534 { 5581 {
5535 /* (1) */ 5582 /* (1) */
5536 mychip_t *chip = card->pm_private_data; 5583 struct snd_card *card = pci_get_drvdata(pci);
5584 struct mychip *chip = card->private_data;
5537 /* (2) */ 5585 /* (2) */
5538 snd_pcm_suspend_all(chip->pcm); 5586 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
5539 /* (3) */ 5587 /* (3) */
5540 snd_mychip_save_registers(chip); 5588 snd_pcm_suspend_all(chip->pcm);
5541 /* (4) */ 5589 /* (4) */
5542 snd_mychip_stop_hardware(chip); 5590 snd_ac97_suspend(chip->ac97);
5543 /* (5) */ 5591 /* (5) */
5544 pci_disable_device(chip->pci); 5592 snd_mychip_save_registers(chip);
5593 /* (6) */
5594 snd_mychip_stop_hardware(chip);
5595 /* (7) */
5596 pci_disable_device(pci);
5597 pci_save_state(pci);
5545 return 0; 5598 return 0;
5546 } 5599 }
5547]]> 5600]]>
@@ -5553,14 +5606,17 @@ struct _snd_pcm_runtime {
5553 The scheme of the real resume job is as following. 5606 The scheme of the real resume job is as following.
5554 5607
5555 <orderedlist> 5608 <orderedlist>
5556 <listitem><para>Retrieve the chip data from pm_private_data field.</para></listitem> 5609 <listitem><para>Retrieve the card and the chip data.</para></listitem>
5557 <listitem><para>Enable the pci device again by calling 5610 <listitem><para>Set up PCI. First, call <function>pci_restore_state()</function>.
5558 <function>pci_enable_device()</function>.</para></listitem> 5611 Then enable the pci device again by calling <function>pci_enable_device()</function>.
5612 Call <function>pci_set_master()</function> if necessary, too.</para></listitem>
5559 <listitem><para>Re-initialize the chip.</para></listitem> 5613 <listitem><para>Re-initialize the chip.</para></listitem>
5560 <listitem><para>Restore the saved registers if necessary.</para></listitem> 5614 <listitem><para>Restore the saved registers if necessary.</para></listitem>
5561 <listitem><para>Resume the mixer, e.g. calling 5615 <listitem><para>Resume the mixer, e.g. calling
5562 <function>snd_ac97_resume()</function>.</para></listitem> 5616 <function>snd_ac97_resume()</function>.</para></listitem>
5563 <listitem><para>Restart the hardware (if any).</para></listitem> 5617 <listitem><para>Restart the hardware (if any).</para></listitem>
5618 <listitem><para>Call <function>snd_power_change_state()</function> with
5619 <constant>SNDRV_CTL_POWER_D0</constant> to notify the processes.</para></listitem>
5564 </orderedlist> 5620 </orderedlist>
5565 </para> 5621 </para>
5566 5622
@@ -5570,12 +5626,15 @@ struct _snd_pcm_runtime {
5570 <informalexample> 5626 <informalexample>
5571 <programlisting> 5627 <programlisting>
5572<![CDATA[ 5628<![CDATA[
5573 static void mychip_resume(mychip_t *chip) 5629 static int mychip_resume(struct pci_dev *pci)
5574 { 5630 {
5575 /* (1) */ 5631 /* (1) */
5576 mychip_t *chip = card->pm_private_data; 5632 struct snd_card *card = pci_get_drvdata(pci);
5633 struct mychip *chip = card->private_data;
5577 /* (2) */ 5634 /* (2) */
5578 pci_enable_device(chip->pci); 5635 pci_restore_state(pci);
5636 pci_enable_device(pci);
5637 pci_set_master(pci);
5579 /* (3) */ 5638 /* (3) */
5580 snd_mychip_reinit_chip(chip); 5639 snd_mychip_reinit_chip(chip);
5581 /* (4) */ 5640 /* (4) */
@@ -5584,6 +5643,8 @@ struct _snd_pcm_runtime {
5584 snd_ac97_resume(chip->ac97); 5643 snd_ac97_resume(chip->ac97);
5585 /* (6) */ 5644 /* (6) */
5586 snd_mychip_restart_chip(chip); 5645 snd_mychip_restart_chip(chip);
5646 /* (7) */
5647 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
5587 return 0; 5648 return 0;
5588 } 5649 }
5589]]> 5650]]>
@@ -5592,8 +5653,23 @@ struct _snd_pcm_runtime {
5592 </para> 5653 </para>
5593 5654
5594 <para> 5655 <para>
5595 OK, we have all callbacks now. Let's set up them now. In the 5656 As shown in the above, it's better to save registers after
5596 initialization of the card, add the following: 5657 suspending the PCM operations via
5658 <function>snd_pcm_suspend_all()</function> or
5659 <function>snd_pcm_suspend()</function>. It means that the PCM
5660 streams are already stoppped when the register snapshot is
5661 taken. But, remind that you don't have to restart the PCM
5662 stream in the resume callback. It'll be restarted via
5663 trigger call with <constant>SNDRV_PCM_TRIGGER_RESUME</constant>
5664 when necessary.
5665 </para>
5666
5667 <para>
5668 OK, we have all callbacks now. Let's set them up. In the
5669 initialization of the card, make sure that you can get the chip
5670 data from the card instance, typically via
5671 <structfield>private_data</structfield> field, in case you
5672 created the chip data individually.
5597 5673
5598 <informalexample> 5674 <informalexample>
5599 <programlisting> 5675 <programlisting>
@@ -5602,33 +5678,56 @@ struct _snd_pcm_runtime {
5602 const struct pci_device_id *pci_id) 5678 const struct pci_device_id *pci_id)
5603 { 5679 {
5604 .... 5680 ....
5605 snd_card_t *card; 5681 struct snd_card *card;
5606 mychip_t *chip; 5682 struct mychip *chip;
5607 .... 5683 ....
5608 snd_card_set_pm_callback(card, snd_my_suspend, snd_my_resume, chip); 5684 card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
5685 ....
5686 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
5687 ....
5688 card->private_data = chip;
5689 ....
5690 }
5691]]>
5692 </programlisting>
5693 </informalexample>
5694
5695 When you created the chip data with
5696 <function>snd_card_new()</function>, it's anyway accessible
5697 via <structfield>private_data</structfield> field.
5698
5699 <informalexample>
5700 <programlisting>
5701<![CDATA[
5702 static int __devinit snd_mychip_probe(struct pci_dev *pci,
5703 const struct pci_device_id *pci_id)
5704 {
5705 ....
5706 struct snd_card *card;
5707 struct mychip *chip;
5708 ....
5709 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
5710 sizeof(struct mychip));
5711 ....
5712 chip = card->private_data;
5609 .... 5713 ....
5610 } 5714 }
5611]]> 5715]]>
5612 </programlisting> 5716 </programlisting>
5613 </informalexample> 5717 </informalexample>
5614 5718
5615 Here you don't have to put ifdef CONFIG_PM around, since it's already
5616 checked in the header and expanded to empty if not needed.
5617 </para> 5719 </para>
5618 5720
5619 <para> 5721 <para>
5620 If you need a space for saving the registers, you'll need to 5722 If you need a space for saving the registers, allocate the
5621 allocate the buffer for it here, too, since it would be fatal 5723 buffer for it here, too, since it would be fatal
5622 if you cannot allocate a memory in the suspend phase. 5724 if you cannot allocate a memory in the suspend phase.
5623 The allocated buffer should be released in the corresponding 5725 The allocated buffer should be released in the corresponding
5624 destructor. 5726 destructor.
5625 </para> 5727 </para>
5626 5728
5627 <para> 5729 <para>
5628 And next, set suspend/resume callbacks to the pci_driver, 5730 And next, set suspend/resume callbacks to the pci_driver.
5629 This can be done by passing a macro SND_PCI_PM_CALLBACKS
5630 in the pci_driver struct. This macro is expanded to the correct
5631 (global) callbacks if CONFIG_PM is set.
5632 5731
5633 <informalexample> 5732 <informalexample>
5634 <programlisting> 5733 <programlisting>
@@ -5638,7 +5737,10 @@ struct _snd_pcm_runtime {
5638 .id_table = snd_my_ids, 5737 .id_table = snd_my_ids,
5639 .probe = snd_my_probe, 5738 .probe = snd_my_probe,
5640 .remove = __devexit_p(snd_my_remove), 5739 .remove = __devexit_p(snd_my_remove),
5641 SND_PCI_PM_CALLBACKS 5740 #ifdef CONFIG_PM
5741 .suspend = snd_my_suspend,
5742 .resume = snd_my_resume,
5743 #endif
5642 }; 5744 };
5643]]> 5745]]>
5644 </programlisting> 5746 </programlisting>
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index 25c5d648aef6..1fe48846d78f 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -138,6 +138,22 @@ card*/codec97#0/ac97#?-?+regs
138 # echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs 138 # echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs
139 139
140 140
141USB Audio Streams
142-----------------
143
144card*/stream*
145 Shows the assignment and the current status of each audio stream
146 of the given card. This information is very useful for debugging.
147
148
149HD-Audio Codecs
150---------------
151
152card*/codec#*
153 Shows the general codec information and the attribute of each
154 widget node.
155
156
141Sequencer Information 157Sequencer Information
142--------------------- 158---------------------
143 159
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt
index e9d07b8f1acb..0be57ed81302 100644
--- a/Documentation/sound/alsa/hda_codec.txt
+++ b/Documentation/sound/alsa/hda_codec.txt
@@ -63,7 +63,7 @@ The bus instance is created via snd_hda_bus_new(). You need to pass
63the card instance, the template, and the pointer to store the 63the card instance, the template, and the pointer to store the
64resultant bus instance. 64resultant bus instance.
65 65
66int snd_hda_bus_new(snd_card_t *card, const struct hda_bus_template *temp, 66int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
67 struct hda_bus **busp); 67 struct hda_bus **busp);
68 68
69It returns zero if successful. A negative return value means any 69It returns zero if successful. A negative return value means any
@@ -166,14 +166,14 @@ The ops field contains the following callback functions:
166 166
167struct hda_pcm_ops { 167struct hda_pcm_ops {
168 int (*open)(struct hda_pcm_stream *info, struct hda_codec *codec, 168 int (*open)(struct hda_pcm_stream *info, struct hda_codec *codec,
169 snd_pcm_substream_t *substream); 169 struct snd_pcm_substream *substream);
170 int (*close)(struct hda_pcm_stream *info, struct hda_codec *codec, 170 int (*close)(struct hda_pcm_stream *info, struct hda_codec *codec,
171 snd_pcm_substream_t *substream); 171 struct snd_pcm_substream *substream);
172 int (*prepare)(struct hda_pcm_stream *info, struct hda_codec *codec, 172 int (*prepare)(struct hda_pcm_stream *info, struct hda_codec *codec,
173 unsigned int stream_tag, unsigned int format, 173 unsigned int stream_tag, unsigned int format,
174 snd_pcm_substream_t *substream); 174 struct snd_pcm_substream *substream);
175 int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec, 175 int (*cleanup)(struct hda_pcm_stream *info, struct hda_codec *codec,
176 snd_pcm_substream_t *substream); 176 struct snd_pcm_substream *substream);
177}; 177};
178 178
179All are non-NULL, so you can call them safely without NULL check. 179All are non-NULL, so you can call them safely without NULL check.
@@ -284,7 +284,7 @@ parameter, and PCI subsystem IDs. If the matching entry is found, it
284returns the config field value. 284returns the config field value.
285 285
286snd_hda_add_new_ctls() can be used to create and add control entries. 286snd_hda_add_new_ctls() can be used to create and add control entries.
287Pass the zero-terminated array of snd_kcontrol_new_t. The same array 287Pass the zero-terminated array of struct snd_kcontrol_new. The same array
288can be passed to snd_hda_resume_ctls() for resume. 288can be passed to snd_hda_resume_ctls() for resume.
289Note that this will call control->put callback of these entries. So, 289Note that this will call control->put callback of these entries. So,
290put callback should check codec->in_resume and force to restore the 290put callback should check codec->in_resume and force to restore the
@@ -292,7 +292,7 @@ given value if it's non-zero even if the value is identical with the
292cached value. 292cached value.
293 293
294Macros HDA_CODEC_VOLUME(), HDA_CODEC_MUTE() and their variables can be 294Macros HDA_CODEC_VOLUME(), HDA_CODEC_MUTE() and their variables can be
295used for the entry of snd_kcontrol_new_t. 295used for the entry of struct snd_kcontrol_new.
296 296
297The input MUX helper callbacks for such a control are provided, too: 297The input MUX helper callbacks for such a control are provided, too:
298snd_hda_input_mux_info() and snd_hda_input_mux_put(). See 298snd_hda_input_mux_info() and snd_hda_input_mux_put(). See
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index baf17b381588..ad0bedf678b3 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -202,17 +202,13 @@ you must call __handle_sysrq_nolock instead.
202 202
203* I have more questions, who can I ask? 203* I have more questions, who can I ask?
204~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 204~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205You may feel free to send email to myrdraal@deathsdoor.com, and I will
206respond as soon as possible.
207 -Myrdraal
208
209And I'll answer any questions about the registration system you got, also 205And I'll answer any questions about the registration system you got, also
210responding as soon as possible. 206responding as soon as possible.
211 -Crutcher 207 -Crutcher
212 208
213* Credits 209* Credits
214~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 210~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215Written by Mydraal <myrdraal@deathsdoor.com> 211Written by Mydraal <vulpyne@vulpyne.net>
216Updated by Adam Sulmicki <adam@cfar.umd.edu> 212Updated by Adam Sulmicki <adam@cfar.umd.edu>
217Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59 213Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
218Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com> 214Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>