aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt81
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--drivers/char/keyboard.c38
-rw-r--r--drivers/input/evdev.c21
-rw-r--r--drivers/input/input.c11
-rw-r--r--drivers/input/keyboard/spitzkbd.c4
-rw-r--r--drivers/input/misc/wistron_btns.c30
-rw-r--r--drivers/input/mouse/psmouse-base.c4
-rw-r--r--drivers/input/touchscreen/ads7846.c414
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c2
-rw-r--r--include/linux/input.h109
-rw-r--r--include/linux/mod_devicetable.h48
-rw-r--r--include/linux/spi/ads7846.h7
-rw-r--r--include/sound/pcm.h6
-rw-r--r--include/sound/pcm_oss.h2
-rw-r--r--scripts/mod/file2alias.c36
-rw-r--r--sound/core/Kconfig12
-rw-r--r--sound/core/oss/pcm_oss.c8
-rw-r--r--sound/core/pcm.c12
-rw-r--r--sound/core/pcm_lib.c6
-rw-r--r--sound/core/pcm_memory.c8
-rw-r--r--sound/drivers/dummy.c14
-rw-r--r--sound/drivers/mpu401/mpu401.c14
-rw-r--r--sound/drivers/serial-u16550.c14
-rw-r--r--sound/drivers/virmidi.c14
-rw-r--r--sound/isa/opti9xx/miro.c3
-rw-r--r--sound/pci/ad1889.c3
-rw-r--r--sound/pci/ali5451/ali5451.c2
-rw-r--r--sound/pci/als300.c2
-rw-r--r--sound/pci/als4000.c2
-rw-r--r--sound/pci/atiixp.c2
-rw-r--r--sound/pci/atiixp_modem.c2
-rw-r--r--sound/pci/au88x0/au8810.c2
-rw-r--r--sound/pci/au88x0/au8820.c2
-rw-r--r--sound/pci/au88x0/au8830.c2
-rw-r--r--sound/pci/azt3328.c2
-rw-r--r--sound/pci/bt87x.c4
-rw-r--r--sound/pci/ca0106/ca0106_main.c2
-rw-r--r--sound/pci/cmipci.c2
-rw-r--r--sound/pci/cs4281.c2
-rw-r--r--sound/pci/cs46xx/cs46xx.c2
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c2
-rw-r--r--sound/pci/emu10k1/emu10k1.c2
-rw-r--r--sound/pci/emu10k1/emu10k1x.c3
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/es1938.c2
-rw-r--r--sound/pci/es1968.c3
-rw-r--r--sound/pci/fm801.c2
-rw-r--r--sound/pci/hda/hda_intel.c2
-rw-r--r--sound/pci/hda/patch_analog.c13
-rw-r--r--sound/pci/hda/patch_realtek.c1
-rw-r--r--sound/pci/hda/patch_sigmatel.c4
-rw-r--r--sound/pci/ice1712/ice1712.c3
-rw-r--r--sound/pci/ice1712/ice1724.c2
-rw-r--r--sound/pci/intel8x0.c8
-rw-r--r--sound/pci/intel8x0m.c2
-rw-r--r--sound/pci/korg1212/korg1212.c2
-rw-r--r--sound/pci/maestro3.c3
-rw-r--r--sound/pci/mixart/mixart.c3
-rw-r--r--sound/pci/nm256/nm256.c2
-rw-r--r--sound/pci/pcxhr/pcxhr.c3
-rw-r--r--sound/pci/pcxhr/pcxhr_hwdep.c4
-rw-r--r--sound/pci/riptide/riptide.c4
-rw-r--r--sound/pci/rme32.c2
-rw-r--r--sound/pci/rme96.c2
-rw-r--r--sound/pci/rme9652/hdsp.c2
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/pci/rme9652/rme9652.c2
-rw-r--r--sound/pci/sonicvibes.c2
-rw-r--r--sound/pci/trident/trident.c2
-rw-r--r--sound/pci/via82xx.c18
-rw-r--r--sound/pci/via82xx_modem.c2
-rw-r--r--sound/pci/vx222/vx222.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c2
-rw-r--r--sound/pcmcia/Kconfig4
-rw-r--r--sound/usb/usbquirks.h9
76 files changed, 751 insertions, 327 deletions
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index 4692c8e77dc1..b535c2a198f8 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -1,4 +1,4 @@
1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.2 1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.3
2 ======================================================== 2 ========================================================
3 3
4 Thibault Le Meur <Thibault.LeMeur@supelec.fr> 4 Thibault Le Meur <Thibault.LeMeur@supelec.fr>
@@ -22,16 +22,16 @@ The device has 4 audio interfaces, and 2 MIDI ports:
22 * Midi In (Mi) 22 * Midi In (Mi)
23 * Midi Out (Mo) 23 * Midi Out (Mo)
24 24
25The internal DAC/ADC has the following caracteristics: 25The internal DAC/ADC has the following characteristics:
26* sample depth of 16 or 24 bits 26* sample depth of 16 or 24 bits
27* sample rate from 8kHz to 96kHz 27* sample rate from 8kHz to 96kHz
28* Two ports can't use different sample depths at the same time.Moreover, the 28* Two ports can't use different sample depths at the same time. Moreover, the
29Audiophile USB documentation gives the following Warning: "Please exit any 29Audiophile USB documentation gives the following Warning: "Please exit any
30audio application running before switching between bit depths" 30audio application running before switching between bit depths"
31 31
32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be 32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
33activated at the same time depending on the audio mode selected: 33activated at the same time depending on the audio mode selected:
34 * 16-bit/48kHz ==> 4 channels in/ 4 channels out 34 * 16-bit/48kHz ==> 4 channels in/4 channels out
35 - Ai+Ao+Di+Do 35 - Ai+Ao+Di+Do
36 * 24-bit/48kHz ==> 4 channels in/2 channels out, 36 * 24-bit/48kHz ==> 4 channels in/2 channels out,
37 or 2 channels in/4 channels out 37 or 2 channels in/4 channels out
@@ -41,8 +41,8 @@ activated at the same time depending on the audio mode selected:
41 41
42Important facts about the Digital interface: 42Important facts about the Digital interface:
43-------------------------------------------- 43--------------------------------------------
44 * The Do port additionnaly supports surround-encoded AC-3 and DTS passthrough, 44 * The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
45though I haven't tested it under linux 45though I haven't tested it under Linux
46 - Note that in this setup only the Do interface can be enabled 46 - Note that in this setup only the Do interface can be enabled
47 * Apart from recording an audio digital stream, enabling the Di port is a way 47 * Apart from recording an audio digital stream, enabling the Di port is a way
48to synchronize the device to an external sample clock 48to synchronize the device to an external sample clock
@@ -60,24 +60,23 @@ synchronization error (for instance sound played at an odd sample rate)
60The Audiophile USB MIDI ports will be automatically supported once the 60The Audiophile USB MIDI ports will be automatically supported once the
61following modules have been loaded: 61following modules have been loaded:
62 * snd-usb-audio 62 * snd-usb-audio
63 * snd-seq
64 * snd-seq-midi 63 * snd-seq-midi
65 64
66No additionnal setting is required. 65No additional setting is required.
67 66
682.2 - Audio ports 672.2 - Audio ports
69----------------- 68-----------------
70 69
71Audio functions of the Audiophile USB device are handled by the snd-usb-audio 70Audio functions of the Audiophile USB device are handled by the snd-usb-audio
72module. This module can work in a default mode (without any device-specific 71module. This module can work in a default mode (without any device-specific
73parameter), or in an advanced mode with the device-specific parameter called 72parameter), or in an "advanced" mode with the device-specific parameter called
74"device_setup". 73"device_setup".
75 74
762.2.1 - Default Alsa driver mode 752.2.1 - Default Alsa driver mode
77 76
78The default behaviour of the snd-usb-audio driver is to parse the device 77The default behavior of the snd-usb-audio driver is to parse the device
79capabilities at startup and enable all functions inside the device (including 78capabilities at startup and enable all functions inside the device (including
80all ports at any sample rates and any sample depths supported). This approach 79all ports at any supported sample rates and sample depths). This approach
81has the advantage to let the driver easily switch from sample rates/depths 80has the advantage to let the driver easily switch from sample rates/depths
82automatically according to the need of the application claiming the device. 81automatically according to the need of the application claiming the device.
83 82
@@ -114,9 +113,9 @@ gain).
114For people having this problem, the snd-usb-audio module has a new module 113For people having this problem, the snd-usb-audio module has a new module
115parameter called "device_setup". 114parameter called "device_setup".
116 115
1172.2.2.1 - Initializing the working mode of the Audiohile USB 1162.2.2.1 - Initializing the working mode of the Audiophile USB
118 117
119As far as the Audiohile USB device is concerned, this value let the user 118As far as the Audiophile USB device is concerned, this value let the user
120specify: 119specify:
121 * the sample depth 120 * the sample depth
122 * the sample rate 121 * the sample rate
@@ -174,20 +173,20 @@ The parameter can be given:
174 173
175IMPORTANT NOTE WHEN SWITCHING CONFIGURATION: 174IMPORTANT NOTE WHEN SWITCHING CONFIGURATION:
176------------------------------------------- 175-------------------------------------------
177 * You may need to _first_ intialize the module with the correct device_setup 176 * You may need to _first_ initialize the module with the correct device_setup
178 parameter and _only_after_ turn on the Audiophile USB device 177 parameter and _only_after_ turn on the Audiophile USB device
179 * This is especially true when switching the sample depth: 178 * This is especially true when switching the sample depth:
180 - first trun off the device 179 - first turn off the device
181 - de-register the snd-usb-audio module 180 - de-register the snd-usb-audio module (modprobe -r)
182 - change the device_setup parameter (by either manually reprobing the module 181 - change the device_setup parameter by changing the device_setup
183 or changing modprobe.conf) 182 option in /etc/modprobe.conf
184 - turn on the device 183 - turn on the device
185 184
1862.2.2.3 - Audiophile USB's device_setup structure 1852.2.2.3 - Audiophile USB's device_setup structure
187 186
188If you want to understand the device_setup magic numbers for the Audiophile 187If you want to understand the device_setup magic numbers for the Audiophile
189USB, you need some very basic understanding of binary computation. However, 188USB, you need some very basic understanding of binary computation. However,
190this is not required to use the parameter and you may skip thi section. 189this is not required to use the parameter and you may skip this section.
191 190
192The device_setup is one byte long and its structure is the following: 191The device_setup is one byte long and its structure is the following:
193 192
@@ -231,11 +230,11 @@ Caution:
231 230
2322.2.3 - USB implementation details for this device 2312.2.3 - USB implementation details for this device
233 232
234You may safely skip this section if you're not interrested in driver 233You may safely skip this section if you're not interested in driver
235development. 234development.
236 235
237This section describes some internals aspect of the device and summarize the 236This section describes some internal aspects of the device and summarize the
238data I got by usb-snooping the windows and linux drivers. 237data I got by usb-snooping the windows and Linux drivers.
239 238
240The M-Audio Audiophile USB has 7 USB Interfaces: 239The M-Audio Audiophile USB has 7 USB Interfaces:
241a "USB interface": 240a "USB interface":
@@ -277,9 +276,9 @@ Here is a short description of the AltSettings capabilities:
277 - 16-bit depth, 8-48kHz sample mode 276 - 16-bit depth, 8-48kHz sample mode
278 - Synch playback (Do), audio format type III IEC1937_AC-3 277 - Synch playback (Do), audio format type III IEC1937_AC-3
279 278
280In order to ensure a correct intialization of the device, the driver 279In order to ensure a correct initialization of the device, the driver
281_must_know_ how the device will be used: 280_must_know_ how the device will be used:
282 * if DTS is choosen, only Interface 2 with AltSet nb.6 must be 281 * if DTS is chosen, only Interface 2 with AltSet nb.6 must be
283 registered 282 registered
284 * if 96KHz only AltSets nb.1 of each interface must be selected 283 * if 96KHz only AltSets nb.1 of each interface must be selected
285 * if samples are using 24bits/48KHz then AltSet 2 must me used if 284 * if samples are using 24bits/48KHz then AltSet 2 must me used if
@@ -290,7 +289,7 @@ _must_know_ how the device will be used:
290 is not connected 289 is not connected
291 290
292When device_setup is given as a parameter to the snd-usb-audio module, the 291When device_setup is given as a parameter to the snd-usb-audio module, the
293parse_audio_enpoint function uses a quirk called 292parse_audio_endpoints function uses a quirk called
294"audiophile_skip_setting_quirk" in order to prevent AltSettings not 293"audiophile_skip_setting_quirk" in order to prevent AltSettings not
295corresponding to device_setup from being registered in the driver. 294corresponding to device_setup from being registered in the driver.
296 295
@@ -317,9 +316,8 @@ However you may see the following warning message:
317using the "default" ALSA device. This is less efficient than it could be. 316using the "default" ALSA device. This is less efficient than it could be.
318Consider using a hardware device instead rather than using the plug layer." 317Consider using a hardware device instead rather than using the plug layer."
319 318
320
3213.2 - Patching alsa to use direct pcm device 3193.2 - Patching alsa to use direct pcm device
322------------------------------------------- 320--------------------------------------------
323A patch for Jack by Andreas Steinmetz adds support for Big Endian devices. 321A patch for Jack by Andreas Steinmetz adds support for Big Endian devices.
324However it has not been included in the CVS tree. 322However it has not been included in the CVS tree.
325 323
@@ -331,3 +329,32 @@ After having applied the patch you can run jackd with the following command
331line: 329line:
332 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1 330 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
333 331
3323.2 - Getting 2 input and/or output interfaces in Jack
333------------------------------------------------------
334
335As you can see, starting the Jack server this way will only enable 1 stereo
336input (Di or Ai) and 1 stereo output (Ao or Do).
337
338This is due to the following restrictions:
339* Jack can only open one capture device and one playback device at a time
340* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
341 (and optionally hw:1,2)
342If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
343combine the Alsa devices into one logical "complex" device.
344
345If you want to give it a try, I recommend reading the information from
346this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
347It is related to another device (ice1712) but can be adapted to suit
348the Audiophile USB.
349
350Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
351* patching Jack with the previously mentioned "Big Endian" patch
352* patching Jackd with the MMAP_COMPLEX patch (see the ice1712 page)
353* patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
354* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
355 file
356* start jackd with this device
357
358I had no success in testing this for now, but this may be due to my OS
359configuration. If you have any success with this kind of setup, please
360drop me an email.
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 68eeebc17ff4..1faf76383bab 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -1172,7 +1172,7 @@
1172 } 1172 }
1173 1173
1174 /* PCI IDs */ 1174 /* PCI IDs */
1175 static struct pci_device_id snd_mychip_ids[] = { 1175 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1178 .... 1178 ....
@@ -1565,7 +1565,7 @@
1565 <informalexample> 1565 <informalexample>
1566 <programlisting> 1566 <programlisting>
1567<![CDATA[ 1567<![CDATA[
1568 static struct pci_device_id snd_mychip_ids[] = { 1568 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1571 .... 1571 ....
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 935670a3cd98..5755b7e5f187 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -860,9 +860,32 @@ static void k_slock(struct vc_data *vc, unsigned char value, char up_flag, struc
860} 860}
861 861
862/* by default, 300ms interval for combination release */ 862/* by default, 300ms interval for combination release */
863static long brl_timeout = 300; 863static unsigned brl_timeout = 300;
864MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for combination on first release, < 0 for dead characters)"); 864MODULE_PARM_DESC(brl_timeout, "Braille keys release delay in ms (0 for commit on first key release)");
865module_param(brl_timeout, long, 0644); 865module_param(brl_timeout, uint, 0644);
866
867static unsigned brl_nbchords = 1;
868MODULE_PARM_DESC(brl_nbchords, "Number of chords that produce a braille pattern (0 for dead chords)");
869module_param(brl_nbchords, uint, 0644);
870
871static void k_brlcommit(struct vc_data *vc, unsigned int pattern, char up_flag, struct pt_regs *regs)
872{
873 static unsigned long chords;
874 static unsigned committed;
875
876 if (!brl_nbchords)
877 k_deadunicode(vc, BRL_UC_ROW | pattern, up_flag, regs);
878 else {
879 committed |= pattern;
880 chords++;
881 if (chords == brl_nbchords) {
882 k_unicode(vc, BRL_UC_ROW | committed, up_flag, regs);
883 chords = 0;
884 committed = 0;
885 }
886 }
887}
888
866static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs) 889static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct pt_regs *regs)
867{ 890{
868 static unsigned pressed,committing; 891 static unsigned pressed,committing;
@@ -882,11 +905,6 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
882 if (value > 8) 905 if (value > 8)
883 return; 906 return;
884 907
885 if (brl_timeout < 0) {
886 k_deadunicode(vc, BRL_UC_ROW | (1 << (value - 1)), up_flag, regs);
887 return;
888 }
889
890 if (up_flag) { 908 if (up_flag) {
891 if (brl_timeout) { 909 if (brl_timeout) {
892 if (!committing || 910 if (!committing ||
@@ -897,13 +915,13 @@ static void k_brl(struct vc_data *vc, unsigned char value, char up_flag, struct
897 pressed &= ~(1 << (value - 1)); 915 pressed &= ~(1 << (value - 1));
898 if (!pressed) { 916 if (!pressed) {
899 if (committing) { 917 if (committing) {
900 k_unicode(vc, BRL_UC_ROW | committing, 0, regs); 918 k_brlcommit(vc, committing, 0, regs);
901 committing = 0; 919 committing = 0;
902 } 920 }
903 } 921 }
904 } else { 922 } else {
905 if (committing) { 923 if (committing) {
906 k_unicode(vc, BRL_UC_ROW | committing, 0, regs); 924 k_brlcommit(vc, committing, 0, regs);
907 committing = 0; 925 committing = 0;
908 } 926 }
909 pressed &= ~(1 << (value - 1)); 927 pressed &= ~(1 << (value - 1));
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index a34e3d91d9ed..ba325f16d077 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -403,6 +403,27 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
403 case EVIOCGID: 403 case EVIOCGID:
404 if (copy_to_user(p, &dev->id, sizeof(struct input_id))) 404 if (copy_to_user(p, &dev->id, sizeof(struct input_id)))
405 return -EFAULT; 405 return -EFAULT;
406 return 0;
407
408 case EVIOCGREP:
409 if (!test_bit(EV_REP, dev->evbit))
410 return -ENOSYS;
411 if (put_user(dev->rep[REP_DELAY], ip))
412 return -EFAULT;
413 if (put_user(dev->rep[REP_PERIOD], ip + 1))
414 return -EFAULT;
415 return 0;
416
417 case EVIOCSREP:
418 if (!test_bit(EV_REP, dev->evbit))
419 return -ENOSYS;
420 if (get_user(u, ip))
421 return -EFAULT;
422 if (get_user(v, ip + 1))
423 return -EFAULT;
424
425 input_event(dev, EV_REP, REP_DELAY, u);
426 input_event(dev, EV_REP, REP_PERIOD, v);
406 427
407 return 0; 428 return 0;
408 429
diff --git a/drivers/input/input.c b/drivers/input/input.c
index a935abeffffc..3038c268917d 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -155,6 +155,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
155 if (code > SND_MAX || !test_bit(code, dev->sndbit)) 155 if (code > SND_MAX || !test_bit(code, dev->sndbit))
156 return; 156 return;
157 157
158 if (!!test_bit(code, dev->snd) != !!value)
159 change_bit(code, dev->snd);
160
158 if (dev->event) dev->event(dev, type, code, value); 161 if (dev->event) dev->event(dev, type, code, value);
159 162
160 break; 163 break;
@@ -286,19 +289,19 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
286 for (; id->flags || id->driver_info; id++) { 289 for (; id->flags || id->driver_info; id++) {
287 290
288 if (id->flags & INPUT_DEVICE_ID_MATCH_BUS) 291 if (id->flags & INPUT_DEVICE_ID_MATCH_BUS)
289 if (id->id.bustype != dev->id.bustype) 292 if (id->bustype != dev->id.bustype)
290 continue; 293 continue;
291 294
292 if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR) 295 if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
293 if (id->id.vendor != dev->id.vendor) 296 if (id->vendor != dev->id.vendor)
294 continue; 297 continue;
295 298
296 if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT) 299 if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
297 if (id->id.product != dev->id.product) 300 if (id->product != dev->id.product)
298 continue; 301 continue;
299 302
300 if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION) 303 if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
301 if (id->id.version != dev->id.version) 304 if (id->version != dev->id.version)
302 continue; 305 continue;
303 306
304 MATCH_BIT(evbit, EV_MAX); 307 MATCH_BIT(evbit, EV_MAX);
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index bc61cf8cfc65..1d238a9d52d6 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -53,8 +53,8 @@ static unsigned char spitzkbd_keycode[NR_SCANCODES] = {
53 KEY_LEFTCTRL, KEY_1, KEY_3, KEY_5, KEY_6, KEY_7, KEY_9, KEY_0, KEY_BACKSPACE, SPITZ_KEY_EXOK, SPITZ_KEY_EXCANCEL, 0, 0, 0, 0, 0, /* 1-16 */ 53 KEY_LEFTCTRL, KEY_1, KEY_3, KEY_5, KEY_6, KEY_7, KEY_9, KEY_0, KEY_BACKSPACE, SPITZ_KEY_EXOK, SPITZ_KEY_EXCANCEL, 0, 0, 0, 0, 0, /* 1-16 */
54 0, KEY_2, KEY_4, KEY_R, KEY_Y, KEY_8, KEY_I, KEY_O, KEY_P, SPITZ_KEY_EXJOGDOWN, SPITZ_KEY_EXJOGUP, 0, 0, 0, 0, 0, /* 17-32 */ 54 0, KEY_2, KEY_4, KEY_R, KEY_Y, KEY_8, KEY_I, KEY_O, KEY_P, SPITZ_KEY_EXJOGDOWN, SPITZ_KEY_EXJOGUP, 0, 0, 0, 0, 0, /* 17-32 */
55 KEY_TAB, KEY_Q, KEY_E, KEY_T, KEY_G, KEY_U, KEY_J, KEY_K, 0, 0, 0, 0, 0, 0, 0, 0, /* 33-48 */ 55 KEY_TAB, KEY_Q, KEY_E, KEY_T, KEY_G, KEY_U, KEY_J, KEY_K, 0, 0, 0, 0, 0, 0, 0, 0, /* 33-48 */
56 SPITZ_KEY_CALENDER, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */ 56 SPITZ_KEY_ADDRESS, KEY_W, KEY_S, KEY_F, KEY_V, KEY_H, KEY_M, KEY_L, 0, KEY_RIGHTSHIFT, 0, 0, 0, 0, 0, 0, /* 49-64 */
57 SPITZ_KEY_ADDRESS, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */ 57 SPITZ_KEY_CALENDER, KEY_A, KEY_D, KEY_C, KEY_B, KEY_N, KEY_DOT, 0, KEY_ENTER, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 65-80 */
58 SPITZ_KEY_MAIL, KEY_Z, KEY_X, KEY_MINUS, KEY_SPACE, KEY_COMMA, 0, KEY_UP, 0, 0, SPITZ_KEY_FN, 0, 0, 0, 0, 0, /* 81-96 */ 58 SPITZ_KEY_MAIL, KEY_Z, KEY_X, KEY_MINUS, KEY_SPACE, KEY_COMMA, 0, KEY_UP, 0, 0, SPITZ_KEY_FN, 0, 0, 0, 0, 0, /* 81-96 */
59 KEY_SYSRQ, SPITZ_KEY_JAP1, SPITZ_KEY_JAP2, SPITZ_KEY_CANCEL, SPITZ_KEY_OK, SPITZ_KEY_MENU, KEY_LEFT, KEY_DOWN, KEY_RIGHT, 0, 0, 0, 0, 0, 0, 0 /* 97-112 */ 59 KEY_SYSRQ, SPITZ_KEY_JAP1, SPITZ_KEY_JAP2, SPITZ_KEY_CANCEL, SPITZ_KEY_OK, SPITZ_KEY_MENU, KEY_LEFT, KEY_DOWN, KEY_RIGHT, 0, 0, 0, 0, 0, 0, 0 /* 97-112 */
60}; 60};
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 4b415d9b0123..36cd2e07fce8 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -273,6 +273,18 @@ static struct key_entry keymap_fs_amilo_pro_v2000[] = {
273 { KE_END, 0 } 273 { KE_END, 0 }
274}; 274};
275 275
276static struct key_entry keymap_fujitsu_n3510[] = {
277 { KE_KEY, 0x11, KEY_PROG1 },
278 { KE_KEY, 0x12, KEY_PROG2 },
279 { KE_KEY, 0x36, KEY_WWW },
280 { KE_KEY, 0x31, KEY_MAIL },
281 { KE_KEY, 0x71, KEY_STOPCD },
282 { KE_KEY, 0x72, KEY_PLAYPAUSE },
283 { KE_KEY, 0x74, KEY_REWIND },
284 { KE_KEY, 0x78, KEY_FORWARD },
285 { KE_END, 0 }
286};
287
276static struct key_entry keymap_wistron_ms2141[] = { 288static struct key_entry keymap_wistron_ms2141[] = {
277 { KE_KEY, 0x11, KEY_PROG1 }, 289 { KE_KEY, 0x11, KEY_PROG1 },
278 { KE_KEY, 0x12, KEY_PROG2 }, 290 { KE_KEY, 0x12, KEY_PROG2 },
@@ -323,6 +335,24 @@ static struct dmi_system_id dmi_ids[] = {
323 }, 335 },
324 { 336 {
325 .callback = dmi_matched, 337 .callback = dmi_matched,
338 .ident = "Fujitsu-Siemens Amilo M7400",
339 .matches = {
340 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
341 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M "),
342 },
343 .driver_data = keymap_fs_amilo_pro_v2000
344 },
345 {
346 .callback = dmi_matched,
347 .ident = "Fujitsu N3510",
348 .matches = {
349 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
350 DMI_MATCH(DMI_PRODUCT_NAME, "N3510"),
351 },
352 .driver_data = keymap_fujitsu_n3510
353 },
354 {
355 .callback = dmi_matched,
326 .ident = "Acer Aspire 1500", 356 .ident = "Acer Aspire 1500",
327 .matches = { 357 .matches = {
328 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 358 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 32d70ed8f41d..136321a2cfdb 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -302,8 +302,10 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
302 * Check if this is a new device announcement (0xAA 0x00) 302 * Check if this is a new device announcement (0xAA 0x00)
303 */ 303 */
304 if (unlikely(psmouse->packet[0] == PSMOUSE_RET_BAT && psmouse->pktcnt <= 2)) { 304 if (unlikely(psmouse->packet[0] == PSMOUSE_RET_BAT && psmouse->pktcnt <= 2)) {
305 if (psmouse->pktcnt == 1) 305 if (psmouse->pktcnt == 1) {
306 psmouse->last = jiffies;
306 goto out; 307 goto out;
308 }
307 309
308 if (psmouse->packet[1] == PSMOUSE_RET_ID) { 310 if (psmouse->packet[1] == PSMOUSE_RET_ID) {
309 __psmouse_set_state(psmouse, PSMOUSE_IGNORE); 311 __psmouse_set_state(psmouse, PSMOUSE_IGNORE);
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 46d1fec2cfd8..1494175ac6fe 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -2,6 +2,8 @@
2 * ADS7846 based touchscreen and sensor driver 2 * ADS7846 based touchscreen and sensor driver
3 * 3 *
4 * Copyright (c) 2005 David Brownell 4 * Copyright (c) 2005 David Brownell
5 * Copyright (c) 2006 Nokia Corporation
6 * Various changes: Imre Deak <imre.deak@nokia.com>
5 * 7 *
6 * Using code from: 8 * Using code from:
7 * - corgi_ts.c 9 * - corgi_ts.c
@@ -34,17 +36,25 @@
34 36
35 37
36/* 38/*
37 * This code has been lightly tested on an ads7846. 39 * This code has been tested on an ads7846 / N770 device.
38 * Support for ads7843 and ads7845 has only been stubbed in. 40 * Support for ads7843 and ads7845 has only been stubbed in.
39 * 41 *
40 * Not yet done: investigate the values reported. Are x/y/pressure 42 * Not yet done: How accurate are the temperature and voltage
41 * event values sane enough for X11? How accurate are the temperature 43 * readings? (System-specific calibration should support
42 * and voltage readings? (System-specific calibration should support
43 * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.) 44 * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.)
44 * 45 *
46 * IRQ handling needs a workaround because of a shortcoming in handling
47 * edge triggered IRQs on some platforms like the OMAP1/2. These
48 * platforms don't handle the ARM lazy IRQ disabling properly, thus we
49 * have to maintain our own SW IRQ disabled status. This should be
50 * removed as soon as the affected platform's IRQ handling is fixed.
51 *
45 * app note sbaa036 talks in more detail about accurate sampling... 52 * app note sbaa036 talks in more detail about accurate sampling...
46 * that ought to help in situations like LCDs inducing noise (which 53 * that ought to help in situations like LCDs inducing noise (which
47 * can also be helped by using synch signals) and more generally. 54 * can also be helped by using synch signals) and more generally.
55 * This driver tries to utilize the measures described in the app
56 * note. The strength of filtering can be set in the board-* specific
57 * files.
48 */ 58 */
49 59
50#define TS_POLL_PERIOD msecs_to_jiffies(10) 60#define TS_POLL_PERIOD msecs_to_jiffies(10)
@@ -61,6 +71,7 @@ struct ts_event {
61 __be16 x; 71 __be16 x;
62 __be16 y; 72 __be16 y;
63 __be16 z1, z2; 73 __be16 z1, z2;
74 int ignore;
64}; 75};
65 76
66struct ads7846 { 77struct ads7846 {
@@ -71,12 +82,23 @@ struct ads7846 {
71 u16 model; 82 u16 model;
72 u16 vref_delay_usecs; 83 u16 vref_delay_usecs;
73 u16 x_plate_ohms; 84 u16 x_plate_ohms;
85 u16 pressure_max;
74 86
75 u8 read_x, read_y, read_z1, read_z2; 87 u8 read_x, read_y, read_z1, read_z2, pwrdown;
88 u16 dummy; /* for the pwrdown read */
76 struct ts_event tc; 89 struct ts_event tc;
77 90
78 struct spi_transfer xfer[8]; 91 struct spi_transfer xfer[10];
79 struct spi_message msg; 92 struct spi_message msg[5];
93 struct spi_message *last_msg;
94 int msg_idx;
95 int read_cnt;
96 int read_rep;
97 int last_read;
98
99 u16 debounce_max;
100 u16 debounce_tol;
101 u16 debounce_rep;
80 102
81 spinlock_t lock; 103 spinlock_t lock;
82 struct timer_list timer; /* P: lock */ 104 struct timer_list timer; /* P: lock */
@@ -84,6 +106,9 @@ struct ads7846 {
84 unsigned pending:1; /* P: lock */ 106 unsigned pending:1; /* P: lock */
85// FIXME remove "irq_disabled" 107// FIXME remove "irq_disabled"
86 unsigned irq_disabled:1; /* P: lock */ 108 unsigned irq_disabled:1; /* P: lock */
109 unsigned disabled:1;
110
111 int (*get_pendown_state)(void);
87}; 112};
88 113
89/* leave chip selected when we're done, for quicker re-select? */ 114/* leave chip selected when we're done, for quicker re-select? */
@@ -125,7 +150,9 @@ struct ads7846 {
125#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON) 150#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON)
126#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON) 151#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
127#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON) 152#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
128#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_PDOWN) /* LAST */ 153
154#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_ADC_ON)
155#define PWRDOWN (READ_12BIT_DFR(y) | ADS_PD10_PDOWN) /* LAST */
129 156
130/* single-ended samples need to first power up reference voltage; 157/* single-ended samples need to first power up reference voltage;
131 * we leave both ADC and VREF powered 158 * we leave both ADC and VREF powered
@@ -152,6 +179,15 @@ struct ser_req {
152 struct spi_transfer xfer[6]; 179 struct spi_transfer xfer[6];
153}; 180};
154 181
182static void ads7846_enable(struct ads7846 *ts);
183static void ads7846_disable(struct ads7846 *ts);
184
185static int device_suspended(struct device *dev)
186{
187 struct ads7846 *ts = dev_get_drvdata(dev);
188 return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
189}
190
155static int ads7846_read12_ser(struct device *dev, unsigned command) 191static int ads7846_read12_ser(struct device *dev, unsigned command)
156{ 192{
157 struct spi_device *spi = to_spi_device(dev); 193 struct spi_device *spi = to_spi_device(dev);
@@ -164,7 +200,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
164 if (!req) 200 if (!req)
165 return -ENOMEM; 201 return -ENOMEM;
166 202
167 INIT_LIST_HEAD(&req->msg.transfers); 203 spi_message_init(&req->msg);
168 204
169 /* activate reference, so it has time to settle; */ 205 /* activate reference, so it has time to settle; */
170 req->ref_on = REF_ON; 206 req->ref_on = REF_ON;
@@ -204,8 +240,10 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
204 for (i = 0; i < 6; i++) 240 for (i = 0; i < 6; i++)
205 spi_message_add_tail(&req->xfer[i], &req->msg); 241 spi_message_add_tail(&req->xfer[i], &req->msg);
206 242
243 ts->irq_disabled = 1;
207 disable_irq(spi->irq); 244 disable_irq(spi->irq);
208 status = spi_sync(spi, &req->msg); 245 status = spi_sync(spi, &req->msg);
246 ts->irq_disabled = 0;
209 enable_irq(spi->irq); 247 enable_irq(spi->irq);
210 248
211 if (req->msg.status) 249 if (req->msg.status)
@@ -233,6 +271,52 @@ SHOW(temp1)
233SHOW(vaux) 271SHOW(vaux)
234SHOW(vbatt) 272SHOW(vbatt)
235 273
274static int is_pen_down(struct device *dev)
275{
276 struct ads7846 *ts = dev_get_drvdata(dev);
277
278 return ts->pendown;
279}
280
281static ssize_t ads7846_pen_down_show(struct device *dev,
282 struct device_attribute *attr, char *buf)
283{
284 return sprintf(buf, "%u\n", is_pen_down(dev));
285}
286
287static DEVICE_ATTR(pen_down, S_IRUGO, ads7846_pen_down_show, NULL);
288
289static ssize_t ads7846_disable_show(struct device *dev,
290 struct device_attribute *attr, char *buf)
291{
292 struct ads7846 *ts = dev_get_drvdata(dev);
293
294 return sprintf(buf, "%u\n", ts->disabled);
295}
296
297static ssize_t ads7846_disable_store(struct device *dev,
298 struct device_attribute *attr,
299 const char *buf, size_t count)
300{
301 struct ads7846 *ts = dev_get_drvdata(dev);
302 char *endp;
303 int i;
304
305 i = simple_strtoul(buf, &endp, 10);
306 spin_lock_irq(&ts->lock);
307
308 if (i)
309 ads7846_disable(ts);
310 else
311 ads7846_enable(ts);
312
313 spin_unlock_irq(&ts->lock);
314
315 return count;
316}
317
318static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
319
236/*--------------------------------------------------------------------------*/ 320/*--------------------------------------------------------------------------*/
237 321
238/* 322/*
@@ -264,7 +348,7 @@ static void ads7846_rx(void *ads)
264 if (x == MAX_12BIT) 348 if (x == MAX_12BIT)
265 x = 0; 349 x = 0;
266 350
267 if (x && z1 && ts->spi->dev.power.power_state.event == PM_EVENT_ON) { 351 if (likely(x && z1 && !device_suspended(&ts->spi->dev))) {
268 /* compute touch pressure resistance using equation #2 */ 352 /* compute touch pressure resistance using equation #2 */
269 Rt = z2; 353 Rt = z2;
270 Rt -= z1; 354 Rt -= z1;
@@ -275,6 +359,14 @@ static void ads7846_rx(void *ads)
275 } else 359 } else
276 Rt = 0; 360 Rt = 0;
277 361
362 /* Sample found inconsistent by debouncing or pressure is beyond
363 * the maximum. Don't report it to user space, repeat at least
364 * once more the measurement */
365 if (ts->tc.ignore || Rt > ts->pressure_max) {
366 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD);
367 return;
368 }
369
278 /* NOTE: "pendown" is inferred from pressure; we don't rely on 370 /* NOTE: "pendown" is inferred from pressure; we don't rely on
279 * being able to check nPENIRQ status, or "friendly" trigger modes 371 * being able to check nPENIRQ status, or "friendly" trigger modes
280 * (both-edges is much better than just-falling or low-level). 372 * (both-edges is much better than just-falling or low-level).
@@ -296,11 +388,13 @@ static void ads7846_rx(void *ads)
296 if (Rt) { 388 if (Rt) {
297 input_report_abs(input_dev, ABS_X, x); 389 input_report_abs(input_dev, ABS_X, x);
298 input_report_abs(input_dev, ABS_Y, y); 390 input_report_abs(input_dev, ABS_Y, y);
299 input_report_abs(input_dev, ABS_PRESSURE, Rt);
300 sync = 1; 391 sync = 1;
301 } 392 }
302 if (sync) 393
394 if (sync) {
395 input_report_abs(input_dev, ABS_PRESSURE, Rt);
303 input_sync(input_dev); 396 input_sync(input_dev);
397 }
304 398
305#ifdef VERBOSE 399#ifdef VERBOSE
306 if (Rt || ts->pendown) 400 if (Rt || ts->pendown)
@@ -308,80 +402,138 @@ static void ads7846_rx(void *ads)
308 x, y, Rt, Rt ? "" : " UP"); 402 x, y, Rt, Rt ? "" : " UP");
309#endif 403#endif
310 404
311 /* don't retrigger while we're suspended */
312 spin_lock_irqsave(&ts->lock, flags); 405 spin_lock_irqsave(&ts->lock, flags);
313 406
314 ts->pendown = (Rt != 0); 407 ts->pendown = (Rt != 0);
315 ts->pending = 0; 408 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD);
316 409
317 if (ts->spi->dev.power.power_state.event == PM_EVENT_ON) { 410 spin_unlock_irqrestore(&ts->lock, flags);
318 if (ts->pendown) 411}
319 mod_timer(&ts->timer, jiffies + TS_POLL_PERIOD); 412
320 else if (ts->irq_disabled) { 413static void ads7846_debounce(void *ads)
321 ts->irq_disabled = 0; 414{
322 enable_irq(ts->spi->irq); 415 struct ads7846 *ts = ads;
416 struct spi_message *m;
417 struct spi_transfer *t;
418 int val;
419 int status;
420
421 m = &ts->msg[ts->msg_idx];
422 t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list);
423 val = (*(u16 *)t->rx_buf) >> 3;
424 if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) {
425 /* Repeat it, if this was the first read or the read
426 * wasn't consistent enough. */
427 if (ts->read_cnt < ts->debounce_max) {
428 ts->last_read = val;
429 ts->read_cnt++;
430 } else {
431 /* Maximum number of debouncing reached and still
432 * not enough number of consistent readings. Abort
433 * the whole sample, repeat it in the next sampling
434 * period.
435 */
436 ts->tc.ignore = 1;
437 ts->read_cnt = 0;
438 /* Last message will contain ads7846_rx() as the
439 * completion function.
440 */
441 m = ts->last_msg;
323 } 442 }
443 /* Start over collecting consistent readings. */
444 ts->read_rep = 0;
445 } else {
446 if (++ts->read_rep > ts->debounce_rep) {
447 /* Got a good reading for this coordinate,
448 * go for the next one. */
449 ts->tc.ignore = 0;
450 ts->msg_idx++;
451 ts->read_cnt = 0;
452 ts->read_rep = 0;
453 m++;
454 } else
455 /* Read more values that are consistent. */
456 ts->read_cnt++;
324 } 457 }
325 458 status = spi_async(ts->spi, m);
326 spin_unlock_irqrestore(&ts->lock, flags); 459 if (status)
460 dev_err(&ts->spi->dev, "spi_async --> %d\n",
461 status);
327} 462}
328 463
329static void ads7846_timer(unsigned long handle) 464static void ads7846_timer(unsigned long handle)
330{ 465{
331 struct ads7846 *ts = (void *)handle; 466 struct ads7846 *ts = (void *)handle;
332 int status = 0; 467 int status = 0;
333 unsigned long flags; 468
469 spin_lock_irq(&ts->lock);
470
471 if (unlikely(ts->msg_idx && !ts->pendown)) {
472 /* measurment cycle ended */
473 if (!device_suspended(&ts->spi->dev)) {
474 ts->irq_disabled = 0;
475 enable_irq(ts->spi->irq);
476 }
477 ts->pending = 0;
478 ts->msg_idx = 0;
479 } else {
480 /* pen is still down, continue with the measurement */
481 ts->msg_idx = 0;
482 status = spi_async(ts->spi, &ts->msg[0]);
483 if (status)
484 dev_err(&ts->spi->dev, "spi_async --> %d\n", status);
485 }
486
487 spin_unlock_irq(&ts->lock);
488}
489
490static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs)
491{
492 struct ads7846 *ts = handle;
493 unsigned long flags;
334 494
335 spin_lock_irqsave(&ts->lock, flags); 495 spin_lock_irqsave(&ts->lock, flags);
336 if (!ts->pending) { 496 if (likely(ts->get_pendown_state())) {
337 ts->pending = 1;
338 if (!ts->irq_disabled) { 497 if (!ts->irq_disabled) {
498 /* REVISIT irq logic for many ARM chips has cloned a
499 * bug wherein disabling an irq in its handler won't
500 * work;(it's disabled lazily, and too late to work.
501 * until all their irq logic is fixed, we must shadow
502 * that state here.
503 */
339 ts->irq_disabled = 1; 504 ts->irq_disabled = 1;
340 disable_irq(ts->spi->irq); 505 disable_irq(ts->spi->irq);
506 ts->pending = 1;
507 mod_timer(&ts->timer, jiffies);
341 } 508 }
342 status = spi_async(ts->spi, &ts->msg);
343 if (status)
344 dev_err(&ts->spi->dev, "spi_async --> %d\n",
345 status);
346 } 509 }
347 spin_unlock_irqrestore(&ts->lock, flags); 510 spin_unlock_irqrestore(&ts->lock, flags);
348}
349 511
350static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs)
351{
352 ads7846_timer((unsigned long) handle);
353 return IRQ_HANDLED; 512 return IRQ_HANDLED;
354} 513}
355 514
356/*--------------------------------------------------------------------------*/ 515/*--------------------------------------------------------------------------*/
357 516
358static int 517/* Must be called with ts->lock held */
359ads7846_suspend(struct spi_device *spi, pm_message_t message) 518static void ads7846_disable(struct ads7846 *ts)
360{ 519{
361 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 520 if (ts->disabled)
362 unsigned long flags; 521 return;
363 522
364 spin_lock_irqsave(&ts->lock, flags); 523 ts->disabled = 1;
365
366 spi->dev.power.power_state = message;
367 524
368 /* are we waiting for IRQ, or polling? */ 525 /* are we waiting for IRQ, or polling? */
369 if (!ts->pendown) { 526 if (!ts->pending) {
370 if (!ts->irq_disabled) { 527 ts->irq_disabled = 1;
371 ts->irq_disabled = 1; 528 disable_irq(ts->spi->irq);
372 disable_irq(ts->spi->irq);
373 }
374 } else { 529 } else {
375 /* polling; force a final SPI completion; 530 /* the timer will run at least once more, and
376 * that will clean things up neatly 531 * leave everything in a clean state, IRQ disabled
377 */ 532 */
378 if (!ts->pending) 533 while (ts->pending) {
379 mod_timer(&ts->timer, jiffies); 534 spin_unlock_irq(&ts->lock);
380 535 msleep(1);
381 while (ts->pendown || ts->pending) { 536 spin_lock_irq(&ts->lock);
382 spin_unlock_irqrestore(&ts->lock, flags);
383 udelay(10);
384 spin_lock_irqsave(&ts->lock, flags);
385 } 537 }
386 } 538 }
387 539
@@ -389,17 +541,45 @@ ads7846_suspend(struct spi_device *spi, pm_message_t message)
389 * leave it that way after every request 541 * leave it that way after every request
390 */ 542 */
391 543
392 spin_unlock_irqrestore(&ts->lock, flags); 544}
545
546/* Must be called with ts->lock held */
547static void ads7846_enable(struct ads7846 *ts)
548{
549 if (!ts->disabled)
550 return;
551
552 ts->disabled = 0;
553 ts->irq_disabled = 0;
554 enable_irq(ts->spi->irq);
555}
556
557static int ads7846_suspend(struct spi_device *spi, pm_message_t message)
558{
559 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
560
561 spin_lock_irq(&ts->lock);
562
563 spi->dev.power.power_state = message;
564 ads7846_disable(ts);
565
566 spin_unlock_irq(&ts->lock);
567
393 return 0; 568 return 0;
569
394} 570}
395 571
396static int ads7846_resume(struct spi_device *spi) 572static int ads7846_resume(struct spi_device *spi)
397{ 573{
398 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 574 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
399 575
400 ts->irq_disabled = 0; 576 spin_lock_irq(&ts->lock);
401 enable_irq(ts->spi->irq); 577
402 spi->dev.power.power_state = PMSG_ON; 578 spi->dev.power.power_state = PMSG_ON;
579 ads7846_enable(ts);
580
581 spin_unlock_irq(&ts->lock);
582
403 return 0; 583 return 0;
404} 584}
405 585
@@ -408,6 +588,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
408 struct ads7846 *ts; 588 struct ads7846 *ts;
409 struct input_dev *input_dev; 589 struct input_dev *input_dev;
410 struct ads7846_platform_data *pdata = spi->dev.platform_data; 590 struct ads7846_platform_data *pdata = spi->dev.platform_data;
591 struct spi_message *m;
411 struct spi_transfer *x; 592 struct spi_transfer *x;
412 int err; 593 int err;
413 594
@@ -428,6 +609,11 @@ static int __devinit ads7846_probe(struct spi_device *spi)
428 return -EINVAL; 609 return -EINVAL;
429 } 610 }
430 611
612 if (pdata->get_pendown_state == NULL) {
613 dev_dbg(&spi->dev, "no get_pendown_state function?\n");
614 return -EINVAL;
615 }
616
431 /* We'd set the wordsize to 12 bits ... except that some controllers 617 /* We'd set the wordsize to 12 bits ... except that some controllers
432 * will then treat the 8 bit command words as 12 bits (and drop the 618 * will then treat the 8 bit command words as 12 bits (and drop the
433 * four MSBs of the 12 bit result). Result: inputs must be shifted 619 * four MSBs of the 12 bit result). Result: inputs must be shifted
@@ -451,9 +637,21 @@ static int __devinit ads7846_probe(struct spi_device *spi)
451 ts->timer.data = (unsigned long) ts; 637 ts->timer.data = (unsigned long) ts;
452 ts->timer.function = ads7846_timer; 638 ts->timer.function = ads7846_timer;
453 639
640 spin_lock_init(&ts->lock);
641
454 ts->model = pdata->model ? : 7846; 642 ts->model = pdata->model ? : 7846;
455 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100; 643 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
456 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; 644 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
645 ts->pressure_max = pdata->pressure_max ? : ~0;
646 if (pdata->debounce_max) {
647 ts->debounce_max = pdata->debounce_max;
648 ts->debounce_tol = pdata->debounce_tol;
649 ts->debounce_rep = pdata->debounce_rep;
650 if (ts->debounce_rep > ts->debounce_max + 1)
651 ts->debounce_rep = ts->debounce_max - 1;
652 } else
653 ts->debounce_tol = ~0;
654 ts->get_pendown_state = pdata->get_pendown_state;
457 655
458 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id); 656 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
459 657
@@ -477,60 +675,100 @@ static int __devinit ads7846_probe(struct spi_device *spi)
477 /* set up the transfers to read touchscreen state; this assumes we 675 /* set up the transfers to read touchscreen state; this assumes we
478 * use formula #2 for pressure, not #3. 676 * use formula #2 for pressure, not #3.
479 */ 677 */
480 INIT_LIST_HEAD(&ts->msg.transfers); 678 m = &ts->msg[0];
481 x = ts->xfer; 679 x = ts->xfer;
482 680
681 spi_message_init(m);
682
483 /* y- still on; turn on only y+ (and ADC) */ 683 /* y- still on; turn on only y+ (and ADC) */
484 ts->read_y = READ_Y; 684 ts->read_y = READ_Y;
485 x->tx_buf = &ts->read_y; 685 x->tx_buf = &ts->read_y;
486 x->len = 1; 686 x->len = 1;
487 spi_message_add_tail(x, &ts->msg); 687 spi_message_add_tail(x, m);
488 688
489 x++; 689 x++;
490 x->rx_buf = &ts->tc.y; 690 x->rx_buf = &ts->tc.y;
491 x->len = 2; 691 x->len = 2;
492 spi_message_add_tail(x, &ts->msg); 692 spi_message_add_tail(x, m);
693
694 m->complete = ads7846_debounce;
695 m->context = ts;
696
697 m++;
698 spi_message_init(m);
699
700 /* turn y- off, x+ on, then leave in lowpower */
701 x++;
702 ts->read_x = READ_X;
703 x->tx_buf = &ts->read_x;
704 x->len = 1;
705 spi_message_add_tail(x, m);
706
707 x++;
708 x->rx_buf = &ts->tc.x;
709 x->len = 2;
710 spi_message_add_tail(x, m);
711
712 m->complete = ads7846_debounce;
713 m->context = ts;
493 714
494 /* turn y+ off, x- on; we'll use formula #2 */ 715 /* turn y+ off, x- on; we'll use formula #2 */
495 if (ts->model == 7846) { 716 if (ts->model == 7846) {
717 m++;
718 spi_message_init(m);
719
496 x++; 720 x++;
497 ts->read_z1 = READ_Z1; 721 ts->read_z1 = READ_Z1;
498 x->tx_buf = &ts->read_z1; 722 x->tx_buf = &ts->read_z1;
499 x->len = 1; 723 x->len = 1;
500 spi_message_add_tail(x, &ts->msg); 724 spi_message_add_tail(x, m);
501 725
502 x++; 726 x++;
503 x->rx_buf = &ts->tc.z1; 727 x->rx_buf = &ts->tc.z1;
504 x->len = 2; 728 x->len = 2;
505 spi_message_add_tail(x, &ts->msg); 729 spi_message_add_tail(x, m);
730
731 m->complete = ads7846_debounce;
732 m->context = ts;
733
734 m++;
735 spi_message_init(m);
506 736
507 x++; 737 x++;
508 ts->read_z2 = READ_Z2; 738 ts->read_z2 = READ_Z2;
509 x->tx_buf = &ts->read_z2; 739 x->tx_buf = &ts->read_z2;
510 x->len = 1; 740 x->len = 1;
511 spi_message_add_tail(x, &ts->msg); 741 spi_message_add_tail(x, m);
512 742
513 x++; 743 x++;
514 x->rx_buf = &ts->tc.z2; 744 x->rx_buf = &ts->tc.z2;
515 x->len = 2; 745 x->len = 2;
516 spi_message_add_tail(x, &ts->msg); 746 spi_message_add_tail(x, m);
747
748 m->complete = ads7846_debounce;
749 m->context = ts;
517 } 750 }
518 751
519 /* turn y- off, x+ on, then leave in lowpower */ 752 /* power down */
753 m++;
754 spi_message_init(m);
755
520 x++; 756 x++;
521 ts->read_x = READ_X; 757 ts->pwrdown = PWRDOWN;
522 x->tx_buf = &ts->read_x; 758 x->tx_buf = &ts->pwrdown;
523 x->len = 1; 759 x->len = 1;
524 spi_message_add_tail(x, &ts->msg); 760 spi_message_add_tail(x, m);
525 761
526 x++; 762 x++;
527 x->rx_buf = &ts->tc.x; 763 x->rx_buf = &ts->dummy;
528 x->len = 2; 764 x->len = 2;
529 CS_CHANGE(*x); 765 CS_CHANGE(*x);
530 spi_message_add_tail(x, &ts->msg); 766 spi_message_add_tail(x, m);
531 767
532 ts->msg.complete = ads7846_rx; 768 m->complete = ads7846_rx;
533 ts->msg.context = ts; 769 m->context = ts;
770
771 ts->last_msg = m;
534 772
535 if (request_irq(spi->irq, ads7846_irq, 773 if (request_irq(spi->irq, ads7846_irq,
536 SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, 774 SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING,
@@ -559,13 +797,27 @@ static int __devinit ads7846_probe(struct spi_device *spi)
559 device_create_file(&spi->dev, &dev_attr_vbatt); 797 device_create_file(&spi->dev, &dev_attr_vbatt);
560 device_create_file(&spi->dev, &dev_attr_vaux); 798 device_create_file(&spi->dev, &dev_attr_vaux);
561 799
800 device_create_file(&spi->dev, &dev_attr_pen_down);
801
802 device_create_file(&spi->dev, &dev_attr_disable);
803
562 err = input_register_device(input_dev); 804 err = input_register_device(input_dev);
563 if (err) 805 if (err)
564 goto err_free_irq; 806 goto err_remove_attr;
565 807
566 return 0; 808 return 0;
567 809
568 err_free_irq: 810 err_remove_attr:
811 device_remove_file(&spi->dev, &dev_attr_disable);
812 device_remove_file(&spi->dev, &dev_attr_pen_down);
813 if (ts->model == 7846) {
814 device_remove_file(&spi->dev, &dev_attr_temp1);
815 device_remove_file(&spi->dev, &dev_attr_temp0);
816 }
817 if (ts->model != 7845)
818 device_remove_file(&spi->dev, &dev_attr_vbatt);
819 device_remove_file(&spi->dev, &dev_attr_vaux);
820
569 free_irq(spi->irq, ts); 821 free_irq(spi->irq, ts);
570 err_free_mem: 822 err_free_mem:
571 input_free_device(input_dev); 823 input_free_device(input_dev);
@@ -577,20 +829,24 @@ static int __devexit ads7846_remove(struct spi_device *spi)
577{ 829{
578 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 830 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
579 831
832 input_unregister_device(ts->input);
833
580 ads7846_suspend(spi, PMSG_SUSPEND); 834 ads7846_suspend(spi, PMSG_SUSPEND);
581 free_irq(ts->spi->irq, ts);
582 if (ts->irq_disabled)
583 enable_irq(ts->spi->irq);
584 835
836 device_remove_file(&spi->dev, &dev_attr_disable);
837 device_remove_file(&spi->dev, &dev_attr_pen_down);
585 if (ts->model == 7846) { 838 if (ts->model == 7846) {
586 device_remove_file(&spi->dev, &dev_attr_temp0);
587 device_remove_file(&spi->dev, &dev_attr_temp1); 839 device_remove_file(&spi->dev, &dev_attr_temp1);
840 device_remove_file(&spi->dev, &dev_attr_temp0);
588 } 841 }
589 if (ts->model != 7845) 842 if (ts->model != 7845)
590 device_remove_file(&spi->dev, &dev_attr_vbatt); 843 device_remove_file(&spi->dev, &dev_attr_vbatt);
591 device_remove_file(&spi->dev, &dev_attr_vaux); 844 device_remove_file(&spi->dev, &dev_attr_vaux);
592 845
593 input_unregister_device(ts->input); 846 free_irq(ts->spi->irq, ts);
847 /* suspend left the IRQ disabled */
848 enable_irq(ts->spi->irq);
849
594 kfree(ts); 850 kfree(ts);
595 851
596 dev_dbg(&spi->dev, "unregistered touchscreen\n"); 852 dev_dbg(&spi->dev, "unregistered touchscreen\n");
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index f9d87b86492c..320b3d9384ba 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -616,7 +616,7 @@ static struct snd_kcontrol_new snd_cx88_capture_volume = {
616 * Only boards with eeprom and byte 1 at eeprom=1 have it 616 * Only boards with eeprom and byte 1 at eeprom=1 have it
617 */ 617 */
618 618
619static struct pci_device_id cx88_audio_pci_tbl[] = { 619static struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = {
620 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 620 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
621 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 621 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
622 {0, } 622 {0, }
diff --git a/include/linux/input.h b/include/linux/input.h
index b0e612dda0cf..50e338d2ffda 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,8 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#else 15#else
18#include <sys/time.h> 16#include <sys/time.h>
19#include <sys/ioctl.h> 17#include <sys/ioctl.h>
@@ -58,6 +56,8 @@ struct input_absinfo {
58 56
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 57#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 58#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
59#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
60#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
63 63
@@ -577,15 +577,15 @@ struct input_absinfo {
577 * Switch events 577 * Switch events
578 */ 578 */
579 579
580#define SW_0 0x00 580#define SW_0 0x00
581#define SW_1 0x01 581#define SW_1 0x01
582#define SW_2 0x02 582#define SW_2 0x02
583#define SW_3 0x03 583#define SW_3 0x03
584#define SW_4 0x04 584#define SW_4 0x04
585#define SW_5 0x05 585#define SW_5 0x05
586#define SW_6 0x06 586#define SW_6 0x06
587#define SW_7 0x07 587#define SW_7 0x07
588#define SW_MAX 0x0f 588#define SW_MAX 0x0f
589 589
590/* 590/*
591 * Misc events 591 * Misc events
@@ -805,52 +805,16 @@ struct ff_effect {
805 805
806#define FF_MAX 0x7f 806#define FF_MAX 0x7f
807 807
808struct input_device_id {
809
810 kernel_ulong_t flags;
811
812 struct input_id id;
813
814 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
815 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
816 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
817 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
818 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
819 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
820 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
821 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
822 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
823
824 kernel_ulong_t driver_info;
825};
826
827/*
828 * Structure for hotplug & device<->driver matching.
829 */
830
831#define INPUT_DEVICE_ID_MATCH_BUS 1
832#define INPUT_DEVICE_ID_MATCH_VENDOR 2
833#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
834#define INPUT_DEVICE_ID_MATCH_VERSION 8
835
836#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
837#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
838#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
839#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
840#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
841#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
842#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
843#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
844#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
845
846#ifdef __KERNEL__ 808#ifdef __KERNEL__
847 809
848/* 810/*
849 * In-kernel definitions. 811 * In-kernel definitions.
850 */ 812 */
851 813
814#include <linux/device.h>
852#include <linux/fs.h> 815#include <linux/fs.h>
853#include <linux/timer.h> 816#include <linux/timer.h>
817#include <linux/mod_devicetable.h>
854 818
855#define NBITS(x) (((x)/BITS_PER_LONG)+1) 819#define NBITS(x) (((x)/BITS_PER_LONG)+1)
856#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 820#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
@@ -951,9 +915,49 @@ struct input_dev {
951}; 915};
952#define to_input_dev(d) container_of(d, struct input_dev, cdev) 916#define to_input_dev(d) container_of(d, struct input_dev, cdev)
953 917
954#define INPUT_DEVICE_ID_MATCH_DEVICE\ 918/*
919 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
920 */
921
922#if EV_MAX != INPUT_DEVICE_ID_EV_MAX
923#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
924#endif
925
926#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
927#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
928#endif
929
930#if REL_MAX != INPUT_DEVICE_ID_REL_MAX
931#error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
932#endif
933
934#if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
935#error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
936#endif
937
938#if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
939#error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
940#endif
941
942#if LED_MAX != INPUT_DEVICE_ID_LED_MAX
943#error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
944#endif
945
946#if SND_MAX != INPUT_DEVICE_ID_SND_MAX
947#error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
948#endif
949
950#if FF_MAX != INPUT_DEVICE_ID_FF_MAX
951#error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
952#endif
953
954#if SW_MAX != INPUT_DEVICE_ID_SW_MAX
955#error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
956#endif
957
958#define INPUT_DEVICE_ID_MATCH_DEVICE \
955 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 959 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
956#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 960#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
957 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 961 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
958 962
959struct input_handle; 963struct input_handle;
@@ -1016,7 +1020,8 @@ static inline void input_put_device(struct input_dev *dev)
1016 1020
1017static inline void input_free_device(struct input_dev *dev) 1021static inline void input_free_device(struct input_dev *dev)
1018{ 1022{
1019 input_put_device(dev); 1023 if (dev)
1024 input_put_device(dev);
1020} 1025}
1021 1026
1022int input_register_device(struct input_dev *); 1027int input_register_device(struct input_dev *);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7b08c11ec4cc..f6977708585c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -249,4 +249,52 @@ struct i2c_device_id {
249 __u16 id; 249 __u16 id;
250}; 250};
251 251
252/* Input */
253#define INPUT_DEVICE_ID_EV_MAX 0x1f
254#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
255#define INPUT_DEVICE_ID_REL_MAX 0x0f
256#define INPUT_DEVICE_ID_ABS_MAX 0x3f
257#define INPUT_DEVICE_ID_MSC_MAX 0x07
258#define INPUT_DEVICE_ID_LED_MAX 0x0f
259#define INPUT_DEVICE_ID_SND_MAX 0x07
260#define INPUT_DEVICE_ID_FF_MAX 0x7f
261#define INPUT_DEVICE_ID_SW_MAX 0x0f
262
263#define INPUT_DEVICE_ID_MATCH_BUS 1
264#define INPUT_DEVICE_ID_MATCH_VENDOR 2
265#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
266#define INPUT_DEVICE_ID_MATCH_VERSION 8
267
268#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
269#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
270#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
271#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
272#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
273#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
274#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
275#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
276#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
277
278struct input_device_id {
279
280 kernel_ulong_t flags;
281
282 __u16 bustype;
283 __u16 vendor;
284 __u16 product;
285 __u16 version;
286
287 kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
288 kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
289 kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
290 kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
291 kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
292 kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
293 kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
294 kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
295 kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
296
297 kernel_ulong_t driver_info;
298};
299
252#endif /* LINUX_MOD_DEVICETABLE_H */ 300#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 72261e0f2ac1..adb3dafd33e9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -14,5 +14,12 @@ struct ads7846_platform_data {
14 u16 x_min, x_max; 14 u16 x_min, x_max;
15 u16 y_min, y_max; 15 u16 y_min, y_max;
16 u16 pressure_min, pressure_max; 16 u16 pressure_min, pressure_max;
17
18 u16 debounce_max; /* max number of additional readings
19 * per sample */
20 u16 debounce_tol; /* tolerance used for filtering */
21 u16 debounce_rep; /* additional consecutive good readings
22 * required after the first two */
23 int (*get_pendown_state)(void);
17}; 24};
18 25
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index df70e7592ab5..373425895faa 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -374,12 +374,14 @@ struct snd_pcm_substream {
374 /* -- OSS things -- */ 374 /* -- OSS things -- */
375 struct snd_pcm_oss_substream oss; 375 struct snd_pcm_oss_substream oss;
376#endif 376#endif
377#ifdef CONFIG_SND_VERBOSE_PROCFS
377 struct snd_info_entry *proc_root; 378 struct snd_info_entry *proc_root;
378 struct snd_info_entry *proc_info_entry; 379 struct snd_info_entry *proc_info_entry;
379 struct snd_info_entry *proc_hw_params_entry; 380 struct snd_info_entry *proc_hw_params_entry;
380 struct snd_info_entry *proc_sw_params_entry; 381 struct snd_info_entry *proc_sw_params_entry;
381 struct snd_info_entry *proc_status_entry; 382 struct snd_info_entry *proc_status_entry;
382 struct snd_info_entry *proc_prealloc_entry; 383 struct snd_info_entry *proc_prealloc_entry;
384#endif
383 /* misc flags */ 385 /* misc flags */
384 unsigned int no_mmap_ctrl: 1; 386 unsigned int no_mmap_ctrl: 1;
385 unsigned int hw_opened: 1; 387 unsigned int hw_opened: 1;
@@ -400,12 +402,14 @@ struct snd_pcm_str {
400 struct snd_pcm_oss_stream oss; 402 struct snd_pcm_oss_stream oss;
401#endif 403#endif
402 struct snd_pcm_file *files; 404 struct snd_pcm_file *files;
405#ifdef CONFIG_SND_VERBOSE_PROCFS
403 struct snd_info_entry *proc_root; 406 struct snd_info_entry *proc_root;
404 struct snd_info_entry *proc_info_entry; 407 struct snd_info_entry *proc_info_entry;
405#ifdef CONFIG_SND_DEBUG 408#ifdef CONFIG_SND_PCM_XRUN_DEBUG
406 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ 409 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
407 struct snd_info_entry *proc_xrun_debug_entry; 410 struct snd_info_entry *proc_xrun_debug_entry;
408#endif 411#endif
412#endif
409}; 413};
410 414
411struct snd_pcm { 415struct snd_pcm {
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 39df2baca18a..c854647b6f3c 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -75,7 +75,9 @@ struct snd_pcm_oss_substream {
75struct snd_pcm_oss_stream { 75struct snd_pcm_oss_stream {
76 struct snd_pcm_oss_setup *setup_list; /* setup list */ 76 struct snd_pcm_oss_setup *setup_list; /* setup list */
77 struct mutex setup_mutex; 77 struct mutex setup_mutex;
78#ifdef CONFIG_SND_VERBOSE_PROCFS
78 struct snd_info_entry *proc_entry; 79 struct snd_info_entry *proc_entry;
80#endif
79}; 81};
80 82
81struct snd_pcm_oss { 83struct snd_pcm_oss {
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 84e21201f3c0..37f67c23e11b 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -374,10 +374,10 @@ static void do_input(char *alias,
374 kernel_ulong_t *arr, unsigned int min, unsigned int max) 374 kernel_ulong_t *arr, unsigned int min, unsigned int max)
375{ 375{
376 unsigned int i; 376 unsigned int i;
377 for (i = min; i < max; i++) { 377
378 if (arr[i/BITS_PER_LONG] & (1 << (i%BITS_PER_LONG))) 378 for (i = min; i < max; i++)
379 sprintf(alias+strlen(alias), "%X,*", i); 379 if (arr[i / BITS_PER_LONG] & (1 << (i%BITS_PER_LONG)))
380 } 380 sprintf(alias + strlen(alias), "%X,*", i);
381} 381}
382 382
383/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */ 383/* input:b0v0p0e0-eXkXrXaXmXlXsXfXwX where X is comma-separated %02X. */
@@ -386,39 +386,37 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
386{ 386{
387 sprintf(alias, "input:"); 387 sprintf(alias, "input:");
388 388
389 ADD(alias, "b", id->flags&INPUT_DEVICE_ID_MATCH_BUS, id->id.bustype); 389 ADD(alias, "b", id->flags & INPUT_DEVICE_ID_MATCH_BUS, id->bustype);
390 ADD(alias, "v", id->flags&INPUT_DEVICE_ID_MATCH_VENDOR, id->id.vendor); 390 ADD(alias, "v", id->flags & INPUT_DEVICE_ID_MATCH_VENDOR, id->vendor);
391 ADD(alias, "p", id->flags&INPUT_DEVICE_ID_MATCH_PRODUCT, 391 ADD(alias, "p", id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT, id->product);
392 id->id.product); 392 ADD(alias, "e", id->flags & INPUT_DEVICE_ID_MATCH_VERSION, id->version);
393 ADD(alias, "e", id->flags&INPUT_DEVICE_ID_MATCH_VERSION,
394 id->id.version);
395 393
396 sprintf(alias + strlen(alias), "-e*"); 394 sprintf(alias + strlen(alias), "-e*");
397 if (id->flags&INPUT_DEVICE_ID_MATCH_EVBIT) 395 if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT)
398 do_input(alias, id->evbit, 0, EV_MAX); 396 do_input(alias, id->evbit, 0, EV_MAX);
399 sprintf(alias + strlen(alias), "k*"); 397 sprintf(alias + strlen(alias), "k*");
400 if (id->flags&INPUT_DEVICE_ID_MATCH_KEYBIT) 398 if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT)
401 do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX); 399 do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX);
402 sprintf(alias + strlen(alias), "r*"); 400 sprintf(alias + strlen(alias), "r*");
403 if (id->flags&INPUT_DEVICE_ID_MATCH_RELBIT) 401 if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT)
404 do_input(alias, id->relbit, 0, REL_MAX); 402 do_input(alias, id->relbit, 0, REL_MAX);
405 sprintf(alias + strlen(alias), "a*"); 403 sprintf(alias + strlen(alias), "a*");
406 if (id->flags&INPUT_DEVICE_ID_MATCH_ABSBIT) 404 if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT)
407 do_input(alias, id->absbit, 0, ABS_MAX); 405 do_input(alias, id->absbit, 0, ABS_MAX);
408 sprintf(alias + strlen(alias), "m*"); 406 sprintf(alias + strlen(alias), "m*");
409 if (id->flags&INPUT_DEVICE_ID_MATCH_MSCIT) 407 if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT)
410 do_input(alias, id->mscbit, 0, MSC_MAX); 408 do_input(alias, id->mscbit, 0, MSC_MAX);
411 sprintf(alias + strlen(alias), "l*"); 409 sprintf(alias + strlen(alias), "l*");
412 if (id->flags&INPUT_DEVICE_ID_MATCH_LEDBIT) 410 if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT)
413 do_input(alias, id->ledbit, 0, LED_MAX); 411 do_input(alias, id->ledbit, 0, LED_MAX);
414 sprintf(alias + strlen(alias), "s*"); 412 sprintf(alias + strlen(alias), "s*");
415 if (id->flags&INPUT_DEVICE_ID_MATCH_SNDBIT) 413 if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT)
416 do_input(alias, id->sndbit, 0, SND_MAX); 414 do_input(alias, id->sndbit, 0, SND_MAX);
417 sprintf(alias + strlen(alias), "f*"); 415 sprintf(alias + strlen(alias), "f*");
418 if (id->flags&INPUT_DEVICE_ID_MATCH_FFBIT) 416 if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT)
419 do_input(alias, id->ffbit, 0, FF_MAX); 417 do_input(alias, id->ffbit, 0, FF_MAX);
420 sprintf(alias + strlen(alias), "w*"); 418 sprintf(alias + strlen(alias), "w*");
421 if (id->flags&INPUT_DEVICE_ID_MATCH_SWBIT) 419 if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT)
422 do_input(alias, id->swbit, 0, SW_MAX); 420 do_input(alias, id->swbit, 0, SW_MAX);
423 return 1; 421 return 1;
424} 422}
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index 8efc1b12f3a8..4262a1c87731 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -142,7 +142,7 @@ config SND_SUPPORT_OLD_API
142 142
143config SND_VERBOSE_PROCFS 143config SND_VERBOSE_PROCFS
144 bool "Verbose procfs contents" 144 bool "Verbose procfs contents"
145 depends on SND 145 depends on SND && PROC_FS
146 default y 146 default y
147 help 147 help
148 Say Y here to include code for verbose procfs contents (provides 148 Say Y here to include code for verbose procfs contents (provides
@@ -171,3 +171,13 @@ config SND_DEBUG_DETECT
171 help 171 help
172 Say Y here to enable extra-verbose log messages printed when 172 Say Y here to enable extra-verbose log messages printed when
173 detecting devices. 173 detecting devices.
174
175config SND_PCM_XRUN_DEBUG
176 bool "Enable PCM ring buffer overrun/underrun debugging"
177 default n
178 depends on SND_DEBUG && SND_VERBOSE_PROCFS
179 help
180 Say Y to enable the PCM ring buffer overrun/underrun debugging.
181 It is usually not required, but if you have trouble with
182 sound clicking when system is loaded, it may help to determine
183 the process or driver which causes the scheduling gaps.
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index c5978d6c6080..ac990bf0b48f 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1242,6 +1242,8 @@ static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int for
1242 1242
1243 if (format != AFMT_QUERY) { 1243 if (format != AFMT_QUERY) {
1244 formats = snd_pcm_oss_get_formats(pcm_oss_file); 1244 formats = snd_pcm_oss_get_formats(pcm_oss_file);
1245 if (formats < 0)
1246 return formats;
1245 if (!(formats & format)) 1247 if (!(formats & format))
1246 format = AFMT_U8; 1248 format = AFMT_U8;
1247 for (idx = 1; idx >= 0; --idx) { 1249 for (idx = 1; idx >= 0; --idx) {
@@ -2212,7 +2214,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2212 return 0; 2214 return 0;
2213} 2215}
2214 2216
2215#ifdef CONFIG_PROC_FS 2217#ifdef CONFIG_SND_VERBOSE_PROCFS
2216/* 2218/*
2217 * /proc interface 2219 * /proc interface
2218 */ 2220 */
@@ -2366,10 +2368,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
2366 } 2368 }
2367 } 2369 }
2368} 2370}
2369#else /* !CONFIG_PROC_FS */ 2371#else /* !CONFIG_SND_VERBOSE_PROCFS */
2370#define snd_pcm_oss_proc_init(pcm) 2372#define snd_pcm_oss_proc_init(pcm)
2371#define snd_pcm_oss_proc_done(pcm) 2373#define snd_pcm_oss_proc_done(pcm)
2372#endif /* CONFIG_PROC_FS */ 2374#endif /* CONFIG_SND_VERBOSE_PROCFS */
2373 2375
2374/* 2376/*
2375 * ENTRY functions 2377 * ENTRY functions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 122e10a61ab9..84b00038236d 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -142,7 +142,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,
142 return -ENOIOCTLCMD; 142 return -ENOIOCTLCMD;
143} 143}
144 144
145#if defined(CONFIG_PROC_FS) && defined(CONFIG_SND_VERBOSE_PROCFS) 145#ifdef CONFIG_SND_VERBOSE_PROCFS
146 146
147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v 147#define STATE(v) [SNDRV_PCM_STATE_##v] = #v
148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v 148#define STREAM(v) [SNDRV_PCM_STREAM_##v] = #v
@@ -436,7 +436,7 @@ static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
436 snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); 436 snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr);
437} 437}
438 438
439#ifdef CONFIG_SND_DEBUG 439#ifdef CONFIG_SND_PCM_XRUN_DEBUG
440static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry, 440static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry,
441 struct snd_info_buffer *buffer) 441 struct snd_info_buffer *buffer)
442{ 442{
@@ -480,7 +480,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
480 } 480 }
481 pstr->proc_info_entry = entry; 481 pstr->proc_info_entry = entry;
482 482
483#ifdef CONFIG_SND_DEBUG 483#ifdef CONFIG_SND_PCM_XRUN_DEBUG
484 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", 484 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
485 pstr->proc_root)) != NULL) { 485 pstr->proc_root)) != NULL) {
486 entry->c.text.read_size = 64; 486 entry->c.text.read_size = 64;
@@ -501,7 +501,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
501 501
502static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) 502static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr)
503{ 503{
504#ifdef CONFIG_SND_DEBUG 504#ifdef CONFIG_SND_PCM_XRUN_DEBUG
505 if (pstr->proc_xrun_debug_entry) { 505 if (pstr->proc_xrun_debug_entry) {
506 snd_info_unregister(pstr->proc_xrun_debug_entry); 506 snd_info_unregister(pstr->proc_xrun_debug_entry);
507 pstr->proc_xrun_debug_entry = NULL; 507 pstr->proc_xrun_debug_entry = NULL;
@@ -599,12 +599,12 @@ static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
599 } 599 }
600 return 0; 600 return 0;
601} 601}
602#else /* !CONFIG_PROC_FS */ 602#else /* !CONFIG_SND_VERBOSE_PROCFS */
603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; } 603static inline int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) { return 0; }
604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; } 604static inline int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) { return 0; }
605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } 605static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } 606static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; }
607#endif /* CONFIG_PROC_FS */ 607#endif /* CONFIG_SND_VERBOSE_PROCFS */
608 608
609/** 609/**
610 * snd_pcm_new_stream - create a new PCM stream 610 * snd_pcm_new_stream - create a new PCM stream
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 230a940d00bd..eedc6cb038bb 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -130,7 +130,7 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
130static void xrun(struct snd_pcm_substream *substream) 130static void xrun(struct snd_pcm_substream *substream)
131{ 131{
132 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 132 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
133#ifdef CONFIG_SND_DEBUG 133#ifdef CONFIG_SND_PCM_XRUN_DEBUG
134 if (substream->pstr->xrun_debug) { 134 if (substream->pstr->xrun_debug) {
135 snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n", 135 snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
136 substream->pcm->card->number, 136 substream->pcm->card->number,
@@ -204,7 +204,7 @@ static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *subs
204 delta = hw_ptr_interrupt - new_hw_ptr; 204 delta = hw_ptr_interrupt - new_hw_ptr;
205 if (delta > 0) { 205 if (delta > 0) {
206 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 206 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
207#ifdef CONFIG_SND_DEBUG 207#ifdef CONFIG_SND_PCM_XRUN_DEBUG
208 if (runtime->periods > 1 && substream->pstr->xrun_debug) { 208 if (runtime->periods > 1 && substream->pstr->xrun_debug) {
209 snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 209 snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
210 if (substream->pstr->xrun_debug > 1) 210 if (substream->pstr->xrun_debug > 1)
@@ -249,7 +249,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
249 delta = old_hw_ptr - new_hw_ptr; 249 delta = old_hw_ptr - new_hw_ptr;
250 if (delta > 0) { 250 if (delta > 0) {
251 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 251 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
252#ifdef CONFIG_SND_DEBUG 252#ifdef CONFIG_SND_PCM_XRUN_DEBUG
253 if (runtime->periods > 2 && substream->pstr->xrun_debug) { 253 if (runtime->periods > 2 && substream->pstr->xrun_debug) {
254 snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 254 snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
255 if (substream->pstr->xrun_debug > 1) 255 if (substream->pstr->xrun_debug > 1)
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index a0119ae67dcd..428f8c169ee1 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -100,8 +100,10 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream
100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) 100int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
101{ 101{
102 snd_pcm_lib_preallocate_dma_free(substream); 102 snd_pcm_lib_preallocate_dma_free(substream);
103#ifdef CONFIG_SND_VERBOSE_PROCFS
103 snd_info_unregister(substream->proc_prealloc_entry); 104 snd_info_unregister(substream->proc_prealloc_entry);
104 substream->proc_prealloc_entry = NULL; 105 substream->proc_prealloc_entry = NULL;
106#endif
105 return 0; 107 return 0;
106} 108}
107 109
@@ -124,7 +126,7 @@ int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm)
124 return 0; 126 return 0;
125} 127}
126 128
127#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_SND_VERBOSE_PROCFS
128/* 130/*
129 * read callback for prealloc proc file 131 * read callback for prealloc proc file
130 * 132 *
@@ -203,9 +205,9 @@ static inline void preallocate_info_init(struct snd_pcm_substream *substream)
203 substream->proc_prealloc_entry = entry; 205 substream->proc_prealloc_entry = entry;
204} 206}
205 207
206#else /* !CONFIG_PROC_FS */ 208#else /* !CONFIG_SND_VERBOSE_PROCFS */
207#define preallocate_info_init(s) 209#define preallocate_info_init(s)
208#endif 210#endif /* CONFIG_SND_VERBOSE_PROCFS */
209 211
210/* 212/*
211 * pre-allocate the buffer and create a proc file for the substream 213 * pre-allocate the buffer and create a proc file for the substream
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index e35fd5779a9d..ae0df549fac7 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(void)
675 continue; 675 continue;
676 device = platform_device_register_simple(SND_DUMMY_DRIVER, 676 device = platform_device_register_simple(SND_DUMMY_DRIVER,
677 i, NULL, 0); 677 i, NULL, 0);
678 if (IS_ERR(device)) { 678 if (IS_ERR(device))
679 err = PTR_ERR(device); 679 continue;
680 goto errout;
681 }
682 devices[i] = device; 680 devices[i] = device;
683 cards++; 681 cards++;
684 } 682 }
@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(void)
686#ifdef MODULE 684#ifdef MODULE
687 printk(KERN_ERR "Dummy soundcard not found or device busy\n"); 685 printk(KERN_ERR "Dummy soundcard not found or device busy\n");
688#endif 686#endif
689 err = -ENODEV; 687 snd_dummy_unregister_all();
690 goto errout; 688 return -ENODEV;
691 } 689 }
692 return 0; 690 return 0;
693
694 errout:
695 snd_dummy_unregister_all();
696 return err;
697} 691}
698 692
699static void __exit alsa_card_dummy_exit(void) 693static void __exit alsa_card_dummy_exit(void)
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index 9ea3059a7064..da7ef26995c3 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -251,10 +251,8 @@ static int __init alsa_card_mpu401_init(void)
251#endif 251#endif
252 device = platform_device_register_simple(SND_MPU401_DRIVER, 252 device = platform_device_register_simple(SND_MPU401_DRIVER,
253 i, NULL, 0); 253 i, NULL, 0);
254 if (IS_ERR(device)) { 254 if (IS_ERR(device))
255 err = PTR_ERR(device); 255 continue;
256 goto errout;
257 }
258 platform_devices[i] = device; 256 platform_devices[i] = device;
259 snd_mpu401_devices++; 257 snd_mpu401_devices++;
260 } 258 }
@@ -266,14 +264,10 @@ static int __init alsa_card_mpu401_init(void)
266#ifdef MODULE 264#ifdef MODULE
267 printk(KERN_ERR "MPU-401 device not found or device busy\n"); 265 printk(KERN_ERR "MPU-401 device not found or device busy\n");
268#endif 266#endif
269 err = -ENODEV; 267 snd_mpu401_unregister_all();
270 goto errout; 268 return -ENODEV;
271 } 269 }
272 return 0; 270 return 0;
273
274 errout:
275 snd_mpu401_unregister_all();
276 return err;
277} 271}
278 272
279static void __exit alsa_card_mpu401_exit(void) 273static void __exit alsa_card_mpu401_exit(void)
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 1a7fbefe4740..c01b4c5118b9 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(void)
996 continue; 996 continue;
997 device = platform_device_register_simple(SND_SERIAL_DRIVER, 997 device = platform_device_register_simple(SND_SERIAL_DRIVER,
998 i, NULL, 0); 998 i, NULL, 0);
999 if (IS_ERR(device)) { 999 if (IS_ERR(device))
1000 err = PTR_ERR(device); 1000 continue;
1001 goto errout;
1002 }
1003 devices[i] = device; 1001 devices[i] = device;
1004 cards++; 1002 cards++;
1005 } 1003 }
@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(void)
1007#ifdef MODULE 1005#ifdef MODULE
1008 printk(KERN_ERR "serial midi soundcard not found or device busy\n"); 1006 printk(KERN_ERR "serial midi soundcard not found or device busy\n");
1009#endif 1007#endif
1010 err = -ENODEV; 1008 snd_serial_unregister_all();
1011 goto errout; 1009 return -ENODEV;
1012 } 1010 }
1013 return 0; 1011 return 0;
1014
1015 errout:
1016 snd_serial_unregister_all();
1017 return err;
1018} 1012}
1019 1013
1020static void __exit alsa_card_serial_exit(void) 1014static void __exit alsa_card_serial_exit(void)
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index a3ee306239c9..26eb2499d442 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void)
169 continue; 169 continue;
170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER, 170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
171 i, NULL, 0); 171 i, NULL, 0);
172 if (IS_ERR(device)) { 172 if (IS_ERR(device))
173 err = PTR_ERR(device); 173 continue;
174 goto errout;
175 }
176 devices[i] = device; 174 devices[i] = device;
177 cards++; 175 cards++;
178 } 176 }
@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void)
180#ifdef MODULE 178#ifdef MODULE
181 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); 179 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
182#endif 180#endif
183 err = -ENODEV; 181 snd_virmidi_unregister_all();
184 goto errout; 182 return -ENODEV;
185 } 183 }
186 return 0; 184 return 0;
187
188 errout:
189 snd_virmidi_unregister_all();
190 return err;
191} 185}
192 186
193static void __exit alsa_card_virmidi_exit(void) 187static void __exit alsa_card_virmidi_exit(void)
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 83d64bc07ff0..e6bfcf74c1c1 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -1179,20 +1179,17 @@ static int __init snd_card_miro_aci_detect(struct snd_card *card, struct snd_mir
1179 /* force ACI into a known state */ 1179 /* force ACI into a known state */
1180 for (i = 0; i < 3; i++) 1180 for (i = 0; i < 3; i++)
1181 if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) { 1181 if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) {
1182 snd_card_free(card);
1183 snd_printk(KERN_ERR "can't force aci into known state.\n"); 1182 snd_printk(KERN_ERR "can't force aci into known state.\n");
1184 return -ENXIO; 1183 return -ENXIO;
1185 } 1184 }
1186 1185
1187 if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 || 1186 if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 ||
1188 (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) { 1187 (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) {
1189 snd_card_free(card);
1190 snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port); 1188 snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port);
1191 return -ENXIO; 1189 return -ENXIO;
1192 } 1190 }
1193 1191
1194 if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) { 1192 if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) {
1195 snd_card_free(card);
1196 snd_printk(KERN_ERR "can't read aci version on 0x%lx.\n", 1193 snd_printk(KERN_ERR "can't read aci version on 0x%lx.\n",
1197 miro->aci_port); 1194 miro->aci_port);
1198 return -ENXIO; 1195 return -ENXIO;
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index c6c8333acc62..eece1c7e55a0 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -39,7 +39,6 @@
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/compiler.h> 40#include <linux/compiler.h>
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/dma-mapping.h>
43 42
44#include <sound/driver.h> 43#include <sound/driver.h>
45#include <sound/core.h> 44#include <sound/core.h>
@@ -1052,7 +1051,7 @@ snd_ad1889_remove(struct pci_dev *pci)
1052 pci_set_drvdata(pci, NULL); 1051 pci_set_drvdata(pci, NULL);
1053} 1052}
1054 1053
1055static struct pci_device_id snd_ad1889_ids[] = { 1054static struct pci_device_id snd_ad1889_ids[] __devinitdata = {
1056 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) }, 1055 { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
1057 { 0, }, 1056 { 0, },
1058}; 1057};
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index fc92b6896c24..e2dbc2118902 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -279,7 +279,7 @@ struct snd_ali {
279#endif 279#endif
280}; 280};
281 281
282static struct pci_device_id snd_ali_ids[] = { 282static struct pci_device_id snd_ali_ids[] __devinitdata = {
283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0}, 283 {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0},
284 {0, } 284 {0, }
285}; 285};
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 91899f87f037..901b08ae9174 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -146,7 +146,7 @@ struct snd_als300_substream_data {
146 int block_counter_register; 146 int block_counter_register;
147}; 147};
148 148
149static struct pci_device_id snd_als300_ids[] = { 149static struct pci_device_id snd_als300_ids[] __devinitdata = {
150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 }, 150 { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 },
151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS }, 151 { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS },
152 { 0, } 152 { 0, }
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 100d8127a411..60423b1c678b 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -116,7 +116,7 @@ struct snd_card_als4000 {
116#endif 116#endif
117}; 117};
118 118
119static struct pci_device_id snd_als4000_ids[] = { 119static struct pci_device_id snd_als4000_ids[] __devinitdata = {
120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */ 120 { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ALS4000 */
121 { 0, } 121 { 0, }
122}; 122};
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 12e618851262..d0f759d86d3d 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -284,7 +284,7 @@ struct atiixp {
284 284
285/* 285/*
286 */ 286 */
287static struct pci_device_id snd_atiixp_ids[] = { 287static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 288 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */ 289 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 290 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 1d3766044643..12a34c39caa7 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -262,7 +262,7 @@ struct atiixp_modem {
262 262
263/* 263/*
264 */ 264 */
265static struct pci_device_id snd_atiixp_ids[] = { 265static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 266 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 267 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
268 { 0, } 268 { 0, }
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c
index fce22c7af0ea..bd3352998ad0 100644
--- a/sound/pci/au88x0/au8810.c
+++ b/sound/pci/au88x0/au8810.c
@@ -1,6 +1,6 @@
1#include "au8810.h" 1#include "au8810.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c
index d1fbcce07257..7e3fd8372d8d 100644
--- a/sound/pci/au88x0/au8820.c
+++ b/sound/pci/au88x0/au8820.c
@@ -1,6 +1,6 @@
1#include "au8820.h" 1#include "au8820.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c
index d4f2717c14fb..b840f6608a61 100644
--- a/sound/pci/au88x0/au8830.c
+++ b/sound/pci/au88x0/au8830.c
@@ -1,6 +1,6 @@
1#include "au8830.h" 1#include "au8830.h"
2#include "au88x0.h" 2#include "au88x0.h"
3static struct pci_device_id snd_vortex_ids[] = { 3static struct pci_device_id snd_vortex_ids[] __devinitdata = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2, 4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2,
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 6 {0,}
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 680077e1e057..52a364524262 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -216,7 +216,7 @@ struct snd_azf3328 {
216 int irq; 216 int irq;
217}; 217};
218 218
219static const struct pci_device_id snd_azf3328_ids[] = { 219static const struct pci_device_id snd_azf3328_ids[] __devinitdata = {
220 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */ 220 { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* PCI168/3328 */
221 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */ 221 { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 3328 */
222 { 0, } 222 { 0, }
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 7b44a8db033d..9ee07d4aac1e 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -774,7 +774,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
774 .driver_data = rate } 774 .driver_data = rate }
775 775
776/* driver_data is the default digital_rate value for that device */ 776/* driver_data is the default digital_rate value for that device */
777static struct pci_device_id snd_bt87x_ids[] = { 777static struct pci_device_id snd_bt87x_ids[] __devinitdata = {
778 /* Hauppauge WinTV series */ 778 /* Hauppauge WinTV series */
779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000), 779 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000),
780 /* Hauppauge WinTV series */ 780 /* Hauppauge WinTV series */
@@ -911,7 +911,7 @@ static void __devexit snd_bt87x_remove(struct pci_dev *pci)
911 911
912/* default entries for all Bt87x cards - it's not exported */ 912/* default entries for all Bt87x cards - it's not exported */
913/* driver_data is set to 0 to call detection */ 913/* driver_data is set to 0 to call detection */
914static struct pci_device_id snd_bt87x_default_ids[] = { 914static struct pci_device_id snd_bt87x_default_ids[] __devinitdata = {
915 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0), 915 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0),
916 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0), 916 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0),
917 { } 917 { }
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 9477838a9c88..fd8bfebfbd54 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1561,7 +1561,7 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
1561} 1561}
1562 1562
1563// PCI IDs 1563// PCI IDs
1564static struct pci_device_id snd_ca0106_ids[] = { 1564static struct pci_device_id snd_ca0106_ids[] __devinitdata = {
1565 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */ 1565 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */
1566 { 0, } 1566 { 0, }
1567}; 1567};
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 2ecbddbbdcf0..e5ce2dabd081 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2609,7 +2609,7 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
2609#endif 2609#endif
2610 2610
2611 2611
2612static struct pci_device_id snd_cmipci_ids[] = { 2612static struct pci_device_id snd_cmipci_ids[] __devinitdata = {
2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2613 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2614 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2615 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ac4e73f69c1d..b3c94d83450a 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -494,7 +494,7 @@ struct cs4281 {
494 494
495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs); 495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
496 496
497static struct pci_device_id snd_cs4281_ids[] = { 497static struct pci_device_id snd_cs4281_ids[] __devinitdata = {
498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ 498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */
499 { 0, } 499 { 0, }
500}; 500};
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index c590602e20cd..848d772ae3c6 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
65module_param_array(mmap_valid, bool, NULL, 0444); 65module_param_array(mmap_valid, bool, NULL, 0444);
66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); 66MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
67 67
68static struct pci_device_id snd_cs46xx_ids[] = { 68static struct pci_device_id snd_cs46xx_ids[] __devinitdata = {
69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ 69 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */
70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */ 70 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */
71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */ 71 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 9fc7f3827461..2c1213a35dcc 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -45,7 +45,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
47 47
48static struct pci_device_id snd_cs5535audio_ids[] = { 48static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = {
49 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, 49 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO,
50 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 50 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
51 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO, 51 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO,
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 2dfa932f7825..42b11ba1d210 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -77,7 +77,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
77/* 77/*
78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 78 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
79 */ 79 */
80static struct pci_device_id snd_emu10k1_ids[] = { 80static struct pci_device_id snd_emu10k1_ids[] __devinitdata = {
81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ 81 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */
82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ 82 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */
83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ 83 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 3e332f398162..d51290c18167 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -36,7 +36,6 @@
36#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
39#include <linux/dma-mapping.h>
40#include <sound/core.h> 39#include <sound/core.h>
41#include <sound/initval.h> 40#include <sound/initval.h>
42#include <sound/pcm.h> 41#include <sound/pcm.h>
@@ -1596,7 +1595,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci)
1596} 1595}
1597 1596
1598// PCI IDs 1597// PCI IDs
1599static struct pci_device_id snd_emu10k1x_ids[] = { 1598static struct pci_device_id snd_emu10k1x_ids[] __devinitdata = {
1600 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ 1599 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */
1601 { 0, } 1600 { 0, }
1602}; 1601};
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index a5533c86b0b6..ca9e34e88f62 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -446,7 +446,7 @@ struct ensoniq {
446 446
447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); 447static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
448 448
449static struct pci_device_id snd_audiopci_ids[] = { 449static struct pci_device_id snd_audiopci_ids[] __devinitdata = {
450#ifdef CHIP1370 450#ifdef CHIP1370
451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */ 451 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */
452#endif 452#endif
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 4d62fe439177..6f9094ca4fb4 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -242,7 +242,7 @@ struct es1938 {
242 242
243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs); 243static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
244 244
245static struct pci_device_id snd_es1938_ids[] = { 245static struct pci_device_id snd_es1938_ids[] __devinitdata = {
246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ 246 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */
247 { 0, } 247 { 0, }
248}; 248};
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index e3ad17f53c29..5ff4175c7b6d 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -104,7 +104,6 @@
104#include <linux/slab.h> 104#include <linux/slab.h>
105#include <linux/gameport.h> 105#include <linux/gameport.h>
106#include <linux/moduleparam.h> 106#include <linux/moduleparam.h>
107#include <linux/dma-mapping.h>
108#include <linux/mutex.h> 107#include <linux/mutex.h>
109 108
110#include <sound/core.h> 109#include <sound/core.h>
@@ -593,7 +592,7 @@ struct es1968 {
593 592
594static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs); 593static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
595 594
596static struct pci_device_id snd_es1968_ids[] = { 595static struct pci_device_id snd_es1968_ids[] __devinitdata = {
597 /* Maestro 1 */ 596 /* Maestro 1 */
598 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO }, 597 { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
599 /* Maestro 2 */ 598 /* Maestro 2 */
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 6ab4aefbccf8..d72fc28c580e 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -199,7 +199,7 @@ struct fm801 {
199#endif 199#endif
200}; 200};
201 201
202static struct pci_device_id snd_fm801_ids[] = { 202static struct pci_device_id snd_fm801_ids[] __devinitdata = {
203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */ 203 { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */
204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */ 204 { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* Gallant Odyssey Sound 4 */
205 { 0, } 205 { 0, }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 0ad60ae29011..e821d65afa11 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1614,7 +1614,7 @@ static void __devexit azx_remove(struct pci_dev *pci)
1614} 1614}
1615 1615
1616/* PCI IDs */ 1616/* PCI IDs */
1617static struct pci_device_id azx_ids[] = { 1617static struct pci_device_id azx_ids[] __devinitdata = {
1618 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */ 1618 { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */
1619 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ 1619 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */
1620 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ 1620 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index bcfca159c6a2..40f000ba1362 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -799,10 +799,14 @@ static struct hda_board_config ad1986a_cfg_tbl[] = {
799 { .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD }, 799 { .modelname = "laptop-eapd", .config = AD1986A_LAPTOP_EAPD },
800 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc024, 800 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc024,
801 .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */ 801 .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */
802 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1153,
803 .config = AD1986A_LAPTOP_EAPD }, /* ASUS M9 */
802 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213, 804 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213,
803 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ 805 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */
804 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, 806 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7,
805 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ 807 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */
808 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297,
809 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
806 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, 810 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
807 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */ 811 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */
808 {} 812 {}
@@ -1330,12 +1334,8 @@ enum { AD1981_BASIC, AD1981_HP };
1330 1334
1331static struct hda_board_config ad1981_cfg_tbl[] = { 1335static struct hda_board_config ad1981_cfg_tbl[] = {
1332 { .modelname = "hp", .config = AD1981_HP }, 1336 { .modelname = "hp", .config = AD1981_HP },
1333 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30aa, 1337 /* All HP models */
1334 .config = AD1981_HP }, /* HP nx6320 */ 1338 { .pci_subvendor = 0x103c, .config = AD1981_HP },
1335 { .pci_subvendor = 0x103c, .pci_subdevice = 0x309f,
1336 .config = AD1981_HP }, /* HP nx9420 AngelFire */
1337 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a2,
1338 .config = AD1981_HP }, /* HP nx9420 AngelFire */
1339 { .modelname = "basic", .config = AD1981_BASIC }, 1339 { .modelname = "basic", .config = AD1981_BASIC },
1340 {} 1340 {}
1341}; 1341};
@@ -2623,5 +2623,6 @@ struct hda_codec_preset snd_hda_preset_analog[] = {
2623 { .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 }, 2623 { .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 },
2624 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a }, 2624 { .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a },
2625 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 }, 2625 { .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 },
2626 { .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 },
2626 {} /* terminator */ 2627 {} /* terminator */
2627}; 2628};
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 66bbdb60f50b..f0e9a9c90780 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2148,6 +2148,7 @@ static struct hda_board_config alc880_cfg_tbl[] = {
2148 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG }, 2148 { .pci_subvendor = 0x1025, .pci_subdevice = 0x0087, .config = ALC880_6ST_DIG },
2149 { .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */ 2149 { .pci_subvendor = 0x1297, .pci_subdevice = 0xc790, .config = ALC880_6ST_DIG }, /* Shuttle ST20G5 */
2150 { .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */ 2150 { .pci_subvendor = 0x1509, .pci_subdevice = 0x925d, .config = ALC880_6ST_DIG }, /* FIC P4M-915GD1 */
2151 { .pci_subvendor = 0x1695, .pci_subdevice = 0x4012, .config = ALC880_5ST_DIG }, /* Epox EP-5LDA+ GLi */
2151 2152
2152 { .modelname = "asus", .config = ALC880_ASUS }, 2153 { .modelname = "asus", .config = ALC880_ASUS },
2153 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG }, 2154 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1964, .config = ALC880_ASUS_DIG },
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 715260787953..8c440fb98603 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1212,8 +1212,8 @@ static hda_nid_t vaio_mux_nids[] = { 0x15 };
1212static struct hda_input_mux vaio_mux = { 1212static struct hda_input_mux vaio_mux = {
1213 .num_items = 2, 1213 .num_items = 2,
1214 .items = { 1214 .items = {
1215 /* { "HP", 0x0 }, 1215 /* { "HP", 0x0 }, */
1216 { "Unknown", 0x1 }, */ 1216 { "Line", 0x1 },
1217 { "Mic", 0x2 }, 1217 { "Mic", 0x2 },
1218 { "PCM", 0x3 }, 1218 { "PCM", 0x3 },
1219 } 1219 }
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 32f8415558a5..c56793b381e2 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -56,7 +56,6 @@
56#include <linux/dma-mapping.h> 56#include <linux/dma-mapping.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/moduleparam.h> 58#include <linux/moduleparam.h>
59#include <linux/dma-mapping.h>
60#include <linux/mutex.h> 59#include <linux/mutex.h>
61 60
62#include <sound/core.h> 61#include <sound/core.h>
@@ -108,7 +107,7 @@ module_param_array(dxr_enable, int, NULL, 0444);
108MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE."); 107MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE.");
109 108
110 109
111static struct pci_device_id snd_ice1712_ids[] = { 110static struct pci_device_id snd_ice1712_ids[] __devinitdata = {
112 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ 111 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */
113 { 0, } 112 { 0, }
114}; 113};
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index fce616c2761f..b1c007e022d2 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -86,7 +86,7 @@ MODULE_PARM_DESC(model, "Use the given board model.");
86 86
87 87
88/* Both VT1720 and VT1724 have the same PCI IDs */ 88/* Both VT1720 and VT1724 have the same PCI IDs */
89static struct pci_device_id snd_vt1724_ids[] = { 89static struct pci_device_id snd_vt1724_ids[] __devinitdata = {
90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 90 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
91 { 0, } 91 { 0, }
92}; 92};
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index ebbf2cf4ca0f..0df7602568e2 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -413,7 +413,7 @@ struct intel8x0 {
413 u32 int_sta_mask; /* interrupt status mask */ 413 u32 int_sta_mask; /* interrupt status mask */
414}; 414};
415 415
416static struct pci_device_id snd_intel8x0_ids[] = { 416static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 417 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 418 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 419 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
@@ -1293,6 +1293,7 @@ static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substre
1293 return 0; 1293 return 0;
1294} 1294}
1295 1295
1296#if 0 // NYI
1296static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream) 1297static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
1297{ 1298{
1298 struct intel8x0 *chip = snd_pcm_substream_chip(substream); 1299 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1308,7 +1309,6 @@ static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream)
1308 return 0; 1309 return 0;
1309} 1310}
1310 1311
1311#if 0 // NYI
1312static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream) 1312static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream)
1313{ 1313{
1314 struct intel8x0 *chip = snd_pcm_substream_chip(substream); 1314 struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1435,6 +1435,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
1435 .pointer = snd_intel8x0_pcm_pointer, 1435 .pointer = snd_intel8x0_pcm_pointer,
1436}; 1436};
1437 1437
1438#if 0 // NYI
1438static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = { 1439static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
1439 .open = snd_intel8x0_ali_spdifin_open, 1440 .open = snd_intel8x0_ali_spdifin_open,
1440 .close = snd_intel8x0_ali_spdifin_close, 1441 .close = snd_intel8x0_ali_spdifin_close,
@@ -1446,7 +1447,6 @@ static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
1446 .pointer = snd_intel8x0_pcm_pointer, 1447 .pointer = snd_intel8x0_pcm_pointer,
1447}; 1448};
1448 1449
1449#if 0 // NYI
1450static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = { 1450static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
1451 .open = snd_intel8x0_ali_spdifout_open, 1451 .open = snd_intel8x0_ali_spdifout_open,
1452 .close = snd_intel8x0_ali_spdifout_close, 1452 .close = snd_intel8x0_ali_spdifout_close,
@@ -1582,7 +1582,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
1582 { 1582 {
1583 .suffix = "IEC958", 1583 .suffix = "IEC958",
1584 .playback_ops = &snd_intel8x0_ali_ac97spdifout_ops, 1584 .playback_ops = &snd_intel8x0_ali_ac97spdifout_ops,
1585 .capture_ops = &snd_intel8x0_ali_spdifin_ops, 1585 /* .capture_ops = &snd_intel8x0_ali_spdifin_ops, */
1586 .prealloc_size = 64 * 1024, 1586 .prealloc_size = 64 * 1024,
1587 .prealloc_max_size = 128 * 1024, 1587 .prealloc_max_size = 128 * 1024,
1588 .ac97_idx = ALID_AC97SPDIFOUT, 1588 .ac97_idx = ALID_AC97SPDIFOUT,
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 47e26aaa9ad7..720635f0cb81 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -224,7 +224,7 @@ struct intel8x0m {
224 unsigned int pcm_pos_shift; 224 unsigned int pcm_pos_shift;
225}; 225};
226 226
227static struct pci_device_id snd_intel8x0m_ids[] = { 227static struct pci_device_id snd_intel8x0m_ids[] __devinitdata = {
228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 228 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 229 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 230 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 4721c096335e..e39fad1a4200 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -424,7 +424,7 @@ module_param_array(enable, bool, NULL, 0444);
424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard."); 424MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>"); 425MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
426 426
427static struct pci_device_id snd_korg1212_ids[] = { 427static struct pci_device_id snd_korg1212_ids[] __devinitdata = {
428 { 428 {
429 .vendor = 0x10b5, 429 .vendor = 0x10b5,
430 .device = 0x906d, 430 .device = 0x906d,
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9c90d901e6b9..1928e06b6d82 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -41,7 +41,6 @@
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/vmalloc.h> 42#include <linux/vmalloc.h>
43#include <linux/moduleparam.h> 43#include <linux/moduleparam.h>
44#include <linux/dma-mapping.h>
45#include <sound/core.h> 44#include <sound/core.h>
46#include <sound/info.h> 45#include <sound/info.h>
47#include <sound/control.h> 46#include <sound/control.h>
@@ -870,7 +869,7 @@ struct snd_m3 {
870/* 869/*
871 * pci ids 870 * pci ids
872 */ 871 */
873static struct pci_device_id snd_m3_ids[] = { 872static struct pci_device_id snd_m3_ids[] __devinitdata = {
874 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID, 873 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID,
875 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 874 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
876 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID, 875 {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID,
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index b5a095052d4c..09cc0786495a 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -28,7 +28,6 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/dma-mapping.h>
32 31
33#include <sound/core.h> 32#include <sound/core.h>
34#include <sound/initval.h> 33#include <sound/initval.h>
@@ -62,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
62/* 61/*
63 */ 62 */
64 63
65static struct pci_device_id snd_mixart_ids[] = { 64static struct pci_device_id snd_mixart_ids[] __devinitdata = {
66 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */ 65 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */
67 { 0, } 66 { 0, }
68}; 67};
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index cc297abc9d11..b92d6600deb9 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -263,7 +263,7 @@ struct nm256 {
263/* 263/*
264 * PCI ids 264 * PCI ids
265 */ 265 */
266static struct pci_device_id snd_nm256_ids[] = { 266static struct pci_device_id snd_nm256_ids[] __devinitdata = {
267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 269 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 35875c8aa299..dafa2235abaa 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -30,7 +30,6 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/dma-mapping.h>
34 33
35#include <sound/core.h> 34#include <sound/core.h>
36#include <sound/initval.h> 35#include <sound/initval.h>
@@ -74,7 +73,7 @@ enum {
74 PCI_ID_LAST 73 PCI_ID_LAST
75}; 74};
76 75
77static struct pci_device_id pcxhr_ids[] = { 76static struct pci_device_id pcxhr_ids[] __devinitdata = {
78 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */ 77 { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, }, /* VX882HR */
79 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */ 78 { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, }, /* PCX882HR */
80 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */ 79 { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, }, /* VX881HR */
diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c
index 03517c10e99c..369c19fea985 100644
--- a/sound/pci/pcxhr/pcxhr_hwdep.c
+++ b/sound/pci/pcxhr/pcxhr_hwdep.c
@@ -385,8 +385,8 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
385 fw.size = dsp->length; 385 fw.size = dsp->length;
386 fw.data = vmalloc(fw.size); 386 fw.data = vmalloc(fw.size);
387 if (! fw.data) { 387 if (! fw.data) {
388 snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%d bytes)\n", 388 snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%lu bytes)\n",
389 fw.size); 389 (unsigned long)fw.size);
390 return -ENOMEM; 390 return -ENOMEM;
391 } 391 }
392 if (copy_from_user(fw.data, dsp->image, dsp->length)) { 392 if (copy_from_user(fw.data, dsp->image, dsp->length)) {
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index f148ee434a6b..d8cc985d7241 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -506,7 +506,7 @@ static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
506/* 506/*
507 */ 507 */
508 508
509static struct pci_device_id snd_riptide_ids[] = { 509static struct pci_device_id snd_riptide_ids[] __devinitdata = {
510 { 510 {
511 .vendor = 0x127a,.device = 0x4310, 511 .vendor = 0x127a,.device = 0x4310,
512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID, 512 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
@@ -527,7 +527,7 @@ static struct pci_device_id snd_riptide_ids[] = {
527}; 527};
528 528
529#ifdef SUPPORT_JOYSTICK 529#ifdef SUPPORT_JOYSTICK
530static struct pci_device_id snd_riptide_joystick_ids[] = { 530static struct pci_device_id snd_riptide_joystick_ids[] __devinitdata = {
531 { 531 {
532 .vendor = 0x127a,.device = 0x4312, 532 .vendor = 0x127a,.device = 0x4312,
533 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID, 533 .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index ab78544bf042..55b1d4838d97 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -227,7 +227,7 @@ struct rme32 {
227 struct snd_kcontrol *spdif_ctl; 227 struct snd_kcontrol *spdif_ctl;
228}; 228};
229 229
230static struct pci_device_id snd_rme32_ids[] = { 230static struct pci_device_id snd_rme32_ids[] __devinitdata = {
231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, 231 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32,
232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 232 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, 233 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8,
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 6c2a9f4a7659..3c1bc533d511 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -232,7 +232,7 @@ struct rme96 {
232 struct snd_kcontrol *spdif_ctl; 232 struct snd_kcontrol *spdif_ctl;
233}; 233};
234 234
235static struct pci_device_id snd_rme96_ids[] = { 235static struct pci_device_id snd_rme96_ids[] __devinitdata = {
236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, 236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96,
237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 237 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, 238 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8,
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index ebf7a2b86c23..61f82f0d5cc6 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -568,7 +568,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
568} 568}
569 569
570 570
571static struct pci_device_id snd_hdsp_ids[] = { 571static struct pci_device_id snd_hdsp_ids[] __devinitdata = {
572 { 572 {
573 .vendor = PCI_VENDOR_ID_XILINX, 573 .vendor = PCI_VENDOR_ID_XILINX,
574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP, 574 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index b5538efd146b..722b9e6ce54a 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -426,7 +426,7 @@ static char channel_map_madi_qs[HDSPM_MAX_CHANNELS] = {
426}; 426};
427 427
428 428
429static struct pci_device_id snd_hdspm_ids[] = { 429static struct pci_device_id snd_hdspm_ids[] __devinitdata = {
430 { 430 {
431 .vendor = PCI_VENDOR_ID_XILINX, 431 .vendor = PCI_VENDOR_ID_XILINX,
432 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI, 432 .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI,
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index a687eb63236f..75d6406303d3 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -315,7 +315,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
315} 315}
316 316
317 317
318static struct pci_device_id snd_rme9652_ids[] = { 318static struct pci_device_id snd_rme9652_ids[] __devinitdata = {
319 { 319 {
320 .vendor = 0x10ee, 320 .vendor = 0x10ee,
321 .device = 0x3fc4, 321 .device = 0x3fc4,
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 2d66a09fe5ee..91f8bf3ae9fa 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -243,7 +243,7 @@ struct sonicvibes {
243#endif 243#endif
244}; 244};
245 245
246static struct pci_device_id snd_sonic_ids[] = { 246static struct pci_device_id snd_sonic_ids[] __devinitdata = {
247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 247 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
248 { 0, } 248 { 0, }
249}; 249};
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index b4538045049f..9624a5f2b875 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM.");
63module_param_array(wavetable_size, int, NULL, 0444); 63module_param_array(wavetable_size, int, NULL, 0444);
64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); 64MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
65 65
66static struct pci_device_id snd_trident_ids[] = { 66static struct pci_device_id snd_trident_ids[] __devinitdata = {
67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), 67 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, 68 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), 69 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 0f171dd1377b..39daf62d2bad 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -123,6 +123,7 @@ module_param(enable, bool, 0444);
123#define VIA_REV_8233A 0x40 /* 1 rec, 1 multi-pb, spdf */ 123#define VIA_REV_8233A 0x40 /* 1 rec, 1 multi-pb, spdf */
124#define VIA_REV_8235 0x50 /* 2 rec, 4 pb, 1 multi-pb, spdif */ 124#define VIA_REV_8235 0x50 /* 2 rec, 4 pb, 1 multi-pb, spdif */
125#define VIA_REV_8237 0x60 125#define VIA_REV_8237 0x60
126#define VIA_REV_8251 0x70
126 127
127/* 128/*
128 * Direct registers 129 * Direct registers
@@ -395,7 +396,7 @@ struct via82xx {
395#endif 396#endif
396}; 397};
397 398
398static struct pci_device_id snd_via82xx_ids[] = { 399static struct pci_device_id snd_via82xx_ids[] __devinitdata = {
399 /* 0x1106, 0x3058 */ 400 /* 0x1106, 0x3058 */
400 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ 401 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */
401 /* 0x1106, 0x3059 */ 402 /* 0x1106, 0x3059 */
@@ -862,6 +863,11 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
862 if (!status) 863 if (!status)
863 status = inb(VIADEV_REG(viadev, OFFSET_STATUS)); 864 status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
864 865
866 /* An apparent bug in the 8251 is worked around by sending a
867 * REG_CTRL_START. */
868 if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL))
869 snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START);
870
865 if (!(status & VIA_REG_STAT_ACTIVE)) { 871 if (!(status & VIA_REG_STAT_ACTIVE)) {
866 res = 0; 872 res = 0;
867 goto unlock; 873 goto unlock;
@@ -2313,6 +2319,7 @@ static struct via823x_info via823x_cards[] __devinitdata = {
2313 { VIA_REV_8233A, "VIA 8233A", TYPE_VIA8233A }, 2319 { VIA_REV_8233A, "VIA 8233A", TYPE_VIA8233A },
2314 { VIA_REV_8235, "VIA 8235", TYPE_VIA8233 }, 2320 { VIA_REV_8235, "VIA 8235", TYPE_VIA8233 },
2315 { VIA_REV_8237, "VIA 8237", TYPE_VIA8233 }, 2321 { VIA_REV_8237, "VIA 8237", TYPE_VIA8233 },
2322 { VIA_REV_8251, "VIA 8251", TYPE_VIA8233 },
2316}; 2323};
2317 2324
2318/* 2325/*
@@ -2325,7 +2332,7 @@ struct dxs_whitelist {
2325 short action; /* new dxs_support value */ 2332 short action; /* new dxs_support value */
2326}; 2333};
2327 2334
2328static int __devinit check_dxs_list(struct pci_dev *pci) 2335static int __devinit check_dxs_list(struct pci_dev *pci, int revision)
2329{ 2336{
2330 static struct dxs_whitelist whitelist[] = { 2337 static struct dxs_whitelist whitelist[] = {
2331 { .subvendor = 0x1005, .subdevice = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */ 2338 { .subvendor = 0x1005, .subdevice = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */
@@ -2342,6 +2349,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
2342 { .subvendor = 0x1043, .subdevice = 0x810d, .action = VIA_DXS_SRC }, /* ASUS */ 2349 { .subvendor = 0x1043, .subdevice = 0x810d, .action = VIA_DXS_SRC }, /* ASUS */
2343 { .subvendor = 0x1043, .subdevice = 0x812a, .action = VIA_DXS_SRC }, /* ASUS A8V Deluxe */ 2350 { .subvendor = 0x1043, .subdevice = 0x812a, .action = VIA_DXS_SRC }, /* ASUS A8V Deluxe */
2344 { .subvendor = 0x1043, .subdevice = 0x8174, .action = VIA_DXS_SRC }, /* ASUS */ 2351 { .subvendor = 0x1043, .subdevice = 0x8174, .action = VIA_DXS_SRC }, /* ASUS */
2352 { .subvendor = 0x1043, .subdevice = 0x81b9, .action = VIA_DXS_SRC }, /* ASUS A8V-MX */
2345 { .subvendor = 0x1071, .subdevice = 0x8375, .action = VIA_DXS_NO_VRA }, /* Vobis/Yakumo/Mitac notebook */ 2353 { .subvendor = 0x1071, .subdevice = 0x8375, .action = VIA_DXS_NO_VRA }, /* Vobis/Yakumo/Mitac notebook */
2346 { .subvendor = 0x1071, .subdevice = 0x8399, .action = VIA_DXS_NO_VRA }, /* Umax AB 595T (VIA K8N800A - VT8237) */ 2354 { .subvendor = 0x1071, .subdevice = 0x8399, .action = VIA_DXS_NO_VRA }, /* Umax AB 595T (VIA K8N800A - VT8237) */
2347 { .subvendor = 0x10cf, .subdevice = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */ 2355 { .subvendor = 0x10cf, .subdevice = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */
@@ -2405,6 +2413,10 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
2405 } 2413 }
2406 } 2414 }
2407 2415
2416 /* for newer revision, default to DXS_SRC */
2417 if (revision >= VIA_REV_8235)
2418 return VIA_DXS_SRC;
2419
2408 /* 2420 /*
2409 * not detected, try 48k rate only to be sure. 2421 * not detected, try 48k rate only to be sure.
2410 */ 2422 */
@@ -2449,7 +2461,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
2449 } 2461 }
2450 if (chip_type != TYPE_VIA8233A) { 2462 if (chip_type != TYPE_VIA8233A) {
2451 if (dxs_support == VIA_DXS_AUTO) 2463 if (dxs_support == VIA_DXS_AUTO)
2452 dxs_support = check_dxs_list(pci); 2464 dxs_support = check_dxs_list(pci, revision);
2453 /* force to use VIA8233 or 8233A model according to 2465 /* force to use VIA8233 or 8233A model according to
2454 * dxs_support module option 2466 * dxs_support module option
2455 */ 2467 */
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 22ce4d309929..ef97e50cd6c2 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -261,7 +261,7 @@ struct via82xx_modem {
261 struct snd_info_entry *proc_entry; 261 struct snd_info_entry *proc_entry;
262}; 262};
263 263
264static struct pci_device_id snd_via82xx_modem_ids[] = { 264static struct pci_device_id snd_via82xx_modem_ids[] __devinitdata = {
265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, }, 265 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, },
266 { 0, } 266 { 0, }
267}; 267};
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index c816ddf1b215..0f1ebb010a5e 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -60,7 +60,7 @@ enum {
60 VX_PCI_VX222_NEW 60 VX_PCI_VX222_NEW
61}; 61};
62 62
63static struct pci_device_id snd_vx222_ids[] = { 63static struct pci_device_id snd_vx222_ids[] __devinitdata = {
64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */ 64 { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, }, /* PLX */
65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */ 65 { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, }, /* PLX */
66 { 0, } 66 { 0, }
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index db57ce939fa8..65ebf5f1933a 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -70,7 +70,7 @@ MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
70module_param_array(rear_swap, bool, NULL, 0444); 70module_param_array(rear_swap, bool, NULL, 0444);
71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output"); 71MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
72 72
73static struct pci_device_id snd_ymfpci_ids[] = { 73static struct pci_device_id snd_ymfpci_ids[] __devinitdata = {
74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ 74 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */
75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */ 75 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */
76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */ 76 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */
diff --git a/sound/pcmcia/Kconfig b/sound/pcmcia/Kconfig
index 5d1b0b762efa..c9fa1a2bc58b 100644
--- a/sound/pcmcia/Kconfig
+++ b/sound/pcmcia/Kconfig
@@ -5,7 +5,7 @@ menu "PCMCIA devices"
5 5
6config SND_VXPOCKET 6config SND_VXPOCKET
7 tristate "Digigram VXpocket" 7 tristate "Digigram VXpocket"
8 depends on SND && PCMCIA && ISA 8 depends on SND && PCMCIA
9 select SND_VX_LIB 9 select SND_VX_LIB
10 help 10 help
11 Say Y here to include support for Digigram VXpocket and 11 Say Y here to include support for Digigram VXpocket and
@@ -16,7 +16,7 @@ config SND_VXPOCKET
16 16
17config SND_PDAUDIOCF 17config SND_PDAUDIOCF
18 tristate "Sound Core PDAudioCF" 18 tristate "Sound Core PDAudioCF"
19 depends on SND && PCMCIA && ISA 19 depends on SND && PCMCIA
20 select SND_PCM 20 select SND_PCM
21 help 21 help
22 Say Y here to include support for Sound Core PDAudioCF 22 Say Y here to include support for Sound Core PDAudioCF
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 0992a0923f1a..9351846d7a9d 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -1531,6 +1531,15 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1531 } 1531 }
1532}, 1532},
1533{ 1533{
1534 USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0014),
1535 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1536 .vendor_name = "TerraTec",
1537 .product_name = "PHASE 26",
1538 .ifnum = 3,
1539 .type = QUIRK_MIDI_STANDARD_INTERFACE
1540 }
1541},
1542{
1534 USB_DEVICE(0x0ccd, 0x0035), 1543 USB_DEVICE(0x0ccd, 0x0035),
1535 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1544 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1536 .vendor_name = "Miditech", 1545 .vendor_name = "Miditech",