aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/Kconfig69
-rw-r--r--sound/isa/Makefile2
-rw-r--r--sound/isa/ad1816a/ad1816a.c14
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c11
-rw-r--r--sound/isa/cmi8330.c68
-rw-r--r--sound/isa/cs423x/Makefile8
-rw-r--r--sound/isa/cs423x/cs4232.c2
-rw-r--r--sound/isa/cs423x/cs4236.c153
-rw-r--r--sound/isa/cs423x/cs4236_lib.c45
-rw-r--r--sound/isa/es1688/es1688.c23
-rw-r--r--sound/isa/es1688/es1688_lib.c23
-rw-r--r--sound/isa/gus/gus_dma.c27
-rw-r--r--sound/isa/gus/gus_irq.c6
-rw-r--r--sound/isa/gus/gus_pcm.c26
-rw-r--r--sound/isa/gus/gus_uart.c10
-rw-r--r--sound/isa/gus/interwave.c16
-rw-r--r--sound/isa/msnd/Makefile9
-rw-r--r--sound/isa/msnd/msnd.c707
-rw-r--r--sound/isa/msnd/msnd.h308
-rw-r--r--sound/isa/msnd/msnd_classic.c3
-rw-r--r--sound/isa/msnd/msnd_classic.h129
-rw-r--r--sound/isa/msnd/msnd_midi.c180
-rw-r--r--sound/isa/msnd/msnd_pinnacle.c1238
-rw-r--r--sound/isa/msnd/msnd_pinnacle.h181
-rw-r--r--sound/isa/msnd/msnd_pinnacle_mixer.c343
-rw-r--r--sound/isa/opl3sa2.c33
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c40
-rw-r--r--sound/isa/sb/sb16_csp.c19
-rw-r--r--sound/isa/sb/sb_mixer.c156
-rw-r--r--sound/isa/sc6000.c4
-rw-r--r--sound/isa/sscape.c189
-rw-r--r--sound/isa/wavefront/wavefront.c4
-rw-r--r--sound/isa/wavefront/wavefront_fx.c30
-rw-r--r--sound/isa/wavefront/wavefront_synth.c13
-rw-r--r--sound/isa/wavefront/yss225.c2739
-rw-r--r--sound/isa/wss/wss_lib.c160
36 files changed, 3716 insertions, 3272 deletions
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index ce0aa044e274..c6942a4de99b 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -56,8 +56,8 @@ config SND_AD1848
56 Say Y here to include support for AD1848 (Analog Devices) or 56 Say Y here to include support for AD1848 (Analog Devices) or
57 CS4248 (Cirrus Logic - Crystal Semiconductors) chips. 57 CS4248 (Cirrus Logic - Crystal Semiconductors) chips.
58 58
59 For newer chips from Cirrus Logic, use the CS4231, CS4232 or 59 For newer chips from Cirrus Logic, use the CS4231 or CS4232+
60 CS4236+ drivers. 60 drivers.
61 61
62 To compile this driver as a module, choose M here: the module 62 To compile this driver as a module, choose M here: the module
63 will be called snd-ad1848. 63 will be called snd-ad1848.
@@ -94,6 +94,8 @@ config SND_CMI8330
94 tristate "C-Media CMI8330" 94 tristate "C-Media CMI8330"
95 select SND_WSS_LIB 95 select SND_WSS_LIB
96 select SND_SB16_DSP 96 select SND_SB16_DSP
97 select SND_OPL3_LIB
98 select SND_MPU401_UART
97 help 99 help
98 Say Y here to include support for soundcards based on the 100 Say Y here to include support for soundcards based on the
99 C-Media CMI8330 chip. 101 C-Media CMI8330 chip.
@@ -112,26 +114,15 @@ config SND_CS4231
112 To compile this driver as a module, choose M here: the module 114 To compile this driver as a module, choose M here: the module
113 will be called snd-cs4231. 115 will be called snd-cs4231.
114 116
115config SND_CS4232
116 tristate "Generic Cirrus Logic CS4232 driver"
117 select SND_OPL3_LIB
118 select SND_MPU401_UART
119 select SND_WSS_LIB
120 help
121 Say Y here to include support for CS4232 chips from Cirrus
122 Logic - Crystal Semiconductors.
123
124 To compile this driver as a module, choose M here: the module
125 will be called snd-cs4232.
126
127config SND_CS4236 117config SND_CS4236
128 tristate "Generic Cirrus Logic CS4236+ driver" 118 tristate "Generic Cirrus Logic CS4232/CS4236+ driver"
129 select SND_OPL3_LIB 119 select SND_OPL3_LIB
130 select SND_MPU401_UART 120 select SND_MPU401_UART
131 select SND_WSS_LIB 121 select SND_WSS_LIB
132 help 122 help
133 Say Y to include support for CS4235,CS4236,CS4237B,CS4238B, 123 Say Y to include support for CS4232,CS4235,CS4236,CS4237B,
134 CS4239 chips from Cirrus Logic - Crystal Semiconductors. 124 CS4238B,CS4239 chips from Cirrus Logic - Crystal
125 Semiconductors.
135 126
136 To compile this driver as a module, choose M here: the module 127 To compile this driver as a module, choose M here: the module
137 will be called snd-cs4236. 128 will be called snd-cs4236.
@@ -377,14 +368,17 @@ config SND_SGALAXY
377 will be called snd-sgalaxy. 368 will be called snd-sgalaxy.
378 369
379config SND_SSCAPE 370config SND_SSCAPE
380 tristate "Ensoniq SoundScape PnP driver" 371 tristate "Ensoniq SoundScape driver"
381 select SND_HWDEP 372 select SND_HWDEP
382 select SND_MPU401_UART 373 select SND_MPU401_UART
383 select SND_WSS_LIB 374 select SND_WSS_LIB
384 help 375 help
385 Say Y here to include support for Ensoniq SoundScape PnP 376 Say Y here to include support for Ensoniq SoundScape
386 soundcards. 377 soundcards.
387 378
379 The PCM audio is supported on SoundScape Classic, Elite, PnP
380 and VIVO cards. The MIDI support is very experimental.
381
388 To compile this driver as a module, choose M here: the module 382 To compile this driver as a module, choose M here: the module
389 will be called snd-sscape. 383 will be called snd-sscape.
390 384
@@ -401,15 +395,36 @@ config SND_WAVEFRONT
401 To compile this driver as a module, choose M here: the module 395 To compile this driver as a module, choose M here: the module
402 will be called snd-wavefront. 396 will be called snd-wavefront.
403 397
404config SND_WAVEFRONT_FIRMWARE_IN_KERNEL 398config SND_MSND_PINNACLE
405 bool "In-kernel firmware for Wavefront" 399 tristate "Turtle Beach MultiSound Pinnacle/Fiji driver"
406 depends on SND_WAVEFRONT 400 depends on X86 && EXPERIMENTAL
407 default y 401 select FW_LOADER
402 select SND_MPU401_UART
403 select SND_PCM
404 help
405 Say Y to include support for Turtle Beach MultiSound Pinnacle/
406 Fiji soundcards.
407
408 To compile this driver as a module, choose M here: the module
409 will be called snd-msnd-pinnacle.
410
411config SND_MSND_CLASSIC
412 tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey"
413 depends on X86 && EXPERIMENTAL
414 select FW_LOADER
415 select SND_MPU401_UART
416 select SND_PCM
408 help 417 help
409 Say Y here to include the static firmware for FX DSP built in 418 Say M here if you have a Turtle Beach MultiSound Classic, Tahiti or
410 the kernel for the Wavefront driver. If you choose N here, 419 Monterey (not for the Pinnacle or Fiji).
411 you need to install the firmware files from the 420
412 alsa-firmware package. 421 See <file:Documentation/sound/oss/MultiSound> for important information
422 about this driver. Note that it has been discontinued, but the
423 Voyetra Turtle Beach knowledge base entry for it is still available
424 at <http://www.turtlebeach.com/site/kb_ftp/790.asp>.
425
426 To compile this driver as a module, choose M here: the module
427 will be called snd-msnd-classic.
413 428
414endif # SND_ISA 429endif # SND_ISA
415 430
diff --git a/sound/isa/Makefile b/sound/isa/Makefile
index 63af13d901a5..b906b9a1a81e 100644
--- a/sound/isa/Makefile
+++ b/sound/isa/Makefile
@@ -26,5 +26,5 @@ obj-$(CONFIG_SND_SC6000) += snd-sc6000.o
26obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o 26obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o
27obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o 27obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o
28 28
29obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ opti9xx/ \ 29obj-$(CONFIG_SND) += ad1816a/ ad1848/ cs423x/ es1688/ gus/ msnd/ opti9xx/ \
30 sb/ wavefront/ wss/ 30 sb/ wavefront/ wss/
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 9660e598232c..bbcbf92a8ebe 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -156,6 +156,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
156 struct snd_card_ad1816a *acard; 156 struct snd_card_ad1816a *acard;
157 struct snd_ad1816a *chip; 157 struct snd_ad1816a *chip;
158 struct snd_opl3 *opl3; 158 struct snd_opl3 *opl3;
159 struct snd_timer *timer;
159 160
160 error = snd_card_create(index[dev], id[dev], THIS_MODULE, 161 error = snd_card_create(index[dev], id[dev], THIS_MODULE,
161 sizeof(struct snd_card_ad1816a), &card); 162 sizeof(struct snd_card_ad1816a), &card);
@@ -195,6 +196,12 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
195 return error; 196 return error;
196 } 197 }
197 198
199 error = snd_ad1816a_timer(chip, 0, &timer);
200 if (error < 0) {
201 snd_card_free(card);
202 return error;
203 }
204
198 if (mpu_port[dev] > 0) { 205 if (mpu_port[dev] > 0) {
199 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 206 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
200 mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED, 207 mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED,
@@ -208,11 +215,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
208 OPL3_HW_AUTO, 0, &opl3) < 0) { 215 OPL3_HW_AUTO, 0, &opl3) < 0) {
209 printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2); 216 printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2);
210 } else { 217 } else {
211 if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) { 218 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
212 snd_card_free(card); 219 if (error < 0) {
213 return error;
214 }
215 if ((error = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
216 snd_card_free(card); 220 snd_card_free(card);
217 return error; 221 return error;
218 } 222 }
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 3bfca7c59baf..05aef8b97e96 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -37,7 +37,7 @@ static inline int snd_ad1816a_busy_wait(struct snd_ad1816a *chip)
37 if (inb(AD1816A_REG(AD1816A_CHIP_STATUS)) & AD1816A_READY) 37 if (inb(AD1816A_REG(AD1816A_CHIP_STATUS)) & AD1816A_READY)
38 return 0; 38 return 0;
39 39
40 snd_printk("chip busy.\n"); 40 snd_printk(KERN_WARNING "chip busy.\n");
41 return -EBUSY; 41 return -EBUSY;
42} 42}
43 43
@@ -196,7 +196,7 @@ static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what,
196 spin_unlock(&chip->lock); 196 spin_unlock(&chip->lock);
197 break; 197 break;
198 default: 198 default:
199 snd_printk("invalid trigger mode 0x%x.\n", what); 199 snd_printk(KERN_WARNING "invalid trigger mode 0x%x.\n", what);
200 error = -EINVAL; 200 error = -EINVAL;
201 } 201 }
202 202
@@ -377,7 +377,6 @@ static struct snd_pcm_hardware snd_ad1816a_capture = {
377 .fifo_size = 0, 377 .fifo_size = 0,
378}; 378};
379 379
380#if 0 /* not used now */
381static int snd_ad1816a_timer_close(struct snd_timer *timer) 380static int snd_ad1816a_timer_close(struct snd_timer *timer)
382{ 381{
383 struct snd_ad1816a *chip = snd_timer_chip(timer); 382 struct snd_ad1816a *chip = snd_timer_chip(timer);
@@ -442,8 +441,6 @@ static struct snd_timer_hardware snd_ad1816a_timer_table = {
442 .start = snd_ad1816a_timer_start, 441 .start = snd_ad1816a_timer_start,
443 .stop = snd_ad1816a_timer_stop, 442 .stop = snd_ad1816a_timer_stop,
444}; 443};
445#endif /* not used now */
446
447 444
448static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream) 445static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream)
449{ 446{
@@ -568,7 +565,7 @@ static const char __devinit *snd_ad1816a_chip_id(struct snd_ad1816a *chip)
568 case AD1816A_HW_AD1815: return "AD1815"; 565 case AD1816A_HW_AD1815: return "AD1815";
569 case AD1816A_HW_AD18MAX10: return "AD18max10"; 566 case AD1816A_HW_AD18MAX10: return "AD18max10";
570 default: 567 default:
571 snd_printk("Unknown chip version %d:%d.\n", 568 snd_printk(KERN_WARNING "Unknown chip version %d:%d.\n",
572 chip->version, chip->hardware); 569 chip->version, chip->hardware);
573 return "AD1816A - unknown"; 570 return "AD1816A - unknown";
574 } 571 }
@@ -687,7 +684,6 @@ int __devinit snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_p
687 return 0; 684 return 0;
688} 685}
689 686
690#if 0 /* not used now */
691int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer) 687int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer)
692{ 688{
693 struct snd_timer *timer; 689 struct snd_timer *timer;
@@ -709,7 +705,6 @@ int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd
709 *rtimer = timer; 705 *rtimer = timer;
710 return 0; 706 return 0;
711} 707}
712#endif /* not used now */
713 708
714/* 709/*
715 * 710 *
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index 24e60902f8ca..de83608719ea 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -31,11 +31,11 @@
31 * To quickly load the module, 31 * To quickly load the module,
32 * 32 *
33 * modprobe -a snd-cmi8330 sbport=0x220 sbirq=5 sbdma8=1 33 * modprobe -a snd-cmi8330 sbport=0x220 sbirq=5 sbdma8=1
34 * sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 34 * sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 fmport=0x388
35 * 35 *
36 * This card has two mixers and two PCM devices. I've cheesed it such 36 * This card has two mixers and two PCM devices. I've cheesed it such
37 * that recording and playback can be done through the same device. 37 * that recording and playback can be done through the same device.
38 * The driver "magically" routes the capturing to the AD1848 codec, 38 * The driver "magically" routes the capturing to the CMI8330 codec,
39 * and playback to the SB16 codec. This allows for full-duplex mode 39 * and playback to the SB16 codec. This allows for full-duplex mode
40 * to some extent. 40 * to some extent.
41 * The utilities in alsa-utils are aware of both devices, so passing 41 * The utilities in alsa-utils are aware of both devices, so passing
@@ -51,6 +51,8 @@
51#include <linux/moduleparam.h> 51#include <linux/moduleparam.h>
52#include <sound/core.h> 52#include <sound/core.h>
53#include <sound/wss.h> 53#include <sound/wss.h>
54#include <sound/opl3.h>
55#include <sound/mpu401.h>
54#include <sound/sb.h> 56#include <sound/sb.h>
55#include <sound/initval.h> 57#include <sound/initval.h>
56 58
@@ -79,6 +81,9 @@ static int sbdma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
79static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 81static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
80static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 82static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
81static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; 83static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
84static long fmport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
85static long mpuport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
86static int mpuirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
82 87
83module_param_array(index, int, NULL, 0444); 88module_param_array(index, int, NULL, 0444);
84MODULE_PARM_DESC(index, "Index value for CMI8330 soundcard."); 89MODULE_PARM_DESC(index, "Index value for CMI8330 soundcard.");
@@ -107,6 +112,12 @@ MODULE_PARM_DESC(wssirq, "IRQ # for CMI8330 WSS driver.");
107module_param_array(wssdma, int, NULL, 0444); 112module_param_array(wssdma, int, NULL, 0444);
108MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); 113MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
109 114
115module_param_array(fmport, long, NULL, 0444);
116MODULE_PARM_DESC(fmport, "FM port # for CMI8330 driver.");
117module_param_array(mpuport, long, NULL, 0444);
118MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8330 driver.");
119module_param_array(mpuirq, int, NULL, 0444);
120MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8330 MPU-401 port.");
110#ifdef CONFIG_PNP 121#ifdef CONFIG_PNP
111static int isa_registered; 122static int isa_registered;
112static int pnp_registered; 123static int pnp_registered;
@@ -149,6 +160,7 @@ struct snd_cmi8330 {
149#ifdef CONFIG_PNP 160#ifdef CONFIG_PNP
150 struct pnp_dev *cap; 161 struct pnp_dev *cap;
151 struct pnp_dev *play; 162 struct pnp_dev *play;
163 struct pnp_dev *mpu;
152#endif 164#endif
153 struct snd_card *card; 165 struct snd_card *card;
154 struct snd_wss *wss; 166 struct snd_wss *wss;
@@ -165,7 +177,7 @@ struct snd_cmi8330 {
165#ifdef CONFIG_PNP 177#ifdef CONFIG_PNP
166 178
167static struct pnp_card_device_id snd_cmi8330_pnpids[] = { 179static struct pnp_card_device_id snd_cmi8330_pnpids[] = {
168 { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" } } }, 180 { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } },
169 { .id = "" } 181 { .id = "" }
170}; 182};
171 183
@@ -219,8 +231,10 @@ WSS_SINGLE("3D Control - Switch", 0,
219 CMI8330_RMUX3D, 5, 1, 1), 231 CMI8330_RMUX3D, 5, 1, 1),
220WSS_SINGLE("PC Speaker Playback Volume", 0, 232WSS_SINGLE("PC Speaker Playback Volume", 0,
221 CMI8330_OUTPUTVOL, 3, 3, 0), 233 CMI8330_OUTPUTVOL, 3, 3, 0),
222WSS_SINGLE("FM Playback Switch", 0, 234WSS_DOUBLE("FM Playback Switch", 0,
223 CMI8330_RECMUX, 3, 1, 1), 235 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
236WSS_DOUBLE("FM Playback Volume", 0,
237 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1),
224WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0, 238WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0,
225 CMI8330_RMUX3D, 7, 1, 1), 239 CMI8330_RMUX3D, 7, 1, 1),
226WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0, 240WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0,
@@ -323,16 +337,21 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
323 if (acard->play == NULL) 337 if (acard->play == NULL)
324 return -EBUSY; 338 return -EBUSY;
325 339
340 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
341 if (acard->play == NULL)
342 return -EBUSY;
343
326 pdev = acard->cap; 344 pdev = acard->cap;
327 345
328 err = pnp_activate_dev(pdev); 346 err = pnp_activate_dev(pdev);
329 if (err < 0) { 347 if (err < 0) {
330 snd_printk(KERN_ERR "CMI8330/C3D (AD1848) PnP configure failure\n"); 348 snd_printk(KERN_ERR "CMI8330/C3D PnP configure failure\n");
331 return -EBUSY; 349 return -EBUSY;
332 } 350 }
333 wssport[dev] = pnp_port_start(pdev, 0); 351 wssport[dev] = pnp_port_start(pdev, 0);
334 wssdma[dev] = pnp_dma(pdev, 0); 352 wssdma[dev] = pnp_dma(pdev, 0);
335 wssirq[dev] = pnp_irq(pdev, 0); 353 wssirq[dev] = pnp_irq(pdev, 0);
354 fmport[dev] = pnp_port_start(pdev, 1);
336 355
337 /* allocate SB16 resources */ 356 /* allocate SB16 resources */
338 pdev = acard->play; 357 pdev = acard->play;
@@ -347,6 +366,17 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
347 sbdma16[dev] = pnp_dma(pdev, 1); 366 sbdma16[dev] = pnp_dma(pdev, 1);
348 sbirq[dev] = pnp_irq(pdev, 0); 367 sbirq[dev] = pnp_irq(pdev, 0);
349 368
369 /* allocate MPU-401 resources */
370 pdev = acard->mpu;
371
372 err = pnp_activate_dev(pdev);
373 if (err < 0) {
374 snd_printk(KERN_ERR
375 "CMI8330/C3D (MPU-401) PnP configure failure\n");
376 return -EBUSY;
377 }
378 mpuport[dev] = pnp_port_start(pdev, 0);
379 mpuirq[dev] = pnp_irq(pdev, 0);
350 return 0; 380 return 0;
351} 381}
352#endif 382#endif
@@ -489,6 +519,7 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
489{ 519{
490 struct snd_cmi8330 *acard; 520 struct snd_cmi8330 *acard;
491 int i, err; 521 int i, err;
522 struct snd_opl3 *opl3;
492 523
493 acard = card->private_data; 524 acard = card->private_data;
494 err = snd_wss_create(card, wssport[dev] + 4, -1, 525 err = snd_wss_create(card, wssport[dev] + 4, -1,
@@ -496,11 +527,11 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
496 wssdma[dev], -1, 527 wssdma[dev], -1,
497 WSS_HW_DETECT, 0, &acard->wss); 528 WSS_HW_DETECT, 0, &acard->wss);
498 if (err < 0) { 529 if (err < 0) {
499 snd_printk(KERN_ERR PFX "(AD1848) device busy??\n"); 530 snd_printk(KERN_ERR PFX "(CMI8330) device busy??\n");
500 return err; 531 return err;
501 } 532 }
502 if (acard->wss->hardware != WSS_HW_CMI8330) { 533 if (acard->wss->hardware != WSS_HW_CMI8330) {
503 snd_printk(KERN_ERR PFX "(AD1848) not found during probe\n"); 534 snd_printk(KERN_ERR PFX "(CMI8330) not found during probe\n");
504 return -ENODEV; 535 return -ENODEV;
505 } 536 }
506 537
@@ -532,6 +563,27 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
532 snd_printk(KERN_ERR PFX "failed to create pcms\n"); 563 snd_printk(KERN_ERR PFX "failed to create pcms\n");
533 return err; 564 return err;
534 } 565 }
566 if (fmport[dev] != SNDRV_AUTO_PORT) {
567 if (snd_opl3_create(card,
568 fmport[dev], fmport[dev] + 2,
569 OPL3_HW_AUTO, 0, &opl3) < 0) {
570 snd_printk(KERN_ERR PFX
571 "no OPL device at 0x%lx-0x%lx ?\n",
572 fmport[dev], fmport[dev] + 2);
573 } else {
574 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
575 if (err < 0)
576 return err;
577 }
578 }
579
580 if (mpuport[dev] != SNDRV_AUTO_PORT) {
581 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
582 mpuport[dev], 0, mpuirq[dev],
583 IRQF_DISABLED, NULL) < 0)
584 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n",
585 mpuport[dev]);
586 }
535 587
536 strcpy(card->driver, "CMI8330/C3D"); 588 strcpy(card->driver, "CMI8330/C3D");
537 strcpy(card->shortname, "C-Media CMI8330/C3D"); 589 strcpy(card->shortname, "C-Media CMI8330/C3D");
diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile
index 5870ca21ab59..6d397e8d54ac 100644
--- a/sound/isa/cs423x/Makefile
+++ b/sound/isa/cs423x/Makefile
@@ -3,13 +3,11 @@
3# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz> 3# Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
4# 4#
5 5
6snd-cs4236-lib-objs := cs4236_lib.o
7snd-cs4231-objs := cs4231.o 6snd-cs4231-objs := cs4231.o
8snd-cs4232-objs := cs4232.o 7snd-cs4236-objs := cs4236.o cs4236_lib.o
9snd-cs4236-objs := cs4236.o
10 8
11# Toplevel Module Dependency 9# Toplevel Module Dependency
12obj-$(CONFIG_SND_CS4231) += snd-cs4231.o 10obj-$(CONFIG_SND_CS4231) += snd-cs4231.o
13obj-$(CONFIG_SND_CS4232) += snd-cs4232.o 11obj-$(CONFIG_SND_CS4236) += snd-cs4236.o
14obj-$(CONFIG_SND_CS4236) += snd-cs4236.o snd-cs4236-lib.o 12
15 13
diff --git a/sound/isa/cs423x/cs4232.c b/sound/isa/cs423x/cs4232.c
deleted file mode 100644
index 9fad2e6c0c2c..000000000000
--- a/sound/isa/cs423x/cs4232.c
+++ /dev/null
@@ -1,2 +0,0 @@
1#define CS4232
2#include "cs4236.c"
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index f7845986f467..a076a6ce8071 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -33,17 +33,14 @@
33 33
34MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); 34MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
35MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
36#ifdef CS4232 36MODULE_DESCRIPTION("Cirrus Logic CS4232-9");
37MODULE_DESCRIPTION("Cirrus Logic CS4232");
38MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000}," 37MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000},"
39 "{Turtle Beach,Tropez Plus}," 38 "{Turtle Beach,Tropez Plus},"
40 "{SIC CrystalWave 32}," 39 "{SIC CrystalWave 32},"
41 "{Hewlett Packard,Omnibook 5500}," 40 "{Hewlett Packard,Omnibook 5500},"
42 "{TerraTec,Maestro 32/96}," 41 "{TerraTec,Maestro 32/96},"
43 "{Philips,PCA70PS}}"); 42 "{Philips,PCA70PS}},"
44#else 43 "{{Crystal Semiconductors,CS4235},"
45MODULE_DESCRIPTION("Cirrus Logic CS4235-9");
46MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235},"
47 "{Crystal Semiconductors,CS4236}," 44 "{Crystal Semiconductors,CS4236},"
48 "{Crystal Semiconductors,CS4237}," 45 "{Crystal Semiconductors,CS4237},"
49 "{Crystal Semiconductors,CS4238}," 46 "{Crystal Semiconductors,CS4238},"
@@ -70,15 +67,11 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235},"
70 "{Typhoon Soundsystem,CS4236B}," 67 "{Typhoon Soundsystem,CS4236B},"
71 "{Turtle Beach,Malibu}," 68 "{Turtle Beach,Malibu},"
72 "{Unknown,Digital PC 5000 Onboard}}"); 69 "{Unknown,Digital PC 5000 Onboard}}");
73#endif
74 70
75#ifdef CS4232 71MODULE_ALIAS("snd_cs4232");
76#define IDENT "CS4232" 72
77#define DEV_NAME "cs4232" 73#define IDENT "CS4232+"
78#else 74#define DEV_NAME "cs4232+"
79#define IDENT "CS4236+"
80#define DEV_NAME "cs4236"
81#endif
82 75
83static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 76static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
84static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 77static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -128,9 +121,7 @@ MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
128#ifdef CONFIG_PNP 121#ifdef CONFIG_PNP
129static int isa_registered; 122static int isa_registered;
130static int pnpc_registered; 123static int pnpc_registered;
131#ifdef CS4232
132static int pnp_registered; 124static int pnp_registered;
133#endif
134#endif /* CONFIG_PNP */ 125#endif /* CONFIG_PNP */
135 126
136struct snd_card_cs4236 { 127struct snd_card_cs4236 {
@@ -145,11 +136,10 @@ struct snd_card_cs4236 {
145 136
146#ifdef CONFIG_PNP 137#ifdef CONFIG_PNP
147 138
148#ifdef CS4232
149/* 139/*
150 * PNP BIOS 140 * PNP BIOS
151 */ 141 */
152static const struct pnp_device_id snd_cs4232_pnpbiosids[] = { 142static const struct pnp_device_id snd_cs423x_pnpbiosids[] = {
153 { .id = "CSC0100" }, 143 { .id = "CSC0100" },
154 { .id = "CSC0000" }, 144 { .id = "CSC0000" },
155 /* Guillemot Turtlebeach something appears to be cs4232 compatible 145 /* Guillemot Turtlebeach something appears to be cs4232 compatible
@@ -157,10 +147,8 @@ static const struct pnp_device_id snd_cs4232_pnpbiosids[] = {
157 { .id = "GIM0100" }, 147 { .id = "GIM0100" },
158 { .id = "" } 148 { .id = "" }
159}; 149};
160MODULE_DEVICE_TABLE(pnp, snd_cs4232_pnpbiosids); 150MODULE_DEVICE_TABLE(pnp, snd_cs423x_pnpbiosids);
161#endif /* CS4232 */
162 151
163#ifdef CS4232
164#define CS423X_ISAPNP_DRIVER "cs4232_isapnp" 152#define CS423X_ISAPNP_DRIVER "cs4232_isapnp"
165static struct pnp_card_device_id snd_cs423x_pnpids[] = { 153static struct pnp_card_device_id snd_cs423x_pnpids[] = {
166 /* Philips PCA70PS */ 154 /* Philips PCA70PS */
@@ -179,12 +167,6 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = {
179 { .id = "CSCf032", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, 167 { .id = "CSCf032", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
180 /* Netfinity 3000 on-board soundcard */ 168 /* Netfinity 3000 on-board soundcard */
181 { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } }, 169 { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } },
182 /* --- */
183 { .id = "" } /* end */
184};
185#else /* CS4236 */
186#define CS423X_ISAPNP_DRIVER "cs4236_isapnp"
187static struct pnp_card_device_id snd_cs423x_pnpids[] = {
188 /* Intel Marlin Spike Motherboard - CS4235 */ 170 /* Intel Marlin Spike Motherboard - CS4235 */
189 { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, 171 { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
190 /* Intel Marlin Spike Motherboard (#2) - CS4235 */ 172 /* Intel Marlin Spike Motherboard (#2) - CS4235 */
@@ -266,7 +248,6 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = {
266 /* --- */ 248 /* --- */
267 { .id = "" } /* end */ 249 { .id = "" } /* end */
268}; 250};
269#endif
270 251
271MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids); 252MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids);
272 253
@@ -323,17 +304,19 @@ static int __devinit snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev)
323 return 0; 304 return 0;
324} 305}
325 306
326#ifdef CS4232 307static int __devinit snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard,
327static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard, 308 struct pnp_dev *pdev,
328 struct pnp_dev *pdev) 309 struct pnp_dev *cdev)
329{ 310{
330 acard->wss = pdev; 311 acard->wss = pdev;
331 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) 312 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0)
332 return -EBUSY; 313 return -EBUSY;
333 cport[dev] = -1; 314 if (cdev)
315 cport[dev] = pnp_port_start(cdev, 0);
316 else
317 cport[dev] = -1;
334 return 0; 318 return 0;
335} 319}
336#endif
337 320
338static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, 321static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard,
339 struct pnp_card_link *card, 322 struct pnp_card_link *card,
@@ -411,40 +394,39 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
411 return -EBUSY; 394 return -EBUSY;
412 } 395 }
413 396
414#ifdef CS4232
415 err = snd_wss_create(card, port[dev], cport[dev], 397 err = snd_wss_create(card, port[dev], cport[dev],
416 irq[dev], 398 irq[dev],
417 dma1[dev], dma2[dev], 399 dma1[dev], dma2[dev],
418 WSS_HW_DETECT, 0, &chip); 400 WSS_HW_DETECT3, 0, &chip);
419 if (err < 0)
420 return err;
421 acard->chip = chip;
422
423 err = snd_wss_pcm(chip, 0, &pcm);
424 if (err < 0)
425 return err;
426
427 err = snd_wss_mixer(chip);
428 if (err < 0) 401 if (err < 0)
429 return err; 402 return err;
430 403 if (chip->hardware & WSS_HW_CS4236B_MASK) {
431#else /* CS4236 */ 404 snd_wss_free(chip);
432 err = snd_cs4236_create(card, 405 err = snd_cs4236_create(card,
433 port[dev], cport[dev], 406 port[dev], cport[dev],
434 irq[dev], dma1[dev], dma2[dev], 407 irq[dev], dma1[dev], dma2[dev],
435 WSS_HW_DETECT, 0, &chip); 408 WSS_HW_DETECT, 0, &chip);
436 if (err < 0) 409 if (err < 0)
437 return err; 410 return err;
438 acard->chip = chip; 411 acard->chip = chip;
439 412
440 err = snd_cs4236_pcm(chip, 0, &pcm); 413 err = snd_cs4236_pcm(chip, 0, &pcm);
441 if (err < 0) 414 if (err < 0)
442 return err; 415 return err;
443 416
444 err = snd_cs4236_mixer(chip); 417 err = snd_cs4236_mixer(chip);
445 if (err < 0) 418 if (err < 0)
446 return err; 419 return err;
447#endif 420 } else {
421 acard->chip = chip;
422 err = snd_wss_pcm(chip, 0, &pcm);
423 if (err < 0)
424 return err;
425
426 err = snd_wss_mixer(chip);
427 if (err < 0)
428 return err;
429 }
448 strcpy(card->driver, pcm->name); 430 strcpy(card->driver, pcm->name);
449 strcpy(card->shortname, pcm->name); 431 strcpy(card->shortname, pcm->name);
450 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", 432 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
@@ -579,13 +561,14 @@ static struct isa_driver cs423x_isa_driver = {
579 561
580 562
581#ifdef CONFIG_PNP 563#ifdef CONFIG_PNP
582#ifdef CS4232 564static int __devinit snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
583static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
584 const struct pnp_device_id *id) 565 const struct pnp_device_id *id)
585{ 566{
586 static int dev; 567 static int dev;
587 int err; 568 int err;
588 struct snd_card *card; 569 struct snd_card *card;
570 struct pnp_dev *cdev;
571 char cid[PNP_ID_LEN];
589 572
590 if (pnp_device_is_isapnp(pdev)) 573 if (pnp_device_is_isapnp(pdev))
591 return -ENOENT; /* we have another procedure - card */ 574 return -ENOENT; /* we have another procedure - card */
@@ -596,10 +579,19 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
596 if (dev >= SNDRV_CARDS) 579 if (dev >= SNDRV_CARDS)
597 return -ENODEV; 580 return -ENODEV;
598 581
582 /* prepare second id */
583 strcpy(cid, pdev->id[0].id);
584 cid[5] = '1';
585 cdev = NULL;
586 list_for_each_entry(cdev, &(pdev->protocol->devices), protocol_list) {
587 if (!strcmp(cdev->id[0].id, cid))
588 break;
589 }
599 err = snd_cs423x_card_new(dev, &card); 590 err = snd_cs423x_card_new(dev, &card);
600 if (err < 0) 591 if (err < 0)
601 return err; 592 return err;
602 if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { 593 err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);
594 if (err < 0) {
603 printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); 595 printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n");
604 snd_card_free(card); 596 snd_card_free(card);
605 return err; 597 return err;
@@ -614,35 +606,34 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
614 return 0; 606 return 0;
615} 607}
616 608
617static void __devexit snd_cs4232_pnp_remove(struct pnp_dev * pdev) 609static void __devexit snd_cs423x_pnp_remove(struct pnp_dev *pdev)
618{ 610{
619 snd_card_free(pnp_get_drvdata(pdev)); 611 snd_card_free(pnp_get_drvdata(pdev));
620 pnp_set_drvdata(pdev, NULL); 612 pnp_set_drvdata(pdev, NULL);
621} 613}
622 614
623#ifdef CONFIG_PM 615#ifdef CONFIG_PM
624static int snd_cs4232_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) 616static int snd_cs423x_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
625{ 617{
626 return snd_cs423x_suspend(pnp_get_drvdata(pdev)); 618 return snd_cs423x_suspend(pnp_get_drvdata(pdev));
627} 619}
628 620
629static int snd_cs4232_pnp_resume(struct pnp_dev *pdev) 621static int snd_cs423x_pnp_resume(struct pnp_dev *pdev)
630{ 622{
631 return snd_cs423x_resume(pnp_get_drvdata(pdev)); 623 return snd_cs423x_resume(pnp_get_drvdata(pdev));
632} 624}
633#endif 625#endif
634 626
635static struct pnp_driver cs4232_pnp_driver = { 627static struct pnp_driver cs423x_pnp_driver = {
636 .name = "cs4232-pnpbios", 628 .name = "cs423x-pnpbios",
637 .id_table = snd_cs4232_pnpbiosids, 629 .id_table = snd_cs423x_pnpbiosids,
638 .probe = snd_cs4232_pnpbios_detect, 630 .probe = snd_cs423x_pnpbios_detect,
639 .remove = __devexit_p(snd_cs4232_pnp_remove), 631 .remove = __devexit_p(snd_cs423x_pnp_remove),
640#ifdef CONFIG_PM 632#ifdef CONFIG_PM
641 .suspend = snd_cs4232_pnp_suspend, 633 .suspend = snd_cs423x_pnp_suspend,
642 .resume = snd_cs4232_pnp_resume, 634 .resume = snd_cs423x_pnp_resume,
643#endif 635#endif
644}; 636};
645#endif /* CS4232 */
646 637
647static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, 638static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
648 const struct pnp_card_device_id *pid) 639 const struct pnp_card_device_id *pid)
@@ -716,18 +707,14 @@ static int __init alsa_card_cs423x_init(void)
716#ifdef CONFIG_PNP 707#ifdef CONFIG_PNP
717 if (!err) 708 if (!err)
718 isa_registered = 1; 709 isa_registered = 1;
719#ifdef CS4232 710 err = pnp_register_driver(&cs423x_pnp_driver);
720 err = pnp_register_driver(&cs4232_pnp_driver);
721 if (!err) 711 if (!err)
722 pnp_registered = 1; 712 pnp_registered = 1;
723#endif
724 err = pnp_register_card_driver(&cs423x_pnpc_driver); 713 err = pnp_register_card_driver(&cs423x_pnpc_driver);
725 if (!err) 714 if (!err)
726 pnpc_registered = 1; 715 pnpc_registered = 1;
727#ifdef CS4232
728 if (pnp_registered) 716 if (pnp_registered)
729 err = 0; 717 err = 0;
730#endif
731 if (isa_registered) 718 if (isa_registered)
732 err = 0; 719 err = 0;
733#endif 720#endif
@@ -739,10 +726,8 @@ static void __exit alsa_card_cs423x_exit(void)
739#ifdef CONFIG_PNP 726#ifdef CONFIG_PNP
740 if (pnpc_registered) 727 if (pnpc_registered)
741 pnp_unregister_card_driver(&cs423x_pnpc_driver); 728 pnp_unregister_card_driver(&cs423x_pnpc_driver);
742#ifdef CS4232
743 if (pnp_registered) 729 if (pnp_registered)
744 pnp_unregister_driver(&cs4232_pnp_driver); 730 pnp_unregister_driver(&cs423x_pnp_driver);
745#endif
746 if (isa_registered) 731 if (isa_registered)
747#endif 732#endif
748 isa_unregister_driver(&cs423x_isa_driver); 733 isa_unregister_driver(&cs423x_isa_driver);
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 6a85fdc53b60..38835f31298b 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -88,10 +88,6 @@
88#include <sound/wss.h> 88#include <sound/wss.h>
89#include <sound/asoundef.h> 89#include <sound/asoundef.h>
90 90
91MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
92MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips");
93MODULE_LICENSE("GPL");
94
95/* 91/*
96 * 92 *
97 */ 93 */
@@ -286,7 +282,8 @@ int snd_cs4236_create(struct snd_card *card,
286 if (hardware == WSS_HW_DETECT) 282 if (hardware == WSS_HW_DETECT)
287 hardware = WSS_HW_DETECT3; 283 hardware = WSS_HW_DETECT3;
288 if (cport < 0x100) { 284 if (cport < 0x100) {
289 snd_printk("please, specify control port for CS4236+ chips\n"); 285 snd_printk(KERN_ERR "please, specify control port "
286 "for CS4236+ chips\n");
290 return -ENODEV; 287 return -ENODEV;
291 } 288 }
292 err = snd_wss_create(card, port, cport, 289 err = snd_wss_create(card, port, cport,
@@ -295,7 +292,8 @@ int snd_cs4236_create(struct snd_card *card,
295 return err; 292 return err;
296 293
297 if (!(chip->hardware & WSS_HW_CS4236B_MASK)) { 294 if (!(chip->hardware & WSS_HW_CS4236B_MASK)) {
298 snd_printk("CS4236+: MODE3 and extended registers not available, hardware=0x%x\n",chip->hardware); 295 snd_printk(KERN_ERR "CS4236+: MODE3 and extended registers "
296 "not available, hardware=0x%x\n", chip->hardware);
299 snd_device_free(card, chip); 297 snd_device_free(card, chip);
300 return -ENODEV; 298 return -ENODEV;
301 } 299 }
@@ -303,16 +301,19 @@ int snd_cs4236_create(struct snd_card *card,
303 { 301 {
304 int idx; 302 int idx;
305 for (idx = 0; idx < 8; idx++) 303 for (idx = 0; idx < 8; idx++)
306 snd_printk("CD%i = 0x%x\n", idx, inb(chip->cport + idx)); 304 snd_printk(KERN_DEBUG "CD%i = 0x%x\n",
305 idx, inb(chip->cport + idx));
307 for (idx = 0; idx < 9; idx++) 306 for (idx = 0; idx < 9; idx++)
308 snd_printk("C%i = 0x%x\n", idx, snd_cs4236_ctrl_in(chip, idx)); 307 snd_printk(KERN_DEBUG "C%i = 0x%x\n",
308 idx, snd_cs4236_ctrl_in(chip, idx));
309 } 309 }
310#endif 310#endif
311 ver1 = snd_cs4236_ctrl_in(chip, 1); 311 ver1 = snd_cs4236_ctrl_in(chip, 1);
312 ver2 = snd_cs4236_ext_in(chip, CS4236_VERSION); 312 ver2 = snd_cs4236_ext_in(chip, CS4236_VERSION);
313 snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2); 313 snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2);
314 if (ver1 != ver2) { 314 if (ver1 != ver2) {
315 snd_printk("CS4236+ chip detected, but control port 0x%lx is not valid\n", cport); 315 snd_printk(KERN_ERR "CS4236+ chip detected, but "
316 "control port 0x%lx is not valid\n", cport);
316 snd_device_free(card, chip); 317 snd_device_free(card, chip);
317 return -ENODEV; 318 return -ENODEV;
318 } 319 }
@@ -883,7 +884,8 @@ static int snd_cs4236_get_iec958_switch(struct snd_kcontrol *kcontrol, struct sn
883 spin_lock_irqsave(&chip->reg_lock, flags); 884 spin_lock_irqsave(&chip->reg_lock, flags);
884 ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0; 885 ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0;
885#if 0 886#if 0
886 printk("get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 887 printk(KERN_DEBUG "get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, "
888 "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
887 snd_wss_in(chip, CS4231_ALT_FEATURE_1), 889 snd_wss_in(chip, CS4231_ALT_FEATURE_1),
888 snd_cs4236_ctrl_in(chip, 3), 890 snd_cs4236_ctrl_in(chip, 3),
889 snd_cs4236_ctrl_in(chip, 4), 891 snd_cs4236_ctrl_in(chip, 4),
@@ -920,7 +922,8 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn
920 mutex_unlock(&chip->mce_mutex); 922 mutex_unlock(&chip->mce_mutex);
921 923
922#if 0 924#if 0
923 printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 925 printk(KERN_DEBUG "set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, "
926 "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
924 snd_wss_in(chip, CS4231_ALT_FEATURE_1), 927 snd_wss_in(chip, CS4231_ALT_FEATURE_1),
925 snd_cs4236_ctrl_in(chip, 3), 928 snd_cs4236_ctrl_in(chip, 3),
926 snd_cs4236_ctrl_in(chip, 4), 929 snd_cs4236_ctrl_in(chip, 4),
@@ -1015,23 +1018,3 @@ int snd_cs4236_mixer(struct snd_wss *chip)
1015 } 1018 }
1016 return 0; 1019 return 0;
1017} 1020}
1018
1019EXPORT_SYMBOL(snd_cs4236_create);
1020EXPORT_SYMBOL(snd_cs4236_pcm);
1021EXPORT_SYMBOL(snd_cs4236_mixer);
1022
1023/*
1024 * INIT part
1025 */
1026
1027static int __init alsa_cs4236_init(void)
1028{
1029 return 0;
1030}
1031
1032static void __exit alsa_cs4236_exit(void)
1033{
1034}
1035
1036module_init(alsa_cs4236_init)
1037module_exit(alsa_cs4236_exit)
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index d746750410ea..442b081cafb7 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -49,6 +49,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
51static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 51static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
52static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */
52static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 53static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
53static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ 54static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
54static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ 55static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
@@ -65,6 +66,8 @@ MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver.");
65module_param_array(mpu_port, long, NULL, 0444); 66module_param_array(mpu_port, long, NULL, 0444);
66MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); 67MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver.");
67module_param_array(irq, int, NULL, 0444); 68module_param_array(irq, int, NULL, 0444);
69module_param_array(fm_port, long, NULL, 0444);
70MODULE_PARM_DESC(fm_port, "FM port # for ES1688 driver.");
68MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); 71MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver.");
69module_param_array(mpu_irq, int, NULL, 0444); 72module_param_array(mpu_irq, int, NULL, 0444);
70MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); 73MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver.");
@@ -143,13 +146,19 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
143 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, 146 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name,
144 chip->port, chip->irq, chip->dma8); 147 chip->port, chip->irq, chip->dma8);
145 148
146 if (snd_opl3_create(card, chip->port, chip->port + 2, 149 if (fm_port[n] == SNDRV_AUTO_PORT)
147 OPL3_HW_OPL3, 0, &opl3) < 0) 150 fm_port[n] = port[n]; /* share the same port */
148 dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port); 151
149 else { 152 if (fm_port[n] > 0) {
150 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 153 if (snd_opl3_create(card, fm_port[n], fm_port[n] + 2,
151 if (error < 0) 154 OPL3_HW_OPL3, 0, &opl3) < 0)
152 goto out; 155 dev_warn(dev,
156 "opl3 not detected at 0x%lx\n", fm_port[n]);
157 else {
158 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
159 if (error < 0)
160 goto out;
161 }
153 } 162 }
154 163
155 if (mpu_irq[n] >= 0 && mpu_irq[n] != SNDRV_AUTO_IRQ && 164 if (mpu_irq[n] >= 0 && mpu_irq[n] != SNDRV_AUTO_IRQ &&
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index 4fbb508a817f..4c6e14f87f2d 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -45,7 +45,7 @@ static int snd_es1688_dsp_command(struct snd_es1688 *chip, unsigned char val)
45 return 1; 45 return 1;
46 } 46 }
47#ifdef CONFIG_SND_DEBUG 47#ifdef CONFIG_SND_DEBUG
48 printk("snd_es1688_dsp_command: timeout (0x%x)\n", val); 48 printk(KERN_DEBUG "snd_es1688_dsp_command: timeout (0x%x)\n", val);
49#endif 49#endif
50 return 0; 50 return 0;
51} 51}
@@ -167,13 +167,16 @@ static int snd_es1688_probe(struct snd_es1688 *chip)
167 hw = ES1688_HW_AUTO; 167 hw = ES1688_HW_AUTO;
168 switch (chip->version & 0xfff0) { 168 switch (chip->version & 0xfff0) {
169 case 0x4880: 169 case 0x4880:
170 snd_printk("[0x%lx] ESS: AudioDrive ES488 detected, but driver is in another place\n", chip->port); 170 snd_printk(KERN_ERR "[0x%lx] ESS: AudioDrive ES488 detected, "
171 "but driver is in another place\n", chip->port);
171 return -ENODEV; 172 return -ENODEV;
172 case 0x6880: 173 case 0x6880:
173 hw = (chip->version & 0x0f) >= 8 ? ES1688_HW_1688 : ES1688_HW_688; 174 hw = (chip->version & 0x0f) >= 8 ? ES1688_HW_1688 : ES1688_HW_688;
174 break; 175 break;
175 default: 176 default:
176 snd_printk("[0x%lx] ESS: unknown AudioDrive chip with version 0x%x (Jazz16 soundcard?)\n", chip->port, chip->version); 177 snd_printk(KERN_ERR "[0x%lx] ESS: unknown AudioDrive chip "
178 "with version 0x%x (Jazz16 soundcard?)\n",
179 chip->port, chip->version);
177 return -ENODEV; 180 return -ENODEV;
178 } 181 }
179 182
@@ -223,7 +226,7 @@ static int snd_es1688_init(struct snd_es1688 * chip, int enable)
223 } 226 }
224 } 227 }
225#if 0 228#if 0
226 snd_printk("mpu cfg = 0x%x\n", cfg); 229 snd_printk(KERN_DEBUG "mpu cfg = 0x%x\n", cfg);
227#endif 230#endif
228 spin_lock_irqsave(&chip->reg_lock, flags); 231 spin_lock_irqsave(&chip->reg_lock, flags);
229 snd_es1688_mixer_write(chip, 0x40, cfg); 232 snd_es1688_mixer_write(chip, 0x40, cfg);
@@ -237,7 +240,9 @@ static int snd_es1688_init(struct snd_es1688 * chip, int enable)
237 cfg = 0xf0; /* enable only DMA counter interrupt */ 240 cfg = 0xf0; /* enable only DMA counter interrupt */
238 irq_bits = irqs[chip->irq & 0x0f]; 241 irq_bits = irqs[chip->irq & 0x0f];
239 if (irq_bits < 0) { 242 if (irq_bits < 0) {
240 snd_printk("[0x%lx] ESS: bad IRQ %d for ES1688 chip!!\n", chip->port, chip->irq); 243 snd_printk(KERN_ERR "[0x%lx] ESS: bad IRQ %d "
244 "for ES1688 chip!!\n",
245 chip->port, chip->irq);
241#if 0 246#if 0
242 irq_bits = 0; 247 irq_bits = 0;
243 cfg = 0x10; 248 cfg = 0x10;
@@ -250,7 +255,8 @@ static int snd_es1688_init(struct snd_es1688 * chip, int enable)
250 cfg = 0xf0; /* extended mode DMA enable */ 255 cfg = 0xf0; /* extended mode DMA enable */
251 dma = chip->dma8; 256 dma = chip->dma8;
252 if (dma > 3 || dma == 2) { 257 if (dma > 3 || dma == 2) {
253 snd_printk("[0x%lx] ESS: bad DMA channel %d for ES1688 chip!!\n", chip->port, dma); 258 snd_printk(KERN_ERR "[0x%lx] ESS: bad DMA channel %d "
259 "for ES1688 chip!!\n", chip->port, dma);
254#if 0 260#if 0
255 dma_bits = 0; 261 dma_bits = 0;
256 cfg = 0x00; /* disable all DMA */ 262 cfg = 0x00; /* disable all DMA */
@@ -341,8 +347,9 @@ static int snd_es1688_trigger(struct snd_es1688 *chip, int cmd, unsigned char va
341 return -EINVAL; /* something is wrong */ 347 return -EINVAL; /* something is wrong */
342 } 348 }
343#if 0 349#if 0
344 printk("trigger: val = 0x%x, value = 0x%x\n", val, value); 350 printk(KERN_DEBUG "trigger: val = 0x%x, value = 0x%x\n", val, value);
345 printk("trigger: pointer = 0x%x\n", snd_dma_pointer(chip->dma8, chip->dma_size)); 351 printk(KERN_DEBUG "trigger: pointer = 0x%x\n",
352 snd_dma_pointer(chip->dma8, chip->dma_size));
346#endif 353#endif
347 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value); 354 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value);
348 spin_unlock(&chip->reg_lock); 355 spin_unlock(&chip->reg_lock);
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index f45f6116c77a..36c27c832360 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -45,7 +45,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
45 unsigned char dma_cmd; 45 unsigned char dma_cmd;
46 unsigned int address_high; 46 unsigned int address_high;
47 47
48 // snd_printk("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", addr, (long) buf, count); 48 snd_printdd("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n",
49 addr, buf_addr, count);
49 50
50 if (gus->gf1.dma1 > 3) { 51 if (gus->gf1.dma1 > 3) {
51 if (gus->gf1.enh_mode) { 52 if (gus->gf1.enh_mode) {
@@ -77,7 +78,8 @@ static void snd_gf1_dma_program(struct snd_gus_card * gus,
77 snd_gf1_dma_ack(gus); 78 snd_gf1_dma_ack(gus);
78 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE); 79 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
79#if 0 80#if 0
80 snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd); 81 snd_printk(KERN_DEBUG "address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n",
82 address << 1, count, dma_cmd);
81#endif 83#endif
82 spin_lock_irqsave(&gus->reg_lock, flags); 84 spin_lock_irqsave(&gus->reg_lock, flags);
83 if (gus->gf1.enh_mode) { 85 if (gus->gf1.enh_mode) {
@@ -142,7 +144,9 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
142 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); 144 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
143 kfree(block); 145 kfree(block);
144#if 0 146#if 0
145 printk("program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", addr, (long) buffer, count, cmd); 147 snd_printd(KERN_DEBUG "program dma (IRQ) - "
148 "addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
149 block->addr, block->buf_addr, block->count, block->cmd);
146#endif 150#endif
147} 151}
148 152
@@ -203,13 +207,16 @@ int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
203 } 207 }
204 *block = *__block; 208 *block = *__block;
205 block->next = NULL; 209 block->next = NULL;
206#if 0 210
207 printk("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", block->addr, (long) block->buffer, block->count, block->cmd); 211 snd_printdd("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
208#endif 212 block->addr, (long) block->buffer, block->count,
209#if 0 213 block->cmd);
210 printk("gus->gf1.dma_data_pcm_last = 0x%lx\n", (long)gus->gf1.dma_data_pcm_last); 214
211 printk("gus->gf1.dma_data_pcm = 0x%lx\n", (long)gus->gf1.dma_data_pcm); 215 snd_printdd("gus->gf1.dma_data_pcm_last = 0x%lx\n",
212#endif 216 (long)gus->gf1.dma_data_pcm_last);
217 snd_printdd("gus->gf1.dma_data_pcm = 0x%lx\n",
218 (long)gus->gf1.dma_data_pcm);
219
213 spin_lock_irqsave(&gus->dma_lock, flags); 220 spin_lock_irqsave(&gus->dma_lock, flags);
214 if (synth) { 221 if (synth) {
215 if (gus->gf1.dma_data_synth_last) { 222 if (gus->gf1.dma_data_synth_last) {
diff --git a/sound/isa/gus/gus_irq.c b/sound/isa/gus/gus_irq.c
index 041894ddd014..2055aff71b50 100644
--- a/sound/isa/gus/gus_irq.c
+++ b/sound/isa/gus/gus_irq.c
@@ -41,7 +41,7 @@ __again:
41 if (status == 0) 41 if (status == 0)
42 return IRQ_RETVAL(handled); 42 return IRQ_RETVAL(handled);
43 handled = 1; 43 handled = 1;
44 // snd_printk("IRQ: status = 0x%x\n", status); 44 /* snd_printk(KERN_DEBUG "IRQ: status = 0x%x\n", status); */
45 if (status & 0x02) { 45 if (status & 0x02) {
46 STAT_ADD(gus->gf1.interrupt_stat_midi_in); 46 STAT_ADD(gus->gf1.interrupt_stat_midi_in);
47 if (gus->gf1.interrupt_handler_midi_in) 47 if (gus->gf1.interrupt_handler_midi_in)
@@ -65,7 +65,9 @@ __again:
65 continue; /* multi request */ 65 continue; /* multi request */
66 already |= _current_; /* mark request */ 66 already |= _current_; /* mark request */
67#if 0 67#if 0
68 printk("voice = %i, voice_status = 0x%x, voice_verify = %i\n", voice, voice_status, inb(GUSP(gus, GF1PAGE))); 68 printk(KERN_DEBUG "voice = %i, voice_status = 0x%x, "
69 "voice_verify = %i\n",
70 voice, voice_status, inb(GUSP(gus, GF1PAGE)));
69#endif 71#endif
70 pvoice = &gus->gf1.voices[voice]; 72 pvoice = &gus->gf1.voices[voice];
71 if (pvoice->use) { 73 if (pvoice->use) {
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 38510aeb21c6..edb11eefdfe3 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -82,7 +82,10 @@ static int snd_gf1_pcm_block_change(struct snd_pcm_substream *substream,
82 82
83 count += offset & 31; 83 count += offset & 31;
84 offset &= ~31; 84 offset &= ~31;
85 // snd_printk("block change - offset = 0x%x, count = 0x%x\n", offset, count); 85 /*
86 snd_printk(KERN_DEBUG "block change - offset = 0x%x, count = 0x%x\n",
87 offset, count);
88 */
86 memset(&block, 0, sizeof(block)); 89 memset(&block, 0, sizeof(block));
87 block.cmd = SNDRV_GF1_DMA_IRQ; 90 block.cmd = SNDRV_GF1_DMA_IRQ;
88 if (snd_pcm_format_unsigned(runtime->format)) 91 if (snd_pcm_format_unsigned(runtime->format))
@@ -135,7 +138,11 @@ static void snd_gf1_pcm_trigger_up(struct snd_pcm_substream *substream)
135 curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels; 138 curr = begin + (pcmp->bpos * pcmp->block_size) / runtime->channels;
136 end = curr + (pcmp->block_size / runtime->channels); 139 end = curr + (pcmp->block_size / runtime->channels);
137 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1; 140 end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1;
138 // snd_printk("init: curr=0x%x, begin=0x%x, end=0x%x, ctrl=0x%x, ramp=0x%x, rate=0x%x\n", curr, begin, end, voice_ctrl, ramp_ctrl, rate); 141 /*
142 snd_printk(KERN_DEBUG "init: curr=0x%x, begin=0x%x, end=0x%x, "
143 "ctrl=0x%x, ramp=0x%x, rate=0x%x\n",
144 curr, begin, end, voice_ctrl, ramp_ctrl, rate);
145 */
139 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8; 146 pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8;
140 vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; 147 vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
141 spin_lock_irqsave(&gus->reg_lock, flags); 148 spin_lock_irqsave(&gus->reg_lock, flags);
@@ -205,9 +212,11 @@ static void snd_gf1_pcm_interrupt_wave(struct snd_gus_card * gus,
205 ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03; 212 ramp_ctrl = (snd_gf1_read8(gus, SNDRV_GF1_VB_VOLUME_CONTROL) & ~0xa4) | 0x03;
206#if 0 213#if 0
207 snd_gf1_select_voice(gus, pvoice->number); 214 snd_gf1_select_voice(gus, pvoice->number);
208 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 215 printk(KERN_DEBUG "position = 0x%x\n",
216 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
209 snd_gf1_select_voice(gus, pcmp->pvoices[1]->number); 217 snd_gf1_select_voice(gus, pcmp->pvoices[1]->number);
210 printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4)); 218 printk(KERN_DEBUG "position = 0x%x\n",
219 (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
211 snd_gf1_select_voice(gus, pvoice->number); 220 snd_gf1_select_voice(gus, pvoice->number);
212#endif 221#endif
213 pcmp->bpos++; 222 pcmp->bpos++;
@@ -299,7 +308,11 @@ static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf,
299 unsigned int len; 308 unsigned int len;
300 unsigned long flags; 309 unsigned long flags;
301 310
302 // printk("poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n", (int)buf, pos, count, gus->gf1.port); 311 /*
312 printk(KERN_DEBUG
313 "poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n",
314 (int)buf, pos, count, gus->gf1.port);
315 */
303 while (count > 0) { 316 while (count > 0) {
304 len = count; 317 len = count;
305 if (len > 512) /* limit, to allow IRQ */ 318 if (len > 512) /* limit, to allow IRQ */
@@ -680,7 +693,8 @@ static int snd_gf1_pcm_playback_open(struct snd_pcm_substream *substream)
680 runtime->private_free = snd_gf1_pcm_playback_free; 693 runtime->private_free = snd_gf1_pcm_playback_free;
681 694
682#if 0 695#if 0
683 printk("playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer); 696 printk(KERN_DEBUG "playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n",
697 (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer);
684#endif 698#endif
685 if ((err = snd_gf1_dma_init(gus)) < 0) 699 if ((err = snd_gf1_dma_init(gus)) < 0)
686 return err; 700 return err;
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c
index f0af3f79b08b..21cc42e4c4be 100644
--- a/sound/isa/gus/gus_uart.c
+++ b/sound/isa/gus/gus_uart.c
@@ -129,8 +129,14 @@ static int snd_gf1_uart_input_open(struct snd_rawmidi_substream *substream)
129 } 129 }
130 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); 130 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
131#if 0 131#if 0
132 snd_printk("read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); 132 snd_printk(KERN_DEBUG
133 snd_printk("[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x (page = 0x%x)\n", gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102)); 133 "read init - enable = %i, cmd = 0x%x, stat = 0x%x\n",
134 gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
135 snd_printk(KERN_DEBUG
136 "[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x "
137 "(page = 0x%x)\n",
138 gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100),
139 inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102));
134#endif 140#endif
135 return 0; 141 return 0;
136} 142}
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 50e429a120da..534a6eced2b8 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -170,7 +170,7 @@ static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl, int da
170 unsigned long port = bus->private_value; 170 unsigned long port = bus->private_value;
171 171
172#if 0 172#if 0
173 printk("i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); 173 printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
174#endif 174#endif
175 outb((data << 1) | ctrl, port); 175 outb((data << 1) | ctrl, port);
176 udelay(10); 176 udelay(10);
@@ -183,7 +183,7 @@ static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus)
183 183
184 res = inb(port) & 1; 184 res = inb(port) & 1;
185#if 0 185#if 0
186 printk("i2c_getclockline - 0x%lx -> %i\n", port, res); 186 printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res);
187#endif 187#endif
188 return res; 188 return res;
189} 189}
@@ -197,7 +197,7 @@ static int snd_interwave_i2c_getdataline(struct snd_i2c_bus *bus, int ack)
197 udelay(10); 197 udelay(10);
198 res = (inb(port) & 2) >> 1; 198 res = (inb(port) & 2) >> 1;
199#if 0 199#if 0
200 printk("i2c_getdataline - 0x%lx -> %i\n", port, res); 200 printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res);
201#endif 201#endif
202 return res; 202 return res;
203} 203}
@@ -342,7 +342,8 @@ static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *s
342 snd_gf1_poke(gus, local, d); 342 snd_gf1_poke(gus, local, d);
343 snd_gf1_poke(gus, local + 1, d + 1); 343 snd_gf1_poke(gus, local + 1, d + 1);
344#if 0 344#if 0
345 printk("d = 0x%x, local = 0x%x, local + 1 = 0x%x, idx << 22 = 0x%x\n", 345 printk(KERN_DEBUG "d = 0x%x, local = 0x%x, "
346 "local + 1 = 0x%x, idx << 22 = 0x%x\n",
346 d, 347 d,
347 snd_gf1_peek(gus, local), 348 snd_gf1_peek(gus, local),
348 snd_gf1_peek(gus, local + 1), 349 snd_gf1_peek(gus, local + 1),
@@ -356,7 +357,8 @@ static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *s
356 } 357 }
357 } 358 }
358#if 0 359#if 0
359 printk("sizes: %i %i %i %i\n", sizes[0], sizes[1], sizes[2], sizes[3]); 360 printk(KERN_DEBUG "sizes: %i %i %i %i\n",
361 sizes[0], sizes[1], sizes[2], sizes[3]);
360#endif 362#endif
361} 363}
362 364
@@ -410,12 +412,12 @@ static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus)
410 lmct = (psizes[3] << 24) | (psizes[2] << 16) | 412 lmct = (psizes[3] << 24) | (psizes[2] << 16) |
411 (psizes[1] << 8) | psizes[0]; 413 (psizes[1] << 8) | psizes[0];
412#if 0 414#if 0
413 printk("lmct = 0x%08x\n", lmct); 415 printk(KERN_DEBUG "lmct = 0x%08x\n", lmct);
414#endif 416#endif
415 for (i = 0; i < ARRAY_SIZE(lmc); i++) 417 for (i = 0; i < ARRAY_SIZE(lmc); i++)
416 if (lmct == lmc[i]) { 418 if (lmct == lmc[i]) {
417#if 0 419#if 0
418 printk("found !!! %i\n", i); 420 printk(KERN_DEBUG "found !!! %i\n", i);
419#endif 421#endif
420 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i); 422 snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i);
421 snd_interwave_bank_sizes(gus, psizes); 423 snd_interwave_bank_sizes(gus, psizes);
diff --git a/sound/isa/msnd/Makefile b/sound/isa/msnd/Makefile
new file mode 100644
index 000000000000..2171c0aa2f62
--- /dev/null
+++ b/sound/isa/msnd/Makefile
@@ -0,0 +1,9 @@
1
2snd-msnd-lib-objs := msnd.o msnd_midi.o msnd_pinnacle_mixer.o
3snd-msnd-pinnacle-objs := msnd_pinnacle.o
4snd-msnd-classic-objs := msnd_classic.o
5
6# Toplevel Module Dependency
7obj-$(CONFIG_SND_MSND_PINNACLE) += snd-msnd-pinnacle.o snd-msnd-lib.o
8obj-$(CONFIG_SND_MSND_CLASSIC) += snd-msnd-classic.o snd-msnd-lib.o
9
diff --git a/sound/isa/msnd/msnd.c b/sound/isa/msnd/msnd.c
new file mode 100644
index 000000000000..3a1526ae1729
--- /dev/null
+++ b/sound/isa/msnd/msnd.c
@@ -0,0 +1,707 @@
1/*********************************************************************
2 *
3 * 2002/06/30 Karsten Wiese:
4 * removed kernel-version dependencies.
5 * ripped from linux kernel 2.4.18 (OSS Implementation) by me.
6 * In the OSS Version, this file is compiled to a separate MODULE,
7 * that is used by the pinnacle and the classic driver.
8 * since there is no classic driver for alsa yet (i dont have a classic
9 * & writing one blindfold is difficult) this file's object is statically
10 * linked into the pinnacle-driver-module for now. look for the string
11 * "uncomment this to make this a module again"
12 * to do guess what.
13 *
14 * the following is a copy of the 2.4.18 OSS FREE file-heading comment:
15 *
16 * msnd.c - Driver Base
17 *
18 * Turtle Beach MultiSound Sound Card Driver for Linux
19 *
20 * Copyright (C) 1998 Andrew Veliath
21 *
22 * This program is free software; you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation; either version 2 of the License, or
25 * (at your option) any later version.
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 *
36 ********************************************************************/
37
38#include <linux/kernel.h>
39#include <linux/types.h>
40#include <linux/interrupt.h>
41#include <linux/io.h>
42#include <linux/fs.h>
43#include <linux/delay.h>
44
45#include <sound/core.h>
46#include <sound/initval.h>
47#include <sound/pcm.h>
48#include <sound/pcm_params.h>
49
50#include "msnd.h"
51
52#define LOGNAME "msnd"
53
54
55void snd_msnd_init_queue(void *base, int start, int size)
56{
57 writew(PCTODSP_BASED(start), base + JQS_wStart);
58 writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize);
59 writew(0, base + JQS_wHead);
60 writew(0, base + JQS_wTail);
61}
62EXPORT_SYMBOL(snd_msnd_init_queue);
63
64static int snd_msnd_wait_TXDE(struct snd_msnd *dev)
65{
66 unsigned int io = dev->io;
67 int timeout = 1000;
68
69 while (timeout-- > 0)
70 if (inb(io + HP_ISR) & HPISR_TXDE)
71 return 0;
72
73 return -EIO;
74}
75
76static int snd_msnd_wait_HC0(struct snd_msnd *dev)
77{
78 unsigned int io = dev->io;
79 int timeout = 1000;
80
81 while (timeout-- > 0)
82 if (!(inb(io + HP_CVR) & HPCVR_HC))
83 return 0;
84
85 return -EIO;
86}
87
88int snd_msnd_send_dsp_cmd(struct snd_msnd *dev, u8 cmd)
89{
90 unsigned long flags;
91
92 spin_lock_irqsave(&dev->lock, flags);
93 if (snd_msnd_wait_HC0(dev) == 0) {
94 outb(cmd, dev->io + HP_CVR);
95 spin_unlock_irqrestore(&dev->lock, flags);
96 return 0;
97 }
98 spin_unlock_irqrestore(&dev->lock, flags);
99
100 snd_printd(KERN_ERR LOGNAME ": Send DSP command timeout\n");
101
102 return -EIO;
103}
104EXPORT_SYMBOL(snd_msnd_send_dsp_cmd);
105
106int snd_msnd_send_word(struct snd_msnd *dev, unsigned char high,
107 unsigned char mid, unsigned char low)
108{
109 unsigned int io = dev->io;
110
111 if (snd_msnd_wait_TXDE(dev) == 0) {
112 outb(high, io + HP_TXH);
113 outb(mid, io + HP_TXM);
114 outb(low, io + HP_TXL);
115 return 0;
116 }
117
118 snd_printd(KERN_ERR LOGNAME ": Send host word timeout\n");
119
120 return -EIO;
121}
122EXPORT_SYMBOL(snd_msnd_send_word);
123
124int snd_msnd_upload_host(struct snd_msnd *dev, const u8 *bin, int len)
125{
126 int i;
127
128 if (len % 3 != 0) {
129 snd_printk(KERN_ERR LOGNAME
130 ": Upload host data not multiple of 3!\n");
131 return -EINVAL;
132 }
133
134 for (i = 0; i < len; i += 3)
135 if (snd_msnd_send_word(dev, bin[i], bin[i + 1], bin[i + 2]))
136 return -EIO;
137
138 inb(dev->io + HP_RXL);
139 inb(dev->io + HP_CVR);
140
141 return 0;
142}
143EXPORT_SYMBOL(snd_msnd_upload_host);
144
145int snd_msnd_enable_irq(struct snd_msnd *dev)
146{
147 unsigned long flags;
148
149 if (dev->irq_ref++)
150 return 0;
151
152 snd_printdd(LOGNAME ": Enabling IRQ\n");
153
154 spin_lock_irqsave(&dev->lock, flags);
155 if (snd_msnd_wait_TXDE(dev) == 0) {
156 outb(inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR);
157 if (dev->type == msndClassic)
158 outb(dev->irqid, dev->io + HP_IRQM);
159
160 outb(inb(dev->io + HP_ICR) & ~HPICR_TREQ, dev->io + HP_ICR);
161 outb(inb(dev->io + HP_ICR) | HPICR_RREQ, dev->io + HP_ICR);
162 enable_irq(dev->irq);
163 snd_msnd_init_queue(dev->DSPQ, dev->dspq_data_buff,
164 dev->dspq_buff_size);
165 spin_unlock_irqrestore(&dev->lock, flags);
166 return 0;
167 }
168 spin_unlock_irqrestore(&dev->lock, flags);
169
170 snd_printd(KERN_ERR LOGNAME ": Enable IRQ failed\n");
171
172 return -EIO;
173}
174EXPORT_SYMBOL(snd_msnd_enable_irq);
175
176int snd_msnd_disable_irq(struct snd_msnd *dev)
177{
178 unsigned long flags;
179
180 if (--dev->irq_ref > 0)
181 return 0;
182
183 if (dev->irq_ref < 0)
184 snd_printd(KERN_WARNING LOGNAME ": IRQ ref count is %d\n",
185 dev->irq_ref);
186
187 snd_printdd(LOGNAME ": Disabling IRQ\n");
188
189 spin_lock_irqsave(&dev->lock, flags);
190 if (snd_msnd_wait_TXDE(dev) == 0) {
191 outb(inb(dev->io + HP_ICR) & ~HPICR_RREQ, dev->io + HP_ICR);
192 if (dev->type == msndClassic)
193 outb(HPIRQ_NONE, dev->io + HP_IRQM);
194 disable_irq(dev->irq);
195 spin_unlock_irqrestore(&dev->lock, flags);
196 return 0;
197 }
198 spin_unlock_irqrestore(&dev->lock, flags);
199
200 snd_printd(KERN_ERR LOGNAME ": Disable IRQ failed\n");
201
202 return -EIO;
203}
204EXPORT_SYMBOL(snd_msnd_disable_irq);
205
206static inline long get_play_delay_jiffies(struct snd_msnd *chip, long size)
207{
208 long tmp = (size * HZ * chip->play_sample_size) / 8;
209 return tmp / (chip->play_sample_rate * chip->play_channels);
210}
211
212static void snd_msnd_dsp_write_flush(struct snd_msnd *chip)
213{
214 if (!(chip->mode & FMODE_WRITE) || !test_bit(F_WRITING, &chip->flags))
215 return;
216 set_bit(F_WRITEFLUSH, &chip->flags);
217/* interruptible_sleep_on_timeout(
218 &chip->writeflush,
219 get_play_delay_jiffies(&chip, chip->DAPF.len));*/
220 clear_bit(F_WRITEFLUSH, &chip->flags);
221 if (!signal_pending(current))
222 schedule_timeout_interruptible(
223 get_play_delay_jiffies(chip, chip->play_period_bytes));
224 clear_bit(F_WRITING, &chip->flags);
225}
226
227void snd_msnd_dsp_halt(struct snd_msnd *chip, struct file *file)
228{
229 if ((file ? file->f_mode : chip->mode) & FMODE_READ) {
230 clear_bit(F_READING, &chip->flags);
231 snd_msnd_send_dsp_cmd(chip, HDEX_RECORD_STOP);
232 snd_msnd_disable_irq(chip);
233 if (file) {
234 snd_printd(KERN_INFO LOGNAME
235 ": Stopping read for %p\n", file);
236 chip->mode &= ~FMODE_READ;
237 }
238 clear_bit(F_AUDIO_READ_INUSE, &chip->flags);
239 }
240 if ((file ? file->f_mode : chip->mode) & FMODE_WRITE) {
241 if (test_bit(F_WRITING, &chip->flags)) {
242 snd_msnd_dsp_write_flush(chip);
243 snd_msnd_send_dsp_cmd(chip, HDEX_PLAY_STOP);
244 }
245 snd_msnd_disable_irq(chip);
246 if (file) {
247 snd_printd(KERN_INFO
248 LOGNAME ": Stopping write for %p\n", file);
249 chip->mode &= ~FMODE_WRITE;
250 }
251 clear_bit(F_AUDIO_WRITE_INUSE, &chip->flags);
252 }
253}
254EXPORT_SYMBOL(snd_msnd_dsp_halt);
255
256
257int snd_msnd_DARQ(struct snd_msnd *chip, int bank)
258{
259 int /*size, n,*/ timeout = 3;
260 u16 wTmp;
261 /* void *DAQD; */
262
263 /* Increment the tail and check for queue wrap */
264 wTmp = readw(chip->DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size);
265 if (wTmp > readw(chip->DARQ + JQS_wSize))
266 wTmp = 0;
267 while (wTmp == readw(chip->DARQ + JQS_wHead) && timeout--)
268 udelay(1);
269
270 if (chip->capturePeriods == 2) {
271 void *pDAQ = chip->mappedbase + DARQ_DATA_BUFF +
272 bank * DAQDS__size + DAQDS_wStart;
273 unsigned short offset = 0x3000 + chip->capturePeriodBytes;
274
275 if (readw(pDAQ) != PCTODSP_BASED(0x3000))
276 offset = 0x3000;
277 writew(PCTODSP_BASED(offset), pDAQ);
278 }
279
280 writew(wTmp, chip->DARQ + JQS_wTail);
281
282#if 0
283 /* Get our digital audio queue struct */
284 DAQD = bank * DAQDS__size + chip->mappedbase + DARQ_DATA_BUFF;
285
286 /* Get length of data */
287 size = readw(DAQD + DAQDS_wSize);
288
289 /* Read data from the head (unprotected bank 1 access okay
290 since this is only called inside an interrupt) */
291 outb(HPBLKSEL_1, chip->io + HP_BLKS);
292 n = msnd_fifo_write(&chip->DARF,
293 (char *)(chip->base + bank * DAR_BUFF_SIZE),
294 size, 0);
295 if (n <= 0) {
296 outb(HPBLKSEL_0, chip->io + HP_BLKS);
297 return n;
298 }
299 outb(HPBLKSEL_0, chip->io + HP_BLKS);
300#endif
301
302 return 1;
303}
304EXPORT_SYMBOL(snd_msnd_DARQ);
305
306int snd_msnd_DAPQ(struct snd_msnd *chip, int start)
307{
308 u16 DAPQ_tail;
309 int protect = start, nbanks = 0;
310 void *DAQD;
311 static int play_banks_submitted;
312 /* unsigned long flags;
313 spin_lock_irqsave(&chip->lock, flags); not necessary */
314
315 DAPQ_tail = readw(chip->DAPQ + JQS_wTail);
316 while (DAPQ_tail != readw(chip->DAPQ + JQS_wHead) || start) {
317 int bank_num = DAPQ_tail / PCTODSP_OFFSET(DAQDS__size);
318
319 if (start) {
320 start = 0;
321 play_banks_submitted = 0;
322 }
323
324 /* Get our digital audio queue struct */
325 DAQD = bank_num * DAQDS__size + chip->mappedbase +
326 DAPQ_DATA_BUFF;
327
328 /* Write size of this bank */
329 writew(chip->play_period_bytes, DAQD + DAQDS_wSize);
330 if (play_banks_submitted < 3)
331 ++play_banks_submitted;
332 else if (chip->playPeriods == 2) {
333 unsigned short offset = chip->play_period_bytes;
334
335 if (readw(DAQD + DAQDS_wStart) != PCTODSP_BASED(0x0))
336 offset = 0;
337
338 writew(PCTODSP_BASED(offset), DAQD + DAQDS_wStart);
339 }
340 ++nbanks;
341
342 /* Then advance the tail */
343 /*
344 if (protect)
345 snd_printd(KERN_INFO "B %X %lX\n",
346 bank_num, xtime.tv_usec);
347 */
348
349 DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size);
350 writew(DAPQ_tail, chip->DAPQ + JQS_wTail);
351 /* Tell the DSP to play the bank */
352 snd_msnd_send_dsp_cmd(chip, HDEX_PLAY_START);
353 if (protect)
354 if (2 == bank_num)
355 break;
356 }
357 /*
358 if (protect)
359 snd_printd(KERN_INFO "%lX\n", xtime.tv_usec);
360 */
361 /* spin_unlock_irqrestore(&chip->lock, flags); not necessary */
362 return nbanks;
363}
364EXPORT_SYMBOL(snd_msnd_DAPQ);
365
366static void snd_msnd_play_reset_queue(struct snd_msnd *chip,
367 unsigned int pcm_periods,
368 unsigned int pcm_count)
369{
370 int n;
371 void *pDAQ = chip->mappedbase + DAPQ_DATA_BUFF;
372
373 chip->last_playbank = -1;
374 chip->playLimit = pcm_count * (pcm_periods - 1);
375 chip->playPeriods = pcm_periods;
376 writew(PCTODSP_OFFSET(0 * DAQDS__size), chip->DAPQ + JQS_wHead);
377 writew(PCTODSP_OFFSET(0 * DAQDS__size), chip->DAPQ + JQS_wTail);
378
379 chip->play_period_bytes = pcm_count;
380
381 for (n = 0; n < pcm_periods; ++n, pDAQ += DAQDS__size) {
382 writew(PCTODSP_BASED((u32)(pcm_count * n)),
383 pDAQ + DAQDS_wStart);
384 writew(0, pDAQ + DAQDS_wSize);
385 writew(1, pDAQ + DAQDS_wFormat);
386 writew(chip->play_sample_size, pDAQ + DAQDS_wSampleSize);
387 writew(chip->play_channels, pDAQ + DAQDS_wChannels);
388 writew(chip->play_sample_rate, pDAQ + DAQDS_wSampleRate);
389 writew(HIMT_PLAY_DONE * 0x100 + n, pDAQ + DAQDS_wIntMsg);
390 writew(n, pDAQ + DAQDS_wFlags);
391 }
392}
393
394static void snd_msnd_capture_reset_queue(struct snd_msnd *chip,
395 unsigned int pcm_periods,
396 unsigned int pcm_count)
397{
398 int n;
399 void *pDAQ;
400 /* unsigned long flags; */
401
402 /* snd_msnd_init_queue(chip->DARQ, DARQ_DATA_BUFF, DARQ_BUFF_SIZE); */
403
404 chip->last_recbank = 2;
405 chip->captureLimit = pcm_count * (pcm_periods - 1);
406 chip->capturePeriods = pcm_periods;
407 writew(PCTODSP_OFFSET(0 * DAQDS__size), chip->DARQ + JQS_wHead);
408 writew(PCTODSP_OFFSET(chip->last_recbank * DAQDS__size),
409 chip->DARQ + JQS_wTail);
410
411#if 0 /* Critical section: bank 1 access. this is how the OSS driver does it:*/
412 spin_lock_irqsave(&chip->lock, flags);
413 outb(HPBLKSEL_1, chip->io + HP_BLKS);
414 memset_io(chip->mappedbase, 0, DAR_BUFF_SIZE * 3);
415 outb(HPBLKSEL_0, chip->io + HP_BLKS);
416 spin_unlock_irqrestore(&chip->lock, flags);
417#endif
418
419 chip->capturePeriodBytes = pcm_count;
420 snd_printdd("snd_msnd_capture_reset_queue() %i\n", pcm_count);
421
422 pDAQ = chip->mappedbase + DARQ_DATA_BUFF;
423
424 for (n = 0; n < pcm_periods; ++n, pDAQ += DAQDS__size) {
425 u32 tmp = pcm_count * n;
426
427 writew(PCTODSP_BASED(tmp + 0x3000), pDAQ + DAQDS_wStart);
428 writew(pcm_count, pDAQ + DAQDS_wSize);
429 writew(1, pDAQ + DAQDS_wFormat);
430 writew(chip->capture_sample_size, pDAQ + DAQDS_wSampleSize);
431 writew(chip->capture_channels, pDAQ + DAQDS_wChannels);
432 writew(chip->capture_sample_rate, pDAQ + DAQDS_wSampleRate);
433 writew(HIMT_RECORD_DONE * 0x100 + n, pDAQ + DAQDS_wIntMsg);
434 writew(n, pDAQ + DAQDS_wFlags);
435 }
436}
437
438static struct snd_pcm_hardware snd_msnd_playback = {
439 .info = SNDRV_PCM_INFO_MMAP |
440 SNDRV_PCM_INFO_INTERLEAVED |
441 SNDRV_PCM_INFO_MMAP_VALID |
442 SNDRV_PCM_INFO_BATCH,
443 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
444 .rates = SNDRV_PCM_RATE_8000_48000,
445 .rate_min = 8000,
446 .rate_max = 48000,
447 .channels_min = 1,
448 .channels_max = 2,
449 .buffer_bytes_max = 0x3000,
450 .period_bytes_min = 0x40,
451 .period_bytes_max = 0x1800,
452 .periods_min = 2,
453 .periods_max = 3,
454 .fifo_size = 0,
455};
456
457static struct snd_pcm_hardware snd_msnd_capture = {
458 .info = SNDRV_PCM_INFO_MMAP |
459 SNDRV_PCM_INFO_INTERLEAVED |
460 SNDRV_PCM_INFO_MMAP_VALID |
461 SNDRV_PCM_INFO_BATCH,
462 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
463 .rates = SNDRV_PCM_RATE_8000_48000,
464 .rate_min = 8000,
465 .rate_max = 48000,
466 .channels_min = 1,
467 .channels_max = 2,
468 .buffer_bytes_max = 0x3000,
469 .period_bytes_min = 0x40,
470 .period_bytes_max = 0x1800,
471 .periods_min = 2,
472 .periods_max = 3,
473 .fifo_size = 0,
474};
475
476
477static int snd_msnd_playback_open(struct snd_pcm_substream *substream)
478{
479 struct snd_pcm_runtime *runtime = substream->runtime;
480 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
481
482 set_bit(F_AUDIO_WRITE_INUSE, &chip->flags);
483 clear_bit(F_WRITING, &chip->flags);
484 snd_msnd_enable_irq(chip);
485
486 runtime->dma_area = chip->mappedbase;
487 runtime->dma_bytes = 0x3000;
488
489 chip->playback_substream = substream;
490 runtime->hw = snd_msnd_playback;
491 return 0;
492}
493
494static int snd_msnd_playback_close(struct snd_pcm_substream *substream)
495{
496 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
497
498 snd_msnd_disable_irq(chip);
499 clear_bit(F_AUDIO_WRITE_INUSE, &chip->flags);
500 return 0;
501}
502
503
504static int snd_msnd_playback_hw_params(struct snd_pcm_substream *substream,
505 struct snd_pcm_hw_params *params)
506{
507 int i;
508 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
509 void *pDAQ = chip->mappedbase + DAPQ_DATA_BUFF;
510
511 chip->play_sample_size = snd_pcm_format_width(params_format(params));
512 chip->play_channels = params_channels(params);
513 chip->play_sample_rate = params_rate(params);
514
515 for (i = 0; i < 3; ++i, pDAQ += DAQDS__size) {
516 writew(chip->play_sample_size, pDAQ + DAQDS_wSampleSize);
517 writew(chip->play_channels, pDAQ + DAQDS_wChannels);
518 writew(chip->play_sample_rate, pDAQ + DAQDS_wSampleRate);
519 }
520 /* dont do this here:
521 * snd_msnd_calibrate_adc(chip->play_sample_rate);
522 */
523
524 return 0;
525}
526
527static int snd_msnd_playback_prepare(struct snd_pcm_substream *substream)
528{
529 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
530 unsigned int pcm_size = snd_pcm_lib_buffer_bytes(substream);
531 unsigned int pcm_count = snd_pcm_lib_period_bytes(substream);
532 unsigned int pcm_periods = pcm_size / pcm_count;
533
534 snd_msnd_play_reset_queue(chip, pcm_periods, pcm_count);
535 chip->playDMAPos = 0;
536 return 0;
537}
538
539static int snd_msnd_playback_trigger(struct snd_pcm_substream *substream,
540 int cmd)
541{
542 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
543 int result = 0;
544
545 if (cmd == SNDRV_PCM_TRIGGER_START) {
546 snd_printdd("snd_msnd_playback_trigger(START)\n");
547 chip->banksPlayed = 0;
548 set_bit(F_WRITING, &chip->flags);
549 snd_msnd_DAPQ(chip, 1);
550 } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
551 snd_printdd("snd_msnd_playback_trigger(STop)\n");
552 /* interrupt diagnostic, comment this out later */
553 clear_bit(F_WRITING, &chip->flags);
554 snd_msnd_send_dsp_cmd(chip, HDEX_PLAY_STOP);
555 } else {
556 snd_printd(KERN_ERR "snd_msnd_playback_trigger(?????)\n");
557 result = -EINVAL;
558 }
559
560 snd_printdd("snd_msnd_playback_trigger() ENDE\n");
561 return result;
562}
563
564static snd_pcm_uframes_t
565snd_msnd_playback_pointer(struct snd_pcm_substream *substream)
566{
567 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
568
569 return bytes_to_frames(substream->runtime, chip->playDMAPos);
570}
571
572
573static struct snd_pcm_ops snd_msnd_playback_ops = {
574 .open = snd_msnd_playback_open,
575 .close = snd_msnd_playback_close,
576 .ioctl = snd_pcm_lib_ioctl,
577 .hw_params = snd_msnd_playback_hw_params,
578 .prepare = snd_msnd_playback_prepare,
579 .trigger = snd_msnd_playback_trigger,
580 .pointer = snd_msnd_playback_pointer,
581};
582
583static int snd_msnd_capture_open(struct snd_pcm_substream *substream)
584{
585 struct snd_pcm_runtime *runtime = substream->runtime;
586 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
587
588 set_bit(F_AUDIO_READ_INUSE, &chip->flags);
589 snd_msnd_enable_irq(chip);
590 runtime->dma_area = chip->mappedbase + 0x3000;
591 runtime->dma_bytes = 0x3000;
592 memset(runtime->dma_area, 0, runtime->dma_bytes);
593 chip->capture_substream = substream;
594 runtime->hw = snd_msnd_capture;
595 return 0;
596}
597
598static int snd_msnd_capture_close(struct snd_pcm_substream *substream)
599{
600 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
601
602 snd_msnd_disable_irq(chip);
603 clear_bit(F_AUDIO_READ_INUSE, &chip->flags);
604 return 0;
605}
606
607static int snd_msnd_capture_prepare(struct snd_pcm_substream *substream)
608{
609 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
610 unsigned int pcm_size = snd_pcm_lib_buffer_bytes(substream);
611 unsigned int pcm_count = snd_pcm_lib_period_bytes(substream);
612 unsigned int pcm_periods = pcm_size / pcm_count;
613
614 snd_msnd_capture_reset_queue(chip, pcm_periods, pcm_count);
615 chip->captureDMAPos = 0;
616 return 0;
617}
618
619static int snd_msnd_capture_trigger(struct snd_pcm_substream *substream,
620 int cmd)
621{
622 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
623
624 if (cmd == SNDRV_PCM_TRIGGER_START) {
625 chip->last_recbank = -1;
626 set_bit(F_READING, &chip->flags);
627 if (snd_msnd_send_dsp_cmd(chip, HDEX_RECORD_START) == 0)
628 return 0;
629
630 clear_bit(F_READING, &chip->flags);
631 } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
632 clear_bit(F_READING, &chip->flags);
633 snd_msnd_send_dsp_cmd(chip, HDEX_RECORD_STOP);
634 return 0;
635 }
636 return -EINVAL;
637}
638
639
640static snd_pcm_uframes_t
641snd_msnd_capture_pointer(struct snd_pcm_substream *substream)
642{
643 struct snd_pcm_runtime *runtime = substream->runtime;
644 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
645
646 return bytes_to_frames(runtime, chip->captureDMAPos);
647}
648
649
650static int snd_msnd_capture_hw_params(struct snd_pcm_substream *substream,
651 struct snd_pcm_hw_params *params)
652{
653 int i;
654 struct snd_msnd *chip = snd_pcm_substream_chip(substream);
655 void *pDAQ = chip->mappedbase + DARQ_DATA_BUFF;
656
657 chip->capture_sample_size = snd_pcm_format_width(params_format(params));
658 chip->capture_channels = params_channels(params);
659 chip->capture_sample_rate = params_rate(params);
660
661 for (i = 0; i < 3; ++i, pDAQ += DAQDS__size) {
662 writew(chip->capture_sample_size, pDAQ + DAQDS_wSampleSize);
663 writew(chip->capture_channels, pDAQ + DAQDS_wChannels);
664 writew(chip->capture_sample_rate, pDAQ + DAQDS_wSampleRate);
665 }
666 return 0;
667}
668
669
670static struct snd_pcm_ops snd_msnd_capture_ops = {
671 .open = snd_msnd_capture_open,
672 .close = snd_msnd_capture_close,
673 .ioctl = snd_pcm_lib_ioctl,
674 .hw_params = snd_msnd_capture_hw_params,
675 .prepare = snd_msnd_capture_prepare,
676 .trigger = snd_msnd_capture_trigger,
677 .pointer = snd_msnd_capture_pointer,
678};
679
680
681int snd_msnd_pcm(struct snd_card *card, int device,
682 struct snd_pcm **rpcm)
683{
684 struct snd_msnd *chip = card->private_data;
685 struct snd_pcm *pcm;
686 int err;
687
688 err = snd_pcm_new(card, "MSNDPINNACLE", device, 1, 1, &pcm);
689 if (err < 0)
690 return err;
691
692 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_msnd_playback_ops);
693 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_msnd_capture_ops);
694
695 pcm->private_data = chip;
696 strcpy(pcm->name, "Hurricane");
697
698
699 if (rpcm)
700 *rpcm = pcm;
701 return 0;
702}
703EXPORT_SYMBOL(snd_msnd_pcm);
704
705MODULE_DESCRIPTION("Common routines for Turtle Beach Multisound drivers");
706MODULE_LICENSE("GPL");
707
diff --git a/sound/isa/msnd/msnd.h b/sound/isa/msnd/msnd.h
new file mode 100644
index 000000000000..3773e242b58e
--- /dev/null
+++ b/sound/isa/msnd/msnd.h
@@ -0,0 +1,308 @@
1/*********************************************************************
2 *
3 * msnd.h
4 *
5 * Turtle Beach MultiSound Sound Card Driver for Linux
6 *
7 * Some parts of this header file were derived from the Turtle Beach
8 * MultiSound Driver Development Kit.
9 *
10 * Copyright (C) 1998 Andrew Veliath
11 * Copyright (C) 1993 Turtle Beach Systems, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 ********************************************************************/
28#ifndef __MSND_H
29#define __MSND_H
30
31#define DEFSAMPLERATE 44100
32#define DEFSAMPLESIZE SNDRV_PCM_FORMAT_S16
33#define DEFCHANNELS 1
34
35#define SRAM_BANK_SIZE 0x8000
36#define SRAM_CNTL_START 0x7F00
37#define SMA_STRUCT_START 0x7F40
38
39#define DSP_BASE_ADDR 0x4000
40#define DSP_BANK_BASE 0x4000
41
42#define AGND 0x01
43#define SIGNAL 0x02
44
45#define EXT_DSP_BIT_DCAL 0x0001
46#define EXT_DSP_BIT_MIDI_CON 0x0002
47
48#define BUFFSIZE 0x8000
49#define HOSTQ_SIZE 0x40
50
51#define DAP_BUFF_SIZE 0x2400
52
53#define DAPQ_STRUCT_SIZE 0x10
54#define DARQ_STRUCT_SIZE 0x10
55#define DAPQ_BUFF_SIZE (3 * 0x10)
56#define DARQ_BUFF_SIZE (3 * 0x10)
57#define MODQ_BUFF_SIZE 0x400
58
59#define DAPQ_DATA_BUFF 0x6C00
60#define DARQ_DATA_BUFF 0x6C30
61#define MODQ_DATA_BUFF 0x6C60
62#define MIDQ_DATA_BUFF 0x7060
63
64#define DAPQ_OFFSET SRAM_CNTL_START
65#define DARQ_OFFSET (SRAM_CNTL_START + 0x08)
66#define MODQ_OFFSET (SRAM_CNTL_START + 0x10)
67#define MIDQ_OFFSET (SRAM_CNTL_START + 0x18)
68#define DSPQ_OFFSET (SRAM_CNTL_START + 0x20)
69
70#define HP_ICR 0x00
71#define HP_CVR 0x01
72#define HP_ISR 0x02
73#define HP_IVR 0x03
74#define HP_NU 0x04
75#define HP_INFO 0x04
76#define HP_TXH 0x05
77#define HP_RXH 0x05
78#define HP_TXM 0x06
79#define HP_RXM 0x06
80#define HP_TXL 0x07
81#define HP_RXL 0x07
82
83#define HP_ICR_DEF 0x00
84#define HP_CVR_DEF 0x12
85#define HP_ISR_DEF 0x06
86#define HP_IVR_DEF 0x0f
87#define HP_NU_DEF 0x00
88
89#define HP_IRQM 0x09
90
91#define HPR_BLRC 0x08
92#define HPR_SPR1 0x09
93#define HPR_SPR2 0x0A
94#define HPR_TCL0 0x0B
95#define HPR_TCL1 0x0C
96#define HPR_TCL2 0x0D
97#define HPR_TCL3 0x0E
98#define HPR_TCL4 0x0F
99
100#define HPICR_INIT 0x80
101#define HPICR_HM1 0x40
102#define HPICR_HM0 0x20
103#define HPICR_HF1 0x10
104#define HPICR_HF0 0x08
105#define HPICR_TREQ 0x02
106#define HPICR_RREQ 0x01
107
108#define HPCVR_HC 0x80
109
110#define HPISR_HREQ 0x80
111#define HPISR_DMA 0x40
112#define HPISR_HF3 0x10
113#define HPISR_HF2 0x08
114#define HPISR_TRDY 0x04
115#define HPISR_TXDE 0x02
116#define HPISR_RXDF 0x01
117
118#define HPIO_290 0
119#define HPIO_260 1
120#define HPIO_250 2
121#define HPIO_240 3
122#define HPIO_230 4
123#define HPIO_220 5
124#define HPIO_210 6
125#define HPIO_3E0 7
126
127#define HPMEM_NONE 0
128#define HPMEM_B000 1
129#define HPMEM_C800 2
130#define HPMEM_D000 3
131#define HPMEM_D400 4
132#define HPMEM_D800 5
133#define HPMEM_E000 6
134#define HPMEM_E800 7
135
136#define HPIRQ_NONE 0
137#define HPIRQ_5 1
138#define HPIRQ_7 2
139#define HPIRQ_9 3
140#define HPIRQ_10 4
141#define HPIRQ_11 5
142#define HPIRQ_12 6
143#define HPIRQ_15 7
144
145#define HIMT_PLAY_DONE 0x00
146#define HIMT_RECORD_DONE 0x01
147#define HIMT_MIDI_EOS 0x02
148#define HIMT_MIDI_OUT 0x03
149
150#define HIMT_MIDI_IN_UCHAR 0x0E
151#define HIMT_DSP 0x0F
152
153#define HDEX_BASE 0x92
154#define HDEX_PLAY_START (0 + HDEX_BASE)
155#define HDEX_PLAY_STOP (1 + HDEX_BASE)
156#define HDEX_PLAY_PAUSE (2 + HDEX_BASE)
157#define HDEX_PLAY_RESUME (3 + HDEX_BASE)
158#define HDEX_RECORD_START (4 + HDEX_BASE)
159#define HDEX_RECORD_STOP (5 + HDEX_BASE)
160#define HDEX_MIDI_IN_START (6 + HDEX_BASE)
161#define HDEX_MIDI_IN_STOP (7 + HDEX_BASE)
162#define HDEX_MIDI_OUT_START (8 + HDEX_BASE)
163#define HDEX_MIDI_OUT_STOP (9 + HDEX_BASE)
164#define HDEX_AUX_REQ (10 + HDEX_BASE)
165
166#define HDEXAR_CLEAR_PEAKS 1
167#define HDEXAR_IN_SET_POTS 2
168#define HDEXAR_AUX_SET_POTS 3
169#define HDEXAR_CAL_A_TO_D 4
170#define HDEXAR_RD_EXT_DSP_BITS 5
171
172/* Pinnacle only HDEXAR defs */
173#define HDEXAR_SET_ANA_IN 0
174#define HDEXAR_SET_SYNTH_IN 4
175#define HDEXAR_READ_DAT_IN 5
176#define HDEXAR_MIC_SET_POTS 6
177#define HDEXAR_SET_DAT_IN 7
178
179#define HDEXAR_SET_SYNTH_48 8
180#define HDEXAR_SET_SYNTH_44 9
181
182#define HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF))
183#define LOWORD(l) ((u16)(u32)(l))
184#define HIBYTE(w) ((u8)(((u16)(w) >> 8) & 0xFF))
185#define LOBYTE(w) ((u8)(w))
186#define MAKELONG(low, hi) ((long)(((u16)(low))|(((u32)((u16)(hi)))<<16)))
187#define MAKEWORD(low, hi) ((u16)(((u8)(low))|(((u16)((u8)(hi)))<<8)))
188
189#define PCTODSP_OFFSET(w) (u16)((w)/2)
190#define PCTODSP_BASED(w) (u16)(((w)/2) + DSP_BASE_ADDR)
191#define DSPTOPC_BASED(w) (((w) - DSP_BASE_ADDR) * 2)
192
193#ifdef SLOWIO
194# undef outb
195# undef inb
196# define outb outb_p
197# define inb inb_p
198#endif
199
200/* JobQueueStruct */
201#define JQS_wStart 0x00
202#define JQS_wSize 0x02
203#define JQS_wHead 0x04
204#define JQS_wTail 0x06
205#define JQS__size 0x08
206
207/* DAQueueDataStruct */
208#define DAQDS_wStart 0x00
209#define DAQDS_wSize 0x02
210#define DAQDS_wFormat 0x04
211#define DAQDS_wSampleSize 0x06
212#define DAQDS_wChannels 0x08
213#define DAQDS_wSampleRate 0x0A
214#define DAQDS_wIntMsg 0x0C
215#define DAQDS_wFlags 0x0E
216#define DAQDS__size 0x10
217
218#include <sound/pcm.h>
219
220struct snd_msnd {
221 void __iomem *mappedbase;
222 int play_period_bytes;
223 int playLimit;
224 int playPeriods;
225 int playDMAPos;
226 int banksPlayed;
227 int captureDMAPos;
228 int capturePeriodBytes;
229 int captureLimit;
230 int capturePeriods;
231 struct snd_card *card;
232 void *msndmidi_mpu;
233 struct snd_rawmidi *rmidi;
234
235 /* Hardware resources */
236 long io;
237 int memid, irqid;
238 int irq, irq_ref;
239 unsigned long base;
240
241 /* Motorola 56k DSP SMA */
242 void __iomem *SMA;
243 void __iomem *DAPQ;
244 void __iomem *DARQ;
245 void __iomem *MODQ;
246 void __iomem *MIDQ;
247 void __iomem *DSPQ;
248 int dspq_data_buff, dspq_buff_size;
249
250 /* State variables */
251 enum { msndClassic, msndPinnacle } type;
252 mode_t mode;
253 unsigned long flags;
254#define F_RESETTING 0
255#define F_HAVEDIGITAL 1
256#define F_AUDIO_WRITE_INUSE 2
257#define F_WRITING 3
258#define F_WRITEBLOCK 4
259#define F_WRITEFLUSH 5
260#define F_AUDIO_READ_INUSE 6
261#define F_READING 7
262#define F_READBLOCK 8
263#define F_EXT_MIDI_INUSE 9
264#define F_HDR_MIDI_INUSE 10
265#define F_DISABLE_WRITE_NDELAY 11
266 spinlock_t lock;
267 spinlock_t mixer_lock;
268 int nresets;
269 unsigned recsrc;
270#define LEVEL_ENTRIES 32
271 int left_levels[LEVEL_ENTRIES];
272 int right_levels[LEVEL_ENTRIES];
273 int calibrate_signal;
274 int play_sample_size, play_sample_rate, play_channels;
275 int play_ndelay;
276 int capture_sample_size, capture_sample_rate, capture_channels;
277 int capture_ndelay;
278 u8 bCurrentMidiPatch;
279
280 int last_playbank, last_recbank;
281 struct snd_pcm_substream *playback_substream;
282 struct snd_pcm_substream *capture_substream;
283
284};
285
286void snd_msnd_init_queue(void *base, int start, int size);
287
288int snd_msnd_send_dsp_cmd(struct snd_msnd *chip, u8 cmd);
289int snd_msnd_send_word(struct snd_msnd *chip,
290 unsigned char high,
291 unsigned char mid,
292 unsigned char low);
293int snd_msnd_upload_host(struct snd_msnd *chip,
294 const u8 *bin, int len);
295int snd_msnd_enable_irq(struct snd_msnd *chip);
296int snd_msnd_disable_irq(struct snd_msnd *chip);
297void snd_msnd_dsp_halt(struct snd_msnd *chip, struct file *file);
298int snd_msnd_DAPQ(struct snd_msnd *chip, int start);
299int snd_msnd_DARQ(struct snd_msnd *chip, int start);
300int snd_msnd_pcm(struct snd_card *card, int device, struct snd_pcm **rpcm);
301
302int snd_msndmidi_new(struct snd_card *card, int device);
303void snd_msndmidi_input_read(void *mpu);
304
305void snd_msndmix_setup(struct snd_msnd *chip);
306int __devinit snd_msndmix_new(struct snd_card *card);
307int snd_msndmix_force_recsrc(struct snd_msnd *chip, int recsrc);
308#endif /* __MSND_H */
diff --git a/sound/isa/msnd/msnd_classic.c b/sound/isa/msnd/msnd_classic.c
new file mode 100644
index 000000000000..3b23a096fa4e
--- /dev/null
+++ b/sound/isa/msnd/msnd_classic.c
@@ -0,0 +1,3 @@
1/* The work is in msnd_pinnacle.c, just define MSND_CLASSIC before it. */
2#define MSND_CLASSIC
3#include "msnd_pinnacle.c"
diff --git a/sound/isa/msnd/msnd_classic.h b/sound/isa/msnd/msnd_classic.h
new file mode 100644
index 000000000000..f18d5fa5baf4
--- /dev/null
+++ b/sound/isa/msnd/msnd_classic.h
@@ -0,0 +1,129 @@
1/*********************************************************************
2 *
3 * msnd_classic.h
4 *
5 * Turtle Beach MultiSound Sound Card Driver for Linux
6 *
7 * Some parts of this header file were derived from the Turtle Beach
8 * MultiSound Driver Development Kit.
9 *
10 * Copyright (C) 1998 Andrew Veliath
11 * Copyright (C) 1993 Turtle Beach Systems, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 ********************************************************************/
28#ifndef __MSND_CLASSIC_H
29#define __MSND_CLASSIC_H
30
31#define DSP_NUMIO 0x10
32
33#define HP_MEMM 0x08
34
35#define HP_BITM 0x0E
36#define HP_WAIT 0x0D
37#define HP_DSPR 0x0A
38#define HP_PROR 0x0B
39#define HP_BLKS 0x0C
40
41#define HPPRORESET_OFF 0
42#define HPPRORESET_ON 1
43
44#define HPDSPRESET_OFF 0
45#define HPDSPRESET_ON 1
46
47#define HPBLKSEL_0 0
48#define HPBLKSEL_1 1
49
50#define HPWAITSTATE_0 0
51#define HPWAITSTATE_1 1
52
53#define HPBITMODE_16 0
54#define HPBITMODE_8 1
55
56#define HIDSP_INT_PLAY_UNDER 0x00
57#define HIDSP_INT_RECORD_OVER 0x01
58#define HIDSP_INPUT_CLIPPING 0x02
59#define HIDSP_MIDI_IN_OVER 0x10
60#define HIDSP_MIDI_OVERRUN_ERR 0x13
61
62#define TIME_PRO_RESET_DONE 0x028A
63#define TIME_PRO_SYSEX 0x0040
64#define TIME_PRO_RESET 0x0032
65
66#define DAR_BUFF_SIZE 0x2000
67
68#define MIDQ_BUFF_SIZE 0x200
69#define DSPQ_BUFF_SIZE 0x40
70
71#define DSPQ_DATA_BUFF 0x7260
72
73#define MOP_SYNTH 0x10
74#define MOP_EXTOUT 0x32
75#define MOP_EXTTHRU 0x02
76#define MOP_OUTMASK 0x01
77
78#define MIP_EXTIN 0x01
79#define MIP_SYNTH 0x00
80#define MIP_INMASK 0x32
81
82/* Classic SMA Common Data */
83#define SMA_wCurrPlayBytes 0x0000
84#define SMA_wCurrRecordBytes 0x0002
85#define SMA_wCurrPlayVolLeft 0x0004
86#define SMA_wCurrPlayVolRight 0x0006
87#define SMA_wCurrInVolLeft 0x0008
88#define SMA_wCurrInVolRight 0x000a
89#define SMA_wUser_3 0x000c
90#define SMA_wUser_4 0x000e
91#define SMA_dwUser_5 0x0010
92#define SMA_dwUser_6 0x0014
93#define SMA_wUser_7 0x0018
94#define SMA_wReserved_A 0x001a
95#define SMA_wReserved_B 0x001c
96#define SMA_wReserved_C 0x001e
97#define SMA_wReserved_D 0x0020
98#define SMA_wReserved_E 0x0022
99#define SMA_wReserved_F 0x0024
100#define SMA_wReserved_G 0x0026
101#define SMA_wReserved_H 0x0028
102#define SMA_wCurrDSPStatusFlags 0x002a
103#define SMA_wCurrHostStatusFlags 0x002c
104#define SMA_wCurrInputTagBits 0x002e
105#define SMA_wCurrLeftPeak 0x0030
106#define SMA_wCurrRightPeak 0x0032
107#define SMA_wExtDSPbits 0x0034
108#define SMA_bExtHostbits 0x0036
109#define SMA_bBoardLevel 0x0037
110#define SMA_bInPotPosRight 0x0038
111#define SMA_bInPotPosLeft 0x0039
112#define SMA_bAuxPotPosRight 0x003a
113#define SMA_bAuxPotPosLeft 0x003b
114#define SMA_wCurrMastVolLeft 0x003c
115#define SMA_wCurrMastVolRight 0x003e
116#define SMA_bUser_12 0x0040
117#define SMA_bUser_13 0x0041
118#define SMA_wUser_14 0x0042
119#define SMA_wUser_15 0x0044
120#define SMA_wCalFreqAtoD 0x0046
121#define SMA_wUser_16 0x0048
122#define SMA_wUser_17 0x004a
123#define SMA__size 0x004c
124
125#define INITCODEFILE "turtlebeach/msndinit.bin"
126#define PERMCODEFILE "turtlebeach/msndperm.bin"
127#define LONGNAME "MultiSound (Classic/Monterey/Tahiti)"
128
129#endif /* __MSND_CLASSIC_H */
diff --git a/sound/isa/msnd/msnd_midi.c b/sound/isa/msnd/msnd_midi.c
new file mode 100644
index 000000000000..cb9aa4c4edd0
--- /dev/null
+++ b/sound/isa/msnd/msnd_midi.c
@@ -0,0 +1,180 @@
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
3 * Copyright (c) 2009 by Krzysztof Helt
4 * Routines for control of MPU-401 in UART mode
5 *
6 * MPU-401 supports UART mode which is not capable generate transmit
7 * interrupts thus output is done via polling. Also, if irq < 0, then
8 * input is done also via polling. Do not expect good performance.
9 *
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27#include <linux/io.h>
28#include <linux/delay.h>
29#include <linux/ioport.h>
30#include <linux/errno.h>
31#include <sound/core.h>
32#include <sound/rawmidi.h>
33
34#include "msnd.h"
35
36#define MSNDMIDI_MODE_BIT_INPUT 0
37#define MSNDMIDI_MODE_BIT_OUTPUT 1
38#define MSNDMIDI_MODE_BIT_INPUT_TRIGGER 2
39#define MSNDMIDI_MODE_BIT_OUTPUT_TRIGGER 3
40
41struct snd_msndmidi {
42 struct snd_msnd *dev;
43
44 unsigned long mode; /* MSNDMIDI_MODE_XXXX */
45
46 struct snd_rawmidi_substream *substream_input;
47
48 spinlock_t input_lock;
49};
50
51/*
52 * input/output open/close - protected by open_mutex in rawmidi.c
53 */
54static int snd_msndmidi_input_open(struct snd_rawmidi_substream *substream)
55{
56 struct snd_msndmidi *mpu;
57
58 snd_printdd("snd_msndmidi_input_open()\n");
59
60 mpu = substream->rmidi->private_data;
61
62 mpu->substream_input = substream;
63
64 snd_msnd_enable_irq(mpu->dev);
65
66 snd_msnd_send_dsp_cmd(mpu->dev, HDEX_MIDI_IN_START);
67 set_bit(MSNDMIDI_MODE_BIT_INPUT, &mpu->mode);
68 return 0;
69}
70
71static int snd_msndmidi_input_close(struct snd_rawmidi_substream *substream)
72{
73 struct snd_msndmidi *mpu;
74
75 mpu = substream->rmidi->private_data;
76 snd_msnd_send_dsp_cmd(mpu->dev, HDEX_MIDI_IN_STOP);
77 clear_bit(MSNDMIDI_MODE_BIT_INPUT, &mpu->mode);
78 mpu->substream_input = NULL;
79 snd_msnd_disable_irq(mpu->dev);
80 return 0;
81}
82
83static void snd_msndmidi_input_drop(struct snd_msndmidi *mpu)
84{
85 u16 tail;
86
87 tail = readw(mpu->dev->MIDQ + JQS_wTail);
88 writew(tail, mpu->dev->MIDQ + JQS_wHead);
89}
90
91/*
92 * trigger input
93 */
94static void snd_msndmidi_input_trigger(struct snd_rawmidi_substream *substream,
95 int up)
96{
97 unsigned long flags;
98 struct snd_msndmidi *mpu;
99
100 snd_printdd("snd_msndmidi_input_trigger(, %i)\n", up);
101
102 mpu = substream->rmidi->private_data;
103 spin_lock_irqsave(&mpu->input_lock, flags);
104 if (up) {
105 if (!test_and_set_bit(MSNDMIDI_MODE_BIT_INPUT_TRIGGER,
106 &mpu->mode))
107 snd_msndmidi_input_drop(mpu);
108 } else {
109 clear_bit(MSNDMIDI_MODE_BIT_INPUT_TRIGGER, &mpu->mode);
110 }
111 spin_unlock_irqrestore(&mpu->input_lock, flags);
112 if (up)
113 snd_msndmidi_input_read(mpu);
114}
115
116void snd_msndmidi_input_read(void *mpuv)
117{
118 unsigned long flags;
119 struct snd_msndmidi *mpu = mpuv;
120 void *pwMIDQData = mpu->dev->mappedbase + MIDQ_DATA_BUFF;
121
122 spin_lock_irqsave(&mpu->input_lock, flags);
123 while (readw(mpu->dev->MIDQ + JQS_wTail) !=
124 readw(mpu->dev->MIDQ + JQS_wHead)) {
125 u16 wTmp, val;
126 val = readw(pwMIDQData + 2 * readw(mpu->dev->MIDQ + JQS_wHead));
127
128 if (test_bit(MSNDMIDI_MODE_BIT_INPUT_TRIGGER,
129 &mpu->mode))
130 snd_rawmidi_receive(mpu->substream_input,
131 (unsigned char *)&val, 1);
132
133 wTmp = readw(mpu->dev->MIDQ + JQS_wHead) + 1;
134 if (wTmp > readw(mpu->dev->MIDQ + JQS_wSize))
135 writew(0, mpu->dev->MIDQ + JQS_wHead);
136 else
137 writew(wTmp, mpu->dev->MIDQ + JQS_wHead);
138 }
139 spin_unlock_irqrestore(&mpu->input_lock, flags);
140}
141EXPORT_SYMBOL(snd_msndmidi_input_read);
142
143static struct snd_rawmidi_ops snd_msndmidi_input = {
144 .open = snd_msndmidi_input_open,
145 .close = snd_msndmidi_input_close,
146 .trigger = snd_msndmidi_input_trigger,
147};
148
149static void snd_msndmidi_free(struct snd_rawmidi *rmidi)
150{
151 struct snd_msndmidi *mpu = rmidi->private_data;
152 kfree(mpu);
153}
154
155int snd_msndmidi_new(struct snd_card *card, int device)
156{
157 struct snd_msnd *chip = card->private_data;
158 struct snd_msndmidi *mpu;
159 struct snd_rawmidi *rmidi;
160 int err;
161
162 err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi);
163 if (err < 0)
164 return err;
165 mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
166 if (mpu == NULL) {
167 snd_device_free(card, rmidi);
168 return -ENOMEM;
169 }
170 mpu->dev = chip;
171 chip->msndmidi_mpu = mpu;
172 rmidi->private_data = mpu;
173 rmidi->private_free = snd_msndmidi_free;
174 spin_lock_init(&mpu->input_lock);
175 strcpy(rmidi->name, "MSND MIDI");
176 snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT,
177 &snd_msndmidi_input);
178 rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT;
179 return 0;
180}
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c
new file mode 100644
index 000000000000..60b6abd71612
--- /dev/null
+++ b/sound/isa/msnd/msnd_pinnacle.c
@@ -0,0 +1,1238 @@
1/*********************************************************************
2 *
3 * Linux multisound pinnacle/fiji driver for ALSA.
4 *
5 * 2002/06/30 Karsten Wiese:
6 * for now this is only used to build a pinnacle / fiji driver.
7 * the OSS parent of this code is designed to also support
8 * the multisound classic via the file msnd_classic.c.
9 * to make it easier for some brave heart to implemt classic
10 * support in alsa, i left all the MSND_CLASSIC tokens in this file.
11 * but for now this untested & undone.
12 *
13 *
14 * ripped from linux kernel 2.4.18 by Karsten Wiese.
15 *
16 * the following is a copy of the 2.4.18 OSS FREE file-heading comment:
17 *
18 * Turtle Beach MultiSound Sound Card Driver for Linux
19 * msnd_pinnacle.c / msnd_classic.c
20 *
21 * -- If MSND_CLASSIC is defined:
22 *
23 * -> driver for Turtle Beach Classic/Monterey/Tahiti
24 *
25 * -- Else
26 *
27 * -> driver for Turtle Beach Pinnacle/Fiji
28 *
29 * 12-3-2000 Modified IO port validation Steve Sycamore
30 *
31 * Copyright (C) 1998 Andrew Veliath
32 *
33 * This program is free software; you can redistribute it and/or modify
34 * it under the terms of the GNU General Public License as published by
35 * the Free Software Foundation; either version 2 of the License, or
36 * (at your option) any later version.
37 *
38 * This program is distributed in the hope that it will be useful,
39 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 * GNU General Public License for more details.
42 *
43 * You should have received a copy of the GNU General Public License
44 * along with this program; if not, write to the Free Software
45 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
46 *
47 ********************************************************************/
48
49#include <linux/kernel.h>
50#include <linux/module.h>
51#include <linux/interrupt.h>
52#include <linux/types.h>
53#include <linux/delay.h>
54#include <linux/ioport.h>
55#include <linux/firmware.h>
56#include <linux/isa.h>
57#include <linux/isapnp.h>
58#include <linux/irq.h>
59#include <linux/io.h>
60
61#include <sound/core.h>
62#include <sound/initval.h>
63#include <sound/asound.h>
64#include <sound/pcm.h>
65#include <sound/mpu401.h>
66
67#ifdef MSND_CLASSIC
68# ifndef __alpha__
69# define SLOWIO
70# endif
71#endif
72#include "msnd.h"
73#ifdef MSND_CLASSIC
74# include "msnd_classic.h"
75# define LOGNAME "msnd_classic"
76#else
77# include "msnd_pinnacle.h"
78# define LOGNAME "snd_msnd_pinnacle"
79#endif
80
81static void __devinit set_default_audio_parameters(struct snd_msnd *chip)
82{
83 chip->play_sample_size = DEFSAMPLESIZE;
84 chip->play_sample_rate = DEFSAMPLERATE;
85 chip->play_channels = DEFCHANNELS;
86 chip->capture_sample_size = DEFSAMPLESIZE;
87 chip->capture_sample_rate = DEFSAMPLERATE;
88 chip->capture_channels = DEFCHANNELS;
89}
90
91static void snd_msnd_eval_dsp_msg(struct snd_msnd *chip, u16 wMessage)
92{
93 switch (HIBYTE(wMessage)) {
94 case HIMT_PLAY_DONE: {
95 if (chip->banksPlayed < 3)
96 snd_printdd("%08X: HIMT_PLAY_DONE: %i\n",
97 (unsigned)jiffies, LOBYTE(wMessage));
98
99 if (chip->last_playbank == LOBYTE(wMessage)) {
100 snd_printdd("chip.last_playbank == LOBYTE(wMessage)\n");
101 break;
102 }
103 chip->banksPlayed++;
104
105 if (test_bit(F_WRITING, &chip->flags))
106 snd_msnd_DAPQ(chip, 0);
107
108 chip->last_playbank = LOBYTE(wMessage);
109 chip->playDMAPos += chip->play_period_bytes;
110 if (chip->playDMAPos > chip->playLimit)
111 chip->playDMAPos = 0;
112 snd_pcm_period_elapsed(chip->playback_substream);
113
114 break;
115 }
116 case HIMT_RECORD_DONE:
117 if (chip->last_recbank == LOBYTE(wMessage))
118 break;
119 chip->last_recbank = LOBYTE(wMessage);
120 chip->captureDMAPos += chip->capturePeriodBytes;
121 if (chip->captureDMAPos > (chip->captureLimit))
122 chip->captureDMAPos = 0;
123
124 if (test_bit(F_READING, &chip->flags))
125 snd_msnd_DARQ(chip, chip->last_recbank);
126
127 snd_pcm_period_elapsed(chip->capture_substream);
128 break;
129
130 case HIMT_DSP:
131 switch (LOBYTE(wMessage)) {
132#ifndef MSND_CLASSIC
133 case HIDSP_PLAY_UNDER:
134#endif
135 case HIDSP_INT_PLAY_UNDER:
136 snd_printd(KERN_WARNING LOGNAME ": Play underflow %i\n",
137 chip->banksPlayed);
138 if (chip->banksPlayed > 2)
139 clear_bit(F_WRITING, &chip->flags);
140 break;
141
142 case HIDSP_INT_RECORD_OVER:
143 snd_printd(KERN_WARNING LOGNAME ": Record overflow\n");
144 clear_bit(F_READING, &chip->flags);
145 break;
146
147 default:
148 snd_printd(KERN_WARNING LOGNAME
149 ": DSP message %d 0x%02x\n",
150 LOBYTE(wMessage), LOBYTE(wMessage));
151 break;
152 }
153 break;
154
155 case HIMT_MIDI_IN_UCHAR:
156 if (chip->msndmidi_mpu)
157 snd_msndmidi_input_read(chip->msndmidi_mpu);
158 break;
159
160 default:
161 snd_printd(KERN_WARNING LOGNAME ": HIMT message %d 0x%02x\n",
162 HIBYTE(wMessage), HIBYTE(wMessage));
163 break;
164 }
165}
166
167static irqreturn_t snd_msnd_interrupt(int irq, void *dev_id)
168{
169 struct snd_msnd *chip = dev_id;
170 void *pwDSPQData = chip->mappedbase + DSPQ_DATA_BUFF;
171
172 /* Send ack to DSP */
173 /* inb(chip->io + HP_RXL); */
174
175 /* Evaluate queued DSP messages */
176 while (readw(chip->DSPQ + JQS_wTail) != readw(chip->DSPQ + JQS_wHead)) {
177 u16 wTmp;
178
179 snd_msnd_eval_dsp_msg(chip,
180 readw(pwDSPQData + 2 * readw(chip->DSPQ + JQS_wHead)));
181
182 wTmp = readw(chip->DSPQ + JQS_wHead) + 1;
183 if (wTmp > readw(chip->DSPQ + JQS_wSize))
184 writew(0, chip->DSPQ + JQS_wHead);
185 else
186 writew(wTmp, chip->DSPQ + JQS_wHead);
187 }
188 /* Send ack to DSP */
189 inb(chip->io + HP_RXL);
190 return IRQ_HANDLED;
191}
192
193
194static int snd_msnd_reset_dsp(long io, unsigned char *info)
195{
196 int timeout = 100;
197
198 outb(HPDSPRESET_ON, io + HP_DSPR);
199 msleep(1);
200#ifndef MSND_CLASSIC
201 if (info)
202 *info = inb(io + HP_INFO);
203#endif
204 outb(HPDSPRESET_OFF, io + HP_DSPR);
205 msleep(1);
206 while (timeout-- > 0) {
207 if (inb(io + HP_CVR) == HP_CVR_DEF)
208 return 0;
209 msleep(1);
210 }
211 snd_printk(KERN_ERR LOGNAME ": Cannot reset DSP\n");
212
213 return -EIO;
214}
215
216static int __devinit snd_msnd_probe(struct snd_card *card)
217{
218 struct snd_msnd *chip = card->private_data;
219 unsigned char info;
220#ifndef MSND_CLASSIC
221 char *xv, *rev = NULL;
222 char *pin = "TB Pinnacle", *fiji = "TB Fiji";
223 char *pinfiji = "TB Pinnacle/Fiji";
224#endif
225
226 if (!request_region(chip->io, DSP_NUMIO, "probing")) {
227 snd_printk(KERN_ERR LOGNAME ": I/O port conflict\n");
228 return -ENODEV;
229 }
230
231 if (snd_msnd_reset_dsp(chip->io, &info) < 0) {
232 release_region(chip->io, DSP_NUMIO);
233 return -ENODEV;
234 }
235
236#ifdef MSND_CLASSIC
237 strcpy(card->shortname, "Classic/Tahiti/Monterey");
238 strcpy(card->longname, "Turtle Beach Multisound");
239 printk(KERN_INFO LOGNAME ": %s, "
240 "I/O 0x%lx-0x%lx, IRQ %d, memory mapped to 0x%lX-0x%lX\n",
241 card->shortname,
242 chip->io, chip->io + DSP_NUMIO - 1,
243 chip->irq,
244 chip->base, chip->base + 0x7fff);
245#else
246 switch (info >> 4) {
247 case 0xf:
248 xv = "<= 1.15";
249 break;
250 case 0x1:
251 xv = "1.18/1.2";
252 break;
253 case 0x2:
254 xv = "1.3";
255 break;
256 case 0x3:
257 xv = "1.4";
258 break;
259 default:
260 xv = "unknown";
261 break;
262 }
263
264 switch (info & 0x7) {
265 case 0x0:
266 rev = "I";
267 strcpy(card->shortname, pin);
268 break;
269 case 0x1:
270 rev = "F";
271 strcpy(card->shortname, pin);
272 break;
273 case 0x2:
274 rev = "G";
275 strcpy(card->shortname, pin);
276 break;
277 case 0x3:
278 rev = "H";
279 strcpy(card->shortname, pin);
280 break;
281 case 0x4:
282 rev = "E";
283 strcpy(card->shortname, fiji);
284 break;
285 case 0x5:
286 rev = "C";
287 strcpy(card->shortname, fiji);
288 break;
289 case 0x6:
290 rev = "D";
291 strcpy(card->shortname, fiji);
292 break;
293 case 0x7:
294 rev = "A-B (Fiji) or A-E (Pinnacle)";
295 strcpy(card->shortname, pinfiji);
296 break;
297 }
298 strcpy(card->longname, "Turtle Beach Multisound Pinnacle");
299 printk(KERN_INFO LOGNAME ": %s revision %s, Xilinx version %s, "
300 "I/O 0x%lx-0x%lx, IRQ %d, memory mapped to 0x%lX-0x%lX\n",
301 card->shortname,
302 rev, xv,
303 chip->io, chip->io + DSP_NUMIO - 1,
304 chip->irq,
305 chip->base, chip->base + 0x7fff);
306#endif
307
308 release_region(chip->io, DSP_NUMIO);
309 return 0;
310}
311
312static int snd_msnd_init_sma(struct snd_msnd *chip)
313{
314 static int initted;
315 u16 mastVolLeft, mastVolRight;
316 unsigned long flags;
317
318#ifdef MSND_CLASSIC
319 outb(chip->memid, chip->io + HP_MEMM);
320#endif
321 outb(HPBLKSEL_0, chip->io + HP_BLKS);
322 /* Motorola 56k shared memory base */
323 chip->SMA = chip->mappedbase + SMA_STRUCT_START;
324
325 if (initted) {
326 mastVolLeft = readw(chip->SMA + SMA_wCurrMastVolLeft);
327 mastVolRight = readw(chip->SMA + SMA_wCurrMastVolRight);
328 } else
329 mastVolLeft = mastVolRight = 0;
330 memset_io(chip->mappedbase, 0, 0x8000);
331
332 /* Critical section: bank 1 access */
333 spin_lock_irqsave(&chip->lock, flags);
334 outb(HPBLKSEL_1, chip->io + HP_BLKS);
335 memset_io(chip->mappedbase, 0, 0x8000);
336 outb(HPBLKSEL_0, chip->io + HP_BLKS);
337 spin_unlock_irqrestore(&chip->lock, flags);
338
339 /* Digital audio play queue */
340 chip->DAPQ = chip->mappedbase + DAPQ_OFFSET;
341 snd_msnd_init_queue(chip->DAPQ, DAPQ_DATA_BUFF, DAPQ_BUFF_SIZE);
342
343 /* Digital audio record queue */
344 chip->DARQ = chip->mappedbase + DARQ_OFFSET;
345 snd_msnd_init_queue(chip->DARQ, DARQ_DATA_BUFF, DARQ_BUFF_SIZE);
346
347 /* MIDI out queue */
348 chip->MODQ = chip->mappedbase + MODQ_OFFSET;
349 snd_msnd_init_queue(chip->MODQ, MODQ_DATA_BUFF, MODQ_BUFF_SIZE);
350
351 /* MIDI in queue */
352 chip->MIDQ = chip->mappedbase + MIDQ_OFFSET;
353 snd_msnd_init_queue(chip->MIDQ, MIDQ_DATA_BUFF, MIDQ_BUFF_SIZE);
354
355 /* DSP -> host message queue */
356 chip->DSPQ = chip->mappedbase + DSPQ_OFFSET;
357 snd_msnd_init_queue(chip->DSPQ, DSPQ_DATA_BUFF, DSPQ_BUFF_SIZE);
358
359 /* Setup some DSP values */
360#ifndef MSND_CLASSIC
361 writew(1, chip->SMA + SMA_wCurrPlayFormat);
362 writew(chip->play_sample_size, chip->SMA + SMA_wCurrPlaySampleSize);
363 writew(chip->play_channels, chip->SMA + SMA_wCurrPlayChannels);
364 writew(chip->play_sample_rate, chip->SMA + SMA_wCurrPlaySampleRate);
365#endif
366 writew(chip->play_sample_rate, chip->SMA + SMA_wCalFreqAtoD);
367 writew(mastVolLeft, chip->SMA + SMA_wCurrMastVolLeft);
368 writew(mastVolRight, chip->SMA + SMA_wCurrMastVolRight);
369#ifndef MSND_CLASSIC
370 writel(0x00010000, chip->SMA + SMA_dwCurrPlayPitch);
371 writel(0x00000001, chip->SMA + SMA_dwCurrPlayRate);
372#endif
373 writew(0x303, chip->SMA + SMA_wCurrInputTagBits);
374
375 initted = 1;
376
377 return 0;
378}
379
380
381static int upload_dsp_code(struct snd_card *card)
382{
383 struct snd_msnd *chip = card->private_data;
384 const struct firmware *init_fw = NULL, *perm_fw = NULL;
385 int err;
386
387 outb(HPBLKSEL_0, chip->io + HP_BLKS);
388
389 err = request_firmware(&init_fw, INITCODEFILE, card->dev);
390 if (err < 0) {
391 printk(KERN_ERR LOGNAME ": Error loading " INITCODEFILE);
392 goto cleanup1;
393 }
394 err = request_firmware(&perm_fw, PERMCODEFILE, card->dev);
395 if (err < 0) {
396 printk(KERN_ERR LOGNAME ": Error loading " PERMCODEFILE);
397 goto cleanup;
398 }
399
400 memcpy_toio(chip->mappedbase, perm_fw->data, perm_fw->size);
401 if (snd_msnd_upload_host(chip, init_fw->data, init_fw->size) < 0) {
402 printk(KERN_WARNING LOGNAME ": Error uploading to DSP\n");
403 err = -ENODEV;
404 goto cleanup;
405 }
406 printk(KERN_INFO LOGNAME ": DSP firmware uploaded\n");
407 err = 0;
408
409cleanup:
410 release_firmware(perm_fw);
411cleanup1:
412 release_firmware(init_fw);
413 return err;
414}
415
416#ifdef MSND_CLASSIC
417static void reset_proteus(struct snd_msnd *chip)
418{
419 outb(HPPRORESET_ON, chip->io + HP_PROR);
420 msleep(TIME_PRO_RESET);
421 outb(HPPRORESET_OFF, chip->io + HP_PROR);
422 msleep(TIME_PRO_RESET_DONE);
423}
424#endif
425
426static int snd_msnd_initialize(struct snd_card *card)
427{
428 struct snd_msnd *chip = card->private_data;
429 int err, timeout;
430
431#ifdef MSND_CLASSIC
432 outb(HPWAITSTATE_0, chip->io + HP_WAIT);
433 outb(HPBITMODE_16, chip->io + HP_BITM);
434
435 reset_proteus(chip);
436#endif
437 err = snd_msnd_init_sma(chip);
438 if (err < 0) {
439 printk(KERN_WARNING LOGNAME ": Cannot initialize SMA\n");
440 return err;
441 }
442
443 err = snd_msnd_reset_dsp(chip->io, NULL);
444 if (err < 0)
445 return err;
446
447 err = upload_dsp_code(card);
448 if (err < 0) {
449 printk(KERN_WARNING LOGNAME ": Cannot upload DSP code\n");
450 return err;
451 }
452
453 timeout = 200;
454
455 while (readw(chip->mappedbase)) {
456 msleep(1);
457 if (!timeout--) {
458 snd_printd(KERN_ERR LOGNAME ": DSP reset timeout\n");
459 return -EIO;
460 }
461 }
462
463 snd_msndmix_setup(chip);
464 return 0;
465}
466
467static int snd_msnd_dsp_full_reset(struct snd_card *card)
468{
469 struct snd_msnd *chip = card->private_data;
470 int rv;
471
472 if (test_bit(F_RESETTING, &chip->flags) || ++chip->nresets > 10)
473 return 0;
474
475 set_bit(F_RESETTING, &chip->flags);
476 snd_msnd_dsp_halt(chip, NULL); /* Unconditionally halt */
477
478 rv = snd_msnd_initialize(card);
479 if (rv)
480 printk(KERN_WARNING LOGNAME ": DSP reset failed\n");
481 snd_msndmix_force_recsrc(chip, 0);
482 clear_bit(F_RESETTING, &chip->flags);
483 return rv;
484}
485
486static int snd_msnd_dev_free(struct snd_device *device)
487{
488 snd_printdd("snd_msnd_chip_free()\n");
489 return 0;
490}
491
492static int snd_msnd_send_dsp_cmd_chk(struct snd_msnd *chip, u8 cmd)
493{
494 if (snd_msnd_send_dsp_cmd(chip, cmd) == 0)
495 return 0;
496 snd_msnd_dsp_full_reset(chip->card);
497 return snd_msnd_send_dsp_cmd(chip, cmd);
498}
499
500static int __devinit snd_msnd_calibrate_adc(struct snd_msnd *chip, u16 srate)
501{
502 snd_printdd("snd_msnd_calibrate_adc(%i)\n", srate);
503 writew(srate, chip->SMA + SMA_wCalFreqAtoD);
504 if (chip->calibrate_signal == 0)
505 writew(readw(chip->SMA + SMA_wCurrHostStatusFlags)
506 | 0x0001, chip->SMA + SMA_wCurrHostStatusFlags);
507 else
508 writew(readw(chip->SMA + SMA_wCurrHostStatusFlags)
509 & ~0x0001, chip->SMA + SMA_wCurrHostStatusFlags);
510 if (snd_msnd_send_word(chip, 0, 0, HDEXAR_CAL_A_TO_D) == 0 &&
511 snd_msnd_send_dsp_cmd_chk(chip, HDEX_AUX_REQ) == 0) {
512 schedule_timeout_interruptible(msecs_to_jiffies(333));
513 return 0;
514 }
515 printk(KERN_WARNING LOGNAME ": ADC calibration failed\n");
516 return -EIO;
517}
518
519/*
520 * ALSA callback function, called when attempting to open the MIDI device.
521 */
522static int snd_msnd_mpu401_open(struct snd_mpu401 *mpu)
523{
524 snd_msnd_enable_irq(mpu->private_data);
525 snd_msnd_send_dsp_cmd(mpu->private_data, HDEX_MIDI_IN_START);
526 return 0;
527}
528
529static void snd_msnd_mpu401_close(struct snd_mpu401 *mpu)
530{
531 snd_msnd_send_dsp_cmd(mpu->private_data, HDEX_MIDI_IN_STOP);
532 snd_msnd_disable_irq(mpu->private_data);
533}
534
535static long mpu_io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
536static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
537
538static int __devinit snd_msnd_attach(struct snd_card *card)
539{
540 struct snd_msnd *chip = card->private_data;
541 int err;
542 static struct snd_device_ops ops = {
543 .dev_free = snd_msnd_dev_free,
544 };
545
546 err = request_irq(chip->irq, snd_msnd_interrupt, 0, card->shortname,
547 chip);
548 if (err < 0) {
549 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", chip->irq);
550 return err;
551 }
552 request_region(chip->io, DSP_NUMIO, card->shortname);
553
554 if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) {
555 printk(KERN_ERR LOGNAME
556 ": unable to grab memory region 0x%lx-0x%lx\n",
557 chip->base, chip->base + BUFFSIZE - 1);
558 release_region(chip->io, DSP_NUMIO);
559 free_irq(chip->irq, chip);
560 return -EBUSY;
561 }
562 chip->mappedbase = ioremap_nocache(chip->base, 0x8000);
563 if (!chip->mappedbase) {
564 printk(KERN_ERR LOGNAME
565 ": unable to map memory region 0x%lx-0x%lx\n",
566 chip->base, chip->base + BUFFSIZE - 1);
567 err = -EIO;
568 goto err_release_region;
569 }
570
571 err = snd_msnd_dsp_full_reset(card);
572 if (err < 0)
573 goto err_release_region;
574
575 /* Register device */
576 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
577 if (err < 0)
578 goto err_release_region;
579
580 err = snd_msnd_pcm(card, 0, NULL);
581 if (err < 0) {
582 printk(KERN_ERR LOGNAME ": error creating new PCM device\n");
583 goto err_release_region;
584 }
585
586 err = snd_msndmix_new(card);
587 if (err < 0) {
588 printk(KERN_ERR LOGNAME ": error creating new Mixer device\n");
589 goto err_release_region;
590 }
591
592
593 if (mpu_io[0] != SNDRV_AUTO_PORT) {
594 struct snd_mpu401 *mpu;
595
596 err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
597 mpu_io[0],
598 MPU401_MODE_INPUT |
599 MPU401_MODE_OUTPUT,
600 mpu_irq[0], IRQF_DISABLED,
601 &chip->rmidi);
602 if (err < 0) {
603 printk(KERN_ERR LOGNAME
604 ": error creating new Midi device\n");
605 goto err_release_region;
606 }
607 mpu = chip->rmidi->private_data;
608
609 mpu->open_input = snd_msnd_mpu401_open;
610 mpu->close_input = snd_msnd_mpu401_close;
611 mpu->private_data = chip;
612 }
613
614 disable_irq(chip->irq);
615 snd_msnd_calibrate_adc(chip, chip->play_sample_rate);
616 snd_msndmix_force_recsrc(chip, 0);
617
618 err = snd_card_register(card);
619 if (err < 0)
620 goto err_release_region;
621
622 return 0;
623
624err_release_region:
625 if (chip->mappedbase)
626 iounmap(chip->mappedbase);
627 release_mem_region(chip->base, BUFFSIZE);
628 release_region(chip->io, DSP_NUMIO);
629 free_irq(chip->irq, chip);
630 return err;
631}
632
633
634static void __devexit snd_msnd_unload(struct snd_card *card)
635{
636 struct snd_msnd *chip = card->private_data;
637
638 iounmap(chip->mappedbase);
639 release_mem_region(chip->base, BUFFSIZE);
640 release_region(chip->io, DSP_NUMIO);
641 free_irq(chip->irq, chip);
642 snd_card_free(card);
643}
644
645#ifndef MSND_CLASSIC
646
647/* Pinnacle/Fiji Logical Device Configuration */
648
649static int __devinit snd_msnd_write_cfg(int cfg, int reg, int value)
650{
651 outb(reg, cfg);
652 outb(value, cfg + 1);
653 if (value != inb(cfg + 1)) {
654 printk(KERN_ERR LOGNAME ": snd_msnd_write_cfg: I/O error\n");
655 return -EIO;
656 }
657 return 0;
658}
659
660static int __devinit snd_msnd_write_cfg_io0(int cfg, int num, u16 io)
661{
662 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
663 return -EIO;
664 if (snd_msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
665 return -EIO;
666 if (snd_msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
667 return -EIO;
668 return 0;
669}
670
671static int __devinit snd_msnd_write_cfg_io1(int cfg, int num, u16 io)
672{
673 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
674 return -EIO;
675 if (snd_msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
676 return -EIO;
677 if (snd_msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
678 return -EIO;
679 return 0;
680}
681
682static int __devinit snd_msnd_write_cfg_irq(int cfg, int num, u16 irq)
683{
684 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
685 return -EIO;
686 if (snd_msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
687 return -EIO;
688 if (snd_msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
689 return -EIO;
690 return 0;
691}
692
693static int __devinit snd_msnd_write_cfg_mem(int cfg, int num, int mem)
694{
695 u16 wmem;
696
697 mem >>= 8;
698 wmem = (u16)(mem & 0xfff);
699 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
700 return -EIO;
701 if (snd_msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
702 return -EIO;
703 if (snd_msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
704 return -EIO;
705 if (wmem && snd_msnd_write_cfg(cfg, IREG_MEMCONTROL,
706 MEMTYPE_HIADDR | MEMTYPE_16BIT))
707 return -EIO;
708 return 0;
709}
710
711static int __devinit snd_msnd_activate_logical(int cfg, int num)
712{
713 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
714 return -EIO;
715 if (snd_msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
716 return -EIO;
717 return 0;
718}
719
720static int __devinit snd_msnd_write_cfg_logical(int cfg, int num, u16 io0,
721 u16 io1, u16 irq, int mem)
722{
723 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
724 return -EIO;
725 if (snd_msnd_write_cfg_io0(cfg, num, io0))
726 return -EIO;
727 if (snd_msnd_write_cfg_io1(cfg, num, io1))
728 return -EIO;
729 if (snd_msnd_write_cfg_irq(cfg, num, irq))
730 return -EIO;
731 if (snd_msnd_write_cfg_mem(cfg, num, mem))
732 return -EIO;
733 if (snd_msnd_activate_logical(cfg, num))
734 return -EIO;
735 return 0;
736}
737
738static int __devinit snd_msnd_pinnacle_cfg_reset(int cfg)
739{
740 int i;
741
742 /* Reset devices if told to */
743 printk(KERN_INFO LOGNAME ": Resetting all devices\n");
744 for (i = 0; i < 4; ++i)
745 if (snd_msnd_write_cfg_logical(cfg, i, 0, 0, 0, 0))
746 return -EIO;
747
748 return 0;
749}
750#endif
751
752static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
753static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
754
755module_param_array(index, int, NULL, S_IRUGO);
756MODULE_PARM_DESC(index, "Index value for msnd_pinnacle soundcard.");
757module_param_array(id, charp, NULL, S_IRUGO);
758MODULE_PARM_DESC(id, "ID string for msnd_pinnacle soundcard.");
759
760static long io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
761static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
762static long mem[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
763
764static long cfg[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
765
766#ifndef MSND_CLASSIC
767/* Extra Peripheral Configuration (Default: Disable) */
768static long ide_io0[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
769static long ide_io1[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
770static int ide_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
771
772static long joystick_io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
773/* If we have the digital daugherboard... */
774static int digital[SNDRV_CARDS];
775
776/* Extra Peripheral Configuration */
777static int reset[SNDRV_CARDS];
778#endif
779
780static int write_ndelay[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
781
782static int calibrate_signal;
783
784#ifdef CONFIG_PNP
785static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
786module_param_array(isapnp, bool, NULL, 0444);
787MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
788#define has_isapnp(x) isapnp[x]
789#else
790#define has_isapnp(x) 0
791#endif
792
793MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");
794MODULE_DESCRIPTION("Turtle Beach " LONGNAME " Linux Driver");
795MODULE_LICENSE("GPL");
796MODULE_FIRMWARE(INITCODEFILE);
797MODULE_FIRMWARE(PERMCODEFILE);
798
799module_param_array(io, long, NULL, S_IRUGO);
800MODULE_PARM_DESC(io, "IO port #");
801module_param_array(irq, int, NULL, S_IRUGO);
802module_param_array(mem, long, NULL, S_IRUGO);
803module_param_array(write_ndelay, int, NULL, S_IRUGO);
804module_param(calibrate_signal, int, S_IRUGO);
805#ifndef MSND_CLASSIC
806module_param_array(digital, int, NULL, S_IRUGO);
807module_param_array(cfg, long, NULL, S_IRUGO);
808module_param_array(reset, int, 0, S_IRUGO);
809module_param_array(mpu_io, long, NULL, S_IRUGO);
810module_param_array(mpu_irq, int, NULL, S_IRUGO);
811module_param_array(ide_io0, long, NULL, S_IRUGO);
812module_param_array(ide_io1, long, NULL, S_IRUGO);
813module_param_array(ide_irq, int, NULL, S_IRUGO);
814module_param_array(joystick_io, long, NULL, S_IRUGO);
815#endif
816
817
818static int __devinit snd_msnd_isa_match(struct device *pdev, unsigned int i)
819{
820 if (io[i] == SNDRV_AUTO_PORT)
821 return 0;
822
823 if (irq[i] == SNDRV_AUTO_PORT || mem[i] == SNDRV_AUTO_PORT) {
824 printk(KERN_WARNING LOGNAME ": io, irq and mem must be set\n");
825 return 0;
826 }
827
828#ifdef MSND_CLASSIC
829 if (!(io[i] == 0x290 ||
830 io[i] == 0x260 ||
831 io[i] == 0x250 ||
832 io[i] == 0x240 ||
833 io[i] == 0x230 ||
834 io[i] == 0x220 ||
835 io[i] == 0x210 ||
836 io[i] == 0x3e0)) {
837 printk(KERN_ERR LOGNAME ": \"io\" - DSP I/O base must be set "
838 " to 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x290, "
839 "or 0x3E0\n");
840 return 0;
841 }
842#else
843 if (io[i] < 0x100 || io[i] > 0x3e0 || (io[i] % 0x10) != 0) {
844 printk(KERN_ERR LOGNAME
845 ": \"io\" - DSP I/O base must within the range 0x100 "
846 "to 0x3E0 and must be evenly divisible by 0x10\n");
847 return 0;
848 }
849#endif /* MSND_CLASSIC */
850
851 if (!(irq[i] == 5 ||
852 irq[i] == 7 ||
853 irq[i] == 9 ||
854 irq[i] == 10 ||
855 irq[i] == 11 ||
856 irq[i] == 12)) {
857 printk(KERN_ERR LOGNAME
858 ": \"irq\" - must be set to 5, 7, 9, 10, 11 or 12\n");
859 return 0;
860 }
861
862 if (!(mem[i] == 0xb0000 ||
863 mem[i] == 0xc8000 ||
864 mem[i] == 0xd0000 ||
865 mem[i] == 0xd8000 ||
866 mem[i] == 0xe0000 ||
867 mem[i] == 0xe8000)) {
868 printk(KERN_ERR LOGNAME ": \"mem\" - must be set to "
869 "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or "
870 "0xe8000\n");
871 return 0;
872 }
873
874#ifndef MSND_CLASSIC
875 if (cfg[i] == SNDRV_AUTO_PORT) {
876 printk(KERN_INFO LOGNAME ": Assuming PnP mode\n");
877 } else if (cfg[i] != 0x250 && cfg[i] != 0x260 && cfg[i] != 0x270) {
878 printk(KERN_INFO LOGNAME
879 ": Config port must be 0x250, 0x260 or 0x270 "
880 "(or unspecified for PnP mode)\n");
881 return 0;
882 }
883#endif /* MSND_CLASSIC */
884
885 return 1;
886}
887
888static int __devinit snd_msnd_isa_probe(struct device *pdev, unsigned int idx)
889{
890 int err;
891 struct snd_card *card;
892 struct snd_msnd *chip;
893
894 if (has_isapnp(idx) || cfg[idx] == SNDRV_AUTO_PORT) {
895 printk(KERN_INFO LOGNAME ": Assuming PnP mode\n");
896 return -ENODEV;
897 }
898
899 err = snd_card_create(index[idx], id[idx], THIS_MODULE,
900 sizeof(struct snd_msnd), &card);
901 if (err < 0)
902 return err;
903
904 snd_card_set_dev(card, pdev);
905 chip = card->private_data;
906 chip->card = card;
907
908#ifdef MSND_CLASSIC
909 switch (irq[idx]) {
910 case 5:
911 chip->irqid = HPIRQ_5; break;
912 case 7:
913 chip->irqid = HPIRQ_7; break;
914 case 9:
915 chip->irqid = HPIRQ_9; break;
916 case 10:
917 chip->irqid = HPIRQ_10; break;
918 case 11:
919 chip->irqid = HPIRQ_11; break;
920 case 12:
921 chip->irqid = HPIRQ_12; break;
922 }
923
924 switch (mem[idx]) {
925 case 0xb0000:
926 chip->memid = HPMEM_B000; break;
927 case 0xc8000:
928 chip->memid = HPMEM_C800; break;
929 case 0xd0000:
930 chip->memid = HPMEM_D000; break;
931 case 0xd8000:
932 chip->memid = HPMEM_D800; break;
933 case 0xe0000:
934 chip->memid = HPMEM_E000; break;
935 case 0xe8000:
936 chip->memid = HPMEM_E800; break;
937 }
938#else
939 printk(KERN_INFO LOGNAME ": Non-PnP mode: configuring at port 0x%lx\n",
940 cfg[idx]);
941
942 if (!request_region(cfg[idx], 2, "Pinnacle/Fiji Config")) {
943 printk(KERN_ERR LOGNAME ": Config port 0x%lx conflict\n",
944 cfg[idx]);
945 snd_card_free(card);
946 return -EIO;
947 }
948 if (reset[idx])
949 if (snd_msnd_pinnacle_cfg_reset(cfg[idx])) {
950 err = -EIO;
951 goto cfg_error;
952 }
953
954 /* DSP */
955 err = snd_msnd_write_cfg_logical(cfg[idx], 0,
956 io[idx], 0,
957 irq[idx], mem[idx]);
958
959 if (err)
960 goto cfg_error;
961
962 /* The following are Pinnacle specific */
963
964 /* MPU */
965 if (mpu_io[idx] != SNDRV_AUTO_PORT
966 && mpu_irq[idx] != SNDRV_AUTO_IRQ) {
967 printk(KERN_INFO LOGNAME
968 ": Configuring MPU to I/O 0x%lx IRQ %d\n",
969 mpu_io[idx], mpu_irq[idx]);
970 err = snd_msnd_write_cfg_logical(cfg[idx], 1,
971 mpu_io[idx], 0,
972 mpu_irq[idx], 0);
973
974 if (err)
975 goto cfg_error;
976 }
977
978 /* IDE */
979 if (ide_io0[idx] != SNDRV_AUTO_PORT
980 && ide_io1[idx] != SNDRV_AUTO_PORT
981 && ide_irq[idx] != SNDRV_AUTO_IRQ) {
982 printk(KERN_INFO LOGNAME
983 ": Configuring IDE to I/O 0x%lx, 0x%lx IRQ %d\n",
984 ide_io0[idx], ide_io1[idx], ide_irq[idx]);
985 err = snd_msnd_write_cfg_logical(cfg[idx], 2,
986 ide_io0[idx], ide_io1[idx],
987 ide_irq[idx], 0);
988
989 if (err)
990 goto cfg_error;
991 }
992
993 /* Joystick */
994 if (joystick_io[idx] != SNDRV_AUTO_PORT) {
995 printk(KERN_INFO LOGNAME
996 ": Configuring joystick to I/O 0x%lx\n",
997 joystick_io[idx]);
998 err = snd_msnd_write_cfg_logical(cfg[idx], 3,
999 joystick_io[idx], 0,
1000 0, 0);
1001
1002 if (err)
1003 goto cfg_error;
1004 }
1005 release_region(cfg[idx], 2);
1006
1007#endif /* MSND_CLASSIC */
1008
1009 set_default_audio_parameters(chip);
1010#ifdef MSND_CLASSIC
1011 chip->type = msndClassic;
1012#else
1013 chip->type = msndPinnacle;
1014#endif
1015 chip->io = io[idx];
1016 chip->irq = irq[idx];
1017 chip->base = mem[idx];
1018
1019 chip->calibrate_signal = calibrate_signal ? 1 : 0;
1020 chip->recsrc = 0;
1021 chip->dspq_data_buff = DSPQ_DATA_BUFF;
1022 chip->dspq_buff_size = DSPQ_BUFF_SIZE;
1023 if (write_ndelay[idx])
1024 clear_bit(F_DISABLE_WRITE_NDELAY, &chip->flags);
1025 else
1026 set_bit(F_DISABLE_WRITE_NDELAY, &chip->flags);
1027#ifndef MSND_CLASSIC
1028 if (digital[idx])
1029 set_bit(F_HAVEDIGITAL, &chip->flags);
1030#endif
1031 spin_lock_init(&chip->lock);
1032 err = snd_msnd_probe(card);
1033 if (err < 0) {
1034 printk(KERN_ERR LOGNAME ": Probe failed\n");
1035 snd_card_free(card);
1036 return err;
1037 }
1038
1039 err = snd_msnd_attach(card);
1040 if (err < 0) {
1041 printk(KERN_ERR LOGNAME ": Attach failed\n");
1042 snd_card_free(card);
1043 return err;
1044 }
1045 dev_set_drvdata(pdev, card);
1046
1047 return 0;
1048
1049#ifndef MSND_CLASSIC
1050cfg_error:
1051 release_region(cfg[idx], 2);
1052 snd_card_free(card);
1053 return err;
1054#endif
1055}
1056
1057static int __devexit snd_msnd_isa_remove(struct device *pdev, unsigned int dev)
1058{
1059 snd_msnd_unload(dev_get_drvdata(pdev));
1060 dev_set_drvdata(pdev, NULL);
1061 return 0;
1062}
1063
1064#define DEV_NAME "msnd-pinnacle"
1065
1066static struct isa_driver snd_msnd_driver = {
1067 .match = snd_msnd_isa_match,
1068 .probe = snd_msnd_isa_probe,
1069 .remove = __devexit_p(snd_msnd_isa_remove),
1070 /* FIXME: suspend, resume */
1071 .driver = {
1072 .name = DEV_NAME
1073 },
1074};
1075
1076#ifdef CONFIG_PNP
1077static int __devinit snd_msnd_pnp_detect(struct pnp_card_link *pcard,
1078 const struct pnp_card_device_id *pid)
1079{
1080 static int idx;
1081 struct pnp_dev *pnp_dev;
1082 struct pnp_dev *mpu_dev;
1083 struct snd_card *card;
1084 struct snd_msnd *chip;
1085 int ret;
1086
1087 for ( ; idx < SNDRV_CARDS; idx++) {
1088 if (has_isapnp(idx))
1089 break;
1090 }
1091 if (idx >= SNDRV_CARDS)
1092 return -ENODEV;
1093
1094 /*
1095 * Check that we still have room for another sound card ...
1096 */
1097 pnp_dev = pnp_request_card_device(pcard, pid->devs[0].id, NULL);
1098 if (!pnp_dev)
1099 return -ENODEV;
1100
1101 mpu_dev = pnp_request_card_device(pcard, pid->devs[1].id, NULL);
1102 if (!mpu_dev)
1103 return -ENODEV;
1104
1105 if (!pnp_is_active(pnp_dev) && pnp_activate_dev(pnp_dev) < 0) {
1106 printk(KERN_INFO "msnd_pinnacle: device is inactive\n");
1107 return -EBUSY;
1108 }
1109
1110 if (!pnp_is_active(mpu_dev) && pnp_activate_dev(mpu_dev) < 0) {
1111 printk(KERN_INFO "msnd_pinnacle: MPU device is inactive\n");
1112 return -EBUSY;
1113 }
1114
1115 /*
1116 * Create a new ALSA sound card entry, in anticipation
1117 * of detecting our hardware ...
1118 */
1119 ret = snd_card_create(index[idx], id[idx], THIS_MODULE,
1120 sizeof(struct snd_msnd), &card);
1121 if (ret < 0)
1122 return ret;
1123
1124 chip = card->private_data;
1125 chip->card = card;
1126 snd_card_set_dev(card, &pcard->card->dev);
1127
1128 /*
1129 * Read the correct parameters off the ISA PnP bus ...
1130 */
1131 io[idx] = pnp_port_start(pnp_dev, 0);
1132 irq[idx] = pnp_irq(pnp_dev, 0);
1133 mem[idx] = pnp_mem_start(pnp_dev, 0);
1134 mpu_io[idx] = pnp_port_start(mpu_dev, 0);
1135 mpu_irq[idx] = pnp_irq(mpu_dev, 0);
1136
1137 set_default_audio_parameters(chip);
1138#ifdef MSND_CLASSIC
1139 chip->type = msndClassic;
1140#else
1141 chip->type = msndPinnacle;
1142#endif
1143 chip->io = io[idx];
1144 chip->irq = irq[idx];
1145 chip->base = mem[idx];
1146
1147 chip->calibrate_signal = calibrate_signal ? 1 : 0;
1148 chip->recsrc = 0;
1149 chip->dspq_data_buff = DSPQ_DATA_BUFF;
1150 chip->dspq_buff_size = DSPQ_BUFF_SIZE;
1151 if (write_ndelay[idx])
1152 clear_bit(F_DISABLE_WRITE_NDELAY, &chip->flags);
1153 else
1154 set_bit(F_DISABLE_WRITE_NDELAY, &chip->flags);
1155#ifndef MSND_CLASSIC
1156 if (digital[idx])
1157 set_bit(F_HAVEDIGITAL, &chip->flags);
1158#endif
1159 spin_lock_init(&chip->lock);
1160 ret = snd_msnd_probe(card);
1161 if (ret < 0) {
1162 printk(KERN_ERR LOGNAME ": Probe failed\n");
1163 goto _release_card;
1164 }
1165
1166 ret = snd_msnd_attach(card);
1167 if (ret < 0) {
1168 printk(KERN_ERR LOGNAME ": Attach failed\n");
1169 goto _release_card;
1170 }
1171
1172 pnp_set_card_drvdata(pcard, card);
1173 ++idx;
1174 return 0;
1175
1176_release_card:
1177 snd_card_free(card);
1178 return ret;
1179}
1180
1181static void __devexit snd_msnd_pnp_remove(struct pnp_card_link *pcard)
1182{
1183 snd_msnd_unload(pnp_get_card_drvdata(pcard));
1184 pnp_set_card_drvdata(pcard, NULL);
1185}
1186
1187static int isa_registered;
1188static int pnp_registered;
1189
1190static struct pnp_card_device_id msnd_pnpids[] = {
1191 /* Pinnacle PnP */
1192 { .id = "BVJ0440", .devs = { { "TBS0000" }, { "TBS0001" } } },
1193 { .id = "" } /* end */
1194};
1195
1196MODULE_DEVICE_TABLE(pnp_card, msnd_pnpids);
1197
1198static struct pnp_card_driver msnd_pnpc_driver = {
1199 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE,
1200 .name = "msnd_pinnacle",
1201 .id_table = msnd_pnpids,
1202 .probe = snd_msnd_pnp_detect,
1203 .remove = __devexit_p(snd_msnd_pnp_remove),
1204};
1205#endif /* CONFIG_PNP */
1206
1207static int __init snd_msnd_init(void)
1208{
1209 int err;
1210
1211 err = isa_register_driver(&snd_msnd_driver, SNDRV_CARDS);
1212#ifdef CONFIG_PNP
1213 if (!err)
1214 isa_registered = 1;
1215
1216 err = pnp_register_card_driver(&msnd_pnpc_driver);
1217 if (!err)
1218 pnp_registered = 1;
1219
1220 if (isa_registered)
1221 err = 0;
1222#endif
1223 return err;
1224}
1225
1226static void __exit snd_msnd_exit(void)
1227{
1228#ifdef CONFIG_PNP
1229 if (pnp_registered)
1230 pnp_unregister_card_driver(&msnd_pnpc_driver);
1231 if (isa_registered)
1232#endif
1233 isa_unregister_driver(&snd_msnd_driver);
1234}
1235
1236module_init(snd_msnd_init);
1237module_exit(snd_msnd_exit);
1238
diff --git a/sound/isa/msnd/msnd_pinnacle.h b/sound/isa/msnd/msnd_pinnacle.h
new file mode 100644
index 000000000000..48318d1ee340
--- /dev/null
+++ b/sound/isa/msnd/msnd_pinnacle.h
@@ -0,0 +1,181 @@
1/*********************************************************************
2 *
3 * msnd_pinnacle.h
4 *
5 * Turtle Beach MultiSound Sound Card Driver for Linux
6 *
7 * Some parts of this header file were derived from the Turtle Beach
8 * MultiSound Driver Development Kit.
9 *
10 * Copyright (C) 1998 Andrew Veliath
11 * Copyright (C) 1993 Turtle Beach Systems, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 ********************************************************************/
28#ifndef __MSND_PINNACLE_H
29#define __MSND_PINNACLE_H
30
31#define DSP_NUMIO 0x08
32
33#define IREG_LOGDEVICE 0x07
34#define IREG_ACTIVATE 0x30
35#define LD_ACTIVATE 0x01
36#define LD_DISACTIVATE 0x00
37#define IREG_EECONTROL 0x3F
38#define IREG_MEMBASEHI 0x40
39#define IREG_MEMBASELO 0x41
40#define IREG_MEMCONTROL 0x42
41#define IREG_MEMRANGEHI 0x43
42#define IREG_MEMRANGELO 0x44
43#define MEMTYPE_8BIT 0x00
44#define MEMTYPE_16BIT 0x02
45#define MEMTYPE_RANGE 0x00
46#define MEMTYPE_HIADDR 0x01
47#define IREG_IO0_BASEHI 0x60
48#define IREG_IO0_BASELO 0x61
49#define IREG_IO1_BASEHI 0x62
50#define IREG_IO1_BASELO 0x63
51#define IREG_IRQ_NUMBER 0x70
52#define IREG_IRQ_TYPE 0x71
53#define IRQTYPE_HIGH 0x02
54#define IRQTYPE_LOW 0x00
55#define IRQTYPE_LEVEL 0x01
56#define IRQTYPE_EDGE 0x00
57
58#define HP_DSPR 0x04
59#define HP_BLKS 0x04
60
61#define HPDSPRESET_OFF 2
62#define HPDSPRESET_ON 0
63
64#define HPBLKSEL_0 2
65#define HPBLKSEL_1 3
66
67#define HIMT_DAT_OFF 0x03
68
69#define HIDSP_PLAY_UNDER 0x00
70#define HIDSP_INT_PLAY_UNDER 0x01
71#define HIDSP_SSI_TX_UNDER 0x02
72#define HIDSP_RECQ_OVERFLOW 0x08
73#define HIDSP_INT_RECORD_OVER 0x09
74#define HIDSP_SSI_RX_OVERFLOW 0x0a
75
76#define HIDSP_MIDI_IN_OVER 0x10
77
78#define HIDSP_MIDI_FRAME_ERR 0x11
79#define HIDSP_MIDI_PARITY_ERR 0x12
80#define HIDSP_MIDI_OVERRUN_ERR 0x13
81
82#define HIDSP_INPUT_CLIPPING 0x20
83#define HIDSP_MIX_CLIPPING 0x30
84#define HIDSP_DAT_IN_OFF 0x21
85
86#define TIME_PRO_RESET_DONE 0x028A
87#define TIME_PRO_SYSEX 0x001E
88#define TIME_PRO_RESET 0x0032
89
90#define DAR_BUFF_SIZE 0x1000
91
92#define MIDQ_BUFF_SIZE 0x800
93#define DSPQ_BUFF_SIZE 0x5A0
94
95#define DSPQ_DATA_BUFF 0x7860
96
97#define MOP_WAVEHDR 0
98#define MOP_EXTOUT 1
99#define MOP_HWINIT 0xfe
100#define MOP_NONE 0xff
101#define MOP_MAX 1
102
103#define MIP_EXTIN 0
104#define MIP_WAVEHDR 1
105#define MIP_HWINIT 0xfe
106#define MIP_MAX 1
107
108/* Pinnacle/Fiji SMA Common Data */
109#define SMA_wCurrPlayBytes 0x0000
110#define SMA_wCurrRecordBytes 0x0002
111#define SMA_wCurrPlayVolLeft 0x0004
112#define SMA_wCurrPlayVolRight 0x0006
113#define SMA_wCurrInVolLeft 0x0008
114#define SMA_wCurrInVolRight 0x000a
115#define SMA_wCurrMHdrVolLeft 0x000c
116#define SMA_wCurrMHdrVolRight 0x000e
117#define SMA_dwCurrPlayPitch 0x0010
118#define SMA_dwCurrPlayRate 0x0014
119#define SMA_wCurrMIDIIOPatch 0x0018
120#define SMA_wCurrPlayFormat 0x001a
121#define SMA_wCurrPlaySampleSize 0x001c
122#define SMA_wCurrPlayChannels 0x001e
123#define SMA_wCurrPlaySampleRate 0x0020
124#define SMA_wCurrRecordFormat 0x0022
125#define SMA_wCurrRecordSampleSize 0x0024
126#define SMA_wCurrRecordChannels 0x0026
127#define SMA_wCurrRecordSampleRate 0x0028
128#define SMA_wCurrDSPStatusFlags 0x002a
129#define SMA_wCurrHostStatusFlags 0x002c
130#define SMA_wCurrInputTagBits 0x002e
131#define SMA_wCurrLeftPeak 0x0030
132#define SMA_wCurrRightPeak 0x0032
133#define SMA_bMicPotPosLeft 0x0034
134#define SMA_bMicPotPosRight 0x0035
135#define SMA_bMicPotMaxLeft 0x0036
136#define SMA_bMicPotMaxRight 0x0037
137#define SMA_bInPotPosLeft 0x0038
138#define SMA_bInPotPosRight 0x0039
139#define SMA_bAuxPotPosLeft 0x003a
140#define SMA_bAuxPotPosRight 0x003b
141#define SMA_bInPotMaxLeft 0x003c
142#define SMA_bInPotMaxRight 0x003d
143#define SMA_bAuxPotMaxLeft 0x003e
144#define SMA_bAuxPotMaxRight 0x003f
145#define SMA_bInPotMaxMethod 0x0040
146#define SMA_bAuxPotMaxMethod 0x0041
147#define SMA_wCurrMastVolLeft 0x0042
148#define SMA_wCurrMastVolRight 0x0044
149#define SMA_wCalFreqAtoD 0x0046
150#define SMA_wCurrAuxVolLeft 0x0048
151#define SMA_wCurrAuxVolRight 0x004a
152#define SMA_wCurrPlay1VolLeft 0x004c
153#define SMA_wCurrPlay1VolRight 0x004e
154#define SMA_wCurrPlay2VolLeft 0x0050
155#define SMA_wCurrPlay2VolRight 0x0052
156#define SMA_wCurrPlay3VolLeft 0x0054
157#define SMA_wCurrPlay3VolRight 0x0056
158#define SMA_wCurrPlay4VolLeft 0x0058
159#define SMA_wCurrPlay4VolRight 0x005a
160#define SMA_wCurrPlay1PeakLeft 0x005c
161#define SMA_wCurrPlay1PeakRight 0x005e
162#define SMA_wCurrPlay2PeakLeft 0x0060
163#define SMA_wCurrPlay2PeakRight 0x0062
164#define SMA_wCurrPlay3PeakLeft 0x0064
165#define SMA_wCurrPlay3PeakRight 0x0066
166#define SMA_wCurrPlay4PeakLeft 0x0068
167#define SMA_wCurrPlay4PeakRight 0x006a
168#define SMA_wCurrPlayPeakLeft 0x006c
169#define SMA_wCurrPlayPeakRight 0x006e
170#define SMA_wCurrDATSR 0x0070
171#define SMA_wCurrDATRXCHNL 0x0072
172#define SMA_wCurrDATTXCHNL 0x0074
173#define SMA_wCurrDATRXRate 0x0076
174#define SMA_dwDSPPlayCount 0x0078
175#define SMA__size 0x007c
176
177#define INITCODEFILE "turtlebeach/pndspini.bin"
178#define PERMCODEFILE "turtlebeach/pndsperm.bin"
179#define LONGNAME "MultiSound (Pinnacle/Fiji)"
180
181#endif /* __MSND_PINNACLE_H */
diff --git a/sound/isa/msnd/msnd_pinnacle_mixer.c b/sound/isa/msnd/msnd_pinnacle_mixer.c
new file mode 100644
index 000000000000..494058a1a502
--- /dev/null
+++ b/sound/isa/msnd/msnd_pinnacle_mixer.c
@@ -0,0 +1,343 @@
1/***************************************************************************
2 msnd_pinnacle_mixer.c - description
3 -------------------
4 begin : Fre Jun 7 2002
5 copyright : (C) 2002 by karsten wiese
6 email : annabellesgarden@yahoo.de
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include <linux/io.h>
19
20#include <sound/core.h>
21#include <sound/control.h>
22#include "msnd.h"
23#include "msnd_pinnacle.h"
24
25
26#define MSND_MIXER_VOLUME 0
27#define MSND_MIXER_PCM 1
28#define MSND_MIXER_AUX 2 /* Input source 1 (aux1) */
29#define MSND_MIXER_IMIX 3 /* Recording monitor */
30#define MSND_MIXER_SYNTH 4
31#define MSND_MIXER_SPEAKER 5
32#define MSND_MIXER_LINE 6
33#define MSND_MIXER_MIC 7
34#define MSND_MIXER_RECLEV 11 /* Recording level */
35#define MSND_MIXER_IGAIN 12 /* Input gain */
36#define MSND_MIXER_OGAIN 13 /* Output gain */
37#define MSND_MIXER_DIGITAL 17 /* Digital (input) 1 */
38
39/* Device mask bits */
40
41#define MSND_MASK_VOLUME (1 << MSND_MIXER_VOLUME)
42#define MSND_MASK_SYNTH (1 << MSND_MIXER_SYNTH)
43#define MSND_MASK_PCM (1 << MSND_MIXER_PCM)
44#define MSND_MASK_SPEAKER (1 << MSND_MIXER_SPEAKER)
45#define MSND_MASK_LINE (1 << MSND_MIXER_LINE)
46#define MSND_MASK_MIC (1 << MSND_MIXER_MIC)
47#define MSND_MASK_IMIX (1 << MSND_MIXER_IMIX)
48#define MSND_MASK_RECLEV (1 << MSND_MIXER_RECLEV)
49#define MSND_MASK_IGAIN (1 << MSND_MIXER_IGAIN)
50#define MSND_MASK_OGAIN (1 << MSND_MIXER_OGAIN)
51#define MSND_MASK_AUX (1 << MSND_MIXER_AUX)
52#define MSND_MASK_DIGITAL (1 << MSND_MIXER_DIGITAL)
53
54static int snd_msndmix_info_mux(struct snd_kcontrol *kcontrol,
55 struct snd_ctl_elem_info *uinfo)
56{
57 static char *texts[3] = {
58 "Analog", "MASS", "SPDIF",
59 };
60 struct snd_msnd *chip = snd_kcontrol_chip(kcontrol);
61 unsigned items = test_bit(F_HAVEDIGITAL, &chip->flags) ? 3 : 2;
62
63 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
64 uinfo->count = 1;
65 uinfo->value.enumerated.items = items;
66 if (uinfo->value.enumerated.item >= items)
67 uinfo->value.enumerated.item = items - 1;
68 strcpy(uinfo->value.enumerated.name,
69 texts[uinfo->value.enumerated.item]);
70 return 0;
71}
72
73static int snd_msndmix_get_mux(struct snd_kcontrol *kcontrol,
74 struct snd_ctl_elem_value *ucontrol)
75{
76 struct snd_msnd *chip = snd_kcontrol_chip(kcontrol);
77 /* MSND_MASK_IMIX is the default */
78 ucontrol->value.enumerated.item[0] = 0;
79
80 if (chip->recsrc & MSND_MASK_SYNTH) {
81 ucontrol->value.enumerated.item[0] = 1;
82 } else if ((chip->recsrc & MSND_MASK_DIGITAL) &&
83 test_bit(F_HAVEDIGITAL, &chip->flags)) {
84 ucontrol->value.enumerated.item[0] = 2;
85 }
86
87
88 return 0;
89}
90
91static int snd_msndmix_set_mux(struct snd_msnd *chip, int val)
92{
93 unsigned newrecsrc;
94 int change;
95 unsigned char msndbyte;
96
97 switch (val) {
98 case 0:
99 newrecsrc = MSND_MASK_IMIX;
100 msndbyte = HDEXAR_SET_ANA_IN;
101 break;
102 case 1:
103 newrecsrc = MSND_MASK_SYNTH;
104 msndbyte = HDEXAR_SET_SYNTH_IN;
105 break;
106 case 2:
107 newrecsrc = MSND_MASK_DIGITAL;
108 msndbyte = HDEXAR_SET_DAT_IN;
109 break;
110 default:
111 return -EINVAL;
112 }
113 change = newrecsrc != chip->recsrc;
114 if (change) {
115 change = 0;
116 if (!snd_msnd_send_word(chip, 0, 0, msndbyte))
117 if (!snd_msnd_send_dsp_cmd(chip, HDEX_AUX_REQ)) {
118 chip->recsrc = newrecsrc;
119 change = 1;
120 }
121 }
122 return change;
123}
124
125static int snd_msndmix_put_mux(struct snd_kcontrol *kcontrol,
126 struct snd_ctl_elem_value *ucontrol)
127{
128 struct snd_msnd *msnd = snd_kcontrol_chip(kcontrol);
129 return snd_msndmix_set_mux(msnd, ucontrol->value.enumerated.item[0]);
130}
131
132
133static int snd_msndmix_volume_info(struct snd_kcontrol *kcontrol,
134 struct snd_ctl_elem_info *uinfo)
135{
136 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
137 uinfo->count = 2;
138 uinfo->value.integer.min = 0;
139 uinfo->value.integer.max = 100;
140 return 0;
141}
142
143static int snd_msndmix_volume_get(struct snd_kcontrol *kcontrol,
144 struct snd_ctl_elem_value *ucontrol)
145{
146 struct snd_msnd *msnd = snd_kcontrol_chip(kcontrol);
147 int addr = kcontrol->private_value;
148 unsigned long flags;
149
150 spin_lock_irqsave(&msnd->mixer_lock, flags);
151 ucontrol->value.integer.value[0] = msnd->left_levels[addr] * 100;
152 ucontrol->value.integer.value[0] /= 0xFFFF;
153 ucontrol->value.integer.value[1] = msnd->right_levels[addr] * 100;
154 ucontrol->value.integer.value[1] /= 0xFFFF;
155 spin_unlock_irqrestore(&msnd->mixer_lock, flags);
156 return 0;
157}
158
159#define update_volm(a, b) \
160 do { \
161 writew((dev->left_levels[a] >> 1) * \
162 readw(dev->SMA + SMA_wCurrMastVolLeft) / 0xffff, \
163 dev->SMA + SMA_##b##Left); \
164 writew((dev->right_levels[a] >> 1) * \
165 readw(dev->SMA + SMA_wCurrMastVolRight) / 0xffff, \
166 dev->SMA + SMA_##b##Right); \
167 } while (0);
168
169#define update_potm(d, s, ar) \
170 do { \
171 writeb((dev->left_levels[d] >> 8) * \
172 readw(dev->SMA + SMA_wCurrMastVolLeft) / 0xffff, \
173 dev->SMA + SMA_##s##Left); \
174 writeb((dev->right_levels[d] >> 8) * \
175 readw(dev->SMA + SMA_wCurrMastVolRight) / 0xffff, \
176 dev->SMA + SMA_##s##Right); \
177 if (snd_msnd_send_word(dev, 0, 0, ar) == 0) \
178 snd_msnd_send_dsp_cmd(dev, HDEX_AUX_REQ); \
179 } while (0);
180
181#define update_pot(d, s, ar) \
182 do { \
183 writeb(dev->left_levels[d] >> 8, \
184 dev->SMA + SMA_##s##Left); \
185 writeb(dev->right_levels[d] >> 8, \
186 dev->SMA + SMA_##s##Right); \
187 if (snd_msnd_send_word(dev, 0, 0, ar) == 0) \
188 snd_msnd_send_dsp_cmd(dev, HDEX_AUX_REQ); \
189 } while (0);
190
191
192static int snd_msndmix_set(struct snd_msnd *dev, int d, int left, int right)
193{
194 int bLeft, bRight;
195 int wLeft, wRight;
196 int updatemaster = 0;
197
198 if (d >= LEVEL_ENTRIES)
199 return -EINVAL;
200
201 bLeft = left * 0xff / 100;
202 wLeft = left * 0xffff / 100;
203
204 bRight = right * 0xff / 100;
205 wRight = right * 0xffff / 100;
206
207 dev->left_levels[d] = wLeft;
208 dev->right_levels[d] = wRight;
209
210 switch (d) {
211 /* master volume unscaled controls */
212 case MSND_MIXER_LINE: /* line pot control */
213 /* scaled by IMIX in digital mix */
214 writeb(bLeft, dev->SMA + SMA_bInPotPosLeft);
215 writeb(bRight, dev->SMA + SMA_bInPotPosRight);
216 if (snd_msnd_send_word(dev, 0, 0, HDEXAR_IN_SET_POTS) == 0)
217 snd_msnd_send_dsp_cmd(dev, HDEX_AUX_REQ);
218 break;
219 case MSND_MIXER_MIC: /* mic pot control */
220 if (dev->type == msndClassic)
221 return -EINVAL;
222 /* scaled by IMIX in digital mix */
223 writeb(bLeft, dev->SMA + SMA_bMicPotPosLeft);
224 writeb(bRight, dev->SMA + SMA_bMicPotPosRight);
225 if (snd_msnd_send_word(dev, 0, 0, HDEXAR_MIC_SET_POTS) == 0)
226 snd_msnd_send_dsp_cmd(dev, HDEX_AUX_REQ);
227 break;
228 case MSND_MIXER_VOLUME: /* master volume */
229 writew(wLeft, dev->SMA + SMA_wCurrMastVolLeft);
230 writew(wRight, dev->SMA + SMA_wCurrMastVolRight);
231 /* fall through */
232
233 case MSND_MIXER_AUX: /* aux pot control */
234 /* scaled by master volume */
235 /* fall through */
236
237 /* digital controls */
238 case MSND_MIXER_SYNTH: /* synth vol (dsp mix) */
239 case MSND_MIXER_PCM: /* pcm vol (dsp mix) */
240 case MSND_MIXER_IMIX: /* input monitor (dsp mix) */
241 /* scaled by master volume */
242 updatemaster = 1;
243 break;
244
245 default:
246 return -EINVAL;
247 }
248
249 if (updatemaster) {
250 /* update master volume scaled controls */
251 update_volm(MSND_MIXER_PCM, wCurrPlayVol);
252 update_volm(MSND_MIXER_IMIX, wCurrInVol);
253 if (dev->type == msndPinnacle)
254 update_volm(MSND_MIXER_SYNTH, wCurrMHdrVol);
255 update_potm(MSND_MIXER_AUX, bAuxPotPos, HDEXAR_AUX_SET_POTS);
256 }
257
258 return 0;
259}
260
261static int snd_msndmix_volume_put(struct snd_kcontrol *kcontrol,
262 struct snd_ctl_elem_value *ucontrol)
263{
264 struct snd_msnd *msnd = snd_kcontrol_chip(kcontrol);
265 int change, addr = kcontrol->private_value;
266 int left, right;
267 unsigned long flags;
268
269 left = ucontrol->value.integer.value[0] % 101;
270 right = ucontrol->value.integer.value[1] % 101;
271 spin_lock_irqsave(&msnd->mixer_lock, flags);
272 change = msnd->left_levels[addr] != left
273 || msnd->right_levels[addr] != right;
274 snd_msndmix_set(msnd, addr, left, right);
275 spin_unlock_irqrestore(&msnd->mixer_lock, flags);
276 return change;
277}
278
279
280#define DUMMY_VOLUME(xname, xindex, addr) \
281{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
282 .info = snd_msndmix_volume_info, \
283 .get = snd_msndmix_volume_get, .put = snd_msndmix_volume_put, \
284 .private_value = addr }
285
286
287static struct snd_kcontrol_new snd_msnd_controls[] = {
288DUMMY_VOLUME("Master Volume", 0, MSND_MIXER_VOLUME),
289DUMMY_VOLUME("PCM Volume", 0, MSND_MIXER_PCM),
290DUMMY_VOLUME("Aux Volume", 0, MSND_MIXER_AUX),
291DUMMY_VOLUME("Line Volume", 0, MSND_MIXER_LINE),
292DUMMY_VOLUME("Mic Volume", 0, MSND_MIXER_MIC),
293DUMMY_VOLUME("Monitor", 0, MSND_MIXER_IMIX),
294{
295 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
296 .name = "Capture Source",
297 .info = snd_msndmix_info_mux,
298 .get = snd_msndmix_get_mux,
299 .put = snd_msndmix_put_mux,
300}
301};
302
303
304int __devinit snd_msndmix_new(struct snd_card *card)
305{
306 struct snd_msnd *chip = card->private_data;
307 unsigned int idx;
308 int err;
309
310 if (snd_BUG_ON(!chip))
311 return -EINVAL;
312 spin_lock_init(&chip->mixer_lock);
313 strcpy(card->mixername, "MSND Pinnacle Mixer");
314
315 for (idx = 0; idx < ARRAY_SIZE(snd_msnd_controls); idx++)
316 err = snd_ctl_add(card,
317 snd_ctl_new1(snd_msnd_controls + idx, chip));
318 if (err < 0)
319 return err;
320
321 return 0;
322}
323EXPORT_SYMBOL(snd_msndmix_new);
324
325void snd_msndmix_setup(struct snd_msnd *dev)
326{
327 update_pot(MSND_MIXER_LINE, bInPotPos, HDEXAR_IN_SET_POTS);
328 update_potm(MSND_MIXER_AUX, bAuxPotPos, HDEXAR_AUX_SET_POTS);
329 update_volm(MSND_MIXER_PCM, wCurrPlayVol);
330 update_volm(MSND_MIXER_IMIX, wCurrInVol);
331 if (dev->type == msndPinnacle) {
332 update_pot(MSND_MIXER_MIC, bMicPotPos, HDEXAR_MIC_SET_POTS);
333 update_volm(MSND_MIXER_SYNTH, wCurrMHdrVol);
334 }
335}
336EXPORT_SYMBOL(snd_msndmix_setup);
337
338int snd_msndmix_force_recsrc(struct snd_msnd *dev, int recsrc)
339{
340 dev->recsrc = -1;
341 return snd_msndmix_set_mux(dev, recsrc);
342}
343EXPORT_SYMBOL(snd_msndmix_force_recsrc);
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 645491a53023..0481a55334b9 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -179,12 +179,13 @@ static unsigned char __snd_opl3sa2_read(struct snd_opl3sa2 *chip, unsigned char
179 unsigned char result; 179 unsigned char result;
180#if 0 180#if 0
181 outb(0x1d, port); /* password */ 181 outb(0x1d, port); /* password */
182 printk("read [0x%lx] = 0x%x\n", port, inb(port)); 182 printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port));
183#endif 183#endif
184 outb(reg, chip->port); /* register */ 184 outb(reg, chip->port); /* register */
185 result = inb(chip->port + 1); 185 result = inb(chip->port + 1);
186#if 0 186#if 0
187 printk("read [0x%lx] = 0x%x [0x%x]\n", port, result, inb(port)); 187 printk(KERN_DEBUG "read [0x%lx] = 0x%x [0x%x]\n",
188 port, result, inb(port));
188#endif 189#endif
189 return result; 190 return result;
190} 191}
@@ -233,7 +234,10 @@ static int __devinit snd_opl3sa2_detect(struct snd_card *card)
233 snd_printk(KERN_ERR PFX "can't grab port 0x%lx\n", port); 234 snd_printk(KERN_ERR PFX "can't grab port 0x%lx\n", port);
234 return -EBUSY; 235 return -EBUSY;
235 } 236 }
236 // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a)); 237 /*
238 snd_printk(KERN_DEBUG "REG 0A = 0x%x\n",
239 snd_opl3sa2_read(chip, 0x0a));
240 */
237 chip->version = 0; 241 chip->version = 0;
238 tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC); 242 tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC);
239 if (tmp == 0xff) { 243 if (tmp == 0xff) {
@@ -477,6 +481,7 @@ OPL3SA2_DOUBLE_TLV("Master Playback Volume", 0, 0x07, 0x08, 0, 0, 15, 1,
477OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1), 481OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1),
478OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, 482OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1,
479 db_scale_5bit_12db_max), 483 db_scale_5bit_12db_max),
484OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0),
480}; 485};
481 486
482static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { 487static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = {
@@ -550,21 +555,27 @@ static int __devinit snd_opl3sa2_mixer(struct snd_card *card)
550#ifdef CONFIG_PM 555#ifdef CONFIG_PM
551static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state) 556static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
552{ 557{
553 struct snd_opl3sa2 *chip = card->private_data; 558 if (card) {
559 struct snd_opl3sa2 *chip = card->private_data;
554 560
555 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 561 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
556 chip->wss->suspend(chip->wss); 562 chip->wss->suspend(chip->wss);
557 /* power down */ 563 /* power down */
558 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3); 564 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
565 }
559 566
560 return 0; 567 return 0;
561} 568}
562 569
563static int snd_opl3sa2_resume(struct snd_card *card) 570static int snd_opl3sa2_resume(struct snd_card *card)
564{ 571{
565 struct snd_opl3sa2 *chip = card->private_data; 572 struct snd_opl3sa2 *chip;
566 int i; 573 int i;
567 574
575 if (!card)
576 return 0;
577
578 chip = card->private_data;
568 /* power up */ 579 /* power up */
569 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0); 580 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
570 581
@@ -613,7 +624,7 @@ static void snd_opl3sa2_free(struct snd_card *card)
613{ 624{
614 struct snd_opl3sa2 *chip = card->private_data; 625 struct snd_opl3sa2 *chip = card->private_data;
615 if (chip->irq >= 0) 626 if (chip->irq >= 0)
616 free_irq(chip->irq, (void *)chip); 627 free_irq(chip->irq, card);
617 release_and_free_resource(chip->res_port); 628 release_and_free_resource(chip->res_port);
618} 629}
619 630
@@ -628,7 +639,7 @@ static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
628 if (err < 0) 639 if (err < 0)
629 return err; 640 return err;
630 strcpy(card->driver, "OPL3SA2"); 641 strcpy(card->driver, "OPL3SA2");
631 strcpy(card->shortname, "Yamaha OPL3-SA2"); 642 strcpy(card->shortname, "Yamaha OPL3-SA");
632 chip = card->private_data; 643 chip = card->private_data;
633 spin_lock_init(&chip->reg_lock); 644 spin_lock_init(&chip->reg_lock);
634 chip->irq = -1; 645 chip->irq = -1;
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index cd6e60a6a4ea..5cd555325b9d 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -252,7 +252,7 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip,
252#endif /* OPTi93X */ 252#endif /* OPTi93X */
253 253
254 default: 254 default:
255 snd_printk("chip %d not supported\n", hardware); 255 snd_printk(KERN_ERR "chip %d not supported\n", hardware);
256 return -ENODEV; 256 return -ENODEV;
257 } 257 }
258 return 0; 258 return 0;
@@ -294,7 +294,7 @@ static unsigned char snd_opti9xx_read(struct snd_opti9xx *chip,
294#endif /* OPTi93X */ 294#endif /* OPTi93X */
295 295
296 default: 296 default:
297 snd_printk("chip %d not supported\n", chip->hardware); 297 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
298 } 298 }
299 299
300 spin_unlock_irqrestore(&chip->lock, flags); 300 spin_unlock_irqrestore(&chip->lock, flags);
@@ -336,7 +336,7 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
336#endif /* OPTi93X */ 336#endif /* OPTi93X */
337 337
338 default: 338 default:
339 snd_printk("chip %d not supported\n", chip->hardware); 339 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
340 } 340 }
341 341
342 spin_unlock_irqrestore(&chip->lock, flags); 342 spin_unlock_irqrestore(&chip->lock, flags);
@@ -412,7 +412,7 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip)
412#endif /* OPTi93X */ 412#endif /* OPTi93X */
413 413
414 default: 414 default:
415 snd_printk("chip %d not supported\n", chip->hardware); 415 snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
416 return -EINVAL; 416 return -EINVAL;
417 } 417 }
418 418
@@ -430,7 +430,8 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip)
430 wss_base_bits = 0x02; 430 wss_base_bits = 0x02;
431 break; 431 break;
432 default: 432 default:
433 snd_printk("WSS port 0x%lx not valid\n", chip->wss_base); 433 snd_printk(KERN_WARNING "WSS port 0x%lx not valid\n",
434 chip->wss_base);
434 goto __skip_base; 435 goto __skip_base;
435 } 436 }
436 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(1), wss_base_bits << 4, 0x30); 437 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(1), wss_base_bits << 4, 0x30);
@@ -455,7 +456,7 @@ __skip_base:
455 irq_bits = 0x04; 456 irq_bits = 0x04;
456 break; 457 break;
457 default: 458 default:
458 snd_printk("WSS irq # %d not valid\n", chip->irq); 459 snd_printk(KERN_WARNING "WSS irq # %d not valid\n", chip->irq);
459 goto __skip_resources; 460 goto __skip_resources;
460 } 461 }
461 462
@@ -470,13 +471,14 @@ __skip_base:
470 dma_bits = 0x03; 471 dma_bits = 0x03;
471 break; 472 break;
472 default: 473 default:
473 snd_printk("WSS dma1 # %d not valid\n", chip->dma1); 474 snd_printk(KERN_WARNING "WSS dma1 # %d not valid\n",
475 chip->dma1);
474 goto __skip_resources; 476 goto __skip_resources;
475 } 477 }
476 478
477#if defined(CS4231) || defined(OPTi93X) 479#if defined(CS4231) || defined(OPTi93X)
478 if (chip->dma1 == chip->dma2) { 480 if (chip->dma1 == chip->dma2) {
479 snd_printk("don't want to share dmas\n"); 481 snd_printk(KERN_ERR "don't want to share dmas\n");
480 return -EBUSY; 482 return -EBUSY;
481 } 483 }
482 484
@@ -485,7 +487,8 @@ __skip_base:
485 case 1: 487 case 1:
486 break; 488 break;
487 default: 489 default:
488 snd_printk("WSS dma2 # %d not valid\n", chip->dma2); 490 snd_printk(KERN_WARNING "WSS dma2 # %d not valid\n",
491 chip->dma2);
489 goto __skip_resources; 492 goto __skip_resources;
490 } 493 }
491 dma_bits |= 0x04; 494 dma_bits |= 0x04;
@@ -516,7 +519,8 @@ __skip_resources:
516 mpu_port_bits = 0x00; 519 mpu_port_bits = 0x00;
517 break; 520 break;
518 default: 521 default:
519 snd_printk("MPU-401 port 0x%lx not valid\n", 522 snd_printk(KERN_WARNING
523 "MPU-401 port 0x%lx not valid\n",
520 chip->mpu_port); 524 chip->mpu_port);
521 goto __skip_mpu; 525 goto __skip_mpu;
522 } 526 }
@@ -535,7 +539,7 @@ __skip_resources:
535 mpu_irq_bits = 0x01; 539 mpu_irq_bits = 0x01;
536 break; 540 break;
537 default: 541 default:
538 snd_printk("MPU-401 irq # %d not valid\n", 542 snd_printk(KERN_WARNING "MPU-401 irq # %d not valid\n",
539 chip->mpu_irq); 543 chip->mpu_irq);
540 goto __skip_mpu; 544 goto __skip_mpu;
541 } 545 }
@@ -726,7 +730,7 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
726 if (chip->wss_base == SNDRV_AUTO_PORT) { 730 if (chip->wss_base == SNDRV_AUTO_PORT) {
727 chip->wss_base = snd_legacy_find_free_ioport(possible_ports, 4); 731 chip->wss_base = snd_legacy_find_free_ioport(possible_ports, 4);
728 if (chip->wss_base < 0) { 732 if (chip->wss_base < 0) {
729 snd_printk("unable to find a free WSS port\n"); 733 snd_printk(KERN_ERR "unable to find a free WSS port\n");
730 return -EBUSY; 734 return -EBUSY;
731 } 735 }
732 } 736 }
@@ -815,14 +819,8 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
815 chip->fm_port, chip->fm_port + 4 - 1); 819 chip->fm_port, chip->fm_port + 4 - 1);
816 } 820 }
817 if (opl3) { 821 if (opl3) {
818#ifdef CS4231 822 error = snd_opl3_hwdep_new(opl3, 0, 1, &synth);
819 const int t1dev = 1; 823 if (error < 0)
820#else
821 const int t1dev = 0;
822#endif
823 if ((error = snd_opl3_timer_new(opl3, t1dev, t1dev+1)) < 0)
824 return error;
825 if ((error = snd_opl3_hwdep_new(opl3, 0, 1, &synth)) < 0)
826 return error; 824 return error;
827 } 825 }
828 } 826 }
@@ -900,7 +898,7 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
900#if defined(CS4231) || defined(OPTi93X) 898#if defined(CS4231) || defined(OPTi93X)
901 if (dma2 == SNDRV_AUTO_DMA) { 899 if (dma2 == SNDRV_AUTO_DMA) {
902 if ((dma2 = snd_legacy_find_free_dma(possible_dma2s[dma1 % 4])) < 0) { 900 if ((dma2 = snd_legacy_find_free_dma(possible_dma2s[dma1 % 4])) < 0) {
903 snd_printk("unable to find a free DMA2\n"); 901 snd_printk(KERN_ERR "unable to find a free DMA2\n");
904 return -EBUSY; 902 return -EBUSY;
905 } 903 }
906 } 904 }
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 49037d074c71..bdc8dde4e4a2 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -684,15 +684,16 @@ static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int
684 684
685static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags) 685static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags)
686{ 686{
687 int err = -ENOMEM; 687 int err;
688 unsigned char *kbuf = kmalloc(size, GFP_KERNEL); 688 unsigned char *kbuf;
689 if (kbuf) { 689
690 if (copy_from_user(kbuf, buf, size)) 690 kbuf = memdup_user(buf, size);
691 err = -EFAULT; 691 if (IS_ERR(kbuf))
692 else 692 return PTR_ERR(kbuf);
693 err = snd_sb_csp_load(p, kbuf, size, load_flags); 693
694 kfree(kbuf); 694 err = snd_sb_csp_load(p, kbuf, size, load_flags);
695 } 695
696 kfree(kbuf);
696 return err; 697 return err;
697} 698}
698 699
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 406a431af91e..475220bbcc96 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -182,7 +182,7 @@ static int snd_sbmixer_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_
182 182
183static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 183static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
184{ 184{
185 static char *texts[5] = { 185 static const char *texts[5] = {
186 "CD", "Mic", "Line", "Synth", "Master" 186 "CD", "Mic", "Line", "Synth", "Master"
187 }; 187 };
188 188
@@ -269,12 +269,73 @@ static int snd_dt019x_input_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl
269} 269}
270 270
271/* 271/*
272 * ALS4000 mono recording control switch
273 */
274
275static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol,
276 struct snd_ctl_elem_info *uinfo)
277{
278 static const char *texts[3] = {
279 "L chan only", "R chan only", "L ch/2 + R ch/2"
280 };
281
282 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
283 uinfo->count = 1;
284 uinfo->value.enumerated.items = 3;
285 if (uinfo->value.enumerated.item > 2)
286 uinfo->value.enumerated.item = 2;
287 strcpy(uinfo->value.enumerated.name,
288 texts[uinfo->value.enumerated.item]);
289 return 0;
290}
291
292static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol,
293 struct snd_ctl_elem_value *ucontrol)
294{
295 struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
296 unsigned long flags;
297 unsigned char oval;
298
299 spin_lock_irqsave(&sb->mixer_lock, flags);
300 oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
301 spin_unlock_irqrestore(&sb->mixer_lock, flags);
302 oval >>= 6;
303 if (oval > 2)
304 oval = 2;
305
306 ucontrol->value.enumerated.item[0] = oval;
307 return 0;
308}
309
310static int snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol,
311 struct snd_ctl_elem_value *ucontrol)
312{
313 struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
314 unsigned long flags;
315 int change;
316 unsigned char nval, oval;
317
318 if (ucontrol->value.enumerated.item[0] > 2)
319 return -EINVAL;
320 spin_lock_irqsave(&sb->mixer_lock, flags);
321 oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
322
323 nval = (oval & ~(3 << 6))
324 | (ucontrol->value.enumerated.item[0] << 6);
325 change = nval != oval;
326 if (change)
327 snd_sbmixer_write(sb, SB_ALS4000_MONO_IO_CTRL, nval);
328 spin_unlock_irqrestore(&sb->mixer_lock, flags);
329 return change;
330}
331
332/*
272 * SBPRO input multiplexer 333 * SBPRO input multiplexer
273 */ 334 */
274 335
275static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 336static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
276{ 337{
277 static char *texts[3] = { 338 static const char *texts[3] = {
278 "Mic", "CD", "Line" 339 "Mic", "CD", "Line"
279 }; 340 };
280 341
@@ -442,6 +503,12 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty
442 .get = snd_dt019x_input_sw_get, 503 .get = snd_dt019x_input_sw_get,
443 .put = snd_dt019x_input_sw_put, 504 .put = snd_dt019x_input_sw_put,
444 }, 505 },
506 [SB_MIX_MONO_CAPTURE_ALS4K] = {
507 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
508 .info = snd_als4k_mono_capture_route_info,
509 .get = snd_als4k_mono_capture_route_get,
510 .put = snd_als4k_mono_capture_route_put,
511 },
445 }; 512 };
446 struct snd_kcontrol *ctl; 513 struct snd_kcontrol *ctl;
447 int err; 514 int err;
@@ -636,6 +703,8 @@ static struct sbmix_elem snd_dt019x_ctl_capture_source =
636 }; 703 };
637 704
638static struct sbmix_elem *snd_dt019x_controls[] = { 705static struct sbmix_elem *snd_dt019x_controls[] = {
706 /* ALS4000 below has some parts which we might be lacking,
707 * e.g. snd_als4000_ctl_mono_playback_switch - check it! */
639 &snd_dt019x_ctl_master_play_vol, 708 &snd_dt019x_ctl_master_play_vol,
640 &snd_dt019x_ctl_pcm_play_vol, 709 &snd_dt019x_ctl_pcm_play_vol,
641 &snd_dt019x_ctl_synth_play_vol, 710 &snd_dt019x_ctl_synth_play_vol,
@@ -666,18 +735,21 @@ static unsigned char snd_dt019x_init_values[][2] = {
666/* 735/*
667 * ALS4000 specific mixer elements 736 * ALS4000 specific mixer elements
668 */ 737 */
669/* FIXME: SB_ALS4000_MONO_IO_CTRL needs output select ctrl! */
670static struct sbmix_elem snd_als4000_ctl_master_mono_playback_switch = 738static struct sbmix_elem snd_als4000_ctl_master_mono_playback_switch =
671 SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1); 739 SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1);
672static struct sbmix_elem snd_als4000_ctl_master_mono_capture_route = 740static struct sbmix_elem snd_als4k_ctl_master_mono_capture_route = {
673 SB_SINGLE("Master Mono Capture Route", SB_ALS4000_MONO_IO_CTRL, 6, 0x03); 741 .name = "Master Mono Capture Route",
674/* FIXME: mono playback switch also available on DT019X? */ 742 .type = SB_MIX_MONO_CAPTURE_ALS4K
743 };
675static struct sbmix_elem snd_als4000_ctl_mono_playback_switch = 744static struct sbmix_elem snd_als4000_ctl_mono_playback_switch =
676 SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1); 745 SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1);
677static struct sbmix_elem snd_als4000_ctl_mic_20db_boost = 746static struct sbmix_elem snd_als4000_ctl_mic_20db_boost =
678 SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03); 747 SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03);
679static struct sbmix_elem snd_als4000_ctl_mixer_loopback = 748static struct sbmix_elem snd_als4000_ctl_mixer_analog_loopback =
680 SB_SINGLE("Analog Loopback", SB_ALS4000_MIC_IN_GAIN, 7, 0x01); 749 SB_SINGLE("Analog Loopback Switch", SB_ALS4000_MIC_IN_GAIN, 7, 0x01);
750static struct sbmix_elem snd_als4000_ctl_mixer_digital_loopback =
751 SB_SINGLE("Digital Loopback Switch",
752 SB_ALS4000_CR3_CONFIGURATION, 7, 0x01);
681/* FIXME: functionality of 3D controls might be swapped, I didn't find 753/* FIXME: functionality of 3D controls might be swapped, I didn't find
682 * a description of how to identify what is supposed to be what */ 754 * a description of how to identify what is supposed to be what */
683static struct sbmix_elem snd_als4000_3d_control_switch = 755static struct sbmix_elem snd_als4000_3d_control_switch =
@@ -694,6 +766,9 @@ static struct sbmix_elem snd_als4000_3d_control_delay =
694 SB_SINGLE("3D Control - Wide", SB_ALS4000_3D_TIME_DELAY, 0, 0x0f); 766 SB_SINGLE("3D Control - Wide", SB_ALS4000_3D_TIME_DELAY, 0, 0x0f);
695static struct sbmix_elem snd_als4000_3d_control_poweroff_switch = 767static struct sbmix_elem snd_als4000_3d_control_poweroff_switch =
696 SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01); 768 SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01);
769static struct sbmix_elem snd_als4000_ctl_3db_freq_control_switch =
770 SB_SINGLE("Master Playback 8kHz / 20kHz LPF Switch",
771 SB_ALS4000_FMDAC, 5, 0x01);
697#ifdef NOT_AVAILABLE 772#ifdef NOT_AVAILABLE
698static struct sbmix_elem snd_als4000_ctl_fmdac = 773static struct sbmix_elem snd_als4000_ctl_fmdac =
699 SB_SINGLE("FMDAC Switch (Option ?)", SB_ALS4000_FMDAC, 0, 0x01); 774 SB_SINGLE("FMDAC Switch (Option ?)", SB_ALS4000_FMDAC, 0, 0x01);
@@ -702,35 +777,37 @@ static struct sbmix_elem snd_als4000_ctl_qsound =
702#endif 777#endif
703 778
704static struct sbmix_elem *snd_als4000_controls[] = { 779static struct sbmix_elem *snd_als4000_controls[] = {
705 &snd_sb16_ctl_master_play_vol, 780 /* ALS4000a.PDF regs page */
706 &snd_dt019x_ctl_pcm_play_switch, 781 &snd_sb16_ctl_master_play_vol, /* MX30/31 12 */
707 &snd_sb16_ctl_pcm_play_vol, 782 &snd_dt019x_ctl_pcm_play_switch, /* MX4C 16 */
708 &snd_sb16_ctl_synth_capture_route, 783 &snd_sb16_ctl_pcm_play_vol, /* MX32/33 12 */
709 &snd_dt019x_ctl_synth_play_switch, 784 &snd_sb16_ctl_synth_capture_route, /* MX3D/3E 14 */
710 &snd_sb16_ctl_synth_play_vol, 785 &snd_dt019x_ctl_synth_play_switch, /* MX4C 16 */
711 &snd_sb16_ctl_cd_capture_route, 786 &snd_sb16_ctl_synth_play_vol, /* MX34/35 12/13 */
712 &snd_sb16_ctl_cd_play_switch, 787 &snd_sb16_ctl_cd_capture_route, /* MX3D/3E 14 */
713 &snd_sb16_ctl_cd_play_vol, 788 &snd_sb16_ctl_cd_play_switch, /* MX3C 14 */
714 &snd_sb16_ctl_line_capture_route, 789 &snd_sb16_ctl_cd_play_vol, /* MX36/37 13 */
715 &snd_sb16_ctl_line_play_switch, 790 &snd_sb16_ctl_line_capture_route, /* MX3D/3E 14 */
716 &snd_sb16_ctl_line_play_vol, 791 &snd_sb16_ctl_line_play_switch, /* MX3C 14 */
717 &snd_sb16_ctl_mic_capture_route, 792 &snd_sb16_ctl_line_play_vol, /* MX38/39 13 */
718 &snd_als4000_ctl_mic_20db_boost, 793 &snd_sb16_ctl_mic_capture_route, /* MX3D/3E 14 */
719 &snd_sb16_ctl_auto_mic_gain, 794 &snd_als4000_ctl_mic_20db_boost, /* MX4D 16 */
720 &snd_sb16_ctl_mic_play_switch, 795 &snd_sb16_ctl_mic_play_switch, /* MX3C 14 */
721 &snd_sb16_ctl_mic_play_vol, 796 &snd_sb16_ctl_mic_play_vol, /* MX3A 13 */
722 &snd_sb16_ctl_pc_speaker_vol, 797 &snd_sb16_ctl_pc_speaker_vol, /* MX3B 14 */
723 &snd_sb16_ctl_capture_vol, 798 &snd_sb16_ctl_capture_vol, /* MX3F/40 15 */
724 &snd_sb16_ctl_play_vol, 799 &snd_sb16_ctl_play_vol, /* MX41/42 15 */
725 &snd_als4000_ctl_master_mono_playback_switch, 800 &snd_als4000_ctl_master_mono_playback_switch, /* MX4C 16 */
726 &snd_als4000_ctl_master_mono_capture_route, 801 &snd_als4k_ctl_master_mono_capture_route, /* MX4B 16 */
727 &snd_als4000_ctl_mono_playback_switch, 802 &snd_als4000_ctl_mono_playback_switch, /* MX4C 16 */
728 &snd_als4000_ctl_mixer_loopback, 803 &snd_als4000_ctl_mixer_analog_loopback, /* MX4D 16 */
729 &snd_als4000_3d_control_switch, 804 &snd_als4000_ctl_mixer_digital_loopback, /* CR3 21 */
730 &snd_als4000_3d_control_ratio, 805 &snd_als4000_3d_control_switch, /* MX50 17 */
731 &snd_als4000_3d_control_freq, 806 &snd_als4000_3d_control_ratio, /* MX50 17 */
732 &snd_als4000_3d_control_delay, 807 &snd_als4000_3d_control_freq, /* MX50 17 */
733 &snd_als4000_3d_control_poweroff_switch, 808 &snd_als4000_3d_control_delay, /* MX51 18 */
809 &snd_als4000_3d_control_poweroff_switch, /* MX51 18 */
810 &snd_als4000_ctl_3db_freq_control_switch, /* MX4F 17 */
734#ifdef NOT_AVAILABLE 811#ifdef NOT_AVAILABLE
735 &snd_als4000_ctl_fmdac, 812 &snd_als4000_ctl_fmdac,
736 &snd_als4000_ctl_qsound, 813 &snd_als4000_ctl_qsound,
@@ -905,13 +982,14 @@ static unsigned char dt019x_saved_regs[] = {
905}; 982};
906 983
907static unsigned char als4000_saved_regs[] = { 984static unsigned char als4000_saved_regs[] = {
985 /* please verify in dsheet whether regs to be added
986 are actually real H/W or just dummy */
908 SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1, 987 SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1,
909 SB_DSP4_OUTPUT_SW, 988 SB_DSP4_OUTPUT_SW,
910 SB_DSP4_PCM_DEV, SB_DSP4_PCM_DEV + 1, 989 SB_DSP4_PCM_DEV, SB_DSP4_PCM_DEV + 1,
911 SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 990 SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT,
912 SB_DSP4_SYNTH_DEV, SB_DSP4_SYNTH_DEV + 1, 991 SB_DSP4_SYNTH_DEV, SB_DSP4_SYNTH_DEV + 1,
913 SB_DSP4_CD_DEV, SB_DSP4_CD_DEV + 1, 992 SB_DSP4_CD_DEV, SB_DSP4_CD_DEV + 1,
914 SB_DSP4_MIC_AGC,
915 SB_DSP4_MIC_DEV, 993 SB_DSP4_MIC_DEV,
916 SB_DSP4_SPEAKER_DEV, 994 SB_DSP4_SPEAKER_DEV,
917 SB_DSP4_IGAIN_DEV, SB_DSP4_IGAIN_DEV + 1, 995 SB_DSP4_IGAIN_DEV, SB_DSP4_IGAIN_DEV + 1,
@@ -919,8 +997,10 @@ static unsigned char als4000_saved_regs[] = {
919 SB_DT019X_OUTPUT_SW2, 997 SB_DT019X_OUTPUT_SW2,
920 SB_ALS4000_MONO_IO_CTRL, 998 SB_ALS4000_MONO_IO_CTRL,
921 SB_ALS4000_MIC_IN_GAIN, 999 SB_ALS4000_MIC_IN_GAIN,
1000 SB_ALS4000_FMDAC,
922 SB_ALS4000_3D_SND_FX, 1001 SB_ALS4000_3D_SND_FX,
923 SB_ALS4000_3D_TIME_DELAY, 1002 SB_ALS4000_3D_TIME_DELAY,
1003 SB_ALS4000_CR3_CONFIGURATION,
924}; 1004};
925 1005
926static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 1006static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index 7a1470376c6d..782010608ef4 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -576,10 +576,6 @@ static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev)
576 snd_printk(KERN_ERR PFX "no OPL device at 0x%x-0x%x ?\n", 576 snd_printk(KERN_ERR PFX "no OPL device at 0x%x-0x%x ?\n",
577 0x388, 0x388 + 2); 577 0x388, 0x388 + 2);
578 } else { 578 } else {
579 err = snd_opl3_timer_new(opl3, 0, 1);
580 if (err < 0)
581 goto err_unmap2;
582
583 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); 579 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
584 if (err < 0) 580 if (err < 0)
585 goto err_unmap2; 581 goto err_unmap2;
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 4025fb558c50..66187122377c 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -89,9 +89,6 @@ MODULE_DEVICE_TABLE(pnp_card, sscape_pnpids);
89#endif 89#endif
90 90
91 91
92#define MPU401_IO(i) ((i) + 0)
93#define MIDI_DATA_IO(i) ((i) + 0)
94#define MIDI_CTRL_IO(i) ((i) + 1)
95#define HOST_CTRL_IO(i) ((i) + 2) 92#define HOST_CTRL_IO(i) ((i) + 2)
96#define HOST_DATA_IO(i) ((i) + 3) 93#define HOST_DATA_IO(i) ((i) + 3)
97#define ODIE_ADDR_IO(i) ((i) + 4) 94#define ODIE_ADDR_IO(i) ((i) + 4)
@@ -129,9 +126,6 @@ enum GA_REG {
129#define DMA_8BIT 0x80 126#define DMA_8BIT 0x80
130 127
131 128
132#define AD1845_FREQ_SEL_MSB 0x16
133#define AD1845_FREQ_SEL_LSB 0x17
134
135enum card_type { 129enum card_type {
136 SSCAPE, 130 SSCAPE,
137 SSCAPE_PNP, 131 SSCAPE_PNP,
@@ -141,8 +135,6 @@ enum card_type {
141struct soundscape { 135struct soundscape {
142 spinlock_t lock; 136 spinlock_t lock;
143 unsigned io_base; 137 unsigned io_base;
144 unsigned wss_base;
145 int codec_type;
146 int ic_type; 138 int ic_type;
147 enum card_type type; 139 enum card_type type;
148 struct resource *io_res; 140 struct resource *io_res;
@@ -330,7 +322,7 @@ static int host_write_ctrl_unsafe(unsigned io_base, unsigned char data,
330 */ 322 */
331static inline int verify_mpu401(const struct snd_mpu401 * mpu) 323static inline int verify_mpu401(const struct snd_mpu401 * mpu)
332{ 324{
333 return ((inb(MIDI_CTRL_IO(mpu->port)) & 0xc0) == 0x80); 325 return ((inb(MPU401C(mpu)) & 0xc0) == 0x80);
334} 326}
335 327
336/* 328/*
@@ -338,7 +330,7 @@ static inline int verify_mpu401(const struct snd_mpu401 * mpu)
338 */ 330 */
339static inline void initialise_mpu401(const struct snd_mpu401 * mpu) 331static inline void initialise_mpu401(const struct snd_mpu401 * mpu)
340{ 332{
341 outb(0, MIDI_DATA_IO(mpu->port)); 333 outb(0, MPU401D(mpu));
342} 334}
343 335
344/* 336/*
@@ -396,20 +388,20 @@ static int sscape_wait_dma_unsafe(unsigned io_base, enum GA_REG reg, unsigned ti
396 */ 388 */
397static int obp_startup_ack(struct soundscape *s, unsigned timeout) 389static int obp_startup_ack(struct soundscape *s, unsigned timeout)
398{ 390{
399 while (timeout != 0) { 391 unsigned long end_time = jiffies + msecs_to_jiffies(timeout);
392
393 do {
400 unsigned long flags; 394 unsigned long flags;
401 unsigned char x; 395 unsigned char x;
402 396
403 schedule_timeout_uninterruptible(1);
404
405 spin_lock_irqsave(&s->lock, flags); 397 spin_lock_irqsave(&s->lock, flags);
406 x = inb(HOST_DATA_IO(s->io_base)); 398 x = inb(HOST_DATA_IO(s->io_base));
407 spin_unlock_irqrestore(&s->lock, flags); 399 spin_unlock_irqrestore(&s->lock, flags);
408 if ((x & 0xfe) == 0xfe) 400 if ((x & 0xfe) == 0xfe)
409 return 1; 401 return 1;
410 402
411 --timeout; 403 msleep(10);
412 } /* while */ 404 } while (time_before(jiffies, end_time));
413 405
414 return 0; 406 return 0;
415} 407}
@@ -423,20 +415,20 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout)
423 */ 415 */
424static int host_startup_ack(struct soundscape *s, unsigned timeout) 416static int host_startup_ack(struct soundscape *s, unsigned timeout)
425{ 417{
426 while (timeout != 0) { 418 unsigned long end_time = jiffies + msecs_to_jiffies(timeout);
419
420 do {
427 unsigned long flags; 421 unsigned long flags;
428 unsigned char x; 422 unsigned char x;
429 423
430 schedule_timeout_uninterruptible(1);
431
432 spin_lock_irqsave(&s->lock, flags); 424 spin_lock_irqsave(&s->lock, flags);
433 x = inb(HOST_DATA_IO(s->io_base)); 425 x = inb(HOST_DATA_IO(s->io_base));
434 spin_unlock_irqrestore(&s->lock, flags); 426 spin_unlock_irqrestore(&s->lock, flags);
435 if (x == 0xfe) 427 if (x == 0xfe)
436 return 1; 428 return 1;
437 429
438 --timeout; 430 msleep(10);
439 } /* while */ 431 } while (time_before(jiffies, end_time));
440 432
441 return 0; 433 return 0;
442} 434}
@@ -532,10 +524,10 @@ static int upload_dma_data(struct soundscape *s,
532 * give it 5 seconds (max) ... 524 * give it 5 seconds (max) ...
533 */ 525 */
534 ret = 0; 526 ret = 0;
535 if (!obp_startup_ack(s, 5)) { 527 if (!obp_startup_ack(s, 5000)) {
536 snd_printk(KERN_ERR "sscape: No response from on-board processor after upload\n"); 528 snd_printk(KERN_ERR "sscape: No response from on-board processor after upload\n");
537 ret = -EAGAIN; 529 ret = -EAGAIN;
538 } else if (!host_startup_ack(s, 5)) { 530 } else if (!host_startup_ack(s, 5000)) {
539 snd_printk(KERN_ERR "sscape: SoundScape failed to initialise\n"); 531 snd_printk(KERN_ERR "sscape: SoundScape failed to initialise\n");
540 ret = -EAGAIN; 532 ret = -EAGAIN;
541 } 533 }
@@ -732,13 +724,7 @@ static int sscape_midi_get(struct snd_kcontrol *kctl,
732 unsigned long flags; 724 unsigned long flags;
733 725
734 spin_lock_irqsave(&s->lock, flags); 726 spin_lock_irqsave(&s->lock, flags);
735 set_host_mode_unsafe(s->io_base); 727 uctl->value.integer.value[0] = s->midi_vol;
736
737 if (host_write_ctrl_unsafe(s->io_base, CMD_GET_MIDI_VOL, 100)) {
738 uctl->value.integer.value[0] = host_read_ctrl_unsafe(s->io_base, 100);
739 }
740
741 set_midi_mode_unsafe(s->io_base);
742 spin_unlock_irqrestore(&s->lock, flags); 728 spin_unlock_irqrestore(&s->lock, flags);
743 return 0; 729 return 0;
744} 730}
@@ -773,6 +759,7 @@ static int sscape_midi_put(struct snd_kcontrol *kctl,
773 change = (host_write_ctrl_unsafe(s->io_base, CMD_SET_MIDI_VOL, 100) 759 change = (host_write_ctrl_unsafe(s->io_base, CMD_SET_MIDI_VOL, 100)
774 && host_write_ctrl_unsafe(s->io_base, ((unsigned char) uctl->value.integer. value[0]) & 127, 100) 760 && host_write_ctrl_unsafe(s->io_base, ((unsigned char) uctl->value.integer. value[0]) & 127, 100)
775 && host_write_ctrl_unsafe(s->io_base, CMD_XXX_MIDI_VOL, 100)); 761 && host_write_ctrl_unsafe(s->io_base, CMD_XXX_MIDI_VOL, 100));
762 s->midi_vol = (unsigned char) uctl->value.integer.value[0] & 127;
776 __skip_change: 763 __skip_change:
777 764
778 /* 765 /*
@@ -815,12 +802,11 @@ static unsigned __devinit get_irq_config(int irq)
815 * Perform certain arcane port-checks to see whether there 802 * Perform certain arcane port-checks to see whether there
816 * is a SoundScape board lurking behind the given ports. 803 * is a SoundScape board lurking behind the given ports.
817 */ 804 */
818static int __devinit detect_sscape(struct soundscape *s) 805static int __devinit detect_sscape(struct soundscape *s, long wss_io)
819{ 806{
820 unsigned long flags; 807 unsigned long flags;
821 unsigned d; 808 unsigned d;
822 int retval = 0; 809 int retval = 0;
823 int codec = s->wss_base;
824 810
825 spin_lock_irqsave(&s->lock, flags); 811 spin_lock_irqsave(&s->lock, flags);
826 812
@@ -836,13 +822,11 @@ static int __devinit detect_sscape(struct soundscape *s)
836 if ((d & 0x80) != 0) 822 if ((d & 0x80) != 0)
837 goto _done; 823 goto _done;
838 824
839 if (d == 0) { 825 if (d == 0)
840 s->codec_type = 1;
841 s->ic_type = IC_ODIE; 826 s->ic_type = IC_ODIE;
842 } else if ((d & 0x60) != 0) { 827 else if ((d & 0x60) != 0)
843 s->codec_type = 2;
844 s->ic_type = IC_OPUS; 828 s->ic_type = IC_OPUS;
845 } else 829 else
846 goto _done; 830 goto _done;
847 831
848 outb(0xfa, ODIE_ADDR_IO(s->io_base)); 832 outb(0xfa, ODIE_ADDR_IO(s->io_base));
@@ -862,10 +846,10 @@ static int __devinit detect_sscape(struct soundscape *s)
862 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0); 846 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0);
863 847
864 if (s->type == SSCAPE_VIVO) 848 if (s->type == SSCAPE_VIVO)
865 codec += 4; 849 wss_io += 4;
866 /* wait for WSS codec */ 850 /* wait for WSS codec */
867 for (d = 0; d < 500; d++) { 851 for (d = 0; d < 500; d++) {
868 if ((inb(codec) & 0x80) == 0) 852 if ((inb(wss_io) & 0x80) == 0)
869 break; 853 break;
870 spin_unlock_irqrestore(&s->lock, flags); 854 spin_unlock_irqrestore(&s->lock, flags);
871 msleep(1); 855 msleep(1);
@@ -955,82 +939,6 @@ static int __devinit create_mpu401(struct snd_card *card, int devnum, unsigned l
955 939
956 940
957/* 941/*
958 * Override for the CS4231 playback format function.
959 * The AD1845 has much simpler format and rate selection.
960 */
961static void ad1845_playback_format(struct snd_wss *chip,
962 struct snd_pcm_hw_params *params,
963 unsigned char format)
964{
965 unsigned long flags;
966 unsigned rate = params_rate(params);
967
968 /*
969 * The AD1845 can't handle sample frequencies
970 * outside of 4 kHZ to 50 kHZ
971 */
972 if (rate > 50000)
973 rate = 50000;
974 else if (rate < 4000)
975 rate = 4000;
976
977 spin_lock_irqsave(&chip->reg_lock, flags);
978
979 /*
980 * Program the AD1845 correctly for the playback stream.
981 * Note that we do NOT need to toggle the MCE bit because
982 * the PLAYBACK_ENABLE bit of the Interface Configuration
983 * register is set.
984 *
985 * NOTE: We seem to need to write to the MSB before the LSB
986 * to get the correct sample frequency.
987 */
988 snd_wss_out(chip, CS4231_PLAYBK_FORMAT, (format & 0xf0));
989 snd_wss_out(chip, AD1845_FREQ_SEL_MSB, (unsigned char) (rate >> 8));
990 snd_wss_out(chip, AD1845_FREQ_SEL_LSB, (unsigned char) rate);
991
992 spin_unlock_irqrestore(&chip->reg_lock, flags);
993}
994
995/*
996 * Override for the CS4231 capture format function.
997 * The AD1845 has much simpler format and rate selection.
998 */
999static void ad1845_capture_format(struct snd_wss *chip,
1000 struct snd_pcm_hw_params *params,
1001 unsigned char format)
1002{
1003 unsigned long flags;
1004 unsigned rate = params_rate(params);
1005
1006 /*
1007 * The AD1845 can't handle sample frequencies
1008 * outside of 4 kHZ to 50 kHZ
1009 */
1010 if (rate > 50000)
1011 rate = 50000;
1012 else if (rate < 4000)
1013 rate = 4000;
1014
1015 spin_lock_irqsave(&chip->reg_lock, flags);
1016
1017 /*
1018 * Program the AD1845 correctly for the playback stream.
1019 * Note that we do NOT need to toggle the MCE bit because
1020 * the CAPTURE_ENABLE bit of the Interface Configuration
1021 * register is set.
1022 *
1023 * NOTE: We seem to need to write to the MSB before the LSB
1024 * to get the correct sample frequency.
1025 */
1026 snd_wss_out(chip, CS4231_REC_FORMAT, (format & 0xf0));
1027 snd_wss_out(chip, AD1845_FREQ_SEL_MSB, (unsigned char) (rate >> 8));
1028 snd_wss_out(chip, AD1845_FREQ_SEL_LSB, (unsigned char) rate);
1029
1030 spin_unlock_irqrestore(&chip->reg_lock, flags);
1031}
1032
1033/*
1034 * Create an AD1845 PCM subdevice on the SoundScape. The AD1845 942 * Create an AD1845 PCM subdevice on the SoundScape. The AD1845
1035 * is very much like a CS4231, with a few extra bits. We will 943 * is very much like a CS4231, with a few extra bits. We will
1036 * try to support at least some of the extra bits by overriding 944 * try to support at least some of the extra bits by overriding
@@ -1055,11 +963,6 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
1055 unsigned long flags; 963 unsigned long flags;
1056 struct snd_pcm *pcm; 964 struct snd_pcm *pcm;
1057 965
1058#define AD1845_FREQ_SEL_ENABLE 0x08
1059
1060#define AD1845_PWR_DOWN_CTRL 0x1b
1061#define AD1845_CRYS_CLOCK_SEL 0x1d
1062
1063/* 966/*
1064 * It turns out that the PLAYBACK_ENABLE bit is set 967 * It turns out that the PLAYBACK_ENABLE bit is set
1065 * by the lowlevel driver ... 968 * by the lowlevel driver ...
@@ -1074,7 +977,6 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
1074 */ 977 */
1075 978
1076 if (sscape->type != SSCAPE_VIVO) { 979 if (sscape->type != SSCAPE_VIVO) {
1077 int val;
1078 /* 980 /*
1079 * The input clock frequency on the SoundScape must 981 * The input clock frequency on the SoundScape must
1080 * be 14.31818 MHz, because we must set this register 982 * be 14.31818 MHz, because we must set this register
@@ -1082,22 +984,10 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
1082 */ 984 */
1083 snd_wss_mce_up(chip); 985 snd_wss_mce_up(chip);
1084 spin_lock_irqsave(&chip->reg_lock, flags); 986 spin_lock_irqsave(&chip->reg_lock, flags);
1085 snd_wss_out(chip, AD1845_CRYS_CLOCK_SEL, 0x20); 987 snd_wss_out(chip, AD1845_CLOCK, 0x20);
1086 spin_unlock_irqrestore(&chip->reg_lock, flags); 988 spin_unlock_irqrestore(&chip->reg_lock, flags);
1087 snd_wss_mce_down(chip); 989 snd_wss_mce_down(chip);
1088 990
1089 /*
1090 * More custom configuration:
1091 * a) select "mode 2" and provide a current drive of 8mA
1092 * b) enable frequency selection (for capture/playback)
1093 */
1094 spin_lock_irqsave(&chip->reg_lock, flags);
1095 snd_wss_out(chip, CS4231_MISC_INFO,
1096 CS4231_MODE2 | 0x10);
1097 val = snd_wss_in(chip, AD1845_PWR_DOWN_CTRL);
1098 snd_wss_out(chip, AD1845_PWR_DOWN_CTRL,
1099 val | AD1845_FREQ_SEL_ENABLE);
1100 spin_unlock_irqrestore(&chip->reg_lock, flags);
1101 } 991 }
1102 992
1103 err = snd_wss_pcm(chip, 0, &pcm); 993 err = snd_wss_pcm(chip, 0, &pcm);
@@ -1113,11 +1003,13 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
1113 "for AD1845 chip\n"); 1003 "for AD1845 chip\n");
1114 goto _error; 1004 goto _error;
1115 } 1005 }
1116 err = snd_wss_timer(chip, 0, NULL); 1006 if (chip->hardware != WSS_HW_AD1848) {
1117 if (err < 0) { 1007 err = snd_wss_timer(chip, 0, NULL);
1118 snd_printk(KERN_ERR "sscape: No timer device " 1008 if (err < 0) {
1119 "for AD1845 chip\n"); 1009 snd_printk(KERN_ERR "sscape: No timer device "
1120 goto _error; 1010 "for AD1845 chip\n");
1011 goto _error;
1012 }
1121 } 1013 }
1122 1014
1123 if (sscape->type != SSCAPE_VIVO) { 1015 if (sscape->type != SSCAPE_VIVO) {
@@ -1128,8 +1020,6 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
1128 "MIDI mixer control\n"); 1020 "MIDI mixer control\n");
1129 goto _error; 1021 goto _error;
1130 } 1022 }
1131 chip->set_playback_format = ad1845_playback_format;
1132 chip->set_capture_format = ad1845_capture_format;
1133 } 1023 }
1134 1024
1135 strcpy(card->driver, "SoundScape"); 1025 strcpy(card->driver, "SoundScape");
@@ -1157,7 +1047,6 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
1157 unsigned dma_cfg; 1047 unsigned dma_cfg;
1158 unsigned irq_cfg; 1048 unsigned irq_cfg;
1159 unsigned mpu_irq_cfg; 1049 unsigned mpu_irq_cfg;
1160 unsigned xport;
1161 struct resource *io_res; 1050 struct resource *io_res;
1162 struct resource *wss_res; 1051 struct resource *wss_res;
1163 unsigned long flags; 1052 unsigned long flags;
@@ -1177,15 +1066,15 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
1177 printk(KERN_ERR "sscape: Invalid IRQ %d\n", mpu_irq[dev]); 1066 printk(KERN_ERR "sscape: Invalid IRQ %d\n", mpu_irq[dev]);
1178 return -ENXIO; 1067 return -ENXIO;
1179 } 1068 }
1180 xport = port[dev];
1181 1069
1182 /* 1070 /*
1183 * Grab IO ports that we will need to probe so that we 1071 * Grab IO ports that we will need to probe so that we
1184 * can detect and control this hardware ... 1072 * can detect and control this hardware ...
1185 */ 1073 */
1186 io_res = request_region(xport, 8, "SoundScape"); 1074 io_res = request_region(port[dev], 8, "SoundScape");
1187 if (!io_res) { 1075 if (!io_res) {
1188 snd_printk(KERN_ERR "sscape: can't grab port 0x%x\n", xport); 1076 snd_printk(KERN_ERR
1077 "sscape: can't grab port 0x%lx\n", port[dev]);
1189 return -EBUSY; 1078 return -EBUSY;
1190 } 1079 }
1191 wss_res = NULL; 1080 wss_res = NULL;
@@ -1212,10 +1101,9 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
1212 spin_lock_init(&sscape->fwlock); 1101 spin_lock_init(&sscape->fwlock);
1213 sscape->io_res = io_res; 1102 sscape->io_res = io_res;
1214 sscape->wss_res = wss_res; 1103 sscape->wss_res = wss_res;
1215 sscape->io_base = xport; 1104 sscape->io_base = port[dev];
1216 sscape->wss_base = wss_port[dev];
1217 1105
1218 if (!detect_sscape(sscape)) { 1106 if (!detect_sscape(sscape, wss_port[dev])) {
1219 printk(KERN_ERR "sscape: hardware not detected at 0x%x\n", sscape->io_base); 1107 printk(KERN_ERR "sscape: hardware not detected at 0x%x\n", sscape->io_base);
1220 err = -ENODEV; 1108 err = -ENODEV;
1221 goto _release_dma; 1109 goto _release_dma;
@@ -1288,12 +1176,11 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
1288 } 1176 }
1289#define MIDI_DEVNUM 0 1177#define MIDI_DEVNUM 0
1290 if (sscape->type != SSCAPE_VIVO) { 1178 if (sscape->type != SSCAPE_VIVO) {
1291 err = create_mpu401(card, MIDI_DEVNUM, 1179 err = create_mpu401(card, MIDI_DEVNUM, port[dev], mpu_irq[dev]);
1292 MPU401_IO(xport), mpu_irq[dev]);
1293 if (err < 0) { 1180 if (err < 0) {
1294 printk(KERN_ERR "sscape: Failed to create " 1181 printk(KERN_ERR "sscape: Failed to create "
1295 "MPU-401 device at 0x%x\n", 1182 "MPU-401 device at 0x%lx\n",
1296 MPU401_IO(xport)); 1183 port[dev]);
1297 goto _release_dma; 1184 goto _release_dma;
1298 } 1185 }
1299 1186
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 95898b2b7b58..a34ae7b1f7d0 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -553,11 +553,11 @@ static int __devinit snd_wavefront_isa_match(struct device *pdev,
553 return 0; 553 return 0;
554#endif 554#endif
555 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { 555 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
556 snd_printk("specify CS4232 port\n"); 556 snd_printk(KERN_ERR "specify CS4232 port\n");
557 return 0; 557 return 0;
558 } 558 }
559 if (ics2115_port[dev] == SNDRV_AUTO_PORT) { 559 if (ics2115_port[dev] == SNDRV_AUTO_PORT) {
560 snd_printk("specify ICS2115 port\n"); 560 snd_printk(KERN_ERR "specify ICS2115 port\n");
561 return 0; 561 return 0;
562 } 562 }
563 return 1; 563 return 1;
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index dfc449a2194e..2bb1cee09255 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -34,14 +34,6 @@
34 34
35#define WAIT_IDLE 0xff 35#define WAIT_IDLE 0xff
36 36
37#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
38#include "yss225.c"
39static const struct firmware yss225_registers_firmware = {
40 .data = (u8 *)yss225_registers,
41 .size = sizeof yss225_registers
42};
43#endif
44
45static int 37static int
46wavefront_fx_idle (snd_wavefront_t *dev) 38wavefront_fx_idle (snd_wavefront_t *dev)
47 39
@@ -210,15 +202,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
210 "> 512 bytes to FX\n"); 202 "> 512 bytes to FX\n");
211 return -EIO; 203 return -EIO;
212 } 204 }
213 page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); 205 page_data = memdup_user((unsigned char __user *)
214 if (!page_data) 206 r.data[3],
215 return -ENOMEM; 207 r.data[2] * sizeof(short));
216 if (copy_from_user (page_data, 208 if (IS_ERR(page_data))
217 (unsigned char __user *) r.data[3], 209 return PTR_ERR(page_data);
218 r.data[2] * sizeof(short))) {
219 kfree(page_data);
220 return -EFAULT;
221 }
222 pd = page_data; 210 pd = page_data;
223 } 211 }
224 212
@@ -260,16 +248,12 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
260 if (dev->fx_initialized) 248 if (dev->fx_initialized)
261 return 0; 249 return 0;
262 250
263#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
264 firmware = &yss225_registers_firmware;
265#else
266 err = request_firmware(&firmware, "yamaha/yss225_registers.bin", 251 err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
267 dev->card->dev); 252 dev->card->dev);
268 if (err < 0) { 253 if (err < 0) {
269 err = -1; 254 err = -1;
270 goto out; 255 goto out;
271 } 256 }
272#endif
273 257
274 for (i = 0; i + 1 < firmware->size; i += 2) { 258 for (i = 0; i + 1 < firmware->size; i += 2) {
275 if (firmware->data[i] >= 8 && firmware->data[i] < 16) { 259 if (firmware->data[i] >= 8 && firmware->data[i] < 16) {
@@ -292,12 +276,8 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
292 err = 0; 276 err = 0;
293 277
294out: 278out:
295#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
296 release_firmware(firmware); 279 release_firmware(firmware);
297#endif
298 return err; 280 return err;
299} 281}
300 282
301#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
302MODULE_FIRMWARE("yamaha/yss225_registers.bin"); 283MODULE_FIRMWARE("yamaha/yss225_registers.bin");
303#endif
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 4c410820a994..5d4ff48c4345 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -633,7 +633,7 @@ wavefront_get_sample_status (snd_wavefront_t *dev, int assume_rom)
633 wbuf[1] = i >> 7; 633 wbuf[1] = i >> 7;
634 634
635 if (snd_wavefront_cmd (dev, WFC_IDENTIFY_SAMPLE_TYPE, rbuf, wbuf)) { 635 if (snd_wavefront_cmd (dev, WFC_IDENTIFY_SAMPLE_TYPE, rbuf, wbuf)) {
636 snd_printk("cannot identify sample " 636 snd_printk(KERN_WARNING "cannot identify sample "
637 "type of slot %d\n", i); 637 "type of slot %d\n", i);
638 dev->sample_status[i] = WF_ST_EMPTY; 638 dev->sample_status[i] = WF_ST_EMPTY;
639 continue; 639 continue;
@@ -1664,12 +1664,11 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file,
1664 break; 1664 break;
1665 1665
1666 case WFCTL_WFCMD: 1666 case WFCTL_WFCMD:
1667 wc = kmalloc(sizeof(*wc), GFP_KERNEL); 1667 wc = memdup_user(argp, sizeof(*wc));
1668 if (! wc) 1668 if (IS_ERR(wc))
1669 return -ENOMEM; 1669 return PTR_ERR(wc);
1670 if (copy_from_user (wc, argp, sizeof (*wc))) 1670
1671 err = -EFAULT; 1671 if (wavefront_synth_control (acard, wc) < 0)
1672 else if (wavefront_synth_control (acard, wc) < 0)
1673 err = -EIO; 1672 err = -EIO;
1674 else if (copy_to_user (argp, wc, sizeof (*wc))) 1673 else if (copy_to_user (argp, wc, sizeof (*wc)))
1675 err = -EFAULT; 1674 err = -EFAULT;
diff --git a/sound/isa/wavefront/yss225.c b/sound/isa/wavefront/yss225.c
deleted file mode 100644
index 9f6be3ff8ecf..000000000000
--- a/sound/isa/wavefront/yss225.c
+++ /dev/null
@@ -1,2739 +0,0 @@
1/*
2 * Copyright (c) 1998-2002 by Paul Davis <pbd@op.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19/* weird stuff, derived from port I/O tracing with dosemu */
20
21static const struct {
22 unsigned char addr;
23 unsigned char data;
24} yss225_registers[] __devinitdata = {
25/* Set all bits for all channels on the MOD unit to zero */
26{ WAIT_IDLE }, { 0xe, 0x10 }, { 0xf, 0x00 },
27{ WAIT_IDLE }, { 0xe, 0x11 }, { 0xf, 0x00 },
28{ WAIT_IDLE }, { 0xe, 0x12 }, { 0xf, 0x00 },
29{ WAIT_IDLE }, { 0xe, 0x13 }, { 0xf, 0x00 },
30{ WAIT_IDLE }, { 0xe, 0x14 }, { 0xf, 0x00 },
31{ WAIT_IDLE }, { 0xe, 0x15 }, { 0xf, 0x00 },
32{ WAIT_IDLE }, { 0xe, 0x16 }, { 0xf, 0x00 },
33{ WAIT_IDLE }, { 0xe, 0x17 }, { 0xf, 0x00 },
34{ WAIT_IDLE }, { 0xe, 0x18 }, { 0xf, 0x00 },
35{ WAIT_IDLE }, { 0xe, 0x19 }, { 0xf, 0x00 },
36{ WAIT_IDLE }, { 0xe, 0x1a }, { 0xf, 0x00 },
37{ WAIT_IDLE }, { 0xe, 0x1b }, { 0xf, 0x00 },
38{ WAIT_IDLE }, { 0xe, 0x1c }, { 0xf, 0x00 },
39{ WAIT_IDLE }, { 0xe, 0x1d }, { 0xf, 0x00 },
40{ WAIT_IDLE }, { 0xe, 0x1e }, { 0xf, 0x00 },
41{ WAIT_IDLE }, { 0xe, 0x1f }, { 0xf, 0x00 },
42{ WAIT_IDLE }, { 0xe, 0x20 }, { 0xf, 0x00 },
43{ WAIT_IDLE }, { 0xe, 0x21 }, { 0xf, 0x00 },
44{ WAIT_IDLE }, { 0xe, 0x22 }, { 0xf, 0x00 },
45{ WAIT_IDLE }, { 0xe, 0x23 }, { 0xf, 0x00 },
46{ WAIT_IDLE }, { 0xe, 0x24 }, { 0xf, 0x00 },
47{ WAIT_IDLE }, { 0xe, 0x25 }, { 0xf, 0x00 },
48{ WAIT_IDLE }, { 0xe, 0x26 }, { 0xf, 0x00 },
49{ WAIT_IDLE }, { 0xe, 0x27 }, { 0xf, 0x00 },
50{ WAIT_IDLE }, { 0xe, 0x28 }, { 0xf, 0x00 },
51{ WAIT_IDLE }, { 0xe, 0x29 }, { 0xf, 0x00 },
52{ WAIT_IDLE }, { 0xe, 0x2a }, { 0xf, 0x00 },
53{ WAIT_IDLE }, { 0xe, 0x2b }, { 0xf, 0x00 },
54{ WAIT_IDLE }, { 0xe, 0x2c }, { 0xf, 0x00 },
55{ WAIT_IDLE }, { 0xe, 0x2d }, { 0xf, 0x00 },
56{ WAIT_IDLE }, { 0xe, 0x2e }, { 0xf, 0x00 },
57{ WAIT_IDLE }, { 0xe, 0x2f }, { 0xf, 0x00 },
58{ WAIT_IDLE }, { 0xe, 0x30 }, { 0xf, 0x00 },
59{ WAIT_IDLE }, { 0xe, 0x31 }, { 0xf, 0x00 },
60{ WAIT_IDLE }, { 0xe, 0x32 }, { 0xf, 0x00 },
61{ WAIT_IDLE }, { 0xe, 0x33 }, { 0xf, 0x00 },
62{ WAIT_IDLE }, { 0xe, 0x34 }, { 0xf, 0x00 },
63{ WAIT_IDLE }, { 0xe, 0x35 }, { 0xf, 0x00 },
64{ WAIT_IDLE }, { 0xe, 0x36 }, { 0xf, 0x00 },
65{ WAIT_IDLE }, { 0xe, 0x37 }, { 0xf, 0x00 },
66{ WAIT_IDLE }, { 0xe, 0x38 }, { 0xf, 0x00 },
67{ WAIT_IDLE }, { 0xe, 0x39 }, { 0xf, 0x00 },
68{ WAIT_IDLE }, { 0xe, 0x3a }, { 0xf, 0x00 },
69{ WAIT_IDLE }, { 0xe, 0x3b }, { 0xf, 0x00 },
70{ WAIT_IDLE }, { 0xe, 0x3c }, { 0xf, 0x00 },
71{ WAIT_IDLE }, { 0xe, 0x3d }, { 0xf, 0x00 },
72{ WAIT_IDLE }, { 0xe, 0x3e }, { 0xf, 0x00 },
73{ WAIT_IDLE }, { 0xe, 0x3f }, { 0xf, 0x00 },
74{ WAIT_IDLE }, { 0xe, 0x40 }, { 0xf, 0x00 },
75{ WAIT_IDLE }, { 0xe, 0x41 }, { 0xf, 0x00 },
76{ WAIT_IDLE }, { 0xe, 0x42 }, { 0xf, 0x00 },
77{ WAIT_IDLE }, { 0xe, 0x43 }, { 0xf, 0x00 },
78{ WAIT_IDLE }, { 0xe, 0x44 }, { 0xf, 0x00 },
79{ WAIT_IDLE }, { 0xe, 0x45 }, { 0xf, 0x00 },
80{ WAIT_IDLE }, { 0xe, 0x46 }, { 0xf, 0x00 },
81{ WAIT_IDLE }, { 0xe, 0x47 }, { 0xf, 0x00 },
82{ WAIT_IDLE }, { 0xe, 0x48 }, { 0xf, 0x00 },
83{ WAIT_IDLE }, { 0xe, 0x49 }, { 0xf, 0x00 },
84{ WAIT_IDLE }, { 0xe, 0x4a }, { 0xf, 0x00 },
85{ WAIT_IDLE }, { 0xe, 0x4b }, { 0xf, 0x00 },
86{ WAIT_IDLE }, { 0xe, 0x4c }, { 0xf, 0x00 },
87{ WAIT_IDLE }, { 0xe, 0x4d }, { 0xf, 0x00 },
88{ WAIT_IDLE }, { 0xe, 0x4e }, { 0xf, 0x00 },
89{ WAIT_IDLE }, { 0xe, 0x4f }, { 0xf, 0x00 },
90{ WAIT_IDLE }, { 0xe, 0x50 }, { 0xf, 0x00 },
91{ WAIT_IDLE }, { 0xe, 0x51 }, { 0xf, 0x00 },
92{ WAIT_IDLE }, { 0xe, 0x52 }, { 0xf, 0x00 },
93{ WAIT_IDLE }, { 0xe, 0x53 }, { 0xf, 0x00 },
94{ WAIT_IDLE }, { 0xe, 0x54 }, { 0xf, 0x00 },
95{ WAIT_IDLE }, { 0xe, 0x55 }, { 0xf, 0x00 },
96{ WAIT_IDLE }, { 0xe, 0x56 }, { 0xf, 0x00 },
97{ WAIT_IDLE }, { 0xe, 0x57 }, { 0xf, 0x00 },
98{ WAIT_IDLE }, { 0xe, 0x58 }, { 0xf, 0x00 },
99{ WAIT_IDLE }, { 0xe, 0x59 }, { 0xf, 0x00 },
100{ WAIT_IDLE }, { 0xe, 0x5a }, { 0xf, 0x00 },
101{ WAIT_IDLE }, { 0xe, 0x5b }, { 0xf, 0x00 },
102{ WAIT_IDLE }, { 0xe, 0x5c }, { 0xf, 0x00 },
103{ WAIT_IDLE }, { 0xe, 0x5d }, { 0xf, 0x00 },
104{ WAIT_IDLE }, { 0xe, 0x5e }, { 0xf, 0x00 },
105{ WAIT_IDLE }, { 0xe, 0x5f }, { 0xf, 0x00 },
106{ WAIT_IDLE }, { 0xe, 0x60 }, { 0xf, 0x00 },
107{ WAIT_IDLE }, { 0xe, 0x61 }, { 0xf, 0x00 },
108{ WAIT_IDLE }, { 0xe, 0x62 }, { 0xf, 0x00 },
109{ WAIT_IDLE }, { 0xe, 0x63 }, { 0xf, 0x00 },
110{ WAIT_IDLE }, { 0xe, 0x64 }, { 0xf, 0x00 },
111{ WAIT_IDLE }, { 0xe, 0x65 }, { 0xf, 0x00 },
112{ WAIT_IDLE }, { 0xe, 0x66 }, { 0xf, 0x00 },
113{ WAIT_IDLE }, { 0xe, 0x67 }, { 0xf, 0x00 },
114{ WAIT_IDLE }, { 0xe, 0x68 }, { 0xf, 0x00 },
115{ WAIT_IDLE }, { 0xe, 0x69 }, { 0xf, 0x00 },
116{ WAIT_IDLE }, { 0xe, 0x6a }, { 0xf, 0x00 },
117{ WAIT_IDLE }, { 0xe, 0x6b }, { 0xf, 0x00 },
118{ WAIT_IDLE }, { 0xe, 0x6c }, { 0xf, 0x00 },
119{ WAIT_IDLE }, { 0xe, 0x6d }, { 0xf, 0x00 },
120{ WAIT_IDLE }, { 0xe, 0x6e }, { 0xf, 0x00 },
121{ WAIT_IDLE }, { 0xe, 0x6f }, { 0xf, 0x00 },
122{ WAIT_IDLE }, { 0xe, 0x70 }, { 0xf, 0x00 },
123{ WAIT_IDLE }, { 0xe, 0x71 }, { 0xf, 0x00 },
124{ WAIT_IDLE }, { 0xe, 0x72 }, { 0xf, 0x00 },
125{ WAIT_IDLE }, { 0xe, 0x73 }, { 0xf, 0x00 },
126{ WAIT_IDLE }, { 0xe, 0x74 }, { 0xf, 0x00 },
127{ WAIT_IDLE }, { 0xe, 0x75 }, { 0xf, 0x00 },
128{ WAIT_IDLE }, { 0xe, 0x76 }, { 0xf, 0x00 },
129{ WAIT_IDLE }, { 0xe, 0x77 }, { 0xf, 0x00 },
130{ WAIT_IDLE }, { 0xe, 0x78 }, { 0xf, 0x00 },
131{ WAIT_IDLE }, { 0xe, 0x79 }, { 0xf, 0x00 },
132{ WAIT_IDLE }, { 0xe, 0x7a }, { 0xf, 0x00 },
133{ WAIT_IDLE }, { 0xe, 0x7b }, { 0xf, 0x00 },
134{ WAIT_IDLE }, { 0xe, 0x7c }, { 0xf, 0x00 },
135{ WAIT_IDLE }, { 0xe, 0x7d }, { 0xf, 0x00 },
136{ WAIT_IDLE }, { 0xe, 0x7e }, { 0xf, 0x00 },
137{ WAIT_IDLE }, { 0xe, 0x7f }, { 0xf, 0x00 },
138{ WAIT_IDLE }, { 0xe, 0x80 }, { 0xf, 0x00 },
139{ WAIT_IDLE }, { 0xe, 0x81 }, { 0xf, 0x00 },
140{ WAIT_IDLE }, { 0xe, 0x82 }, { 0xf, 0x00 },
141{ WAIT_IDLE }, { 0xe, 0x83 }, { 0xf, 0x00 },
142{ WAIT_IDLE }, { 0xe, 0x84 }, { 0xf, 0x00 },
143{ WAIT_IDLE }, { 0xe, 0x85 }, { 0xf, 0x00 },
144{ WAIT_IDLE }, { 0xe, 0x86 }, { 0xf, 0x00 },
145{ WAIT_IDLE }, { 0xe, 0x87 }, { 0xf, 0x00 },
146{ WAIT_IDLE }, { 0xe, 0x88 }, { 0xf, 0x00 },
147{ WAIT_IDLE }, { 0xe, 0x89 }, { 0xf, 0x00 },
148{ WAIT_IDLE }, { 0xe, 0x8a }, { 0xf, 0x00 },
149{ WAIT_IDLE }, { 0xe, 0x8b }, { 0xf, 0x00 },
150{ WAIT_IDLE }, { 0xe, 0x8c }, { 0xf, 0x00 },
151{ WAIT_IDLE }, { 0xe, 0x8d }, { 0xf, 0x00 },
152{ WAIT_IDLE }, { 0xe, 0x8e }, { 0xf, 0x00 },
153{ WAIT_IDLE }, { 0xe, 0x8f }, { 0xf, 0x00 },
154{ WAIT_IDLE }, { 0xe, 0x90 }, { 0xf, 0x00 },
155{ WAIT_IDLE }, { 0xe, 0x91 }, { 0xf, 0x00 },
156{ WAIT_IDLE }, { 0xe, 0x92 }, { 0xf, 0x00 },
157{ WAIT_IDLE }, { 0xe, 0x93 }, { 0xf, 0x00 },
158{ WAIT_IDLE }, { 0xe, 0x94 }, { 0xf, 0x00 },
159{ WAIT_IDLE }, { 0xe, 0x95 }, { 0xf, 0x00 },
160{ WAIT_IDLE }, { 0xe, 0x96 }, { 0xf, 0x00 },
161{ WAIT_IDLE }, { 0xe, 0x97 }, { 0xf, 0x00 },
162{ WAIT_IDLE }, { 0xe, 0x98 }, { 0xf, 0x00 },
163{ WAIT_IDLE }, { 0xe, 0x99 }, { 0xf, 0x00 },
164{ WAIT_IDLE }, { 0xe, 0x9a }, { 0xf, 0x00 },
165{ WAIT_IDLE }, { 0xe, 0x9b }, { 0xf, 0x00 },
166{ WAIT_IDLE }, { 0xe, 0x9c }, { 0xf, 0x00 },
167{ WAIT_IDLE }, { 0xe, 0x9d }, { 0xf, 0x00 },
168{ WAIT_IDLE }, { 0xe, 0x9e }, { 0xf, 0x00 },
169{ WAIT_IDLE }, { 0xe, 0x9f }, { 0xf, 0x00 },
170{ WAIT_IDLE }, { 0xe, 0xa0 }, { 0xf, 0x00 },
171{ WAIT_IDLE }, { 0xe, 0xa1 }, { 0xf, 0x00 },
172{ WAIT_IDLE }, { 0xe, 0xa2 }, { 0xf, 0x00 },
173{ WAIT_IDLE }, { 0xe, 0xa3 }, { 0xf, 0x00 },
174{ WAIT_IDLE }, { 0xe, 0xa4 }, { 0xf, 0x00 },
175{ WAIT_IDLE }, { 0xe, 0xa5 }, { 0xf, 0x00 },
176{ WAIT_IDLE }, { 0xe, 0xa6 }, { 0xf, 0x00 },
177{ WAIT_IDLE }, { 0xe, 0xa7 }, { 0xf, 0x00 },
178{ WAIT_IDLE }, { 0xe, 0xa8 }, { 0xf, 0x00 },
179{ WAIT_IDLE }, { 0xe, 0xa9 }, { 0xf, 0x00 },
180{ WAIT_IDLE }, { 0xe, 0xaa }, { 0xf, 0x00 },
181{ WAIT_IDLE }, { 0xe, 0xab }, { 0xf, 0x00 },
182{ WAIT_IDLE }, { 0xe, 0xac }, { 0xf, 0x00 },
183{ WAIT_IDLE }, { 0xe, 0xad }, { 0xf, 0x00 },
184{ WAIT_IDLE }, { 0xe, 0xae }, { 0xf, 0x00 },
185{ WAIT_IDLE }, { 0xe, 0xaf }, { 0xf, 0x00 },
186{ WAIT_IDLE }, { 0xe, 0xb0 }, { 0xf, 0x00 },
187{ WAIT_IDLE }, { 0xe, 0xb1 }, { 0xf, 0x00 },
188{ WAIT_IDLE }, { 0xe, 0xb2 }, { 0xf, 0x00 },
189{ WAIT_IDLE }, { 0xe, 0xb3 }, { 0xf, 0x00 },
190{ WAIT_IDLE }, { 0xe, 0xb4 }, { 0xf, 0x00 },
191{ WAIT_IDLE }, { 0xe, 0xb5 }, { 0xf, 0x00 },
192{ WAIT_IDLE }, { 0xe, 0xb6 }, { 0xf, 0x00 },
193{ WAIT_IDLE }, { 0xe, 0xb7 }, { 0xf, 0x00 },
194{ WAIT_IDLE }, { 0xe, 0xb8 }, { 0xf, 0x00 },
195{ WAIT_IDLE }, { 0xe, 0xb9 }, { 0xf, 0x00 },
196{ WAIT_IDLE }, { 0xe, 0xba }, { 0xf, 0x00 },
197{ WAIT_IDLE }, { 0xe, 0xbb }, { 0xf, 0x00 },
198{ WAIT_IDLE }, { 0xe, 0xbc }, { 0xf, 0x00 },
199{ WAIT_IDLE }, { 0xe, 0xbd }, { 0xf, 0x00 },
200{ WAIT_IDLE }, { 0xe, 0xbe }, { 0xf, 0x00 },
201{ WAIT_IDLE }, { 0xe, 0xbf }, { 0xf, 0x00 },
202{ WAIT_IDLE }, { 0xe, 0xc0 }, { 0xf, 0x00 },
203{ WAIT_IDLE }, { 0xe, 0xc1 }, { 0xf, 0x00 },
204{ WAIT_IDLE }, { 0xe, 0xc2 }, { 0xf, 0x00 },
205{ WAIT_IDLE }, { 0xe, 0xc3 }, { 0xf, 0x00 },
206{ WAIT_IDLE }, { 0xe, 0xc4 }, { 0xf, 0x00 },
207{ WAIT_IDLE }, { 0xe, 0xc5 }, { 0xf, 0x00 },
208{ WAIT_IDLE }, { 0xe, 0xc6 }, { 0xf, 0x00 },
209{ WAIT_IDLE }, { 0xe, 0xc7 }, { 0xf, 0x00 },
210{ WAIT_IDLE }, { 0xe, 0xc8 }, { 0xf, 0x00 },
211{ WAIT_IDLE }, { 0xe, 0xc9 }, { 0xf, 0x00 },
212{ WAIT_IDLE }, { 0xe, 0xca }, { 0xf, 0x00 },
213{ WAIT_IDLE }, { 0xe, 0xcb }, { 0xf, 0x00 },
214{ WAIT_IDLE }, { 0xe, 0xcc }, { 0xf, 0x00 },
215{ WAIT_IDLE }, { 0xe, 0xcd }, { 0xf, 0x00 },
216{ WAIT_IDLE }, { 0xe, 0xce }, { 0xf, 0x00 },
217{ WAIT_IDLE }, { 0xe, 0xcf }, { 0xf, 0x00 },
218{ WAIT_IDLE }, { 0xe, 0xd0 }, { 0xf, 0x00 },
219{ WAIT_IDLE }, { 0xe, 0xd1 }, { 0xf, 0x00 },
220{ WAIT_IDLE }, { 0xe, 0xd2 }, { 0xf, 0x00 },
221{ WAIT_IDLE }, { 0xe, 0xd3 }, { 0xf, 0x00 },
222{ WAIT_IDLE }, { 0xe, 0xd4 }, { 0xf, 0x00 },
223{ WAIT_IDLE }, { 0xe, 0xd5 }, { 0xf, 0x00 },
224{ WAIT_IDLE }, { 0xe, 0xd6 }, { 0xf, 0x00 },
225{ WAIT_IDLE }, { 0xe, 0xd7 }, { 0xf, 0x00 },
226{ WAIT_IDLE }, { 0xe, 0xd8 }, { 0xf, 0x00 },
227{ WAIT_IDLE }, { 0xe, 0xd9 }, { 0xf, 0x00 },
228{ WAIT_IDLE }, { 0xe, 0xda }, { 0xf, 0x00 },
229{ WAIT_IDLE }, { 0xe, 0xdb }, { 0xf, 0x00 },
230{ WAIT_IDLE }, { 0xe, 0xdc }, { 0xf, 0x00 },
231{ WAIT_IDLE }, { 0xe, 0xdd }, { 0xf, 0x00 },
232{ WAIT_IDLE }, { 0xe, 0xde }, { 0xf, 0x00 },
233{ WAIT_IDLE }, { 0xe, 0xdf }, { 0xf, 0x00 },
234{ WAIT_IDLE }, { 0xe, 0xe0 }, { 0xf, 0x00 },
235{ WAIT_IDLE }, { 0xe, 0xe1 }, { 0xf, 0x00 },
236{ WAIT_IDLE }, { 0xe, 0xe2 }, { 0xf, 0x00 },
237{ WAIT_IDLE }, { 0xe, 0xe3 }, { 0xf, 0x00 },
238{ WAIT_IDLE }, { 0xe, 0xe4 }, { 0xf, 0x00 },
239{ WAIT_IDLE }, { 0xe, 0xe5 }, { 0xf, 0x00 },
240{ WAIT_IDLE }, { 0xe, 0xe6 }, { 0xf, 0x00 },
241{ WAIT_IDLE }, { 0xe, 0xe7 }, { 0xf, 0x00 },
242{ WAIT_IDLE }, { 0xe, 0xe8 }, { 0xf, 0x00 },
243{ WAIT_IDLE }, { 0xe, 0xe9 }, { 0xf, 0x00 },
244{ WAIT_IDLE }, { 0xe, 0xea }, { 0xf, 0x00 },
245{ WAIT_IDLE }, { 0xe, 0xeb }, { 0xf, 0x00 },
246{ WAIT_IDLE }, { 0xe, 0xec }, { 0xf, 0x00 },
247{ WAIT_IDLE }, { 0xe, 0xed }, { 0xf, 0x00 },
248{ WAIT_IDLE }, { 0xe, 0xee }, { 0xf, 0x00 },
249{ WAIT_IDLE }, { 0xe, 0xef }, { 0xf, 0x00 },
250{ WAIT_IDLE }, { 0xe, 0xf0 }, { 0xf, 0x00 },
251{ WAIT_IDLE }, { 0xe, 0xf1 }, { 0xf, 0x00 },
252{ WAIT_IDLE }, { 0xe, 0xf2 }, { 0xf, 0x00 },
253{ WAIT_IDLE }, { 0xe, 0xf3 }, { 0xf, 0x00 },
254{ WAIT_IDLE }, { 0xe, 0xf4 }, { 0xf, 0x00 },
255{ WAIT_IDLE }, { 0xe, 0xf5 }, { 0xf, 0x00 },
256{ WAIT_IDLE }, { 0xe, 0xf6 }, { 0xf, 0x00 },
257{ WAIT_IDLE }, { 0xe, 0xf7 }, { 0xf, 0x00 },
258{ WAIT_IDLE }, { 0xe, 0xf8 }, { 0xf, 0x00 },
259{ WAIT_IDLE }, { 0xe, 0xf9 }, { 0xf, 0x00 },
260{ WAIT_IDLE }, { 0xe, 0xfa }, { 0xf, 0x00 },
261{ WAIT_IDLE }, { 0xe, 0xfb }, { 0xf, 0x00 },
262{ WAIT_IDLE }, { 0xe, 0xfc }, { 0xf, 0x00 },
263{ WAIT_IDLE }, { 0xe, 0xfd }, { 0xf, 0x00 },
264{ WAIT_IDLE }, { 0xe, 0xfe }, { 0xf, 0x00 },
265{ WAIT_IDLE }, { 0xe, 0xff }, { 0xf, 0x00 },
266
267/* XXX But why do this twice? */
268{ WAIT_IDLE }, { 0xe, 0x10 }, { 0xf, 0x00 },
269{ WAIT_IDLE }, { 0xe, 0x11 }, { 0xf, 0x00 },
270{ WAIT_IDLE }, { 0xe, 0x12 }, { 0xf, 0x00 },
271{ WAIT_IDLE }, { 0xe, 0x13 }, { 0xf, 0x00 },
272{ WAIT_IDLE }, { 0xe, 0x14 }, { 0xf, 0x00 },
273{ WAIT_IDLE }, { 0xe, 0x15 }, { 0xf, 0x00 },
274{ WAIT_IDLE }, { 0xe, 0x16 }, { 0xf, 0x00 },
275{ WAIT_IDLE }, { 0xe, 0x17 }, { 0xf, 0x00 },
276{ WAIT_IDLE }, { 0xe, 0x18 }, { 0xf, 0x00 },
277{ WAIT_IDLE }, { 0xe, 0x19 }, { 0xf, 0x00 },
278{ WAIT_IDLE }, { 0xe, 0x1a }, { 0xf, 0x00 },
279{ WAIT_IDLE }, { 0xe, 0x1b }, { 0xf, 0x00 },
280{ WAIT_IDLE }, { 0xe, 0x1c }, { 0xf, 0x00 },
281{ WAIT_IDLE }, { 0xe, 0x1d }, { 0xf, 0x00 },
282{ WAIT_IDLE }, { 0xe, 0x1e }, { 0xf, 0x00 },
283{ WAIT_IDLE }, { 0xe, 0x1f }, { 0xf, 0x00 },
284{ WAIT_IDLE }, { 0xe, 0x20 }, { 0xf, 0x00 },
285{ WAIT_IDLE }, { 0xe, 0x21 }, { 0xf, 0x00 },
286{ WAIT_IDLE }, { 0xe, 0x22 }, { 0xf, 0x00 },
287{ WAIT_IDLE }, { 0xe, 0x23 }, { 0xf, 0x00 },
288{ WAIT_IDLE }, { 0xe, 0x24 }, { 0xf, 0x00 },
289{ WAIT_IDLE }, { 0xe, 0x25 }, { 0xf, 0x00 },
290{ WAIT_IDLE }, { 0xe, 0x26 }, { 0xf, 0x00 },
291{ WAIT_IDLE }, { 0xe, 0x27 }, { 0xf, 0x00 },
292{ WAIT_IDLE }, { 0xe, 0x28 }, { 0xf, 0x00 },
293{ WAIT_IDLE }, { 0xe, 0x29 }, { 0xf, 0x00 },
294{ WAIT_IDLE }, { 0xe, 0x2a }, { 0xf, 0x00 },
295{ WAIT_IDLE }, { 0xe, 0x2b }, { 0xf, 0x00 },
296{ WAIT_IDLE }, { 0xe, 0x2c }, { 0xf, 0x00 },
297{ WAIT_IDLE }, { 0xe, 0x2d }, { 0xf, 0x00 },
298{ WAIT_IDLE }, { 0xe, 0x2e }, { 0xf, 0x00 },
299{ WAIT_IDLE }, { 0xe, 0x2f }, { 0xf, 0x00 },
300{ WAIT_IDLE }, { 0xe, 0x30 }, { 0xf, 0x00 },
301{ WAIT_IDLE }, { 0xe, 0x31 }, { 0xf, 0x00 },
302{ WAIT_IDLE }, { 0xe, 0x32 }, { 0xf, 0x00 },
303{ WAIT_IDLE }, { 0xe, 0x33 }, { 0xf, 0x00 },
304{ WAIT_IDLE }, { 0xe, 0x34 }, { 0xf, 0x00 },
305{ WAIT_IDLE }, { 0xe, 0x35 }, { 0xf, 0x00 },
306{ WAIT_IDLE }, { 0xe, 0x36 }, { 0xf, 0x00 },
307{ WAIT_IDLE }, { 0xe, 0x37 }, { 0xf, 0x00 },
308{ WAIT_IDLE }, { 0xe, 0x38 }, { 0xf, 0x00 },
309{ WAIT_IDLE }, { 0xe, 0x39 }, { 0xf, 0x00 },
310{ WAIT_IDLE }, { 0xe, 0x3a }, { 0xf, 0x00 },
311{ WAIT_IDLE }, { 0xe, 0x3b }, { 0xf, 0x00 },
312{ WAIT_IDLE }, { 0xe, 0x3c }, { 0xf, 0x00 },
313{ WAIT_IDLE }, { 0xe, 0x3d }, { 0xf, 0x00 },
314{ WAIT_IDLE }, { 0xe, 0x3e }, { 0xf, 0x00 },
315{ WAIT_IDLE }, { 0xe, 0x3f }, { 0xf, 0x00 },
316{ WAIT_IDLE }, { 0xe, 0x40 }, { 0xf, 0x00 },
317{ WAIT_IDLE }, { 0xe, 0x41 }, { 0xf, 0x00 },
318{ WAIT_IDLE }, { 0xe, 0x42 }, { 0xf, 0x00 },
319{ WAIT_IDLE }, { 0xe, 0x43 }, { 0xf, 0x00 },
320{ WAIT_IDLE }, { 0xe, 0x44 }, { 0xf, 0x00 },
321{ WAIT_IDLE }, { 0xe, 0x45 }, { 0xf, 0x00 },
322{ WAIT_IDLE }, { 0xe, 0x46 }, { 0xf, 0x00 },
323{ WAIT_IDLE }, { 0xe, 0x47 }, { 0xf, 0x00 },
324{ WAIT_IDLE }, { 0xe, 0x48 }, { 0xf, 0x00 },
325{ WAIT_IDLE }, { 0xe, 0x49 }, { 0xf, 0x00 },
326{ WAIT_IDLE }, { 0xe, 0x4a }, { 0xf, 0x00 },
327{ WAIT_IDLE }, { 0xe, 0x4b }, { 0xf, 0x00 },
328{ WAIT_IDLE }, { 0xe, 0x4c }, { 0xf, 0x00 },
329{ WAIT_IDLE }, { 0xe, 0x4d }, { 0xf, 0x00 },
330{ WAIT_IDLE }, { 0xe, 0x4e }, { 0xf, 0x00 },
331{ WAIT_IDLE }, { 0xe, 0x4f }, { 0xf, 0x00 },
332{ WAIT_IDLE }, { 0xe, 0x50 }, { 0xf, 0x00 },
333{ WAIT_IDLE }, { 0xe, 0x51 }, { 0xf, 0x00 },
334{ WAIT_IDLE }, { 0xe, 0x52 }, { 0xf, 0x00 },
335{ WAIT_IDLE }, { 0xe, 0x53 }, { 0xf, 0x00 },
336{ WAIT_IDLE }, { 0xe, 0x54 }, { 0xf, 0x00 },
337{ WAIT_IDLE }, { 0xe, 0x55 }, { 0xf, 0x00 },
338{ WAIT_IDLE }, { 0xe, 0x56 }, { 0xf, 0x00 },
339{ WAIT_IDLE }, { 0xe, 0x57 }, { 0xf, 0x00 },
340{ WAIT_IDLE }, { 0xe, 0x58 }, { 0xf, 0x00 },
341{ WAIT_IDLE }, { 0xe, 0x59 }, { 0xf, 0x00 },
342{ WAIT_IDLE }, { 0xe, 0x5a }, { 0xf, 0x00 },
343{ WAIT_IDLE }, { 0xe, 0x5b }, { 0xf, 0x00 },
344{ WAIT_IDLE }, { 0xe, 0x5c }, { 0xf, 0x00 },
345{ WAIT_IDLE }, { 0xe, 0x5d }, { 0xf, 0x00 },
346{ WAIT_IDLE }, { 0xe, 0x5e }, { 0xf, 0x00 },
347{ WAIT_IDLE }, { 0xe, 0x5f }, { 0xf, 0x00 },
348{ WAIT_IDLE }, { 0xe, 0x60 }, { 0xf, 0x00 },
349{ WAIT_IDLE }, { 0xe, 0x61 }, { 0xf, 0x00 },
350{ WAIT_IDLE }, { 0xe, 0x62 }, { 0xf, 0x00 },
351{ WAIT_IDLE }, { 0xe, 0x63 }, { 0xf, 0x00 },
352{ WAIT_IDLE }, { 0xe, 0x64 }, { 0xf, 0x00 },
353{ WAIT_IDLE }, { 0xe, 0x65 }, { 0xf, 0x00 },
354{ WAIT_IDLE }, { 0xe, 0x66 }, { 0xf, 0x00 },
355{ WAIT_IDLE }, { 0xe, 0x67 }, { 0xf, 0x00 },
356{ WAIT_IDLE }, { 0xe, 0x68 }, { 0xf, 0x00 },
357{ WAIT_IDLE }, { 0xe, 0x69 }, { 0xf, 0x00 },
358{ WAIT_IDLE }, { 0xe, 0x6a }, { 0xf, 0x00 },
359{ WAIT_IDLE }, { 0xe, 0x6b }, { 0xf, 0x00 },
360{ WAIT_IDLE }, { 0xe, 0x6c }, { 0xf, 0x00 },
361{ WAIT_IDLE }, { 0xe, 0x6d }, { 0xf, 0x00 },
362{ WAIT_IDLE }, { 0xe, 0x6e }, { 0xf, 0x00 },
363{ WAIT_IDLE }, { 0xe, 0x6f }, { 0xf, 0x00 },
364{ WAIT_IDLE }, { 0xe, 0x70 }, { 0xf, 0x00 },
365{ WAIT_IDLE }, { 0xe, 0x71 }, { 0xf, 0x00 },
366{ WAIT_IDLE }, { 0xe, 0x72 }, { 0xf, 0x00 },
367{ WAIT_IDLE }, { 0xe, 0x73 }, { 0xf, 0x00 },
368{ WAIT_IDLE }, { 0xe, 0x74 }, { 0xf, 0x00 },
369{ WAIT_IDLE }, { 0xe, 0x75 }, { 0xf, 0x00 },
370{ WAIT_IDLE }, { 0xe, 0x76 }, { 0xf, 0x00 },
371{ WAIT_IDLE }, { 0xe, 0x77 }, { 0xf, 0x00 },
372{ WAIT_IDLE }, { 0xe, 0x78 }, { 0xf, 0x00 },
373{ WAIT_IDLE }, { 0xe, 0x79 }, { 0xf, 0x00 },
374{ WAIT_IDLE }, { 0xe, 0x7a }, { 0xf, 0x00 },
375{ WAIT_IDLE }, { 0xe, 0x7b }, { 0xf, 0x00 },
376{ WAIT_IDLE }, { 0xe, 0x7c }, { 0xf, 0x00 },
377{ WAIT_IDLE }, { 0xe, 0x7d }, { 0xf, 0x00 },
378{ WAIT_IDLE }, { 0xe, 0x7e }, { 0xf, 0x00 },
379{ WAIT_IDLE }, { 0xe, 0x7f }, { 0xf, 0x00 },
380{ WAIT_IDLE }, { 0xe, 0x80 }, { 0xf, 0x00 },
381{ WAIT_IDLE }, { 0xe, 0x81 }, { 0xf, 0x00 },
382{ WAIT_IDLE }, { 0xe, 0x82 }, { 0xf, 0x00 },
383{ WAIT_IDLE }, { 0xe, 0x83 }, { 0xf, 0x00 },
384{ WAIT_IDLE }, { 0xe, 0x84 }, { 0xf, 0x00 },
385{ WAIT_IDLE }, { 0xe, 0x85 }, { 0xf, 0x00 },
386{ WAIT_IDLE }, { 0xe, 0x86 }, { 0xf, 0x00 },
387{ WAIT_IDLE }, { 0xe, 0x87 }, { 0xf, 0x00 },
388{ WAIT_IDLE }, { 0xe, 0x88 }, { 0xf, 0x00 },
389{ WAIT_IDLE }, { 0xe, 0x89 }, { 0xf, 0x00 },
390{ WAIT_IDLE }, { 0xe, 0x8a }, { 0xf, 0x00 },
391{ WAIT_IDLE }, { 0xe, 0x8b }, { 0xf, 0x00 },
392{ WAIT_IDLE }, { 0xe, 0x8c }, { 0xf, 0x00 },
393{ WAIT_IDLE }, { 0xe, 0x8d }, { 0xf, 0x00 },
394{ WAIT_IDLE }, { 0xe, 0x8e }, { 0xf, 0x00 },
395{ WAIT_IDLE }, { 0xe, 0x8f }, { 0xf, 0x00 },
396{ WAIT_IDLE }, { 0xe, 0x90 }, { 0xf, 0x00 },
397{ WAIT_IDLE }, { 0xe, 0x91 }, { 0xf, 0x00 },
398{ WAIT_IDLE }, { 0xe, 0x92 }, { 0xf, 0x00 },
399{ WAIT_IDLE }, { 0xe, 0x93 }, { 0xf, 0x00 },
400{ WAIT_IDLE }, { 0xe, 0x94 }, { 0xf, 0x00 },
401{ WAIT_IDLE }, { 0xe, 0x95 }, { 0xf, 0x00 },
402{ WAIT_IDLE }, { 0xe, 0x96 }, { 0xf, 0x00 },
403{ WAIT_IDLE }, { 0xe, 0x97 }, { 0xf, 0x00 },
404{ WAIT_IDLE }, { 0xe, 0x98 }, { 0xf, 0x00 },
405{ WAIT_IDLE }, { 0xe, 0x99 }, { 0xf, 0x00 },
406{ WAIT_IDLE }, { 0xe, 0x9a }, { 0xf, 0x00 },
407{ WAIT_IDLE }, { 0xe, 0x9b }, { 0xf, 0x00 },
408{ WAIT_IDLE }, { 0xe, 0x9c }, { 0xf, 0x00 },
409{ WAIT_IDLE }, { 0xe, 0x9d }, { 0xf, 0x00 },
410{ WAIT_IDLE }, { 0xe, 0x9e }, { 0xf, 0x00 },
411{ WAIT_IDLE }, { 0xe, 0x9f }, { 0xf, 0x00 },
412{ WAIT_IDLE }, { 0xe, 0xa0 }, { 0xf, 0x00 },
413{ WAIT_IDLE }, { 0xe, 0xa1 }, { 0xf, 0x00 },
414{ WAIT_IDLE }, { 0xe, 0xa2 }, { 0xf, 0x00 },
415{ WAIT_IDLE }, { 0xe, 0xa3 }, { 0xf, 0x00 },
416{ WAIT_IDLE }, { 0xe, 0xa4 }, { 0xf, 0x00 },
417{ WAIT_IDLE }, { 0xe, 0xa5 }, { 0xf, 0x00 },
418{ WAIT_IDLE }, { 0xe, 0xa6 }, { 0xf, 0x00 },
419{ WAIT_IDLE }, { 0xe, 0xa7 }, { 0xf, 0x00 },
420{ WAIT_IDLE }, { 0xe, 0xa8 }, { 0xf, 0x00 },
421{ WAIT_IDLE }, { 0xe, 0xa9 }, { 0xf, 0x00 },
422{ WAIT_IDLE }, { 0xe, 0xaa }, { 0xf, 0x00 },
423{ WAIT_IDLE }, { 0xe, 0xab }, { 0xf, 0x00 },
424{ WAIT_IDLE }, { 0xe, 0xac }, { 0xf, 0x00 },
425{ WAIT_IDLE }, { 0xe, 0xad }, { 0xf, 0x00 },
426{ WAIT_IDLE }, { 0xe, 0xae }, { 0xf, 0x00 },
427{ WAIT_IDLE }, { 0xe, 0xaf }, { 0xf, 0x00 },
428{ WAIT_IDLE }, { 0xe, 0xb0 }, { 0xf, 0x00 },
429{ WAIT_IDLE }, { 0xe, 0xb1 }, { 0xf, 0x00 },
430{ WAIT_IDLE }, { 0xe, 0xb2 }, { 0xf, 0x00 },
431{ WAIT_IDLE }, { 0xe, 0xb3 }, { 0xf, 0x00 },
432{ WAIT_IDLE }, { 0xe, 0xb4 }, { 0xf, 0x00 },
433{ WAIT_IDLE }, { 0xe, 0xb5 }, { 0xf, 0x00 },
434{ WAIT_IDLE }, { 0xe, 0xb6 }, { 0xf, 0x00 },
435{ WAIT_IDLE }, { 0xe, 0xb7 }, { 0xf, 0x00 },
436{ WAIT_IDLE }, { 0xe, 0xb8 }, { 0xf, 0x00 },
437{ WAIT_IDLE }, { 0xe, 0xb9 }, { 0xf, 0x00 },
438{ WAIT_IDLE }, { 0xe, 0xba }, { 0xf, 0x00 },
439{ WAIT_IDLE }, { 0xe, 0xbb }, { 0xf, 0x00 },
440{ WAIT_IDLE }, { 0xe, 0xbc }, { 0xf, 0x00 },
441{ WAIT_IDLE }, { 0xe, 0xbd }, { 0xf, 0x00 },
442{ WAIT_IDLE }, { 0xe, 0xbe }, { 0xf, 0x00 },
443{ WAIT_IDLE }, { 0xe, 0xbf }, { 0xf, 0x00 },
444{ WAIT_IDLE }, { 0xe, 0xc0 }, { 0xf, 0x00 },
445{ WAIT_IDLE }, { 0xe, 0xc1 }, { 0xf, 0x00 },
446{ WAIT_IDLE }, { 0xe, 0xc2 }, { 0xf, 0x00 },
447{ WAIT_IDLE }, { 0xe, 0xc3 }, { 0xf, 0x00 },
448{ WAIT_IDLE }, { 0xe, 0xc4 }, { 0xf, 0x00 },
449{ WAIT_IDLE }, { 0xe, 0xc5 }, { 0xf, 0x00 },
450{ WAIT_IDLE }, { 0xe, 0xc6 }, { 0xf, 0x00 },
451{ WAIT_IDLE }, { 0xe, 0xc7 }, { 0xf, 0x00 },
452{ WAIT_IDLE }, { 0xe, 0xc8 }, { 0xf, 0x00 },
453{ WAIT_IDLE }, { 0xe, 0xc9 }, { 0xf, 0x00 },
454{ WAIT_IDLE }, { 0xe, 0xca }, { 0xf, 0x00 },
455{ WAIT_IDLE }, { 0xe, 0xcb }, { 0xf, 0x00 },
456{ WAIT_IDLE }, { 0xe, 0xcc }, { 0xf, 0x00 },
457{ WAIT_IDLE }, { 0xe, 0xcd }, { 0xf, 0x00 },
458{ WAIT_IDLE }, { 0xe, 0xce }, { 0xf, 0x00 },
459{ WAIT_IDLE }, { 0xe, 0xcf }, { 0xf, 0x00 },
460{ WAIT_IDLE }, { 0xe, 0xd0 }, { 0xf, 0x00 },
461{ WAIT_IDLE }, { 0xe, 0xd1 }, { 0xf, 0x00 },
462{ WAIT_IDLE }, { 0xe, 0xd2 }, { 0xf, 0x00 },
463{ WAIT_IDLE }, { 0xe, 0xd3 }, { 0xf, 0x00 },
464{ WAIT_IDLE }, { 0xe, 0xd4 }, { 0xf, 0x00 },
465{ WAIT_IDLE }, { 0xe, 0xd5 }, { 0xf, 0x00 },
466{ WAIT_IDLE }, { 0xe, 0xd6 }, { 0xf, 0x00 },
467{ WAIT_IDLE }, { 0xe, 0xd7 }, { 0xf, 0x00 },
468{ WAIT_IDLE }, { 0xe, 0xd8 }, { 0xf, 0x00 },
469{ WAIT_IDLE }, { 0xe, 0xd9 }, { 0xf, 0x00 },
470{ WAIT_IDLE }, { 0xe, 0xda }, { 0xf, 0x00 },
471{ WAIT_IDLE }, { 0xe, 0xdb }, { 0xf, 0x00 },
472{ WAIT_IDLE }, { 0xe, 0xdc }, { 0xf, 0x00 },
473{ WAIT_IDLE }, { 0xe, 0xdd }, { 0xf, 0x00 },
474{ WAIT_IDLE }, { 0xe, 0xde }, { 0xf, 0x00 },
475{ WAIT_IDLE }, { 0xe, 0xdf }, { 0xf, 0x00 },
476{ WAIT_IDLE }, { 0xe, 0xe0 }, { 0xf, 0x00 },
477{ WAIT_IDLE }, { 0xe, 0xe1 }, { 0xf, 0x00 },
478{ WAIT_IDLE }, { 0xe, 0xe2 }, { 0xf, 0x00 },
479{ WAIT_IDLE }, { 0xe, 0xe3 }, { 0xf, 0x00 },
480{ WAIT_IDLE }, { 0xe, 0xe4 }, { 0xf, 0x00 },
481{ WAIT_IDLE }, { 0xe, 0xe5 }, { 0xf, 0x00 },
482{ WAIT_IDLE }, { 0xe, 0xe6 }, { 0xf, 0x00 },
483{ WAIT_IDLE }, { 0xe, 0xe7 }, { 0xf, 0x00 },
484{ WAIT_IDLE }, { 0xe, 0xe8 }, { 0xf, 0x00 },
485{ WAIT_IDLE }, { 0xe, 0xe9 }, { 0xf, 0x00 },
486{ WAIT_IDLE }, { 0xe, 0xea }, { 0xf, 0x00 },
487{ WAIT_IDLE }, { 0xe, 0xeb }, { 0xf, 0x00 },
488{ WAIT_IDLE }, { 0xe, 0xec }, { 0xf, 0x00 },
489{ WAIT_IDLE }, { 0xe, 0xed }, { 0xf, 0x00 },
490{ WAIT_IDLE }, { 0xe, 0xee }, { 0xf, 0x00 },
491{ WAIT_IDLE }, { 0xe, 0xef }, { 0xf, 0x00 },
492{ WAIT_IDLE }, { 0xe, 0xf0 }, { 0xf, 0x00 },
493{ WAIT_IDLE }, { 0xe, 0xf1 }, { 0xf, 0x00 },
494{ WAIT_IDLE }, { 0xe, 0xf2 }, { 0xf, 0x00 },
495{ WAIT_IDLE }, { 0xe, 0xf3 }, { 0xf, 0x00 },
496{ WAIT_IDLE }, { 0xe, 0xf4 }, { 0xf, 0x00 },
497{ WAIT_IDLE }, { 0xe, 0xf5 }, { 0xf, 0x00 },
498{ WAIT_IDLE }, { 0xe, 0xf6 }, { 0xf, 0x00 },
499{ WAIT_IDLE }, { 0xe, 0xf7 }, { 0xf, 0x00 },
500{ WAIT_IDLE }, { 0xe, 0xf8 }, { 0xf, 0x00 },
501{ WAIT_IDLE }, { 0xe, 0xf9 }, { 0xf, 0x00 },
502{ WAIT_IDLE }, { 0xe, 0xfa }, { 0xf, 0x00 },
503{ WAIT_IDLE }, { 0xe, 0xfb }, { 0xf, 0x00 },
504{ WAIT_IDLE }, { 0xe, 0xfc }, { 0xf, 0x00 },
505{ WAIT_IDLE }, { 0xe, 0xfd }, { 0xf, 0x00 },
506{ WAIT_IDLE }, { 0xe, 0xfe }, { 0xf, 0x00 },
507{ WAIT_IDLE }, { 0xe, 0xff }, { 0xf, 0x00 },
508
509/* mute on */
510{ WAIT_IDLE }, { 0x8, 0x02 },
511
512{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x44 }, { 0xd, 0x00 }, { 0xc, 0x00 },
513{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x42 }, { 0xd, 0x00 }, { 0xc, 0x00 },
514{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x43 }, { 0xd, 0x00 }, { 0xc, 0x00 },
515{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x7c }, { 0xd, 0x00 }, { 0xc, 0x00 },
516{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x7e }, { 0xd, 0x00 }, { 0xc, 0x00 },
517{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 },
518{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 },
519{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x47 }, { 0xd, 0x00 }, { 0xc, 0x00 },
520{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x4a }, { 0xd, 0x00 }, { 0xc, 0x00 },
521
522/* either because of stupidity by TB's programmers, or because it
523 actually does something, rezero the MOD page. */
524{ WAIT_IDLE }, { 0xe, 0x10 }, { 0xf, 0x00 },
525{ WAIT_IDLE }, { 0xe, 0x11 }, { 0xf, 0x00 },
526{ WAIT_IDLE }, { 0xe, 0x12 }, { 0xf, 0x00 },
527{ WAIT_IDLE }, { 0xe, 0x13 }, { 0xf, 0x00 },
528{ WAIT_IDLE }, { 0xe, 0x14 }, { 0xf, 0x00 },
529{ WAIT_IDLE }, { 0xe, 0x15 }, { 0xf, 0x00 },
530{ WAIT_IDLE }, { 0xe, 0x16 }, { 0xf, 0x00 },
531{ WAIT_IDLE }, { 0xe, 0x17 }, { 0xf, 0x00 },
532{ WAIT_IDLE }, { 0xe, 0x18 }, { 0xf, 0x00 },
533{ WAIT_IDLE }, { 0xe, 0x19 }, { 0xf, 0x00 },
534{ WAIT_IDLE }, { 0xe, 0x1a }, { 0xf, 0x00 },
535{ WAIT_IDLE }, { 0xe, 0x1b }, { 0xf, 0x00 },
536{ WAIT_IDLE }, { 0xe, 0x1c }, { 0xf, 0x00 },
537{ WAIT_IDLE }, { 0xe, 0x1d }, { 0xf, 0x00 },
538{ WAIT_IDLE }, { 0xe, 0x1e }, { 0xf, 0x00 },
539{ WAIT_IDLE }, { 0xe, 0x1f }, { 0xf, 0x00 },
540{ WAIT_IDLE }, { 0xe, 0x20 }, { 0xf, 0x00 },
541{ WAIT_IDLE }, { 0xe, 0x21 }, { 0xf, 0x00 },
542{ WAIT_IDLE }, { 0xe, 0x22 }, { 0xf, 0x00 },
543{ WAIT_IDLE }, { 0xe, 0x23 }, { 0xf, 0x00 },
544{ WAIT_IDLE }, { 0xe, 0x24 }, { 0xf, 0x00 },
545{ WAIT_IDLE }, { 0xe, 0x25 }, { 0xf, 0x00 },
546{ WAIT_IDLE }, { 0xe, 0x26 }, { 0xf, 0x00 },
547{ WAIT_IDLE }, { 0xe, 0x27 }, { 0xf, 0x00 },
548{ WAIT_IDLE }, { 0xe, 0x28 }, { 0xf, 0x00 },
549{ WAIT_IDLE }, { 0xe, 0x29 }, { 0xf, 0x00 },
550{ WAIT_IDLE }, { 0xe, 0x2a }, { 0xf, 0x00 },
551{ WAIT_IDLE }, { 0xe, 0x2b }, { 0xf, 0x00 },
552{ WAIT_IDLE }, { 0xe, 0x2c }, { 0xf, 0x00 },
553{ WAIT_IDLE }, { 0xe, 0x2d }, { 0xf, 0x00 },
554{ WAIT_IDLE }, { 0xe, 0x2e }, { 0xf, 0x00 },
555{ WAIT_IDLE }, { 0xe, 0x2f }, { 0xf, 0x00 },
556{ WAIT_IDLE }, { 0xe, 0x30 }, { 0xf, 0x00 },
557{ WAIT_IDLE }, { 0xe, 0x31 }, { 0xf, 0x00 },
558{ WAIT_IDLE }, { 0xe, 0x32 }, { 0xf, 0x00 },
559{ WAIT_IDLE }, { 0xe, 0x33 }, { 0xf, 0x00 },
560{ WAIT_IDLE }, { 0xe, 0x34 }, { 0xf, 0x00 },
561{ WAIT_IDLE }, { 0xe, 0x35 }, { 0xf, 0x00 },
562{ WAIT_IDLE }, { 0xe, 0x36 }, { 0xf, 0x00 },
563{ WAIT_IDLE }, { 0xe, 0x37 }, { 0xf, 0x00 },
564{ WAIT_IDLE }, { 0xe, 0x38 }, { 0xf, 0x00 },
565{ WAIT_IDLE }, { 0xe, 0x39 }, { 0xf, 0x00 },
566{ WAIT_IDLE }, { 0xe, 0x3a }, { 0xf, 0x00 },
567{ WAIT_IDLE }, { 0xe, 0x3b }, { 0xf, 0x00 },
568{ WAIT_IDLE }, { 0xe, 0x3c }, { 0xf, 0x00 },
569{ WAIT_IDLE }, { 0xe, 0x3d }, { 0xf, 0x00 },
570{ WAIT_IDLE }, { 0xe, 0x3e }, { 0xf, 0x00 },
571{ WAIT_IDLE }, { 0xe, 0x3f }, { 0xf, 0x00 },
572{ WAIT_IDLE }, { 0xe, 0x40 }, { 0xf, 0x00 },
573{ WAIT_IDLE }, { 0xe, 0x41 }, { 0xf, 0x00 },
574{ WAIT_IDLE }, { 0xe, 0x42 }, { 0xf, 0x00 },
575{ WAIT_IDLE }, { 0xe, 0x43 }, { 0xf, 0x00 },
576{ WAIT_IDLE }, { 0xe, 0x44 }, { 0xf, 0x00 },
577{ WAIT_IDLE }, { 0xe, 0x45 }, { 0xf, 0x00 },
578{ WAIT_IDLE }, { 0xe, 0x46 }, { 0xf, 0x00 },
579{ WAIT_IDLE }, { 0xe, 0x47 }, { 0xf, 0x00 },
580{ WAIT_IDLE }, { 0xe, 0x48 }, { 0xf, 0x00 },
581{ WAIT_IDLE }, { 0xe, 0x49 }, { 0xf, 0x00 },
582{ WAIT_IDLE }, { 0xe, 0x4a }, { 0xf, 0x00 },
583{ WAIT_IDLE }, { 0xe, 0x4b }, { 0xf, 0x00 },
584{ WAIT_IDLE }, { 0xe, 0x4c }, { 0xf, 0x00 },
585{ WAIT_IDLE }, { 0xe, 0x4d }, { 0xf, 0x00 },
586{ WAIT_IDLE }, { 0xe, 0x4e }, { 0xf, 0x00 },
587{ WAIT_IDLE }, { 0xe, 0x4f }, { 0xf, 0x00 },
588{ WAIT_IDLE }, { 0xe, 0x50 }, { 0xf, 0x00 },
589{ WAIT_IDLE }, { 0xe, 0x51 }, { 0xf, 0x00 },
590{ WAIT_IDLE }, { 0xe, 0x52 }, { 0xf, 0x00 },
591{ WAIT_IDLE }, { 0xe, 0x53 }, { 0xf, 0x00 },
592{ WAIT_IDLE }, { 0xe, 0x54 }, { 0xf, 0x00 },
593{ WAIT_IDLE }, { 0xe, 0x55 }, { 0xf, 0x00 },
594{ WAIT_IDLE }, { 0xe, 0x56 }, { 0xf, 0x00 },
595{ WAIT_IDLE }, { 0xe, 0x57 }, { 0xf, 0x00 },
596{ WAIT_IDLE }, { 0xe, 0x58 }, { 0xf, 0x00 },
597{ WAIT_IDLE }, { 0xe, 0x59 }, { 0xf, 0x00 },
598{ WAIT_IDLE }, { 0xe, 0x5a }, { 0xf, 0x00 },
599{ WAIT_IDLE }, { 0xe, 0x5b }, { 0xf, 0x00 },
600{ WAIT_IDLE }, { 0xe, 0x5c }, { 0xf, 0x00 },
601{ WAIT_IDLE }, { 0xe, 0x5d }, { 0xf, 0x00 },
602{ WAIT_IDLE }, { 0xe, 0x5e }, { 0xf, 0x00 },
603{ WAIT_IDLE }, { 0xe, 0x5f }, { 0xf, 0x00 },
604{ WAIT_IDLE }, { 0xe, 0x60 }, { 0xf, 0x00 },
605{ WAIT_IDLE }, { 0xe, 0x61 }, { 0xf, 0x00 },
606{ WAIT_IDLE }, { 0xe, 0x62 }, { 0xf, 0x00 },
607{ WAIT_IDLE }, { 0xe, 0x63 }, { 0xf, 0x00 },
608{ WAIT_IDLE }, { 0xe, 0x64 }, { 0xf, 0x00 },
609{ WAIT_IDLE }, { 0xe, 0x65 }, { 0xf, 0x00 },
610{ WAIT_IDLE }, { 0xe, 0x66 }, { 0xf, 0x00 },
611{ WAIT_IDLE }, { 0xe, 0x67 }, { 0xf, 0x00 },
612{ WAIT_IDLE }, { 0xe, 0x68 }, { 0xf, 0x00 },
613{ WAIT_IDLE }, { 0xe, 0x69 }, { 0xf, 0x00 },
614{ WAIT_IDLE }, { 0xe, 0x6a }, { 0xf, 0x00 },
615{ WAIT_IDLE }, { 0xe, 0x6b }, { 0xf, 0x00 },
616{ WAIT_IDLE }, { 0xe, 0x6c }, { 0xf, 0x00 },
617{ WAIT_IDLE }, { 0xe, 0x6d }, { 0xf, 0x00 },
618{ WAIT_IDLE }, { 0xe, 0x6e }, { 0xf, 0x00 },
619{ WAIT_IDLE }, { 0xe, 0x6f }, { 0xf, 0x00 },
620{ WAIT_IDLE }, { 0xe, 0x70 }, { 0xf, 0x00 },
621{ WAIT_IDLE }, { 0xe, 0x71 }, { 0xf, 0x00 },
622{ WAIT_IDLE }, { 0xe, 0x72 }, { 0xf, 0x00 },
623{ WAIT_IDLE }, { 0xe, 0x73 }, { 0xf, 0x00 },
624{ WAIT_IDLE }, { 0xe, 0x74 }, { 0xf, 0x00 },
625{ WAIT_IDLE }, { 0xe, 0x75 }, { 0xf, 0x00 },
626{ WAIT_IDLE }, { 0xe, 0x76 }, { 0xf, 0x00 },
627{ WAIT_IDLE }, { 0xe, 0x77 }, { 0xf, 0x00 },
628{ WAIT_IDLE }, { 0xe, 0x78 }, { 0xf, 0x00 },
629{ WAIT_IDLE }, { 0xe, 0x79 }, { 0xf, 0x00 },
630{ WAIT_IDLE }, { 0xe, 0x7a }, { 0xf, 0x00 },
631{ WAIT_IDLE }, { 0xe, 0x7b }, { 0xf, 0x00 },
632{ WAIT_IDLE }, { 0xe, 0x7c }, { 0xf, 0x00 },
633{ WAIT_IDLE }, { 0xe, 0x7d }, { 0xf, 0x00 },
634{ WAIT_IDLE }, { 0xe, 0x7e }, { 0xf, 0x00 },
635{ WAIT_IDLE }, { 0xe, 0x7f }, { 0xf, 0x00 },
636{ WAIT_IDLE }, { 0xe, 0x80 }, { 0xf, 0x00 },
637{ WAIT_IDLE }, { 0xe, 0x81 }, { 0xf, 0x00 },
638{ WAIT_IDLE }, { 0xe, 0x82 }, { 0xf, 0x00 },
639{ WAIT_IDLE }, { 0xe, 0x83 }, { 0xf, 0x00 },
640{ WAIT_IDLE }, { 0xe, 0x84 }, { 0xf, 0x00 },
641{ WAIT_IDLE }, { 0xe, 0x85 }, { 0xf, 0x00 },
642{ WAIT_IDLE }, { 0xe, 0x86 }, { 0xf, 0x00 },
643{ WAIT_IDLE }, { 0xe, 0x87 }, { 0xf, 0x00 },
644{ WAIT_IDLE }, { 0xe, 0x88 }, { 0xf, 0x00 },
645{ WAIT_IDLE }, { 0xe, 0x89 }, { 0xf, 0x00 },
646{ WAIT_IDLE }, { 0xe, 0x8a }, { 0xf, 0x00 },
647{ WAIT_IDLE }, { 0xe, 0x8b }, { 0xf, 0x00 },
648{ WAIT_IDLE }, { 0xe, 0x8c }, { 0xf, 0x00 },
649{ WAIT_IDLE }, { 0xe, 0x8d }, { 0xf, 0x00 },
650{ WAIT_IDLE }, { 0xe, 0x8e }, { 0xf, 0x00 },
651{ WAIT_IDLE }, { 0xe, 0x8f }, { 0xf, 0x00 },
652{ WAIT_IDLE }, { 0xe, 0x90 }, { 0xf, 0x00 },
653{ WAIT_IDLE }, { 0xe, 0x91 }, { 0xf, 0x00 },
654{ WAIT_IDLE }, { 0xe, 0x92 }, { 0xf, 0x00 },
655{ WAIT_IDLE }, { 0xe, 0x93 }, { 0xf, 0x00 },
656{ WAIT_IDLE }, { 0xe, 0x94 }, { 0xf, 0x00 },
657{ WAIT_IDLE }, { 0xe, 0x95 }, { 0xf, 0x00 },
658{ WAIT_IDLE }, { 0xe, 0x96 }, { 0xf, 0x00 },
659{ WAIT_IDLE }, { 0xe, 0x97 }, { 0xf, 0x00 },
660{ WAIT_IDLE }, { 0xe, 0x98 }, { 0xf, 0x00 },
661{ WAIT_IDLE }, { 0xe, 0x99 }, { 0xf, 0x00 },
662{ WAIT_IDLE }, { 0xe, 0x9a }, { 0xf, 0x00 },
663{ WAIT_IDLE }, { 0xe, 0x9b }, { 0xf, 0x00 },
664{ WAIT_IDLE }, { 0xe, 0x9c }, { 0xf, 0x00 },
665{ WAIT_IDLE }, { 0xe, 0x9d }, { 0xf, 0x00 },
666{ WAIT_IDLE }, { 0xe, 0x9e }, { 0xf, 0x00 },
667{ WAIT_IDLE }, { 0xe, 0x9f }, { 0xf, 0x00 },
668{ WAIT_IDLE }, { 0xe, 0xa0 }, { 0xf, 0x00 },
669{ WAIT_IDLE }, { 0xe, 0xa1 }, { 0xf, 0x00 },
670{ WAIT_IDLE }, { 0xe, 0xa2 }, { 0xf, 0x00 },
671{ WAIT_IDLE }, { 0xe, 0xa3 }, { 0xf, 0x00 },
672{ WAIT_IDLE }, { 0xe, 0xa4 }, { 0xf, 0x00 },
673{ WAIT_IDLE }, { 0xe, 0xa5 }, { 0xf, 0x00 },
674{ WAIT_IDLE }, { 0xe, 0xa6 }, { 0xf, 0x00 },
675{ WAIT_IDLE }, { 0xe, 0xa7 }, { 0xf, 0x00 },
676{ WAIT_IDLE }, { 0xe, 0xa8 }, { 0xf, 0x00 },
677{ WAIT_IDLE }, { 0xe, 0xa9 }, { 0xf, 0x00 },
678{ WAIT_IDLE }, { 0xe, 0xaa }, { 0xf, 0x00 },
679{ WAIT_IDLE }, { 0xe, 0xab }, { 0xf, 0x00 },
680{ WAIT_IDLE }, { 0xe, 0xac }, { 0xf, 0x00 },
681{ WAIT_IDLE }, { 0xe, 0xad }, { 0xf, 0x00 },
682{ WAIT_IDLE }, { 0xe, 0xae }, { 0xf, 0x00 },
683{ WAIT_IDLE }, { 0xe, 0xaf }, { 0xf, 0x00 },
684{ WAIT_IDLE }, { 0xe, 0xb0 }, { 0xf, 0x00 },
685{ WAIT_IDLE }, { 0xe, 0xb1 }, { 0xf, 0x00 },
686{ WAIT_IDLE }, { 0xe, 0xb2 }, { 0xf, 0x00 },
687{ WAIT_IDLE }, { 0xe, 0xb3 }, { 0xf, 0x00 },
688{ WAIT_IDLE }, { 0xe, 0xb4 }, { 0xf, 0x00 },
689{ WAIT_IDLE }, { 0xe, 0xb5 }, { 0xf, 0x00 },
690{ WAIT_IDLE }, { 0xe, 0xb6 }, { 0xf, 0x00 },
691{ WAIT_IDLE }, { 0xe, 0xb7 }, { 0xf, 0x00 },
692{ WAIT_IDLE }, { 0xe, 0xb8 }, { 0xf, 0x00 },
693{ WAIT_IDLE }, { 0xe, 0xb9 }, { 0xf, 0x00 },
694{ WAIT_IDLE }, { 0xe, 0xba }, { 0xf, 0x00 },
695{ WAIT_IDLE }, { 0xe, 0xbb }, { 0xf, 0x00 },
696{ WAIT_IDLE }, { 0xe, 0xbc }, { 0xf, 0x00 },
697{ WAIT_IDLE }, { 0xe, 0xbd }, { 0xf, 0x00 },
698{ WAIT_IDLE }, { 0xe, 0xbe }, { 0xf, 0x00 },
699{ WAIT_IDLE }, { 0xe, 0xbf }, { 0xf, 0x00 },
700{ WAIT_IDLE }, { 0xe, 0xc0 }, { 0xf, 0x00 },
701{ WAIT_IDLE }, { 0xe, 0xc1 }, { 0xf, 0x00 },
702{ WAIT_IDLE }, { 0xe, 0xc2 }, { 0xf, 0x00 },
703{ WAIT_IDLE }, { 0xe, 0xc3 }, { 0xf, 0x00 },
704{ WAIT_IDLE }, { 0xe, 0xc4 }, { 0xf, 0x00 },
705{ WAIT_IDLE }, { 0xe, 0xc5 }, { 0xf, 0x00 },
706{ WAIT_IDLE }, { 0xe, 0xc6 }, { 0xf, 0x00 },
707{ WAIT_IDLE }, { 0xe, 0xc7 }, { 0xf, 0x00 },
708{ WAIT_IDLE }, { 0xe, 0xc8 }, { 0xf, 0x00 },
709{ WAIT_IDLE }, { 0xe, 0xc9 }, { 0xf, 0x00 },
710{ WAIT_IDLE }, { 0xe, 0xca }, { 0xf, 0x00 },
711{ WAIT_IDLE }, { 0xe, 0xcb }, { 0xf, 0x00 },
712{ WAIT_IDLE }, { 0xe, 0xcc }, { 0xf, 0x00 },
713{ WAIT_IDLE }, { 0xe, 0xcd }, { 0xf, 0x00 },
714{ WAIT_IDLE }, { 0xe, 0xce }, { 0xf, 0x00 },
715{ WAIT_IDLE }, { 0xe, 0xcf }, { 0xf, 0x00 },
716{ WAIT_IDLE }, { 0xe, 0xd0 }, { 0xf, 0x00 },
717{ WAIT_IDLE }, { 0xe, 0xd1 }, { 0xf, 0x00 },
718{ WAIT_IDLE }, { 0xe, 0xd2 }, { 0xf, 0x00 },
719{ WAIT_IDLE }, { 0xe, 0xd3 }, { 0xf, 0x00 },
720{ WAIT_IDLE }, { 0xe, 0xd4 }, { 0xf, 0x00 },
721{ WAIT_IDLE }, { 0xe, 0xd5 }, { 0xf, 0x00 },
722{ WAIT_IDLE }, { 0xe, 0xd6 }, { 0xf, 0x00 },
723{ WAIT_IDLE }, { 0xe, 0xd7 }, { 0xf, 0x00 },
724{ WAIT_IDLE }, { 0xe, 0xd8 }, { 0xf, 0x00 },
725{ WAIT_IDLE }, { 0xe, 0xd9 }, { 0xf, 0x00 },
726{ WAIT_IDLE }, { 0xe, 0xda }, { 0xf, 0x00 },
727{ WAIT_IDLE }, { 0xe, 0xdb }, { 0xf, 0x00 },
728{ WAIT_IDLE }, { 0xe, 0xdc }, { 0xf, 0x00 },
729{ WAIT_IDLE }, { 0xe, 0xdd }, { 0xf, 0x00 },
730{ WAIT_IDLE }, { 0xe, 0xde }, { 0xf, 0x00 },
731{ WAIT_IDLE }, { 0xe, 0xdf }, { 0xf, 0x00 },
732{ WAIT_IDLE }, { 0xe, 0xe0 }, { 0xf, 0x00 },
733{ WAIT_IDLE }, { 0xe, 0xe1 }, { 0xf, 0x00 },
734{ WAIT_IDLE }, { 0xe, 0xe2 }, { 0xf, 0x00 },
735{ WAIT_IDLE }, { 0xe, 0xe3 }, { 0xf, 0x00 },
736{ WAIT_IDLE }, { 0xe, 0xe4 }, { 0xf, 0x00 },
737{ WAIT_IDLE }, { 0xe, 0xe5 }, { 0xf, 0x00 },
738{ WAIT_IDLE }, { 0xe, 0xe6 }, { 0xf, 0x00 },
739{ WAIT_IDLE }, { 0xe, 0xe7 }, { 0xf, 0x00 },
740{ WAIT_IDLE }, { 0xe, 0xe8 }, { 0xf, 0x00 },
741{ WAIT_IDLE }, { 0xe, 0xe9 }, { 0xf, 0x00 },
742{ WAIT_IDLE }, { 0xe, 0xea }, { 0xf, 0x00 },
743{ WAIT_IDLE }, { 0xe, 0xeb }, { 0xf, 0x00 },
744{ WAIT_IDLE }, { 0xe, 0xec }, { 0xf, 0x00 },
745{ WAIT_IDLE }, { 0xe, 0xed }, { 0xf, 0x00 },
746{ WAIT_IDLE }, { 0xe, 0xee }, { 0xf, 0x00 },
747{ WAIT_IDLE }, { 0xe, 0xef }, { 0xf, 0x00 },
748{ WAIT_IDLE }, { 0xe, 0xf0 }, { 0xf, 0x00 },
749{ WAIT_IDLE }, { 0xe, 0xf1 }, { 0xf, 0x00 },
750{ WAIT_IDLE }, { 0xe, 0xf2 }, { 0xf, 0x00 },
751{ WAIT_IDLE }, { 0xe, 0xf3 }, { 0xf, 0x00 },
752{ WAIT_IDLE }, { 0xe, 0xf4 }, { 0xf, 0x00 },
753{ WAIT_IDLE }, { 0xe, 0xf5 }, { 0xf, 0x00 },
754{ WAIT_IDLE }, { 0xe, 0xf6 }, { 0xf, 0x00 },
755{ WAIT_IDLE }, { 0xe, 0xf7 }, { 0xf, 0x00 },
756{ WAIT_IDLE }, { 0xe, 0xf8 }, { 0xf, 0x00 },
757{ WAIT_IDLE }, { 0xe, 0xf9 }, { 0xf, 0x00 },
758{ WAIT_IDLE }, { 0xe, 0xfa }, { 0xf, 0x00 },
759{ WAIT_IDLE }, { 0xe, 0xfb }, { 0xf, 0x00 },
760{ WAIT_IDLE }, { 0xe, 0xfc }, { 0xf, 0x00 },
761{ WAIT_IDLE }, { 0xe, 0xfd }, { 0xf, 0x00 },
762{ WAIT_IDLE }, { 0xe, 0xfe }, { 0xf, 0x00 },
763{ WAIT_IDLE }, { 0xe, 0xff }, { 0xf, 0x00 },
764
765/* load page zero */
766{ 0x9, 0x05 }, { 0xb, 0x00 }, { 0xa, 0x00 },
767
768{ 0xd, 0x01 }, { 0xc, 0x7c }, { WAIT_IDLE },
769{ 0xd, 0x00 }, { 0xc, 0x1e }, { WAIT_IDLE },
770{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
771{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
772{ 0xd, 0x00 }, { 0xc, 0xf5 }, { WAIT_IDLE },
773{ 0xd, 0x00 }, { 0xc, 0x11 }, { WAIT_IDLE },
774{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
775{ 0xd, 0x00 }, { 0xc, 0x32 }, { WAIT_IDLE },
776{ 0xd, 0x00 }, { 0xc, 0x40 }, { WAIT_IDLE },
777{ 0xd, 0x00 }, { 0xc, 0x13 }, { WAIT_IDLE },
778{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
779{ 0xd, 0x00 }, { 0xc, 0x14 }, { WAIT_IDLE },
780{ 0xd, 0x02 }, { 0xc, 0x76 }, { WAIT_IDLE },
781{ 0xd, 0x00 }, { 0xc, 0x60 }, { WAIT_IDLE },
782{ 0xd, 0x00 }, { 0xc, 0x80 }, { WAIT_IDLE },
783{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
784{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
785{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
786{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
787{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
788{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
789{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
790{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
791{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
792{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
793{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
794{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
795{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
796{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
797{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
798{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
799{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
800{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
801{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
802{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
803{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
804{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
805{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
806{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
807{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
808{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
809{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
810{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
811{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
812{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
813{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
814{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
815{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
816{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
817{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
818{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
819{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
820{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
821{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
822{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
823{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
824{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
825{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
826{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
827{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
828{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
829{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
830{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
831{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
832{ 0xd, 0x00 }, { 0xc, 0x18 }, { WAIT_IDLE },
833{ 0xd, 0x00 }, { 0xc, 0x19 }, { WAIT_IDLE },
834{ 0xd, 0x01 }, { 0xc, 0x1a }, { WAIT_IDLE },
835{ 0xd, 0x01 }, { 0xc, 0x20 }, { WAIT_IDLE },
836{ 0xd, 0x01 }, { 0xc, 0x40 }, { WAIT_IDLE },
837{ 0xd, 0x01 }, { 0xc, 0x17 }, { WAIT_IDLE },
838{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
839{ 0xd, 0x01 }, { 0xc, 0x80 }, { WAIT_IDLE },
840{ 0xd, 0x01 }, { 0xc, 0x20 }, { WAIT_IDLE },
841{ 0xd, 0x00 }, { 0xc, 0x10 }, { WAIT_IDLE },
842{ 0xd, 0x01 }, { 0xc, 0xa0 }, { WAIT_IDLE },
843{ 0xd, 0x03 }, { 0xc, 0xd1 }, { WAIT_IDLE },
844{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
845{ 0xd, 0x01 }, { 0xc, 0xf2 }, { WAIT_IDLE },
846{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
847{ 0xd, 0x00 }, { 0xc, 0x13 }, { WAIT_IDLE },
848{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
849{ 0xd, 0x00 }, { 0xc, 0xf4 }, { WAIT_IDLE },
850{ 0xd, 0x02 }, { 0xc, 0xe0 }, { WAIT_IDLE },
851{ 0xd, 0x00 }, { 0xc, 0x15 }, { WAIT_IDLE },
852{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
853{ 0xd, 0x00 }, { 0xc, 0x16 }, { WAIT_IDLE },
854{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
855{ 0xd, 0x00 }, { 0xc, 0x17 }, { WAIT_IDLE },
856{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
857{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
858{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
859{ 0xd, 0x00 }, { 0xc, 0x50 }, { WAIT_IDLE },
860{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
861{ 0xd, 0x00 }, { 0xc, 0x40 }, { WAIT_IDLE },
862{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
863{ 0xd, 0x00 }, { 0xc, 0x71 }, { WAIT_IDLE },
864{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
865{ 0xd, 0x00 }, { 0xc, 0x60 }, { WAIT_IDLE },
866{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
867{ 0xd, 0x00 }, { 0xc, 0x92 }, { WAIT_IDLE },
868{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
869{ 0xd, 0x00 }, { 0xc, 0x80 }, { WAIT_IDLE },
870{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
871{ 0xd, 0x00 }, { 0xc, 0xb3 }, { WAIT_IDLE },
872{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
873{ 0xd, 0x00 }, { 0xc, 0xa0 }, { WAIT_IDLE },
874{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
875{ 0xd, 0x00 }, { 0xc, 0xd4 }, { WAIT_IDLE },
876{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
877{ 0xd, 0x00 }, { 0xc, 0x40 }, { WAIT_IDLE },
878{ 0xd, 0x00 }, { 0xc, 0x80 }, { WAIT_IDLE },
879{ 0xd, 0x00 }, { 0xc, 0xf5 }, { WAIT_IDLE },
880{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
881{ 0xd, 0x00 }, { 0xc, 0x70 }, { WAIT_IDLE },
882{ 0xd, 0x00 }, { 0xc, 0xa0 }, { WAIT_IDLE },
883{ 0xd, 0x02 }, { 0xc, 0x11 }, { WAIT_IDLE },
884{ 0xd, 0x00 }, { 0xc, 0x16 }, { WAIT_IDLE },
885{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
886{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
887{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
888{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
889{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
890{ 0xd, 0x00 }, { 0xc, 0x20 }, { WAIT_IDLE },
891{ 0xd, 0x00 }, { 0xc, 0x10 }, { WAIT_IDLE },
892{ 0xd, 0x00 }, { 0xc, 0x17 }, { WAIT_IDLE },
893{ 0xd, 0x00 }, { 0xc, 0x1b }, { WAIT_IDLE },
894{ 0xd, 0x00 }, { 0xc, 0x1d }, { WAIT_IDLE },
895{ 0xd, 0x02 }, { 0xc, 0xdf }, { WAIT_IDLE },
896
897/* Now load page one */
898{ 0x9, 0x05 }, { 0xb, 0x01 }, { 0xa, 0x00 },
899
900{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
901{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
902{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
903{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
904{ 0xd, 0x00 }, { 0xc, 0x19 }, { WAIT_IDLE },
905{ 0xd, 0x00 }, { 0xc, 0x1f }, { WAIT_IDLE },
906{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
907{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
908{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
909{ 0xd, 0x03 }, { 0xc, 0xd8 }, { WAIT_IDLE },
910{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
911{ 0xd, 0x02 }, { 0xc, 0x20 }, { WAIT_IDLE },
912{ 0xd, 0x00 }, { 0xc, 0x19 }, { WAIT_IDLE },
913{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
914{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
915{ 0xd, 0x00 }, { 0xc, 0x18 }, { WAIT_IDLE },
916{ 0xd, 0x01 }, { 0xc, 0xc0 }, { WAIT_IDLE },
917{ 0xd, 0x01 }, { 0xc, 0xfa }, { WAIT_IDLE },
918{ 0xd, 0x00 }, { 0xc, 0x1a }, { WAIT_IDLE },
919{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
920{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
921{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
922{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
923{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
924{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
925{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
926{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
927{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
928{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
929{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
930{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
931{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
932{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
933{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
934{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
935{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
936{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
937{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
938{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
939{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
940{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
941{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
942{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
943{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
944{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
945{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
946{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
947{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
948{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
949{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
950{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
951{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
952{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
953{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
954{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
955{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
956{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
957{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
958{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
959{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
960{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
961{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
962{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
963{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
964{ 0xd, 0x02 }, { 0xc, 0x40 }, { WAIT_IDLE },
965{ 0xd, 0x02 }, { 0xc, 0x60 }, { WAIT_IDLE },
966{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
967{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
968{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
969{ 0xd, 0x02 }, { 0xc, 0xc0 }, { WAIT_IDLE },
970{ 0xd, 0x02 }, { 0xc, 0x80 }, { WAIT_IDLE },
971{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
972{ 0xd, 0x02 }, { 0xc, 0xfb }, { WAIT_IDLE },
973{ 0xd, 0x02 }, { 0xc, 0xa0 }, { WAIT_IDLE },
974{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
975{ 0xd, 0x00 }, { 0xc, 0x1b }, { WAIT_IDLE },
976{ 0xd, 0x02 }, { 0xc, 0xd7 }, { WAIT_IDLE },
977{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
978{ 0xd, 0x02 }, { 0xc, 0xf7 }, { WAIT_IDLE },
979{ 0xd, 0x03 }, { 0xc, 0x20 }, { WAIT_IDLE },
980{ 0xd, 0x03 }, { 0xc, 0x00 }, { WAIT_IDLE },
981{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
982{ 0xd, 0x00 }, { 0xc, 0x1c }, { WAIT_IDLE },
983{ 0xd, 0x03 }, { 0xc, 0x3c }, { WAIT_IDLE },
984{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
985{ 0xd, 0x03 }, { 0xc, 0x3f }, { WAIT_IDLE },
986{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
987{ 0xd, 0x03 }, { 0xc, 0xc0 }, { WAIT_IDLE },
988{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
989{ 0xd, 0x03 }, { 0xc, 0xdf }, { WAIT_IDLE },
990{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
991{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
992{ 0xd, 0x03 }, { 0xc, 0x5d }, { WAIT_IDLE },
993{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
994{ 0xd, 0x03 }, { 0xc, 0xc0 }, { WAIT_IDLE },
995{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
996{ 0xd, 0x03 }, { 0xc, 0x7d }, { WAIT_IDLE },
997{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
998{ 0xd, 0x03 }, { 0xc, 0xc0 }, { WAIT_IDLE },
999{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1000{ 0xd, 0x03 }, { 0xc, 0x9e }, { WAIT_IDLE },
1001{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1002{ 0xd, 0x03 }, { 0xc, 0xc0 }, { WAIT_IDLE },
1003{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1004{ 0xd, 0x03 }, { 0xc, 0xbe }, { WAIT_IDLE },
1005{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1006{ 0xd, 0x03 }, { 0xc, 0xc0 }, { WAIT_IDLE },
1007{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1008{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1009{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1010{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1011{ 0xd, 0x00 }, { 0xc, 0x1b }, { WAIT_IDLE },
1012{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1013{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1014{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1015{ 0xd, 0x02 }, { 0xc, 0xdb }, { WAIT_IDLE },
1016{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1017{ 0xd, 0x02 }, { 0xc, 0xdb }, { WAIT_IDLE },
1018{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1019{ 0xd, 0x02 }, { 0xc, 0xe0 }, { WAIT_IDLE },
1020{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1021{ 0xd, 0x02 }, { 0xc, 0xfb }, { WAIT_IDLE },
1022{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1023{ 0xd, 0x02 }, { 0xc, 0xc0 }, { WAIT_IDLE },
1024{ 0xd, 0x02 }, { 0xc, 0x40 }, { WAIT_IDLE },
1025{ 0xd, 0x02 }, { 0xc, 0xfb }, { WAIT_IDLE },
1026{ 0xd, 0x02 }, { 0xc, 0x60 }, { WAIT_IDLE },
1027{ 0xd, 0x00 }, { 0xc, 0x1b }, { WAIT_IDLE },
1028
1029{ 0x9, 0x05 }, { 0xb, 0x02 }, { 0xa, 0x00 },
1030
1031{ 0xc, 0xc4 }, { WAIT_IDLE },
1032{ 0xc, 0x00 }, { WAIT_IDLE },
1033{ 0xc, 0x44 }, { WAIT_IDLE },
1034{ 0xc, 0x07 }, { WAIT_IDLE },
1035{ 0xc, 0x44 }, { WAIT_IDLE },
1036{ 0xc, 0x00 }, { WAIT_IDLE },
1037{ 0xc, 0x40 }, { WAIT_IDLE },
1038{ 0xc, 0x25 }, { WAIT_IDLE },
1039{ 0xc, 0x01 }, { WAIT_IDLE },
1040{ 0xc, 0x06 }, { WAIT_IDLE },
1041{ 0xc, 0xc4 }, { WAIT_IDLE },
1042{ 0xc, 0x07 }, { WAIT_IDLE },
1043{ 0xc, 0x40 }, { WAIT_IDLE },
1044{ 0xc, 0x25 }, { WAIT_IDLE },
1045{ 0xc, 0x01 }, { WAIT_IDLE },
1046{ 0xc, 0x00 }, { WAIT_IDLE },
1047{ 0xc, 0x46 }, { WAIT_IDLE },
1048{ 0xc, 0x46 }, { WAIT_IDLE },
1049{ 0xc, 0x00 }, { WAIT_IDLE },
1050{ 0xc, 0x00 }, { WAIT_IDLE },
1051{ 0xc, 0x00 }, { WAIT_IDLE },
1052{ 0xc, 0x00 }, { WAIT_IDLE },
1053{ 0xc, 0x00 }, { WAIT_IDLE },
1054{ 0xc, 0x00 }, { WAIT_IDLE },
1055{ 0xc, 0x00 }, { WAIT_IDLE },
1056{ 0xc, 0x00 }, { WAIT_IDLE },
1057{ 0xc, 0x00 }, { WAIT_IDLE },
1058{ 0xc, 0x00 }, { WAIT_IDLE },
1059{ 0xc, 0x00 }, { WAIT_IDLE },
1060{ 0xc, 0x00 }, { WAIT_IDLE },
1061{ 0xc, 0x00 }, { WAIT_IDLE },
1062{ 0xc, 0x00 }, { WAIT_IDLE },
1063{ 0xc, 0x00 }, { WAIT_IDLE },
1064{ 0xc, 0x00 }, { WAIT_IDLE },
1065{ 0xc, 0x00 }, { WAIT_IDLE },
1066{ 0xc, 0x00 }, { WAIT_IDLE },
1067{ 0xc, 0x00 }, { WAIT_IDLE },
1068{ 0xc, 0x00 }, { WAIT_IDLE },
1069{ 0xc, 0x00 }, { WAIT_IDLE },
1070{ 0xc, 0x00 }, { WAIT_IDLE },
1071{ 0xc, 0x00 }, { WAIT_IDLE },
1072{ 0xc, 0x00 }, { WAIT_IDLE },
1073{ 0xc, 0x00 }, { WAIT_IDLE },
1074{ 0xc, 0x00 }, { WAIT_IDLE },
1075{ 0xc, 0x00 }, { WAIT_IDLE },
1076{ 0xc, 0x00 }, { WAIT_IDLE },
1077{ 0xc, 0x00 }, { WAIT_IDLE },
1078{ 0xc, 0x00 }, { WAIT_IDLE },
1079{ 0xc, 0x00 }, { WAIT_IDLE },
1080{ 0xc, 0x00 }, { WAIT_IDLE },
1081{ 0xc, 0x00 }, { WAIT_IDLE },
1082{ 0xc, 0x00 }, { WAIT_IDLE },
1083{ 0xc, 0x00 }, { WAIT_IDLE },
1084{ 0xc, 0x00 }, { WAIT_IDLE },
1085{ 0xc, 0x00 }, { WAIT_IDLE },
1086{ 0xc, 0x00 }, { WAIT_IDLE },
1087{ 0xc, 0x00 }, { WAIT_IDLE },
1088{ 0xc, 0x00 }, { WAIT_IDLE },
1089{ 0xc, 0x00 }, { WAIT_IDLE },
1090{ 0xc, 0x00 }, { WAIT_IDLE },
1091{ 0xc, 0x00 }, { WAIT_IDLE },
1092{ 0xc, 0x00 }, { WAIT_IDLE },
1093{ 0xc, 0x00 }, { WAIT_IDLE },
1094{ 0xc, 0x00 }, { WAIT_IDLE },
1095{ 0xc, 0x46 }, { WAIT_IDLE },
1096{ 0xc, 0x07 }, { WAIT_IDLE },
1097{ 0xc, 0x05 }, { WAIT_IDLE },
1098{ 0xc, 0x05 }, { WAIT_IDLE },
1099{ 0xc, 0x05 }, { WAIT_IDLE },
1100{ 0xc, 0x04 }, { WAIT_IDLE },
1101{ 0xc, 0x07 }, { WAIT_IDLE },
1102{ 0xc, 0x05 }, { WAIT_IDLE },
1103{ 0xc, 0x04 }, { WAIT_IDLE },
1104{ 0xc, 0x07 }, { WAIT_IDLE },
1105{ 0xc, 0x05 }, { WAIT_IDLE },
1106{ 0xc, 0x44 }, { WAIT_IDLE },
1107{ 0xc, 0x46 }, { WAIT_IDLE },
1108{ 0xc, 0x44 }, { WAIT_IDLE },
1109{ 0xc, 0x46 }, { WAIT_IDLE },
1110{ 0xc, 0x46 }, { WAIT_IDLE },
1111{ 0xc, 0x07 }, { WAIT_IDLE },
1112{ 0xc, 0x05 }, { WAIT_IDLE },
1113{ 0xc, 0x44 }, { WAIT_IDLE },
1114{ 0xc, 0x46 }, { WAIT_IDLE },
1115{ 0xc, 0x05 }, { WAIT_IDLE },
1116{ 0xc, 0x46 }, { WAIT_IDLE },
1117{ 0xc, 0x05 }, { WAIT_IDLE },
1118{ 0xc, 0x46 }, { WAIT_IDLE },
1119{ 0xc, 0x05 }, { WAIT_IDLE },
1120{ 0xc, 0x46 }, { WAIT_IDLE },
1121{ 0xc, 0x05 }, { WAIT_IDLE },
1122{ 0xc, 0x44 }, { WAIT_IDLE },
1123{ 0xc, 0x46 }, { WAIT_IDLE },
1124{ 0xc, 0x05 }, { WAIT_IDLE },
1125{ 0xc, 0x07 }, { WAIT_IDLE },
1126{ 0xc, 0x44 }, { WAIT_IDLE },
1127{ 0xc, 0x46 }, { WAIT_IDLE },
1128{ 0xc, 0x05 }, { WAIT_IDLE },
1129{ 0xc, 0x07 }, { WAIT_IDLE },
1130{ 0xc, 0x44 }, { WAIT_IDLE },
1131{ 0xc, 0x46 }, { WAIT_IDLE },
1132{ 0xc, 0x05 }, { WAIT_IDLE },
1133{ 0xc, 0x07 }, { WAIT_IDLE },
1134{ 0xc, 0x44 }, { WAIT_IDLE },
1135{ 0xc, 0x46 }, { WAIT_IDLE },
1136{ 0xc, 0x05 }, { WAIT_IDLE },
1137{ 0xc, 0x07 }, { WAIT_IDLE },
1138{ 0xc, 0x44 }, { WAIT_IDLE },
1139{ 0xc, 0x05 }, { WAIT_IDLE },
1140{ 0xc, 0x05 }, { WAIT_IDLE },
1141{ 0xc, 0x05 }, { WAIT_IDLE },
1142{ 0xc, 0x44 }, { WAIT_IDLE },
1143{ 0xc, 0x05 }, { WAIT_IDLE },
1144{ 0xc, 0x05 }, { WAIT_IDLE },
1145{ 0xc, 0x05 }, { WAIT_IDLE },
1146{ 0xc, 0x46 }, { WAIT_IDLE },
1147{ 0xc, 0x05 }, { WAIT_IDLE },
1148{ 0xc, 0x46 }, { WAIT_IDLE },
1149{ 0xc, 0x05 }, { WAIT_IDLE },
1150{ 0xc, 0x46 }, { WAIT_IDLE },
1151{ 0xc, 0x05 }, { WAIT_IDLE },
1152{ 0xc, 0x46 }, { WAIT_IDLE },
1153{ 0xc, 0x05 }, { WAIT_IDLE },
1154{ 0xc, 0x46 }, { WAIT_IDLE },
1155{ 0xc, 0x07 }, { WAIT_IDLE },
1156{ 0xc, 0x46 }, { WAIT_IDLE },
1157{ 0xc, 0x07 }, { WAIT_IDLE },
1158{ 0xc, 0x44 }, { WAIT_IDLE },
1159
1160{ 0x9, 0x05 }, { 0xb, 0x03 }, { 0xa, 0x00 },
1161
1162{ 0xc, 0x07 }, { WAIT_IDLE },
1163{ 0xc, 0x40 }, { WAIT_IDLE },
1164{ 0xc, 0x00 }, { WAIT_IDLE },
1165{ 0xc, 0x00 }, { WAIT_IDLE },
1166{ 0xc, 0x00 }, { WAIT_IDLE },
1167{ 0xc, 0x47 }, { WAIT_IDLE },
1168{ 0xc, 0x00 }, { WAIT_IDLE },
1169{ 0xc, 0x40 }, { WAIT_IDLE },
1170{ 0xc, 0x00 }, { WAIT_IDLE },
1171{ 0xc, 0x40 }, { WAIT_IDLE },
1172{ 0xc, 0x06 }, { WAIT_IDLE },
1173{ 0xc, 0x40 }, { WAIT_IDLE },
1174{ 0xc, 0x00 }, { WAIT_IDLE },
1175{ 0xc, 0x00 }, { WAIT_IDLE },
1176{ 0xc, 0x00 }, { WAIT_IDLE },
1177{ 0xc, 0x00 }, { WAIT_IDLE },
1178{ 0xc, 0x00 }, { WAIT_IDLE },
1179{ 0xc, 0x00 }, { WAIT_IDLE },
1180{ 0xc, 0x00 }, { WAIT_IDLE },
1181{ 0xc, 0x00 }, { WAIT_IDLE },
1182{ 0xc, 0x00 }, { WAIT_IDLE },
1183{ 0xc, 0x00 }, { WAIT_IDLE },
1184{ 0xc, 0x00 }, { WAIT_IDLE },
1185{ 0xc, 0x00 }, { WAIT_IDLE },
1186{ 0xc, 0x00 }, { WAIT_IDLE },
1187{ 0xc, 0x00 }, { WAIT_IDLE },
1188{ 0xc, 0x00 }, { WAIT_IDLE },
1189{ 0xc, 0x00 }, { WAIT_IDLE },
1190{ 0xc, 0x00 }, { WAIT_IDLE },
1191{ 0xc, 0x00 }, { WAIT_IDLE },
1192{ 0xc, 0x00 }, { WAIT_IDLE },
1193{ 0xc, 0x00 }, { WAIT_IDLE },
1194{ 0xc, 0x00 }, { WAIT_IDLE },
1195{ 0xc, 0x00 }, { WAIT_IDLE },
1196{ 0xc, 0x00 }, { WAIT_IDLE },
1197{ 0xc, 0x00 }, { WAIT_IDLE },
1198{ 0xc, 0x00 }, { WAIT_IDLE },
1199{ 0xc, 0x00 }, { WAIT_IDLE },
1200{ 0xc, 0x00 }, { WAIT_IDLE },
1201{ 0xc, 0x00 }, { WAIT_IDLE },
1202{ 0xc, 0x00 }, { WAIT_IDLE },
1203{ 0xc, 0x00 }, { WAIT_IDLE },
1204{ 0xc, 0x00 }, { WAIT_IDLE },
1205{ 0xc, 0x00 }, { WAIT_IDLE },
1206{ 0xc, 0x00 }, { WAIT_IDLE },
1207{ 0xc, 0x00 }, { WAIT_IDLE },
1208{ 0xc, 0x00 }, { WAIT_IDLE },
1209{ 0xc, 0x00 }, { WAIT_IDLE },
1210{ 0xc, 0x00 }, { WAIT_IDLE },
1211{ 0xc, 0x00 }, { WAIT_IDLE },
1212{ 0xc, 0x00 }, { WAIT_IDLE },
1213{ 0xc, 0x00 }, { WAIT_IDLE },
1214{ 0xc, 0x00 }, { WAIT_IDLE },
1215{ 0xc, 0x00 }, { WAIT_IDLE },
1216{ 0xc, 0x00 }, { WAIT_IDLE },
1217{ 0xc, 0x00 }, { WAIT_IDLE },
1218{ 0xc, 0x00 }, { WAIT_IDLE },
1219{ 0xc, 0x00 }, { WAIT_IDLE },
1220{ 0xc, 0x00 }, { WAIT_IDLE },
1221{ 0xc, 0x00 }, { WAIT_IDLE },
1222{ 0xc, 0x00 }, { WAIT_IDLE },
1223{ 0xc, 0x00 }, { WAIT_IDLE },
1224{ 0xc, 0x00 }, { WAIT_IDLE },
1225{ 0xc, 0x00 }, { WAIT_IDLE },
1226{ 0xc, 0x80 }, { WAIT_IDLE },
1227{ 0xc, 0x80 }, { WAIT_IDLE },
1228{ 0xc, 0xc0 }, { WAIT_IDLE },
1229{ 0xc, 0x00 }, { WAIT_IDLE },
1230{ 0xc, 0x00 }, { WAIT_IDLE },
1231{ 0xc, 0x40 }, { WAIT_IDLE },
1232{ 0xc, 0x00 }, { WAIT_IDLE },
1233{ 0xc, 0x00 }, { WAIT_IDLE },
1234{ 0xc, 0x00 }, { WAIT_IDLE },
1235{ 0xc, 0x40 }, { WAIT_IDLE },
1236{ 0xc, 0x00 }, { WAIT_IDLE },
1237{ 0xc, 0x40 }, { WAIT_IDLE },
1238{ 0xc, 0x00 }, { WAIT_IDLE },
1239{ 0xc, 0x60 }, { WAIT_IDLE },
1240{ 0xc, 0x00 }, { WAIT_IDLE },
1241{ 0xc, 0x70 }, { WAIT_IDLE },
1242{ 0xc, 0x00 }, { WAIT_IDLE },
1243{ 0xc, 0x40 }, { WAIT_IDLE },
1244{ 0xc, 0x00 }, { WAIT_IDLE },
1245{ 0xc, 0x40 }, { WAIT_IDLE },
1246{ 0xc, 0x00 }, { WAIT_IDLE },
1247{ 0xc, 0x42 }, { WAIT_IDLE },
1248{ 0xc, 0x00 }, { WAIT_IDLE },
1249{ 0xc, 0x40 }, { WAIT_IDLE },
1250{ 0xc, 0x00 }, { WAIT_IDLE },
1251{ 0xc, 0x02 }, { WAIT_IDLE },
1252{ 0xc, 0x00 }, { WAIT_IDLE },
1253{ 0xc, 0x40 }, { WAIT_IDLE },
1254{ 0xc, 0x00 }, { WAIT_IDLE },
1255{ 0xc, 0x00 }, { WAIT_IDLE },
1256{ 0xc, 0x00 }, { WAIT_IDLE },
1257{ 0xc, 0x40 }, { WAIT_IDLE },
1258{ 0xc, 0x00 }, { WAIT_IDLE },
1259{ 0xc, 0x00 }, { WAIT_IDLE },
1260{ 0xc, 0x00 }, { WAIT_IDLE },
1261{ 0xc, 0x40 }, { WAIT_IDLE },
1262{ 0xc, 0x00 }, { WAIT_IDLE },
1263{ 0xc, 0x00 }, { WAIT_IDLE },
1264{ 0xc, 0x00 }, { WAIT_IDLE },
1265{ 0xc, 0x40 }, { WAIT_IDLE },
1266{ 0xc, 0x00 }, { WAIT_IDLE },
1267{ 0xc, 0x00 }, { WAIT_IDLE },
1268{ 0xc, 0x00 }, { WAIT_IDLE },
1269{ 0xc, 0x40 }, { WAIT_IDLE },
1270{ 0xc, 0x00 }, { WAIT_IDLE },
1271{ 0xc, 0x00 }, { WAIT_IDLE },
1272{ 0xc, 0x00 }, { WAIT_IDLE },
1273{ 0xc, 0x42 }, { WAIT_IDLE },
1274{ 0xc, 0x00 }, { WAIT_IDLE },
1275{ 0xc, 0x40 }, { WAIT_IDLE },
1276{ 0xc, 0x00 }, { WAIT_IDLE },
1277{ 0xc, 0x42 }, { WAIT_IDLE },
1278{ 0xc, 0x00 }, { WAIT_IDLE },
1279{ 0xc, 0x02 }, { WAIT_IDLE },
1280{ 0xc, 0x00 }, { WAIT_IDLE },
1281{ 0xc, 0x02 }, { WAIT_IDLE },
1282{ 0xc, 0x00 }, { WAIT_IDLE },
1283{ 0xc, 0x02 }, { WAIT_IDLE },
1284{ 0xc, 0x00 }, { WAIT_IDLE },
1285{ 0xc, 0x42 }, { WAIT_IDLE },
1286{ 0xc, 0x00 }, { WAIT_IDLE },
1287{ 0xc, 0xc0 }, { WAIT_IDLE },
1288{ 0xc, 0x00 }, { WAIT_IDLE },
1289{ 0xc, 0x40 }, { WAIT_IDLE },
1290
1291{ 0x9, 0x05 }, { 0xb, 0x04 }, { 0xa, 0x00 },
1292
1293{ 0xc, 0x63 }, { WAIT_IDLE },
1294{ 0xc, 0x03 }, { WAIT_IDLE },
1295{ 0xc, 0x26 }, { WAIT_IDLE },
1296{ 0xc, 0x02 }, { WAIT_IDLE },
1297{ 0xc, 0x2c }, { WAIT_IDLE },
1298{ 0xc, 0x00 }, { WAIT_IDLE },
1299{ 0xc, 0x24 }, { WAIT_IDLE },
1300{ 0xc, 0x00 }, { WAIT_IDLE },
1301{ 0xc, 0x2e }, { WAIT_IDLE },
1302{ 0xc, 0x02 }, { WAIT_IDLE },
1303{ 0xc, 0x02 }, { WAIT_IDLE },
1304{ 0xc, 0x02 }, { WAIT_IDLE },
1305{ 0xc, 0x00 }, { WAIT_IDLE },
1306{ 0xc, 0x00 }, { WAIT_IDLE },
1307{ 0xc, 0x00 }, { WAIT_IDLE },
1308{ 0xc, 0x00 }, { WAIT_IDLE },
1309{ 0xc, 0x00 }, { WAIT_IDLE },
1310{ 0xc, 0x00 }, { WAIT_IDLE },
1311{ 0xc, 0x00 }, { WAIT_IDLE },
1312{ 0xc, 0x00 }, { WAIT_IDLE },
1313{ 0xc, 0x00 }, { WAIT_IDLE },
1314{ 0xc, 0x00 }, { WAIT_IDLE },
1315{ 0xc, 0x00 }, { WAIT_IDLE },
1316{ 0xc, 0x00 }, { WAIT_IDLE },
1317{ 0xc, 0x00 }, { WAIT_IDLE },
1318{ 0xc, 0x00 }, { WAIT_IDLE },
1319{ 0xc, 0x00 }, { WAIT_IDLE },
1320{ 0xc, 0x00 }, { WAIT_IDLE },
1321{ 0xc, 0x00 }, { WAIT_IDLE },
1322{ 0xc, 0x00 }, { WAIT_IDLE },
1323{ 0xc, 0x00 }, { WAIT_IDLE },
1324{ 0xc, 0x00 }, { WAIT_IDLE },
1325{ 0xc, 0x00 }, { WAIT_IDLE },
1326{ 0xc, 0x00 }, { WAIT_IDLE },
1327{ 0xc, 0x00 }, { WAIT_IDLE },
1328{ 0xc, 0x00 }, { WAIT_IDLE },
1329{ 0xc, 0x00 }, { WAIT_IDLE },
1330{ 0xc, 0x00 }, { WAIT_IDLE },
1331{ 0xc, 0x00 }, { WAIT_IDLE },
1332{ 0xc, 0x00 }, { WAIT_IDLE },
1333{ 0xc, 0x00 }, { WAIT_IDLE },
1334{ 0xc, 0x00 }, { WAIT_IDLE },
1335{ 0xc, 0x00 }, { WAIT_IDLE },
1336{ 0xc, 0x00 }, { WAIT_IDLE },
1337{ 0xc, 0x00 }, { WAIT_IDLE },
1338{ 0xc, 0x00 }, { WAIT_IDLE },
1339{ 0xc, 0x00 }, { WAIT_IDLE },
1340{ 0xc, 0x00 }, { WAIT_IDLE },
1341{ 0xc, 0x00 }, { WAIT_IDLE },
1342{ 0xc, 0x00 }, { WAIT_IDLE },
1343{ 0xc, 0x00 }, { WAIT_IDLE },
1344{ 0xc, 0x00 }, { WAIT_IDLE },
1345{ 0xc, 0x00 }, { WAIT_IDLE },
1346{ 0xc, 0x00 }, { WAIT_IDLE },
1347{ 0xc, 0x00 }, { WAIT_IDLE },
1348{ 0xc, 0x00 }, { WAIT_IDLE },
1349{ 0xc, 0x00 }, { WAIT_IDLE },
1350{ 0xc, 0x00 }, { WAIT_IDLE },
1351{ 0xc, 0x00 }, { WAIT_IDLE },
1352{ 0xc, 0x00 }, { WAIT_IDLE },
1353{ 0xc, 0x00 }, { WAIT_IDLE },
1354{ 0xc, 0x00 }, { WAIT_IDLE },
1355{ 0xc, 0x00 }, { WAIT_IDLE },
1356{ 0xc, 0x00 }, { WAIT_IDLE },
1357{ 0xc, 0x00 }, { WAIT_IDLE },
1358{ 0xc, 0x01 }, { WAIT_IDLE },
1359{ 0xc, 0x20 }, { WAIT_IDLE },
1360{ 0xc, 0x00 }, { WAIT_IDLE },
1361{ 0xc, 0x60 }, { WAIT_IDLE },
1362{ 0xc, 0x00 }, { WAIT_IDLE },
1363{ 0xc, 0x20 }, { WAIT_IDLE },
1364{ 0xc, 0x00 }, { WAIT_IDLE },
1365{ 0xc, 0x20 }, { WAIT_IDLE },
1366{ 0xc, 0x00 }, { WAIT_IDLE },
1367{ 0xc, 0x20 }, { WAIT_IDLE },
1368{ 0xc, 0x00 }, { WAIT_IDLE },
1369{ 0xc, 0x20 }, { WAIT_IDLE },
1370{ 0xc, 0x00 }, { WAIT_IDLE },
1371{ 0xc, 0x20 }, { WAIT_IDLE },
1372{ 0xc, 0x00 }, { WAIT_IDLE },
1373{ 0xc, 0x20 }, { WAIT_IDLE },
1374{ 0xc, 0x00 }, { WAIT_IDLE },
1375{ 0xc, 0x20 }, { WAIT_IDLE },
1376{ 0xc, 0x00 }, { WAIT_IDLE },
1377{ 0xc, 0x20 }, { WAIT_IDLE },
1378{ 0xc, 0x00 }, { WAIT_IDLE },
1379{ 0xc, 0x60 }, { WAIT_IDLE },
1380{ 0xc, 0x00 }, { WAIT_IDLE },
1381{ 0xc, 0x20 }, { WAIT_IDLE },
1382{ 0xc, 0x00 }, { WAIT_IDLE },
1383{ 0xc, 0x60 }, { WAIT_IDLE },
1384{ 0xc, 0x00 }, { WAIT_IDLE },
1385{ 0xc, 0x20 }, { WAIT_IDLE },
1386{ 0xc, 0x00 }, { WAIT_IDLE },
1387{ 0xc, 0x60 }, { WAIT_IDLE },
1388{ 0xc, 0x00 }, { WAIT_IDLE },
1389{ 0xc, 0x20 }, { WAIT_IDLE },
1390{ 0xc, 0x00 }, { WAIT_IDLE },
1391{ 0xc, 0x60 }, { WAIT_IDLE },
1392{ 0xc, 0x00 }, { WAIT_IDLE },
1393{ 0xc, 0x20 }, { WAIT_IDLE },
1394{ 0xc, 0x00 }, { WAIT_IDLE },
1395{ 0xc, 0x60 }, { WAIT_IDLE },
1396{ 0xc, 0x00 }, { WAIT_IDLE },
1397{ 0xc, 0x20 }, { WAIT_IDLE },
1398{ 0xc, 0x00 }, { WAIT_IDLE },
1399{ 0xc, 0x60 }, { WAIT_IDLE },
1400{ 0xc, 0x00 }, { WAIT_IDLE },
1401{ 0xc, 0x20 }, { WAIT_IDLE },
1402{ 0xc, 0x00 }, { WAIT_IDLE },
1403{ 0xc, 0x20 }, { WAIT_IDLE },
1404{ 0xc, 0x00 }, { WAIT_IDLE },
1405{ 0xc, 0x22 }, { WAIT_IDLE },
1406{ 0xc, 0x02 }, { WAIT_IDLE },
1407{ 0xc, 0x22 }, { WAIT_IDLE },
1408{ 0xc, 0x02 }, { WAIT_IDLE },
1409{ 0xc, 0x20 }, { WAIT_IDLE },
1410{ 0xc, 0x00 }, { WAIT_IDLE },
1411{ 0xc, 0x60 }, { WAIT_IDLE },
1412{ 0xc, 0x00 }, { WAIT_IDLE },
1413{ 0xc, 0x22 }, { WAIT_IDLE },
1414{ 0xc, 0x02 }, { WAIT_IDLE },
1415{ 0xc, 0x62 }, { WAIT_IDLE },
1416{ 0xc, 0x02 }, { WAIT_IDLE },
1417{ 0xc, 0x20 }, { WAIT_IDLE },
1418{ 0xc, 0x01 }, { WAIT_IDLE },
1419{ 0xc, 0x21 }, { WAIT_IDLE },
1420{ 0xc, 0x01 }, { WAIT_IDLE },
1421
1422/* Load memory area (page six) */
1423{ 0x9, 0x01 }, { 0xb, 0x06 },
1424
1425{ 0xa, 0x00 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1426{ 0xa, 0x02 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1427{ 0xa, 0x04 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1428{ 0xa, 0x06 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1429{ 0xa, 0x08 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1430{ 0xa, 0x0a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1431{ 0xa, 0x0c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1432{ 0xa, 0x0e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1433{ 0xa, 0x10 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1434{ 0xa, 0x12 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1435{ 0xa, 0x14 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1436{ 0xa, 0x16 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1437{ 0xa, 0x18 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1438{ 0xa, 0x1a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1439{ 0xa, 0x1c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1440{ 0xa, 0x1e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1441{ 0xa, 0x20 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1442{ 0xa, 0x22 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1443{ 0xa, 0x24 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1444{ 0xa, 0x26 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1445{ 0xa, 0x28 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1446{ 0xa, 0x2a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1447{ 0xa, 0x2c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1448{ 0xa, 0x2e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1449{ 0xa, 0x30 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1450{ 0xa, 0x32 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1451{ 0xa, 0x34 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1452{ 0xa, 0x36 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1453{ 0xa, 0x38 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1454{ 0xa, 0x3a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1455{ 0xa, 0x3c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1456{ 0xa, 0x3e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1457{ 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1458{ 0xa, 0x42 }, { 0xd, 0x03 }, { 0xc, 0x00 }, { WAIT_IDLE },
1459{ 0xa, 0x44 }, { 0xd, 0x01 }, { 0xc, 0x00 }, { WAIT_IDLE },
1460{ 0xa, 0x46 }, { 0xd, 0x0a }, { 0xc, 0x21 }, { WAIT_IDLE },
1461{ 0xa, 0x48 }, { 0xd, 0x0d }, { 0xc, 0x23 }, { WAIT_IDLE },
1462{ 0xa, 0x4a }, { 0xd, 0x23 }, { 0xc, 0x1b }, { WAIT_IDLE },
1463{ 0xa, 0x4c }, { 0xd, 0x37 }, { 0xc, 0x8f }, { WAIT_IDLE },
1464{ 0xa, 0x4e }, { 0xd, 0x45 }, { 0xc, 0x77 }, { WAIT_IDLE },
1465{ 0xa, 0x50 }, { 0xd, 0x52 }, { 0xc, 0xe2 }, { WAIT_IDLE },
1466{ 0xa, 0x52 }, { 0xd, 0x1c }, { 0xc, 0x92 }, { WAIT_IDLE },
1467{ 0xa, 0x54 }, { 0xd, 0x1c }, { 0xc, 0x52 }, { WAIT_IDLE },
1468{ 0xa, 0x56 }, { 0xd, 0x07 }, { 0xc, 0x00 }, { WAIT_IDLE },
1469{ 0xa, 0x58 }, { 0xd, 0x2f }, { 0xc, 0xc6 }, { WAIT_IDLE },
1470{ 0xa, 0x5a }, { 0xd, 0x0b }, { 0xc, 0x00 }, { WAIT_IDLE },
1471{ 0xa, 0x5c }, { 0xd, 0x30 }, { 0xc, 0x06 }, { WAIT_IDLE },
1472{ 0xa, 0x5e }, { 0xd, 0x17 }, { 0xc, 0x00 }, { WAIT_IDLE },
1473{ 0xa, 0x60 }, { 0xd, 0x3d }, { 0xc, 0xda }, { WAIT_IDLE },
1474{ 0xa, 0x62 }, { 0xd, 0x29 }, { 0xc, 0x00 }, { WAIT_IDLE },
1475{ 0xa, 0x64 }, { 0xd, 0x3e }, { 0xc, 0x41 }, { WAIT_IDLE },
1476{ 0xa, 0x66 }, { 0xd, 0x39 }, { 0xc, 0x00 }, { WAIT_IDLE },
1477{ 0xa, 0x68 }, { 0xd, 0x4c }, { 0xc, 0x48 }, { WAIT_IDLE },
1478{ 0xa, 0x6a }, { 0xd, 0x49 }, { 0xc, 0x00 }, { WAIT_IDLE },
1479{ 0xa, 0x6c }, { 0xd, 0x4c }, { 0xc, 0x6c }, { WAIT_IDLE },
1480{ 0xa, 0x6e }, { 0xd, 0x11 }, { 0xc, 0xd2 }, { WAIT_IDLE },
1481{ 0xa, 0x70 }, { 0xd, 0x16 }, { 0xc, 0x0c }, { WAIT_IDLE },
1482{ 0xa, 0x72 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1483{ 0xa, 0x74 }, { 0xd, 0x00 }, { 0xc, 0x80 }, { WAIT_IDLE },
1484{ 0xa, 0x76 }, { 0xd, 0x0f }, { 0xc, 0x00 }, { WAIT_IDLE },
1485{ 0xa, 0x78 }, { 0xd, 0x00 }, { 0xc, 0x80 }, { WAIT_IDLE },
1486{ 0xa, 0x7a }, { 0xd, 0x13 }, { 0xc, 0x00 }, { WAIT_IDLE },
1487{ 0xa, 0x7c }, { 0xd, 0x80 }, { 0xc, 0x00 }, { WAIT_IDLE },
1488{ 0xa, 0x7e }, { 0xd, 0x80 }, { 0xc, 0x80 }, { WAIT_IDLE },
1489
1490{ 0x9, 0x05 }, { 0xb, 0x07 }, { 0xa, 0x00 },
1491
1492{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1493{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1494{ 0xd, 0x08 }, { 0xc, 0x00 }, { WAIT_IDLE },
1495{ 0xd, 0x08 }, { 0xc, 0x00 }, { WAIT_IDLE },
1496{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
1497{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1498{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1499{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1500{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1501{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1502{ 0xd, 0x08 }, { 0xc, 0x00 }, { WAIT_IDLE },
1503{ 0xd, 0x08 }, { 0xc, 0x00 }, { WAIT_IDLE },
1504{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1505{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1506{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1507{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1508{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1509{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1510{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1511{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1512{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1513{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1514{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1515{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1516{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1517{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1518{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1519{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1520{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1521{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1522{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1523{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1524{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1525{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1526{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1527{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1528{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1529{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1530{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1531{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1532{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1533{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1534{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1535{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1536{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1537{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1538{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1539{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1540{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1541{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1542{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1543{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1544{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1545{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1546{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1547{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1548{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1549{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1550{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1551{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1552{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1553{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1554{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1555{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1556{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1557{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1558{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1559{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1560{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1561{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1562{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1563{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1564{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1565{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1566{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1567{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1568{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1569{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1570{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1571{ 0xd, 0x02 }, { 0xc, 0xe9 }, { WAIT_IDLE },
1572{ 0xd, 0x06 }, { 0xc, 0x8c }, { WAIT_IDLE },
1573{ 0xd, 0x06 }, { 0xc, 0x8c }, { WAIT_IDLE },
1574{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1575{ 0xd, 0x1a }, { 0xc, 0x75 }, { WAIT_IDLE },
1576{ 0xd, 0x0d }, { 0xc, 0x8b }, { WAIT_IDLE },
1577{ 0xd, 0x04 }, { 0xc, 0xe9 }, { WAIT_IDLE },
1578{ 0xd, 0x0b }, { 0xc, 0x16 }, { WAIT_IDLE },
1579{ 0xd, 0x1a }, { 0xc, 0x38 }, { WAIT_IDLE },
1580{ 0xd, 0x0d }, { 0xc, 0xc8 }, { WAIT_IDLE },
1581{ 0xd, 0x04 }, { 0xc, 0x6f }, { WAIT_IDLE },
1582{ 0xd, 0x0b }, { 0xc, 0x91 }, { WAIT_IDLE },
1583{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1584{ 0xd, 0x06 }, { 0xc, 0x40 }, { WAIT_IDLE },
1585{ 0xd, 0x06 }, { 0xc, 0x40 }, { WAIT_IDLE },
1586{ 0xd, 0x02 }, { 0xc, 0x8f }, { WAIT_IDLE },
1587{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1588{ 0xd, 0x06 }, { 0xc, 0x62 }, { WAIT_IDLE },
1589{ 0xd, 0x06 }, { 0xc, 0x62 }, { WAIT_IDLE },
1590{ 0xd, 0x02 }, { 0xc, 0x7b }, { WAIT_IDLE },
1591{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1592{ 0xd, 0x06 }, { 0xc, 0x97 }, { WAIT_IDLE },
1593{ 0xd, 0x06 }, { 0xc, 0x97 }, { WAIT_IDLE },
1594{ 0xd, 0x02 }, { 0xc, 0x52 }, { WAIT_IDLE },
1595{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1596{ 0xd, 0x06 }, { 0xc, 0xf6 }, { WAIT_IDLE },
1597{ 0xd, 0x06 }, { 0xc, 0xf6 }, { WAIT_IDLE },
1598{ 0xd, 0x02 }, { 0xc, 0x19 }, { WAIT_IDLE },
1599{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1600{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1601{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1602{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1603{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1604{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1605{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1606{ 0xd, 0x05 }, { 0xc, 0x55 }, { WAIT_IDLE },
1607{ 0xd, 0x14 }, { 0xc, 0xda }, { WAIT_IDLE },
1608{ 0xd, 0x0d }, { 0xc, 0x93 }, { WAIT_IDLE },
1609{ 0xd, 0x04 }, { 0xc, 0xda }, { WAIT_IDLE },
1610{ 0xd, 0x05 }, { 0xc, 0x93 }, { WAIT_IDLE },
1611{ 0xd, 0x14 }, { 0xc, 0xda }, { WAIT_IDLE },
1612{ 0xd, 0x0d }, { 0xc, 0x93 }, { WAIT_IDLE },
1613{ 0xd, 0x04 }, { 0xc, 0xda }, { WAIT_IDLE },
1614{ 0xd, 0x05 }, { 0xc, 0x93 }, { WAIT_IDLE },
1615{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1616{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1617{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1618{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1619{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
1620
1621/* Now setup the MOD area. */
1622{ 0xe, 0x01 }, { 0xf, 0x00 }, { WAIT_IDLE },
1623{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1624{ 0xe, 0x01 }, { 0xf, 0x01 }, { WAIT_IDLE },
1625{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1626{ 0xe, 0x01 }, { 0xf, 0x02 }, { WAIT_IDLE },
1627{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1628{ 0xe, 0x01 }, { 0xf, 0x03 }, { WAIT_IDLE },
1629{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1630{ 0xe, 0x01 }, { 0xf, 0x04 }, { WAIT_IDLE },
1631{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1632{ 0xe, 0x01 }, { 0xf, 0x05 }, { WAIT_IDLE },
1633{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1634{ 0xe, 0x01 }, { 0xf, 0x06 }, { WAIT_IDLE },
1635{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1636{ 0xe, 0x01 }, { 0xf, 0x07 }, { WAIT_IDLE },
1637{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1638{ 0xe, 0x01 }, { 0xf, 0x08 }, { WAIT_IDLE },
1639{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1640{ 0xe, 0x01 }, { 0xf, 0x09 }, { WAIT_IDLE },
1641{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1642{ 0xe, 0x01 }, { 0xf, 0x0a }, { WAIT_IDLE },
1643{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1644{ 0xe, 0x01 }, { 0xf, 0x0b }, { WAIT_IDLE },
1645{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1646{ 0xe, 0x01 }, { 0xf, 0x0c }, { WAIT_IDLE },
1647{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1648{ 0xe, 0x01 }, { 0xf, 0x0d }, { WAIT_IDLE },
1649{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1650{ 0xe, 0x01 }, { 0xf, 0x0e }, { WAIT_IDLE },
1651{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1652{ 0xe, 0x01 }, { 0xf, 0x0f }, { WAIT_IDLE },
1653{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
1654
1655{ 0xe, 0xb0 }, { 0xf, 0x20 }, { WAIT_IDLE },
1656{ 0xe, 0xb1 }, { 0xf, 0x20 }, { WAIT_IDLE },
1657{ 0xe, 0xb2 }, { 0xf, 0x20 }, { WAIT_IDLE },
1658{ 0xe, 0xb3 }, { 0xf, 0x20 }, { WAIT_IDLE },
1659{ 0xe, 0xb4 }, { 0xf, 0x20 }, { WAIT_IDLE },
1660{ 0xe, 0xb5 }, { 0xf, 0x20 }, { WAIT_IDLE },
1661{ 0xe, 0xb6 }, { 0xf, 0x20 }, { WAIT_IDLE },
1662{ 0xe, 0xb7 }, { 0xf, 0x20 }, { WAIT_IDLE },
1663{ 0xe, 0xb8 }, { 0xf, 0x20 }, { WAIT_IDLE },
1664{ 0xe, 0xb9 }, { 0xf, 0x20 }, { WAIT_IDLE },
1665{ 0xe, 0xba }, { 0xf, 0x20 }, { WAIT_IDLE },
1666{ 0xe, 0xbb }, { 0xf, 0x20 }, { WAIT_IDLE },
1667{ 0xe, 0xbc }, { 0xf, 0x20 }, { WAIT_IDLE },
1668{ 0xe, 0xbd }, { 0xf, 0x20 }, { WAIT_IDLE },
1669{ 0xe, 0xbe }, { 0xf, 0x20 }, { WAIT_IDLE },
1670{ 0xe, 0xbf }, { 0xf, 0x20 }, { WAIT_IDLE },
1671
1672{ 0xe, 0xf0 }, { 0xf, 0x20 }, { WAIT_IDLE },
1673{ 0xe, 0xf1 }, { 0xf, 0x20 }, { WAIT_IDLE },
1674{ 0xe, 0xf2 }, { 0xf, 0x20 }, { WAIT_IDLE },
1675{ 0xe, 0xf3 }, { 0xf, 0x20 }, { WAIT_IDLE },
1676{ 0xe, 0xf4 }, { 0xf, 0x20 }, { WAIT_IDLE },
1677{ 0xe, 0xf5 }, { 0xf, 0x20 }, { WAIT_IDLE },
1678{ 0xe, 0xf6 }, { 0xf, 0x20 }, { WAIT_IDLE },
1679{ 0xe, 0xf7 }, { 0xf, 0x20 }, { WAIT_IDLE },
1680{ 0xe, 0xf8 }, { 0xf, 0x20 }, { WAIT_IDLE },
1681{ 0xe, 0xf9 }, { 0xf, 0x20 }, { WAIT_IDLE },
1682{ 0xe, 0xfa }, { 0xf, 0x20 }, { WAIT_IDLE },
1683{ 0xe, 0xfb }, { 0xf, 0x20 }, { WAIT_IDLE },
1684{ 0xe, 0xfc }, { 0xf, 0x20 }, { WAIT_IDLE },
1685{ 0xe, 0xfd }, { 0xf, 0x20 }, { WAIT_IDLE },
1686{ 0xe, 0xfe }, { 0xf, 0x20 }, { WAIT_IDLE },
1687{ 0xe, 0xff }, { 0xf, 0x20 }, { WAIT_IDLE },
1688
1689{ 0xe, 0x10 }, { 0xf, 0xff }, { WAIT_IDLE },
1690{ 0xe, 0x11 }, { 0xf, 0xff }, { WAIT_IDLE },
1691{ 0xe, 0x12 }, { 0xf, 0xff }, { WAIT_IDLE },
1692{ 0xe, 0x13 }, { 0xf, 0xff }, { WAIT_IDLE },
1693{ 0xe, 0x14 }, { 0xf, 0xff }, { WAIT_IDLE },
1694{ 0xe, 0x15 }, { 0xf, 0xff }, { WAIT_IDLE },
1695{ 0xe, 0x16 }, { 0xf, 0xff }, { WAIT_IDLE },
1696{ 0xe, 0x17 }, { 0xf, 0xff }, { WAIT_IDLE },
1697{ 0xe, 0x18 }, { 0xf, 0xff }, { WAIT_IDLE },
1698{ 0xe, 0x19 }, { 0xf, 0xff }, { WAIT_IDLE },
1699{ 0xe, 0x1a }, { 0xf, 0xff }, { WAIT_IDLE },
1700{ 0xe, 0x1b }, { 0xf, 0xff }, { WAIT_IDLE },
1701{ 0xe, 0x1c }, { 0xf, 0xff }, { WAIT_IDLE },
1702{ 0xe, 0x1d }, { 0xf, 0xff }, { WAIT_IDLE },
1703{ 0xe, 0x1e }, { 0xf, 0x40 }, { WAIT_IDLE },
1704{ 0xe, 0x1f }, { 0xf, 0xff }, { WAIT_IDLE },
1705{ 0xe, 0x20 }, { 0xf, 0xff }, { WAIT_IDLE },
1706{ 0xe, 0x21 }, { 0xf, 0xff }, { WAIT_IDLE },
1707{ 0xe, 0x22 }, { 0xf, 0xff }, { WAIT_IDLE },
1708{ 0xe, 0x23 }, { 0xf, 0xff }, { WAIT_IDLE },
1709{ 0xe, 0x24 }, { 0xf, 0xff }, { WAIT_IDLE },
1710{ 0xe, 0x25 }, { 0xf, 0xff }, { WAIT_IDLE },
1711{ 0xe, 0x26 }, { 0xf, 0xff }, { WAIT_IDLE },
1712{ 0xe, 0x27 }, { 0xf, 0xff }, { WAIT_IDLE },
1713{ 0xe, 0x28 }, { 0xf, 0xff }, { WAIT_IDLE },
1714{ 0xe, 0x29 }, { 0xf, 0xff }, { WAIT_IDLE },
1715{ 0xe, 0x2a }, { 0xf, 0xff }, { WAIT_IDLE },
1716{ 0xe, 0x2b }, { 0xf, 0xff }, { WAIT_IDLE },
1717{ 0xe, 0x2c }, { 0xf, 0xff }, { WAIT_IDLE },
1718{ 0xe, 0x2d }, { 0xf, 0xff }, { WAIT_IDLE },
1719{ 0xe, 0x2e }, { 0xf, 0x00 }, { WAIT_IDLE },
1720{ 0xe, 0x2f }, { 0xf, 0x00 }, { WAIT_IDLE },
1721{ 0xe, 0x30 }, { 0xf, 0x00 }, { WAIT_IDLE },
1722{ 0xe, 0x31 }, { 0xf, 0x00 }, { WAIT_IDLE },
1723{ 0xe, 0x32 }, { 0xf, 0x00 }, { WAIT_IDLE },
1724{ 0xe, 0x33 }, { 0xf, 0x00 }, { WAIT_IDLE },
1725{ 0xe, 0x34 }, { 0xf, 0x00 }, { WAIT_IDLE },
1726{ 0xe, 0x35 }, { 0xf, 0x00 }, { WAIT_IDLE },
1727{ 0xe, 0x36 }, { 0xf, 0x00 }, { WAIT_IDLE },
1728{ 0xe, 0x37 }, { 0xf, 0x00 }, { WAIT_IDLE },
1729{ 0xe, 0x38 }, { 0xf, 0x00 }, { WAIT_IDLE },
1730{ 0xe, 0x39 }, { 0xf, 0x00 }, { WAIT_IDLE },
1731{ 0xe, 0x3a }, { 0xf, 0x00 }, { WAIT_IDLE },
1732{ 0xe, 0x3b }, { 0xf, 0x00 }, { WAIT_IDLE },
1733{ 0xe, 0x3c }, { 0xf, 0x00 }, { WAIT_IDLE },
1734{ 0xe, 0x3d }, { 0xf, 0x00 }, { WAIT_IDLE },
1735{ 0xe, 0x3e }, { 0xf, 0x00 }, { WAIT_IDLE },
1736{ 0xe, 0x3f }, { 0xf, 0x20 }, { WAIT_IDLE },
1737{ 0xe, 0x40 }, { 0xf, 0x00 }, { WAIT_IDLE },
1738{ 0xe, 0x41 }, { 0xf, 0x00 }, { WAIT_IDLE },
1739{ 0xe, 0x42 }, { 0xf, 0x00 }, { WAIT_IDLE },
1740{ 0xe, 0x43 }, { 0xf, 0x00 }, { WAIT_IDLE },
1741{ 0xe, 0x44 }, { 0xf, 0x00 }, { WAIT_IDLE },
1742{ 0xe, 0x45 }, { 0xf, 0x00 }, { WAIT_IDLE },
1743{ 0xe, 0x46 }, { 0xf, 0x00 }, { WAIT_IDLE },
1744{ 0xe, 0x47 }, { 0xf, 0x00 }, { WAIT_IDLE },
1745{ 0xe, 0x48 }, { 0xf, 0x00 }, { WAIT_IDLE },
1746{ 0xe, 0x49 }, { 0xf, 0x00 }, { WAIT_IDLE },
1747{ 0xe, 0x4a }, { 0xf, 0x00 }, { WAIT_IDLE },
1748{ 0xe, 0x4b }, { 0xf, 0x00 }, { WAIT_IDLE },
1749{ 0xe, 0x4c }, { 0xf, 0x00 }, { WAIT_IDLE },
1750{ 0xe, 0x4d }, { 0xf, 0x00 }, { WAIT_IDLE },
1751{ 0xe, 0x4e }, { 0xf, 0x0e }, { WAIT_IDLE },
1752{ 0xe, 0x4f }, { 0xf, 0x0e }, { WAIT_IDLE },
1753{ 0xe, 0x50 }, { 0xf, 0x00 }, { WAIT_IDLE },
1754{ 0xe, 0x51 }, { 0xf, 0x00 }, { WAIT_IDLE },
1755{ 0xe, 0x52 }, { 0xf, 0x00 }, { WAIT_IDLE },
1756{ 0xe, 0x53 }, { 0xf, 0x00 }, { WAIT_IDLE },
1757{ 0xe, 0x54 }, { 0xf, 0x00 }, { WAIT_IDLE },
1758{ 0xe, 0x55 }, { 0xf, 0x00 }, { WAIT_IDLE },
1759{ 0xe, 0x56 }, { 0xf, 0x00 }, { WAIT_IDLE },
1760{ 0xe, 0x57 }, { 0xf, 0x00 }, { WAIT_IDLE },
1761{ 0xe, 0x58 }, { 0xf, 0x00 }, { WAIT_IDLE },
1762{ 0xe, 0x59 }, { 0xf, 0x00 }, { WAIT_IDLE },
1763{ 0xe, 0x5a }, { 0xf, 0x00 }, { WAIT_IDLE },
1764{ 0xe, 0x5b }, { 0xf, 0x00 }, { WAIT_IDLE },
1765{ 0xe, 0x5c }, { 0xf, 0x00 }, { WAIT_IDLE },
1766{ 0xe, 0x5d }, { 0xf, 0x00 }, { WAIT_IDLE },
1767{ 0xe, 0x5e }, { 0xf, 0x00 }, { WAIT_IDLE },
1768{ 0xe, 0x5f }, { 0xf, 0x00 }, { WAIT_IDLE },
1769{ 0xe, 0x60 }, { 0xf, 0x00 }, { WAIT_IDLE },
1770{ 0xe, 0x61 }, { 0xf, 0x00 }, { WAIT_IDLE },
1771{ 0xe, 0x62 }, { 0xf, 0x00 }, { WAIT_IDLE },
1772{ 0xe, 0x63 }, { 0xf, 0x00 }, { WAIT_IDLE },
1773{ 0xe, 0x64 }, { 0xf, 0x00 }, { WAIT_IDLE },
1774{ 0xe, 0x65 }, { 0xf, 0x00 }, { WAIT_IDLE },
1775{ 0xe, 0x66 }, { 0xf, 0x00 }, { WAIT_IDLE },
1776{ 0xe, 0x67 }, { 0xf, 0x00 }, { WAIT_IDLE },
1777{ 0xe, 0x68 }, { 0xf, 0x00 }, { WAIT_IDLE },
1778{ 0xe, 0x69 }, { 0xf, 0x00 }, { WAIT_IDLE },
1779{ 0xe, 0x6a }, { 0xf, 0x00 }, { WAIT_IDLE },
1780{ 0xe, 0x6b }, { 0xf, 0x00 }, { WAIT_IDLE },
1781{ 0xe, 0x6c }, { 0xf, 0x40 }, { WAIT_IDLE },
1782{ 0xe, 0x6d }, { 0xf, 0x00 }, { WAIT_IDLE },
1783{ 0xe, 0x6e }, { 0xf, 0x40 }, { WAIT_IDLE },
1784{ 0xe, 0x6f }, { 0xf, 0x40 }, { WAIT_IDLE },
1785{ 0xe, 0x70 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1786{ 0xe, 0x71 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1787{ 0xe, 0x72 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1788{ 0xe, 0x73 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1789{ 0xe, 0x74 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1790{ 0xe, 0x75 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1791{ 0xe, 0x76 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1792{ 0xe, 0x77 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1793{ 0xe, 0x78 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1794{ 0xe, 0x79 }, { 0xf, 0xc0 }, { WAIT_IDLE },
1795{ 0xe, 0x7a }, { 0xf, 0xc0 }, { WAIT_IDLE },
1796{ 0xe, 0x7b }, { 0xf, 0xc0 }, { WAIT_IDLE },
1797{ 0xe, 0x7c }, { 0xf, 0xc0 }, { WAIT_IDLE },
1798{ 0xe, 0x7d }, { 0xf, 0xc0 }, { WAIT_IDLE },
1799{ 0xe, 0x7e }, { 0xf, 0xc0 }, { WAIT_IDLE },
1800{ 0xe, 0x7f }, { 0xf, 0xc0 }, { WAIT_IDLE },
1801{ 0xe, 0x80 }, { 0xf, 0x00 }, { WAIT_IDLE },
1802{ 0xe, 0x81 }, { 0xf, 0x00 }, { WAIT_IDLE },
1803{ 0xe, 0x82 }, { 0xf, 0x00 }, { WAIT_IDLE },
1804{ 0xe, 0x83 }, { 0xf, 0x00 }, { WAIT_IDLE },
1805{ 0xe, 0x84 }, { 0xf, 0x00 }, { WAIT_IDLE },
1806{ 0xe, 0x85 }, { 0xf, 0x00 }, { WAIT_IDLE },
1807{ 0xe, 0x86 }, { 0xf, 0x00 }, { WAIT_IDLE },
1808{ 0xe, 0x87 }, { 0xf, 0x00 }, { WAIT_IDLE },
1809{ 0xe, 0x88 }, { 0xf, 0x00 }, { WAIT_IDLE },
1810{ 0xe, 0x89 }, { 0xf, 0x00 }, { WAIT_IDLE },
1811{ 0xe, 0x8a }, { 0xf, 0x00 }, { WAIT_IDLE },
1812{ 0xe, 0x8b }, { 0xf, 0x00 }, { WAIT_IDLE },
1813{ 0xe, 0x8c }, { 0xf, 0x00 }, { WAIT_IDLE },
1814{ 0xe, 0x8d }, { 0xf, 0x00 }, { WAIT_IDLE },
1815{ 0xe, 0x8e }, { 0xf, 0x00 }, { WAIT_IDLE },
1816{ 0xe, 0x8f }, { 0xf, 0x00 }, { WAIT_IDLE },
1817{ 0xe, 0x90 }, { 0xf, 0x00 }, { WAIT_IDLE },
1818{ 0xe, 0x91 }, { 0xf, 0x00 }, { WAIT_IDLE },
1819{ 0xe, 0x92 }, { 0xf, 0x00 }, { WAIT_IDLE },
1820{ 0xe, 0x93 }, { 0xf, 0x00 }, { WAIT_IDLE },
1821{ 0xe, 0x94 }, { 0xf, 0x00 }, { WAIT_IDLE },
1822{ 0xe, 0x95 }, { 0xf, 0x00 }, { WAIT_IDLE },
1823{ 0xe, 0x96 }, { 0xf, 0x00 }, { WAIT_IDLE },
1824{ 0xe, 0x97 }, { 0xf, 0x00 }, { WAIT_IDLE },
1825{ 0xe, 0x98 }, { 0xf, 0x00 }, { WAIT_IDLE },
1826{ 0xe, 0x99 }, { 0xf, 0x00 }, { WAIT_IDLE },
1827{ 0xe, 0x9a }, { 0xf, 0x00 }, { WAIT_IDLE },
1828{ 0xe, 0x9b }, { 0xf, 0x00 }, { WAIT_IDLE },
1829{ 0xe, 0x9c }, { 0xf, 0x00 }, { WAIT_IDLE },
1830{ 0xe, 0x9d }, { 0xf, 0x00 }, { WAIT_IDLE },
1831{ 0xe, 0x9e }, { 0xf, 0x00 }, { WAIT_IDLE },
1832{ 0xe, 0x9f }, { 0xf, 0x00 }, { WAIT_IDLE },
1833{ 0xe, 0xa0 }, { 0xf, 0x00 }, { WAIT_IDLE },
1834{ 0xe, 0xa1 }, { 0xf, 0x00 }, { WAIT_IDLE },
1835{ 0xe, 0xa2 }, { 0xf, 0x00 }, { WAIT_IDLE },
1836{ 0xe, 0xa3 }, { 0xf, 0x00 }, { WAIT_IDLE },
1837{ 0xe, 0xa4 }, { 0xf, 0x00 }, { WAIT_IDLE },
1838{ 0xe, 0xa5 }, { 0xf, 0x00 }, { WAIT_IDLE },
1839{ 0xe, 0xa6 }, { 0xf, 0x00 }, { WAIT_IDLE },
1840{ 0xe, 0xa7 }, { 0xf, 0x00 }, { WAIT_IDLE },
1841{ 0xe, 0xa8 }, { 0xf, 0x00 }, { WAIT_IDLE },
1842{ 0xe, 0xa9 }, { 0xf, 0x00 }, { WAIT_IDLE },
1843{ 0xe, 0xaa }, { 0xf, 0x00 }, { WAIT_IDLE },
1844{ 0xe, 0xab }, { 0xf, 0x00 }, { WAIT_IDLE },
1845{ 0xe, 0xac }, { 0xf, 0x00 }, { WAIT_IDLE },
1846{ 0xe, 0xad }, { 0xf, 0x00 }, { WAIT_IDLE },
1847{ 0xe, 0xae }, { 0xf, 0x00 }, { WAIT_IDLE },
1848{ 0xe, 0xaf }, { 0xf, 0x00 }, { WAIT_IDLE },
1849
1850{ 0xe, 0xc0 }, { 0xf, 0x00 }, { WAIT_IDLE },
1851{ 0xe, 0xc1 }, { 0xf, 0x00 }, { WAIT_IDLE },
1852{ 0xe, 0xc2 }, { 0xf, 0x00 }, { WAIT_IDLE },
1853{ 0xe, 0xc3 }, { 0xf, 0x00 }, { WAIT_IDLE },
1854{ 0xe, 0xc4 }, { 0xf, 0x00 }, { WAIT_IDLE },
1855{ 0xe, 0xc5 }, { 0xf, 0x00 }, { WAIT_IDLE },
1856{ 0xe, 0xc6 }, { 0xf, 0x00 }, { WAIT_IDLE },
1857{ 0xe, 0xc7 }, { 0xf, 0x00 }, { WAIT_IDLE },
1858{ 0xe, 0xc8 }, { 0xf, 0x00 }, { WAIT_IDLE },
1859{ 0xe, 0xc9 }, { 0xf, 0x00 }, { WAIT_IDLE },
1860{ 0xe, 0xca }, { 0xf, 0x00 }, { WAIT_IDLE },
1861{ 0xe, 0xcb }, { 0xf, 0x00 }, { WAIT_IDLE },
1862{ 0xe, 0xcc }, { 0xf, 0x00 }, { WAIT_IDLE },
1863{ 0xe, 0xcd }, { 0xf, 0x00 }, { WAIT_IDLE },
1864{ 0xe, 0xce }, { 0xf, 0x00 }, { WAIT_IDLE },
1865{ 0xe, 0xcf }, { 0xf, 0x00 }, { WAIT_IDLE },
1866{ 0xe, 0xd0 }, { 0xf, 0x00 }, { WAIT_IDLE },
1867{ 0xe, 0xd1 }, { 0xf, 0x00 }, { WAIT_IDLE },
1868{ 0xe, 0xd2 }, { 0xf, 0x00 }, { WAIT_IDLE },
1869{ 0xe, 0xd3 }, { 0xf, 0x00 }, { WAIT_IDLE },
1870{ 0xe, 0xd4 }, { 0xf, 0x00 }, { WAIT_IDLE },
1871{ 0xe, 0xd5 }, { 0xf, 0x00 }, { WAIT_IDLE },
1872{ 0xe, 0xd6 }, { 0xf, 0x00 }, { WAIT_IDLE },
1873{ 0xe, 0xd7 }, { 0xf, 0x00 }, { WAIT_IDLE },
1874{ 0xe, 0xd8 }, { 0xf, 0x00 }, { WAIT_IDLE },
1875{ 0xe, 0xd9 }, { 0xf, 0x00 }, { WAIT_IDLE },
1876{ 0xe, 0xda }, { 0xf, 0x00 }, { WAIT_IDLE },
1877{ 0xe, 0xdb }, { 0xf, 0x00 }, { WAIT_IDLE },
1878{ 0xe, 0xdc }, { 0xf, 0x00 }, { WAIT_IDLE },
1879{ 0xe, 0xdd }, { 0xf, 0x00 }, { WAIT_IDLE },
1880{ 0xe, 0xde }, { 0xf, 0x10 }, { WAIT_IDLE },
1881{ 0xe, 0xdf }, { 0xf, 0x10 }, { WAIT_IDLE },
1882{ 0xe, 0xe0 }, { 0xf, 0x00 }, { WAIT_IDLE },
1883{ 0xe, 0xe1 }, { 0xf, 0x00 }, { WAIT_IDLE },
1884{ 0xe, 0xe2 }, { 0xf, 0x00 }, { WAIT_IDLE },
1885{ 0xe, 0xe3 }, { 0xf, 0x00 }, { WAIT_IDLE },
1886{ 0xe, 0xe4 }, { 0xf, 0x00 }, { WAIT_IDLE },
1887{ 0xe, 0xe5 }, { 0xf, 0x00 }, { WAIT_IDLE },
1888{ 0xe, 0xe6 }, { 0xf, 0x00 }, { WAIT_IDLE },
1889{ 0xe, 0xe7 }, { 0xf, 0x00 }, { WAIT_IDLE },
1890{ 0xe, 0xe8 }, { 0xf, 0x00 }, { WAIT_IDLE },
1891{ 0xe, 0xe9 }, { 0xf, 0x00 }, { WAIT_IDLE },
1892{ 0xe, 0xea }, { 0xf, 0x00 }, { WAIT_IDLE },
1893{ 0xe, 0xeb }, { 0xf, 0x00 }, { WAIT_IDLE },
1894{ 0xe, 0xec }, { 0xf, 0x00 }, { WAIT_IDLE },
1895{ 0xe, 0xed }, { 0xf, 0x00 }, { WAIT_IDLE },
1896{ 0xe, 0xee }, { 0xf, 0x00 }, { WAIT_IDLE },
1897{ 0xe, 0xef }, { 0xf, 0x00 }, { WAIT_IDLE },
1898
1899{ 0xe, 0x01 }, { 0xf, 0x00 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1900{ 0xe, 0x01 }, { 0xf, 0x01 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1901{ 0xe, 0x01 }, { 0xf, 0x02 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1902{ 0xe, 0x01 }, { 0xf, 0x03 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1903{ 0xe, 0x01 }, { 0xf, 0x04 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1904{ 0xe, 0x01 }, { 0xf, 0x05 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1905{ 0xe, 0x01 }, { 0xf, 0x06 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1906{ 0xe, 0x01 }, { 0xf, 0x07 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1907{ 0xe, 0x01 }, { 0xf, 0x08 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1908{ 0xe, 0x01 }, { 0xf, 0x09 }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1909{ 0xe, 0x01 }, { 0xf, 0x0a }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1910{ 0xe, 0x01 }, { 0xf, 0x0b }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1911{ 0xe, 0x01 }, { 0xf, 0x0c }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1912{ 0xe, 0x01 }, { 0xf, 0x0d }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1913{ 0xe, 0x01 }, { 0xf, 0x0e }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1914{ 0xe, 0x01 }, { 0xf, 0x0f }, { 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
1915
1916/* mute on */
1917{ 0x8, 0x02 },
1918
1919/* Now set the coefficients and so forth for the programs above */
1920{ 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1921{ 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1922{ 0xb, 0x00 }, { 0xa, 0x4b }, { 0xd, 0x03 }, { 0xc, 0x11 }, { WAIT_IDLE },
1923{ 0xb, 0x00 }, { 0xa, 0x4d }, { 0xd, 0x01 }, { 0xc, 0x32 }, { WAIT_IDLE },
1924{ 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1925{ 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1926{ 0xb, 0x07 }, { 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1927{ 0xb, 0x07 }, { 0xa, 0x41 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1928{ 0xb, 0x01 }, { 0xa, 0x40 }, { 0xd, 0x02 }, { 0xc, 0x40 }, { WAIT_IDLE },
1929{ 0xb, 0x01 }, { 0xa, 0x41 }, { 0xd, 0x02 }, { 0xc, 0x60 }, { WAIT_IDLE },
1930{ 0xb, 0x07 }, { 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1931{ 0xb, 0x07 }, { 0xa, 0x41 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1932{ 0xb, 0x07 }, { 0xa, 0x47 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1933{ 0xb, 0x07 }, { 0xa, 0x4a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1934{ 0xb, 0x00 }, { 0xa, 0x47 }, { 0xd, 0x01 }, { 0xc, 0x00 }, { WAIT_IDLE },
1935{ 0xb, 0x00 }, { 0xa, 0x4a }, { 0xd, 0x01 }, { 0xc, 0x20 }, { WAIT_IDLE },
1936{ 0xb, 0x07 }, { 0xa, 0x47 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1937{ 0xb, 0x07 }, { 0xa, 0x4a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1938{ 0xb, 0x07 }, { 0xa, 0x7c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1939{ 0xb, 0x07 }, { 0xa, 0x7e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1940{ 0xb, 0x00 }, { 0xa, 0x00 }, { 0xd, 0x01 }, { 0xc, 0x1c }, { WAIT_IDLE },
1941{ 0xb, 0x07 }, { 0xa, 0x7c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1942{ 0xb, 0x07 }, { 0xa, 0x7e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1943{ 0xb, 0x07 }, { 0xa, 0x44 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1944{ 0xb, 0x00 }, { 0xa, 0x44 }, { 0xd, 0x01 }, { 0xc, 0x00 }, { WAIT_IDLE },
1945{ 0xb, 0x07 }, { 0xa, 0x44 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1946{ 0xb, 0x07 }, { 0xa, 0x42 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1947{ 0xb, 0x07 }, { 0xa, 0x43 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1948{ 0xb, 0x00 }, { 0xa, 0x42 }, { 0xd, 0x01 }, { 0xc, 0x1a }, { WAIT_IDLE },
1949{ 0xb, 0x00 }, { 0xa, 0x43 }, { 0xd, 0x01 }, { 0xc, 0x20 }, { WAIT_IDLE },
1950{ 0xb, 0x07 }, { 0xa, 0x42 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1951{ 0xb, 0x07 }, { 0xa, 0x43 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1952{ 0xb, 0x07 }, { 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1953{ 0xb, 0x07 }, { 0xa, 0x41 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1954{ 0xb, 0x01 }, { 0xa, 0x40 }, { 0xd, 0x02 }, { 0xc, 0x40 }, { WAIT_IDLE },
1955{ 0xb, 0x01 }, { 0xa, 0x41 }, { 0xd, 0x02 }, { 0xc, 0x60 }, { WAIT_IDLE },
1956{ 0xb, 0x07 }, { 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1957{ 0xb, 0x07 }, { 0xa, 0x41 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1958{ 0xb, 0x07 }, { 0xa, 0x44 }, { 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
1959{ 0xb, 0x07 }, { 0xa, 0x42 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1960{ 0xb, 0x07 }, { 0xa, 0x43 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1961{ 0xb, 0x07 }, { 0xa, 0x40 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1962{ 0xb, 0x07 }, { 0xa, 0x41 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
1963{ 0xb, 0x07 }, { 0xa, 0x51 }, { 0xd, 0x06 }, { 0xc, 0x40 }, { WAIT_IDLE },
1964{ 0xb, 0x07 }, { 0xa, 0x50 }, { 0xd, 0x06 }, { 0xc, 0x40 }, { WAIT_IDLE },
1965{ 0xb, 0x07 }, { 0xa, 0x4f }, { 0xd, 0x03 }, { 0xc, 0x81 }, { WAIT_IDLE },
1966{ 0xb, 0x07 }, { 0xa, 0x53 }, { 0xd, 0x1a }, { 0xc, 0x76 }, { WAIT_IDLE },
1967{ 0xb, 0x07 }, { 0xa, 0x54 }, { 0xd, 0x0d }, { 0xc, 0x8b }, { WAIT_IDLE },
1968{ 0xb, 0x07 }, { 0xa, 0x55 }, { 0xd, 0x04 }, { 0xc, 0xe9 }, { WAIT_IDLE },
1969{ 0xb, 0x07 }, { 0xa, 0x56 }, { 0xd, 0x0b }, { 0xc, 0x17 }, { WAIT_IDLE },
1970{ 0xb, 0x07 }, { 0xa, 0x57 }, { 0xd, 0x1a }, { 0xc, 0x38 }, { WAIT_IDLE },
1971{ 0xb, 0x07 }, { 0xa, 0x58 }, { 0xd, 0x0d }, { 0xc, 0xc9 }, { WAIT_IDLE },
1972{ 0xb, 0x07 }, { 0xa, 0x59 }, { 0xd, 0x04 }, { 0xc, 0x6f }, { WAIT_IDLE },
1973{ 0xb, 0x07 }, { 0xa, 0x5a }, { 0xd, 0x0b }, { 0xc, 0x91 }, { WAIT_IDLE },
1974{ 0xb, 0x07 }, { 0xa, 0x73 }, { 0xd, 0x14 }, { 0xc, 0xda }, { WAIT_IDLE },
1975{ 0xb, 0x07 }, { 0xa, 0x74 }, { 0xd, 0x0d }, { 0xc, 0x93 }, { WAIT_IDLE },
1976{ 0xb, 0x07 }, { 0xa, 0x75 }, { 0xd, 0x04 }, { 0xc, 0xd9 }, { WAIT_IDLE },
1977{ 0xb, 0x07 }, { 0xa, 0x76 }, { 0xd, 0x05 }, { 0xc, 0x93 }, { WAIT_IDLE },
1978{ 0xb, 0x07 }, { 0xa, 0x77 }, { 0xd, 0x14 }, { 0xc, 0xda }, { WAIT_IDLE },
1979{ 0xb, 0x07 }, { 0xa, 0x78 }, { 0xd, 0x0d }, { 0xc, 0x93 }, { WAIT_IDLE },
1980{ 0xb, 0x07 }, { 0xa, 0x79 }, { 0xd, 0x04 }, { 0xc, 0xd9 }, { WAIT_IDLE },
1981{ 0xb, 0x07 }, { 0xa, 0x7a }, { 0xd, 0x05 }, { 0xc, 0x93 }, { WAIT_IDLE },
1982{ 0xb, 0x07 }, { 0xa, 0x5e }, { 0xd, 0x03 }, { 0xc, 0x68 }, { WAIT_IDLE },
1983{ 0xb, 0x07 }, { 0xa, 0x5c }, { 0xd, 0x04 }, { 0xc, 0x31 }, { WAIT_IDLE },
1984{ 0xb, 0x07 }, { 0xa, 0x5d }, { 0xd, 0x04 }, { 0xc, 0x31 }, { WAIT_IDLE },
1985{ 0xb, 0x07 }, { 0xa, 0x62 }, { 0xd, 0x03 }, { 0xc, 0x52 }, { WAIT_IDLE },
1986{ 0xb, 0x07 }, { 0xa, 0x60 }, { 0xd, 0x04 }, { 0xc, 0x76 }, { WAIT_IDLE },
1987{ 0xb, 0x07 }, { 0xa, 0x61 }, { 0xd, 0x04 }, { 0xc, 0x76 }, { WAIT_IDLE },
1988{ 0xb, 0x07 }, { 0xa, 0x66 }, { 0xd, 0x03 }, { 0xc, 0x2e }, { WAIT_IDLE },
1989{ 0xb, 0x07 }, { 0xa, 0x64 }, { 0xd, 0x04 }, { 0xc, 0xda }, { WAIT_IDLE },
1990{ 0xb, 0x07 }, { 0xa, 0x65 }, { 0xd, 0x04 }, { 0xc, 0xda }, { WAIT_IDLE },
1991{ 0xb, 0x07 }, { 0xa, 0x6a }, { 0xd, 0x02 }, { 0xc, 0xf6 }, { WAIT_IDLE },
1992{ 0xb, 0x07 }, { 0xa, 0x68 }, { 0xd, 0x05 }, { 0xc, 0x62 }, { WAIT_IDLE },
1993{ 0xb, 0x07 }, { 0xa, 0x69 }, { 0xd, 0x05 }, { 0xc, 0x62 }, { WAIT_IDLE },
1994{ 0xb, 0x06 }, { 0xa, 0x46 }, { 0xd, 0x0a }, { 0xc, 0x22 }, { WAIT_IDLE },
1995{ 0xb, 0x06 }, { 0xa, 0x48 }, { 0xd, 0x0d }, { 0xc, 0x24 }, { WAIT_IDLE },
1996{ 0xb, 0x06 }, { 0xa, 0x6e }, { 0xd, 0x11 }, { 0xc, 0xd3 }, { WAIT_IDLE },
1997{ 0xb, 0x06 }, { 0xa, 0x70 }, { 0xd, 0x15 }, { 0xc, 0xcb }, { WAIT_IDLE },
1998{ 0xb, 0x06 }, { 0xa, 0x52 }, { 0xd, 0x20 }, { 0xc, 0x93 }, { WAIT_IDLE },
1999{ 0xb, 0x06 }, { 0xa, 0x54 }, { 0xd, 0x20 }, { 0xc, 0x54 }, { WAIT_IDLE },
2000{ 0xb, 0x06 }, { 0xa, 0x4a }, { 0xd, 0x27 }, { 0xc, 0x1d }, { WAIT_IDLE },
2001{ 0xb, 0x06 }, { 0xa, 0x58 }, { 0xd, 0x2f }, { 0xc, 0xc8 }, { WAIT_IDLE },
2002{ 0xb, 0x06 }, { 0xa, 0x5c }, { 0xd, 0x30 }, { 0xc, 0x07 }, { WAIT_IDLE },
2003{ 0xb, 0x06 }, { 0xa, 0x4c }, { 0xd, 0x37 }, { 0xc, 0x90 }, { WAIT_IDLE },
2004{ 0xb, 0x06 }, { 0xa, 0x60 }, { 0xd, 0x3d }, { 0xc, 0xdb }, { WAIT_IDLE },
2005{ 0xb, 0x06 }, { 0xa, 0x64 }, { 0xd, 0x3e }, { 0xc, 0x42 }, { WAIT_IDLE },
2006{ 0xb, 0x06 }, { 0xa, 0x4e }, { 0xd, 0x45 }, { 0xc, 0x78 }, { WAIT_IDLE },
2007{ 0xb, 0x06 }, { 0xa, 0x68 }, { 0xd, 0x4c }, { 0xc, 0x48 }, { WAIT_IDLE },
2008{ 0xb, 0x06 }, { 0xa, 0x6c }, { 0xd, 0x4c }, { 0xc, 0x6c }, { WAIT_IDLE },
2009{ 0xb, 0x06 }, { 0xa, 0x50 }, { 0xd, 0x52 }, { 0xc, 0xe2 }, { WAIT_IDLE },
2010{ 0xb, 0x06 }, { 0xa, 0x42 }, { 0xd, 0x02 }, { 0xc, 0xba }, { WAIT_IDLE },
2011
2012/* Some settings (?) */
2013{ WAIT_IDLE }, { 0xe, 0x1e }, { 0xf, 0x14 },
2014{ WAIT_IDLE }, { 0xe, 0xde }, { 0xf, 0x20 },
2015{ WAIT_IDLE }, { 0xe, 0xdf }, { 0xf, 0x20 },
2016
2017/* some more coefficients */
2018{ WAIT_IDLE }, { 0xb, 0x06 }, { 0xa, 0x78 }, { 0xd, 0x00 }, { 0xc, 0x40 },
2019{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x03 }, { 0xd, 0x0f }, { 0xc, 0xff },
2020{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x0b }, { 0xd, 0x0f }, { 0xc, 0xff },
2021{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x02 }, { 0xd, 0x00 }, { 0xc, 0x00 },
2022{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x0a }, { 0xd, 0x00 }, { 0xc, 0x00 },
2023{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 },
2024{ WAIT_IDLE }, { 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 },
2025
2026/* Now, for some strange reason, lets reload every page
2027 and all the coefficients over again. I have *NO* idea
2028 why this is done. I do know that no sound is produced
2029 is this phase is omitted. */
2030{ 0x9, 0x05 }, { 0xb, 0x00 }, { 0xa, 0x10 },
2031
2032{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2033{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2034{ 0xd, 0x02 }, { 0xc, 0x00 }, { WAIT_IDLE },
2035{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2036{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2037{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2038{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2039{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2040{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2041{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2042{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2043{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2044{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2045{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2046{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2047{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2048{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2049{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2050{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2051{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2052{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2053{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2054{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2055{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2056{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2057{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2058{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2059{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2060{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2061{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2062{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2063{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2064{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2065{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2066{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2067{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2068{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2069{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2070{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2071{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2072{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2073{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2074{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2075{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2076{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2077{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2078{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2079{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2080
2081{ 0x9, 0x05 }, { 0xb, 0x01 }, { 0xa, 0x10 },
2082
2083{ 0xd, 0x01 }, { 0xc, 0xc0 }, { WAIT_IDLE },
2084{ 0xd, 0x01 }, { 0xc, 0xfa }, { WAIT_IDLE },
2085{ 0xd, 0x00 }, { 0xc, 0x1a }, { WAIT_IDLE },
2086{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2087{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2088{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2089{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2090{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2091{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2092{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2093{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2094{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2095{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2096{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2097{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2098{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2099{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2100{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2101{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2102{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2103{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2104{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2105{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2106{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2107{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2108{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2109{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2110{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2111{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2112{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2113{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2114{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2115{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2116{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2117{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2118{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2119{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2120{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2121{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2122{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2123{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2124{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2125{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2126{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2127{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2128{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2129{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2130{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2131
2132{ WAIT_IDLE }, { WAIT_IDLE },
2133
2134{ 0x9, 0x05 }, { 0xb, 0x02 }, { 0xa, 0x10 },
2135
2136{ 0xc, 0x46 }, { WAIT_IDLE },
2137{ 0xc, 0x46 }, { WAIT_IDLE },
2138{ 0xc, 0x00 }, { WAIT_IDLE },
2139{ 0xc, 0x00 }, { WAIT_IDLE },
2140{ 0xc, 0x00 }, { WAIT_IDLE },
2141{ 0xc, 0x00 }, { WAIT_IDLE },
2142{ 0xc, 0x00 }, { WAIT_IDLE },
2143{ 0xc, 0x00 }, { WAIT_IDLE },
2144{ 0xc, 0x00 }, { WAIT_IDLE },
2145{ 0xc, 0x00 }, { WAIT_IDLE },
2146{ 0xc, 0x00 }, { WAIT_IDLE },
2147{ 0xc, 0x00 }, { WAIT_IDLE },
2148{ 0xc, 0x00 }, { WAIT_IDLE },
2149{ 0xc, 0x00 }, { WAIT_IDLE },
2150{ 0xc, 0x00 }, { WAIT_IDLE },
2151{ 0xc, 0x00 }, { WAIT_IDLE },
2152{ 0xc, 0x00 }, { WAIT_IDLE },
2153{ 0xc, 0x00 }, { WAIT_IDLE },
2154{ 0xc, 0x00 }, { WAIT_IDLE },
2155{ 0xc, 0x00 }, { WAIT_IDLE },
2156{ 0xc, 0x00 }, { WAIT_IDLE },
2157{ 0xc, 0x00 }, { WAIT_IDLE },
2158{ 0xc, 0x00 }, { WAIT_IDLE },
2159{ 0xc, 0x00 }, { WAIT_IDLE },
2160{ 0xc, 0x00 }, { WAIT_IDLE },
2161{ 0xc, 0x00 }, { WAIT_IDLE },
2162{ 0xc, 0x00 }, { WAIT_IDLE },
2163{ 0xc, 0x00 }, { WAIT_IDLE },
2164{ 0xc, 0x00 }, { WAIT_IDLE },
2165{ 0xc, 0x00 }, { WAIT_IDLE },
2166{ 0xc, 0x00 }, { WAIT_IDLE },
2167{ 0xc, 0x00 }, { WAIT_IDLE },
2168{ 0xc, 0x00 }, { WAIT_IDLE },
2169{ 0xc, 0x00 }, { WAIT_IDLE },
2170{ 0xc, 0x00 }, { WAIT_IDLE },
2171{ 0xc, 0x00 }, { WAIT_IDLE },
2172{ 0xc, 0x00 }, { WAIT_IDLE },
2173{ 0xc, 0x00 }, { WAIT_IDLE },
2174{ 0xc, 0x00 }, { WAIT_IDLE },
2175{ 0xc, 0x00 }, { WAIT_IDLE },
2176{ 0xc, 0x00 }, { WAIT_IDLE },
2177{ 0xc, 0x00 }, { WAIT_IDLE },
2178{ 0xc, 0x00 }, { WAIT_IDLE },
2179{ 0xc, 0x00 }, { WAIT_IDLE },
2180{ 0xc, 0x00 }, { WAIT_IDLE },
2181{ 0xc, 0x00 }, { WAIT_IDLE },
2182{ 0xc, 0x00 }, { WAIT_IDLE },
2183{ 0xc, 0x00 }, { WAIT_IDLE },
2184
2185{ 0x9, 0x05 }, { 0xb, 0x03 }, { 0xa, 0x10 },
2186
2187{ 0xc, 0x00 }, { WAIT_IDLE },
2188{ 0xc, 0x00 }, { WAIT_IDLE },
2189{ 0xc, 0x00 }, { WAIT_IDLE },
2190{ 0xc, 0x00 }, { WAIT_IDLE },
2191{ 0xc, 0x00 }, { WAIT_IDLE },
2192{ 0xc, 0x00 }, { WAIT_IDLE },
2193{ 0xc, 0x00 }, { WAIT_IDLE },
2194{ 0xc, 0x00 }, { WAIT_IDLE },
2195{ 0xc, 0x00 }, { WAIT_IDLE },
2196{ 0xc, 0x00 }, { WAIT_IDLE },
2197{ 0xc, 0x00 }, { WAIT_IDLE },
2198{ 0xc, 0x00 }, { WAIT_IDLE },
2199{ 0xc, 0x00 }, { WAIT_IDLE },
2200{ 0xc, 0x00 }, { WAIT_IDLE },
2201{ 0xc, 0x00 }, { WAIT_IDLE },
2202{ 0xc, 0x00 }, { WAIT_IDLE },
2203{ 0xc, 0x00 }, { WAIT_IDLE },
2204{ 0xc, 0x00 }, { WAIT_IDLE },
2205{ 0xc, 0x00 }, { WAIT_IDLE },
2206{ 0xc, 0x00 }, { WAIT_IDLE },
2207{ 0xc, 0x00 }, { WAIT_IDLE },
2208{ 0xc, 0x00 }, { WAIT_IDLE },
2209{ 0xc, 0x00 }, { WAIT_IDLE },
2210{ 0xc, 0x00 }, { WAIT_IDLE },
2211{ 0xc, 0x00 }, { WAIT_IDLE },
2212{ 0xc, 0x00 }, { WAIT_IDLE },
2213{ 0xc, 0x00 }, { WAIT_IDLE },
2214{ 0xc, 0x00 }, { WAIT_IDLE },
2215{ 0xc, 0x00 }, { WAIT_IDLE },
2216{ 0xc, 0x00 }, { WAIT_IDLE },
2217{ 0xc, 0x00 }, { WAIT_IDLE },
2218{ 0xc, 0x00 }, { WAIT_IDLE },
2219{ 0xc, 0x00 }, { WAIT_IDLE },
2220{ 0xc, 0x00 }, { WAIT_IDLE },
2221{ 0xc, 0x00 }, { WAIT_IDLE },
2222{ 0xc, 0x00 }, { WAIT_IDLE },
2223{ 0xc, 0x00 }, { WAIT_IDLE },
2224{ 0xc, 0x00 }, { WAIT_IDLE },
2225{ 0xc, 0x00 }, { WAIT_IDLE },
2226{ 0xc, 0x00 }, { WAIT_IDLE },
2227{ 0xc, 0x00 }, { WAIT_IDLE },
2228{ 0xc, 0x00 }, { WAIT_IDLE },
2229{ 0xc, 0x00 }, { WAIT_IDLE },
2230{ 0xc, 0x00 }, { WAIT_IDLE },
2231{ 0xc, 0x00 }, { WAIT_IDLE },
2232{ 0xc, 0x00 }, { WAIT_IDLE },
2233{ 0xc, 0x00 }, { WAIT_IDLE },
2234{ 0xc, 0x00 }, { WAIT_IDLE },
2235
2236{ 0x9, 0x05 }, { 0xb, 0x04 }, { 0xa, 0x10 },
2237
2238{ 0xc, 0x00 }, { WAIT_IDLE },
2239{ 0xc, 0x00 }, { WAIT_IDLE },
2240{ 0xc, 0x00 }, { WAIT_IDLE },
2241{ 0xc, 0x00 }, { WAIT_IDLE },
2242{ 0xc, 0x00 }, { WAIT_IDLE },
2243{ 0xc, 0x00 }, { WAIT_IDLE },
2244{ 0xc, 0x00 }, { WAIT_IDLE },
2245{ 0xc, 0x00 }, { WAIT_IDLE },
2246{ 0xc, 0x00 }, { WAIT_IDLE },
2247{ 0xc, 0x00 }, { WAIT_IDLE },
2248{ 0xc, 0x00 }, { WAIT_IDLE },
2249{ 0xc, 0x00 }, { WAIT_IDLE },
2250{ 0xc, 0x00 }, { WAIT_IDLE },
2251{ 0xc, 0x00 }, { WAIT_IDLE },
2252{ 0xc, 0x00 }, { WAIT_IDLE },
2253{ 0xc, 0x00 }, { WAIT_IDLE },
2254{ 0xc, 0x00 }, { WAIT_IDLE },
2255{ 0xc, 0x00 }, { WAIT_IDLE },
2256{ 0xc, 0x00 }, { WAIT_IDLE },
2257{ 0xc, 0x00 }, { WAIT_IDLE },
2258{ 0xc, 0x00 }, { WAIT_IDLE },
2259{ 0xc, 0x00 }, { WAIT_IDLE },
2260{ 0xc, 0x00 }, { WAIT_IDLE },
2261{ 0xc, 0x00 }, { WAIT_IDLE },
2262{ 0xc, 0x00 }, { WAIT_IDLE },
2263{ 0xc, 0x00 }, { WAIT_IDLE },
2264{ 0xc, 0x00 }, { WAIT_IDLE },
2265{ 0xc, 0x00 }, { WAIT_IDLE },
2266{ 0xc, 0x00 }, { WAIT_IDLE },
2267{ 0xc, 0x00 }, { WAIT_IDLE },
2268{ 0xc, 0x00 }, { WAIT_IDLE },
2269{ 0xc, 0x00 }, { WAIT_IDLE },
2270{ 0xc, 0x00 }, { WAIT_IDLE },
2271{ 0xc, 0x00 }, { WAIT_IDLE },
2272{ 0xc, 0x00 }, { WAIT_IDLE },
2273{ 0xc, 0x00 }, { WAIT_IDLE },
2274{ 0xc, 0x00 }, { WAIT_IDLE },
2275{ 0xc, 0x00 }, { WAIT_IDLE },
2276{ 0xc, 0x00 }, { WAIT_IDLE },
2277{ 0xc, 0x00 }, { WAIT_IDLE },
2278{ 0xc, 0x00 }, { WAIT_IDLE },
2279{ 0xc, 0x00 }, { WAIT_IDLE },
2280{ 0xc, 0x00 }, { WAIT_IDLE },
2281{ 0xc, 0x00 }, { WAIT_IDLE },
2282{ 0xc, 0x00 }, { WAIT_IDLE },
2283{ 0xc, 0x00 }, { WAIT_IDLE },
2284{ 0xc, 0x00 }, { WAIT_IDLE },
2285{ 0xc, 0x00 }, { WAIT_IDLE },
2286
2287/* Page six v.2 */
2288{ 0x9, 0x01 }, { 0xb, 0x06 },
2289
2290{ 0xa, 0x10 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2291{ 0xa, 0x12 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2292{ 0xa, 0x14 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2293{ 0xa, 0x16 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2294{ 0xa, 0x18 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2295{ 0xa, 0x1a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2296{ 0xa, 0x1c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2297{ 0xa, 0x1e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2298{ 0xa, 0x20 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2299{ 0xa, 0x22 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2300{ 0xa, 0x24 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2301{ 0xa, 0x26 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2302{ 0xa, 0x28 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2303{ 0xa, 0x2a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2304{ 0xa, 0x2c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2305{ 0xa, 0x2e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2306{ 0xa, 0x30 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2307{ 0xa, 0x32 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2308{ 0xa, 0x34 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2309{ 0xa, 0x36 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2310{ 0xa, 0x38 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2311{ 0xa, 0x3a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2312{ 0xa, 0x3c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2313{ 0xa, 0x3e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2314
2315{ 0x9, 0x05 }, { 0xb, 0x07 }, { 0xa, 0x10 },
2316
2317{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
2318{ 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
2319{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2320{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2321{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2322{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2323{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2324{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2325{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2326{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2327{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2328{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2329{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2330{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2331{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2332{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2333{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2334{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2335{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2336{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2337{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2338{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2339{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2340{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2341{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2342{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2343{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2344{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2345{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2346{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2347{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2348{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2349{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2350{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2351{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2352{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2353{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2354{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2355{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2356{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2357{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2358{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2359{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2360{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2361{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2362{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2363{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2364{ 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2365
2366{ 0xe, 0x01 }, { 0xf, 0x00 }, { WAIT_IDLE },
2367{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2368{ 0xe, 0x01 }, { 0xf, 0x01 }, { WAIT_IDLE },
2369{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2370{ 0xe, 0x01 }, { 0xf, 0x02 }, { WAIT_IDLE },
2371{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2372{ 0xe, 0x01 }, { 0xf, 0x03 }, { WAIT_IDLE },
2373{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2374{ 0xe, 0x01 }, { 0xf, 0x04 }, { WAIT_IDLE },
2375{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2376{ 0xe, 0x01 }, { 0xf, 0x05 }, { WAIT_IDLE },
2377{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2378{ 0xe, 0x01 }, { 0xf, 0x06 }, { WAIT_IDLE },
2379{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2380{ 0xe, 0x01 }, { 0xf, 0x07 }, { WAIT_IDLE },
2381{ 0xe, 0x02 }, { 0xf, 0x00 }, { WAIT_IDLE },
2382{ 0xe, 0xb0 }, { 0xf, 0x20 }, { WAIT_IDLE },
2383{ 0xe, 0xb1 }, { 0xf, 0x20 }, { WAIT_IDLE },
2384{ 0xe, 0xb2 }, { 0xf, 0x20 }, { WAIT_IDLE },
2385{ 0xe, 0xb3 }, { 0xf, 0x20 }, { WAIT_IDLE },
2386{ 0xe, 0xb4 }, { 0xf, 0x20 }, { WAIT_IDLE },
2387{ 0xe, 0xb5 }, { 0xf, 0x20 }, { WAIT_IDLE },
2388{ 0xe, 0xb6 }, { 0xf, 0x20 }, { WAIT_IDLE },
2389{ 0xe, 0xb7 }, { 0xf, 0x20 }, { WAIT_IDLE },
2390{ 0xe, 0xf0 }, { 0xf, 0x20 }, { WAIT_IDLE },
2391{ 0xe, 0xf1 }, { 0xf, 0x20 }, { WAIT_IDLE },
2392{ 0xe, 0xf2 }, { 0xf, 0x20 }, { WAIT_IDLE },
2393{ 0xe, 0xf3 }, { 0xf, 0x20 }, { WAIT_IDLE },
2394{ 0xe, 0xf4 }, { 0xf, 0x20 }, { WAIT_IDLE },
2395{ 0xe, 0xf5 }, { 0xf, 0x20 }, { WAIT_IDLE },
2396{ 0xe, 0xf6 }, { 0xf, 0x20 }, { WAIT_IDLE },
2397{ 0xe, 0xf7 }, { 0xf, 0x20 }, { WAIT_IDLE },
2398{ 0xe, 0x10 }, { 0xf, 0xff }, { WAIT_IDLE },
2399{ 0xe, 0x11 }, { 0xf, 0xff }, { WAIT_IDLE },
2400{ 0xe, 0x12 }, { 0xf, 0xff }, { WAIT_IDLE },
2401{ 0xe, 0x13 }, { 0xf, 0xff }, { WAIT_IDLE },
2402{ 0xe, 0x14 }, { 0xf, 0xff }, { WAIT_IDLE },
2403{ 0xe, 0x15 }, { 0xf, 0xff }, { WAIT_IDLE },
2404{ 0xe, 0x16 }, { 0xf, 0xff }, { WAIT_IDLE },
2405{ 0xe, 0x17 }, { 0xf, 0xff }, { WAIT_IDLE },
2406{ 0xe, 0x20 }, { 0xf, 0xff }, { WAIT_IDLE },
2407{ 0xe, 0x21 }, { 0xf, 0xff }, { WAIT_IDLE },
2408{ 0xe, 0x22 }, { 0xf, 0xff }, { WAIT_IDLE },
2409{ 0xe, 0x23 }, { 0xf, 0xff }, { WAIT_IDLE },
2410{ 0xe, 0x24 }, { 0xf, 0xff }, { WAIT_IDLE },
2411{ 0xe, 0x25 }, { 0xf, 0xff }, { WAIT_IDLE },
2412{ 0xe, 0x26 }, { 0xf, 0xff }, { WAIT_IDLE },
2413{ 0xe, 0x27 }, { 0xf, 0xff }, { WAIT_IDLE },
2414{ 0xe, 0x30 }, { 0xf, 0x00 }, { WAIT_IDLE },
2415{ 0xe, 0x31 }, { 0xf, 0x00 }, { WAIT_IDLE },
2416{ 0xe, 0x32 }, { 0xf, 0x00 }, { WAIT_IDLE },
2417{ 0xe, 0x33 }, { 0xf, 0x00 }, { WAIT_IDLE },
2418{ 0xe, 0x34 }, { 0xf, 0x00 }, { WAIT_IDLE },
2419{ 0xe, 0x35 }, { 0xf, 0x00 }, { WAIT_IDLE },
2420{ 0xe, 0x36 }, { 0xf, 0x00 }, { WAIT_IDLE },
2421{ 0xe, 0x37 }, { 0xf, 0x00 }, { WAIT_IDLE },
2422{ 0xe, 0x40 }, { 0xf, 0x00 }, { WAIT_IDLE },
2423{ 0xe, 0x41 }, { 0xf, 0x00 }, { WAIT_IDLE },
2424{ 0xe, 0x42 }, { 0xf, 0x00 }, { WAIT_IDLE },
2425{ 0xe, 0x43 }, { 0xf, 0x00 }, { WAIT_IDLE },
2426{ 0xe, 0x44 }, { 0xf, 0x00 }, { WAIT_IDLE },
2427{ 0xe, 0x45 }, { 0xf, 0x00 }, { WAIT_IDLE },
2428{ 0xe, 0x46 }, { 0xf, 0x00 }, { WAIT_IDLE },
2429{ 0xe, 0x47 }, { 0xf, 0x00 }, { WAIT_IDLE },
2430{ 0xe, 0x50 }, { 0xf, 0x00 }, { WAIT_IDLE },
2431{ 0xe, 0x51 }, { 0xf, 0x00 }, { WAIT_IDLE },
2432{ 0xe, 0x52 }, { 0xf, 0x00 }, { WAIT_IDLE },
2433{ 0xe, 0x53 }, { 0xf, 0x00 }, { WAIT_IDLE },
2434{ 0xe, 0x54 }, { 0xf, 0x00 }, { WAIT_IDLE },
2435{ 0xe, 0x55 }, { 0xf, 0x00 }, { WAIT_IDLE },
2436{ 0xe, 0x56 }, { 0xf, 0x00 }, { WAIT_IDLE },
2437{ 0xe, 0x57 }, { 0xf, 0x00 }, { WAIT_IDLE },
2438{ 0xe, 0x60 }, { 0xf, 0x00 }, { WAIT_IDLE },
2439{ 0xe, 0x61 }, { 0xf, 0x00 }, { WAIT_IDLE },
2440{ 0xe, 0x62 }, { 0xf, 0x00 }, { WAIT_IDLE },
2441{ 0xe, 0x63 }, { 0xf, 0x00 }, { WAIT_IDLE },
2442{ 0xe, 0x64 }, { 0xf, 0x00 }, { WAIT_IDLE },
2443{ 0xe, 0x65 }, { 0xf, 0x00 }, { WAIT_IDLE },
2444{ 0xe, 0x66 }, { 0xf, 0x00 }, { WAIT_IDLE },
2445{ 0xe, 0x67 }, { 0xf, 0x00 }, { WAIT_IDLE },
2446{ 0xe, 0x70 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2447{ 0xe, 0x71 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2448{ 0xe, 0x72 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2449{ 0xe, 0x73 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2450{ 0xe, 0x74 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2451{ 0xe, 0x75 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2452{ 0xe, 0x76 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2453{ 0xe, 0x77 }, { 0xf, 0xc0 }, { WAIT_IDLE },
2454{ 0xe, 0x80 }, { 0xf, 0x00 }, { WAIT_IDLE },
2455{ 0xe, 0x81 }, { 0xf, 0x00 }, { WAIT_IDLE },
2456{ 0xe, 0x82 }, { 0xf, 0x00 }, { WAIT_IDLE },
2457{ 0xe, 0x83 }, { 0xf, 0x00 }, { WAIT_IDLE },
2458{ 0xe, 0x84 }, { 0xf, 0x00 }, { WAIT_IDLE },
2459{ 0xe, 0x85 }, { 0xf, 0x00 }, { WAIT_IDLE },
2460{ 0xe, 0x86 }, { 0xf, 0x00 }, { WAIT_IDLE },
2461{ 0xe, 0x87 }, { 0xf, 0x00 }, { WAIT_IDLE },
2462{ 0xe, 0x90 }, { 0xf, 0x00 }, { WAIT_IDLE },
2463{ 0xe, 0x91 }, { 0xf, 0x00 }, { WAIT_IDLE },
2464{ 0xe, 0x92 }, { 0xf, 0x00 }, { WAIT_IDLE },
2465{ 0xe, 0x93 }, { 0xf, 0x00 }, { WAIT_IDLE },
2466{ 0xe, 0x94 }, { 0xf, 0x00 }, { WAIT_IDLE },
2467{ 0xe, 0x95 }, { 0xf, 0x00 }, { WAIT_IDLE },
2468{ 0xe, 0x96 }, { 0xf, 0x00 }, { WAIT_IDLE },
2469{ 0xe, 0x97 }, { 0xf, 0x00 }, { WAIT_IDLE },
2470{ 0xe, 0xa0 }, { 0xf, 0x00 }, { WAIT_IDLE },
2471{ 0xe, 0xa1 }, { 0xf, 0x00 }, { WAIT_IDLE },
2472{ 0xe, 0xa2 }, { 0xf, 0x00 }, { WAIT_IDLE },
2473{ 0xe, 0xa3 }, { 0xf, 0x00 }, { WAIT_IDLE },
2474{ 0xe, 0xa4 }, { 0xf, 0x00 }, { WAIT_IDLE },
2475{ 0xe, 0xa5 }, { 0xf, 0x00 }, { WAIT_IDLE },
2476{ 0xe, 0xa6 }, { 0xf, 0x00 }, { WAIT_IDLE },
2477{ 0xe, 0xa7 }, { 0xf, 0x00 }, { WAIT_IDLE },
2478{ 0xe, 0xc0 }, { 0xf, 0x00 }, { WAIT_IDLE },
2479{ 0xe, 0xc1 }, { 0xf, 0x00 }, { WAIT_IDLE },
2480{ 0xe, 0xc2 }, { 0xf, 0x00 }, { WAIT_IDLE },
2481{ 0xe, 0xc3 }, { 0xf, 0x00 }, { WAIT_IDLE },
2482{ 0xe, 0xc4 }, { 0xf, 0x00 }, { WAIT_IDLE },
2483{ 0xe, 0xc5 }, { 0xf, 0x00 }, { WAIT_IDLE },
2484{ 0xe, 0xc6 }, { 0xf, 0x00 }, { WAIT_IDLE },
2485{ 0xe, 0xc7 }, { 0xf, 0x00 }, { WAIT_IDLE },
2486{ 0xe, 0xd0 }, { 0xf, 0x00 }, { WAIT_IDLE },
2487{ 0xe, 0xd1 }, { 0xf, 0x00 }, { WAIT_IDLE },
2488{ 0xe, 0xd2 }, { 0xf, 0x00 }, { WAIT_IDLE },
2489{ 0xe, 0xd3 }, { 0xf, 0x00 }, { WAIT_IDLE },
2490{ 0xe, 0xd4 }, { 0xf, 0x00 }, { WAIT_IDLE },
2491{ 0xe, 0xd5 }, { 0xf, 0x00 }, { WAIT_IDLE },
2492{ 0xe, 0xd6 }, { 0xf, 0x00 }, { WAIT_IDLE },
2493{ 0xe, 0xd7 }, { 0xf, 0x00 }, { WAIT_IDLE },
2494{ 0xe, 0xe0 }, { 0xf, 0x00 }, { WAIT_IDLE },
2495{ 0xe, 0xe1 }, { 0xf, 0x00 }, { WAIT_IDLE },
2496{ 0xe, 0xe2 }, { 0xf, 0x00 }, { WAIT_IDLE },
2497{ 0xe, 0xe3 }, { 0xf, 0x00 }, { WAIT_IDLE },
2498{ 0xe, 0xe4 }, { 0xf, 0x00 }, { WAIT_IDLE },
2499{ 0xe, 0xe5 }, { 0xf, 0x00 }, { WAIT_IDLE },
2500{ 0xe, 0xe6 }, { 0xf, 0x00 }, { WAIT_IDLE },
2501{ 0xe, 0xe7 }, { 0xf, 0x00 }, { WAIT_IDLE },
2502{ 0xe, 0x01 }, { 0xf, 0x00 }, { WAIT_IDLE },
2503{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2504{ 0xe, 0x01 }, { 0xf, 0x01 }, { WAIT_IDLE },
2505{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2506{ 0xe, 0x01 }, { 0xf, 0x02 }, { WAIT_IDLE },
2507{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2508{ 0xe, 0x01 }, { 0xf, 0x03 }, { WAIT_IDLE },
2509{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2510{ 0xe, 0x01 }, { 0xf, 0x04 }, { WAIT_IDLE },
2511{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2512{ 0xe, 0x01 }, { 0xf, 0x05 }, { WAIT_IDLE },
2513{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2514{ 0xe, 0x01 }, { 0xf, 0x06 }, { WAIT_IDLE },
2515{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2516{ 0xe, 0x01 }, { 0xf, 0x07 }, { WAIT_IDLE },
2517{ 0xe, 0x02 }, { 0xf, 0x01 }, { WAIT_IDLE },
2518
2519{ 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2520{ 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2521{ 0xb, 0x07 }, { 0xa, 0x45 }, { 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
2522{ 0xb, 0x07 }, { 0xa, 0x48 }, { 0xd, 0x0f }, { 0xc, 0xff }, { WAIT_IDLE },
2523{ 0xb, 0x07 }, { 0xa, 0x7b }, { 0xd, 0x04 }, { 0xc, 0xcc }, { WAIT_IDLE },
2524{ 0xb, 0x07 }, { 0xa, 0x7d }, { 0xd, 0x04 }, { 0xc, 0xcc }, { WAIT_IDLE },
2525{ 0xb, 0x07 }, { 0xa, 0x7c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2526{ 0xb, 0x07 }, { 0xa, 0x7e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2527{ 0xb, 0x07 }, { 0xa, 0x46 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2528{ 0xb, 0x07 }, { 0xa, 0x49 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2529{ 0xb, 0x07 }, { 0xa, 0x47 }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2530{ 0xb, 0x07 }, { 0xa, 0x4a }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2531{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2532{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0x00 }, { WAIT_IDLE },
2533
2534{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0x00 },
2535{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0x00 },
2536{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0x28 },
2537{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0x28 },
2538{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0x51 },
2539{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0x51 },
2540{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0x7a },
2541{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0x7a },
2542{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0xa3 },
2543{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0xa3 },
2544{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0xcc },
2545{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0xcc },
2546{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x00 }, { 0xc, 0xf5 },
2547{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x00 }, { 0xc, 0xf5 },
2548{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0x1e },
2549{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0x1e },
2550{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0x47 },
2551{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0x47 },
2552{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0x70 },
2553{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0x70 },
2554{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0x99 },
2555{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0x99 },
2556{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0xc2 },
2557{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0xc2 },
2558{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x01 }, { 0xc, 0xeb },
2559{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x01 }, { 0xc, 0xeb },
2560{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0x14 },
2561{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0x14 },
2562{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0x3d },
2563{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0x3d },
2564{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0x66 },
2565{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0x66 },
2566{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0x8f },
2567{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0x8f },
2568{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0xb8 },
2569{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0xb8 },
2570{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x02 }, { 0xc, 0xe1 },
2571{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x02 }, { 0xc, 0xe1 },
2572{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0x0a },
2573{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0x0a },
2574{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0x33 },
2575{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0x33 },
2576{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0x5c },
2577{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0x5c },
2578{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0x85 },
2579{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0x85 },
2580{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0xae },
2581{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0xae },
2582{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x03 }, { 0xc, 0xd7 },
2583{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x03 }, { 0xc, 0xd7 },
2584{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0x00 },
2585{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0x00 },
2586{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0x28 },
2587{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0x28 },
2588{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0x51 },
2589{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0x51 },
2590{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0x7a },
2591{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0x7a },
2592{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0xa3 },
2593{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0xa3 },
2594{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0xcc },
2595{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0xcc },
2596{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x04 }, { 0xc, 0xf5 },
2597{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x04 }, { 0xc, 0xf5 },
2598{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0x1e },
2599{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0x1e },
2600{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0x47 },
2601{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0x47 },
2602{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0x70 },
2603{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0x70 },
2604{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0x99 },
2605{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0x99 },
2606{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0xc2 },
2607{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0xc2 },
2608{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x05 }, { 0xc, 0xeb },
2609{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x05 }, { 0xc, 0xeb },
2610{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0x14 },
2611{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0x14 },
2612{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0x3d },
2613{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0x3d },
2614{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0x66 },
2615{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0x66 },
2616{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0x8f },
2617{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0x8f },
2618{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0xb8 },
2619{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0xb8 },
2620{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x06 }, { 0xc, 0xe1 },
2621{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x06 }, { 0xc, 0xe1 },
2622{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0x0a },
2623{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0x0a },
2624{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0x33 },
2625{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0x33 },
2626{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0x5c },
2627{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0x5c },
2628{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0x85 },
2629{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0x85 },
2630{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0xae },
2631{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0xae },
2632{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x07 }, { 0xc, 0xd7 },
2633{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x07 }, { 0xc, 0xd7 },
2634{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0x00 },
2635{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0x00 },
2636{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0x28 },
2637{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0x28 },
2638{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0x51 },
2639{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0x51 },
2640{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0x7a },
2641{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0x7a },
2642{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0xa3 },
2643{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0xa3 },
2644{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0xcc },
2645{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0xcc },
2646{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x08 }, { 0xc, 0xf5 },
2647{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x08 }, { 0xc, 0xf5 },
2648{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0x1e },
2649{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0x1e },
2650{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0x47 },
2651{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0x47 },
2652{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0x70 },
2653{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0x70 },
2654{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0x99 },
2655{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0x99 },
2656{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0xc2 },
2657{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0xc2 },
2658{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x09 }, { 0xc, 0xeb },
2659{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x09 }, { 0xc, 0xeb },
2660{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0x14 },
2661{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0x14 },
2662{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0x3d },
2663{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0x3d },
2664{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0x66 },
2665{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0x66 },
2666{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0x8f },
2667{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0x8f },
2668{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0xb8 },
2669{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0xb8 },
2670{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0a }, { 0xc, 0xe1 },
2671{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0a }, { 0xc, 0xe1 },
2672{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0x0a },
2673{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0x0a },
2674{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0x33 },
2675{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0x33 },
2676{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0x5c },
2677{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0x5c },
2678{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0x85 },
2679{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0x85 },
2680{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0xae },
2681{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0xae },
2682{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0b }, { 0xc, 0xd7 },
2683{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0b }, { 0xc, 0xd7 },
2684{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0x00 },
2685{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0x00 },
2686{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0x28 },
2687{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0x28 },
2688{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0x51 },
2689{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0x51 },
2690{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0x7a },
2691{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0x7a },
2692{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0xa3 },
2693{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0xa3 },
2694{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0xcc },
2695{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0xcc },
2696{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0c }, { 0xc, 0xf5 },
2697{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0c }, { 0xc, 0xf5 },
2698{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0x1e },
2699{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0x1e },
2700{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0x47 },
2701{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0x47 },
2702{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0x70 },
2703{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0x70 },
2704{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0x99 },
2705{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0x99 },
2706{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0xc2 },
2707{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0xc2 },
2708{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0d }, { 0xc, 0xeb },
2709{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0d }, { 0xc, 0xeb },
2710{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0x14 },
2711{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0x14 },
2712{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0x3d },
2713{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0x3d },
2714{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0x66 },
2715{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0x66 },
2716{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0x8f },
2717{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0x8f },
2718{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0xb8 },
2719{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0xb8 },
2720{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0e }, { 0xc, 0xe1 },
2721{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0e }, { 0xc, 0xe1 },
2722{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0x0a },
2723{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0x0a },
2724{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0x33 },
2725{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0x33 },
2726{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0x5c },
2727{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0x5c },
2728{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0x85 },
2729{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0x85 },
2730{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0xae },
2731{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0xae },
2732{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0xd7 },
2733{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0xd7 },
2734{ 0xb, 0x07 }, { 0xa, 0x4c }, { 0xd, 0x0f }, { 0xc, 0xff },
2735{ 0xb, 0x07 }, { 0xa, 0x4e }, { 0xd, 0x0f }, { 0xc, 0xff },
2736
2737/* mute off */
2738{ 0x8, 0x00 }, { WAIT_IDLE }
2739};
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 3d6c5f2838af..5d2ba1b749ab 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -181,25 +181,6 @@ static void snd_wss_wait(struct snd_wss *chip)
181 udelay(100); 181 udelay(100);
182} 182}
183 183
184static void snd_wss_outm(struct snd_wss *chip, unsigned char reg,
185 unsigned char mask, unsigned char value)
186{
187 unsigned char tmp = (chip->image[reg] & mask) | value;
188
189 snd_wss_wait(chip);
190#ifdef CONFIG_SND_DEBUG
191 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
192 snd_printk("outm: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value);
193#endif
194 chip->image[reg] = tmp;
195 if (!chip->calibrate_mute) {
196 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
197 wmb();
198 wss_outb(chip, CS4231P(REG), tmp);
199 mb();
200 }
201}
202
203static void snd_wss_dout(struct snd_wss *chip, unsigned char reg, 184static void snd_wss_dout(struct snd_wss *chip, unsigned char reg,
204 unsigned char value) 185 unsigned char value)
205{ 186{
@@ -219,7 +200,8 @@ void snd_wss_out(struct snd_wss *chip, unsigned char reg, unsigned char value)
219 snd_wss_wait(chip); 200 snd_wss_wait(chip);
220#ifdef CONFIG_SND_DEBUG 201#ifdef CONFIG_SND_DEBUG
221 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 202 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
222 snd_printk("out: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 203 snd_printk(KERN_DEBUG "out: auto calibration time out "
204 "- reg = 0x%x, value = 0x%x\n", reg, value);
223#endif 205#endif
224 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 206 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
225 wss_outb(chip, CS4231P(REG), value); 207 wss_outb(chip, CS4231P(REG), value);
@@ -235,7 +217,8 @@ unsigned char snd_wss_in(struct snd_wss *chip, unsigned char reg)
235 snd_wss_wait(chip); 217 snd_wss_wait(chip);
236#ifdef CONFIG_SND_DEBUG 218#ifdef CONFIG_SND_DEBUG
237 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 219 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
238 snd_printk("in: auto calibration time out - reg = 0x%x\n", reg); 220 snd_printk(KERN_DEBUG "in: auto calibration time out "
221 "- reg = 0x%x\n", reg);
239#endif 222#endif
240 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 223 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
241 mb(); 224 mb();
@@ -252,7 +235,7 @@ void snd_cs4236_ext_out(struct snd_wss *chip, unsigned char reg,
252 wss_outb(chip, CS4231P(REG), val); 235 wss_outb(chip, CS4231P(REG), val);
253 chip->eimage[CS4236_REG(reg)] = val; 236 chip->eimage[CS4236_REG(reg)] = val;
254#if 0 237#if 0
255 printk("ext out : reg = 0x%x, val = 0x%x\n", reg, val); 238 printk(KERN_DEBUG "ext out : reg = 0x%x, val = 0x%x\n", reg, val);
256#endif 239#endif
257} 240}
258EXPORT_SYMBOL(snd_cs4236_ext_out); 241EXPORT_SYMBOL(snd_cs4236_ext_out);
@@ -268,7 +251,8 @@ unsigned char snd_cs4236_ext_in(struct snd_wss *chip, unsigned char reg)
268 { 251 {
269 unsigned char res; 252 unsigned char res;
270 res = wss_inb(chip, CS4231P(REG)); 253 res = wss_inb(chip, CS4231P(REG));
271 printk("ext in : reg = 0x%x, val = 0x%x\n", reg, res); 254 printk(KERN_DEBUG "ext in : reg = 0x%x, val = 0x%x\n",
255 reg, res);
272 return res; 256 return res;
273 } 257 }
274#endif 258#endif
@@ -394,13 +378,16 @@ void snd_wss_mce_up(struct snd_wss *chip)
394 snd_wss_wait(chip); 378 snd_wss_wait(chip);
395#ifdef CONFIG_SND_DEBUG 379#ifdef CONFIG_SND_DEBUG
396 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 380 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
397 snd_printk("mce_up - auto calibration time out (0)\n"); 381 snd_printk(KERN_DEBUG
382 "mce_up - auto calibration time out (0)\n");
398#endif 383#endif
399 spin_lock_irqsave(&chip->reg_lock, flags); 384 spin_lock_irqsave(&chip->reg_lock, flags);
400 chip->mce_bit |= CS4231_MCE; 385 chip->mce_bit |= CS4231_MCE;
401 timeout = wss_inb(chip, CS4231P(REGSEL)); 386 timeout = wss_inb(chip, CS4231P(REGSEL));
402 if (timeout == 0x80) 387 if (timeout == 0x80)
403 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 388 snd_printk(KERN_DEBUG "mce_up [0x%lx]: "
389 "serious init problem - codec still busy\n",
390 chip->port);
404 if (!(timeout & CS4231_MCE)) 391 if (!(timeout & CS4231_MCE))
405 wss_outb(chip, CS4231P(REGSEL), 392 wss_outb(chip, CS4231P(REGSEL),
406 chip->mce_bit | (timeout & 0x1f)); 393 chip->mce_bit | (timeout & 0x1f));
@@ -419,7 +406,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
419 406
420#ifdef CONFIG_SND_DEBUG 407#ifdef CONFIG_SND_DEBUG
421 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 408 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
422 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", (long)CS4231P(REGSEL)); 409 snd_printk(KERN_DEBUG "mce_down [0x%lx] - "
410 "auto calibration time out (0)\n",
411 (long)CS4231P(REGSEL));
423#endif 412#endif
424 spin_lock_irqsave(&chip->reg_lock, flags); 413 spin_lock_irqsave(&chip->reg_lock, flags);
425 chip->mce_bit &= ~CS4231_MCE; 414 chip->mce_bit &= ~CS4231_MCE;
@@ -427,7 +416,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
427 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 416 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
428 spin_unlock_irqrestore(&chip->reg_lock, flags); 417 spin_unlock_irqrestore(&chip->reg_lock, flags);
429 if (timeout == 0x80) 418 if (timeout == 0x80)
430 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); 419 snd_printk(KERN_DEBUG "mce_down [0x%lx]: "
420 "serious init problem - codec still busy\n",
421 chip->port);
431 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask)) 422 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask))
432 return; 423 return;
433 424
@@ -565,7 +556,7 @@ static unsigned char snd_wss_get_format(struct snd_wss *chip,
565 if (channels > 1) 556 if (channels > 1)
566 rformat |= CS4231_STEREO; 557 rformat |= CS4231_STEREO;
567#if 0 558#if 0
568 snd_printk("get_format: 0x%x (mode=0x%x)\n", format, mode); 559 snd_printk(KERN_DEBUG "get_format: 0x%x (mode=0x%x)\n", format, mode);
569#endif 560#endif
570 return rformat; 561 return rformat;
571} 562}
@@ -587,7 +578,15 @@ static void snd_wss_calibrate_mute(struct snd_wss *chip, int mute)
587 chip->image[CS4231_RIGHT_INPUT]); 578 chip->image[CS4231_RIGHT_INPUT]);
588 snd_wss_dout(chip, CS4231_LOOPBACK, 579 snd_wss_dout(chip, CS4231_LOOPBACK,
589 chip->image[CS4231_LOOPBACK]); 580 chip->image[CS4231_LOOPBACK]);
581 } else {
582 snd_wss_dout(chip, CS4231_LEFT_INPUT,
583 0);
584 snd_wss_dout(chip, CS4231_RIGHT_INPUT,
585 0);
586 snd_wss_dout(chip, CS4231_LOOPBACK,
587 0xfd);
590 } 588 }
589
591 snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT, 590 snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT,
592 mute | chip->image[CS4231_AUX1_LEFT_INPUT]); 591 mute | chip->image[CS4231_AUX1_LEFT_INPUT]);
593 snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT, 592 snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT,
@@ -630,7 +629,6 @@ static void snd_wss_playback_format(struct snd_wss *chip,
630 int full_calib = 1; 629 int full_calib = 1;
631 630
632 mutex_lock(&chip->mce_mutex); 631 mutex_lock(&chip->mce_mutex);
633 snd_wss_calibrate_mute(chip, 1);
634 if (chip->hardware == WSS_HW_CS4231A || 632 if (chip->hardware == WSS_HW_CS4231A ||
635 (chip->hardware & WSS_HW_CS4232_MASK)) { 633 (chip->hardware & WSS_HW_CS4232_MASK)) {
636 spin_lock_irqsave(&chip->reg_lock, flags); 634 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -646,6 +644,24 @@ static void snd_wss_playback_format(struct snd_wss *chip,
646 full_calib = 0; 644 full_calib = 0;
647 } 645 }
648 spin_unlock_irqrestore(&chip->reg_lock, flags); 646 spin_unlock_irqrestore(&chip->reg_lock, flags);
647 } else if (chip->hardware == WSS_HW_AD1845) {
648 unsigned rate = params_rate(params);
649
650 /*
651 * Program the AD1845 correctly for the playback stream.
652 * Note that we do NOT need to toggle the MCE bit because
653 * the PLAYBACK_ENABLE bit of the Interface Configuration
654 * register is set.
655 *
656 * NOTE: We seem to need to write to the MSB before the LSB
657 * to get the correct sample frequency.
658 */
659 spin_lock_irqsave(&chip->reg_lock, flags);
660 snd_wss_out(chip, CS4231_PLAYBK_FORMAT, (pdfr & 0xf0));
661 snd_wss_out(chip, AD1845_UPR_FREQ_SEL, (rate >> 8) & 0xff);
662 snd_wss_out(chip, AD1845_LWR_FREQ_SEL, rate & 0xff);
663 full_calib = 0;
664 spin_unlock_irqrestore(&chip->reg_lock, flags);
649 } 665 }
650 if (full_calib) { 666 if (full_calib) {
651 snd_wss_mce_up(chip); 667 snd_wss_mce_up(chip);
@@ -663,7 +679,6 @@ static void snd_wss_playback_format(struct snd_wss *chip,
663 udelay(100); /* this seems to help */ 679 udelay(100); /* this seems to help */
664 snd_wss_mce_down(chip); 680 snd_wss_mce_down(chip);
665 } 681 }
666 snd_wss_calibrate_mute(chip, 0);
667 mutex_unlock(&chip->mce_mutex); 682 mutex_unlock(&chip->mce_mutex);
668} 683}
669 684
@@ -675,7 +690,6 @@ static void snd_wss_capture_format(struct snd_wss *chip,
675 int full_calib = 1; 690 int full_calib = 1;
676 691
677 mutex_lock(&chip->mce_mutex); 692 mutex_lock(&chip->mce_mutex);
678 snd_wss_calibrate_mute(chip, 1);
679 if (chip->hardware == WSS_HW_CS4231A || 693 if (chip->hardware == WSS_HW_CS4231A ||
680 (chip->hardware & WSS_HW_CS4232_MASK)) { 694 (chip->hardware & WSS_HW_CS4232_MASK)) {
681 spin_lock_irqsave(&chip->reg_lock, flags); 695 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -690,6 +704,24 @@ static void snd_wss_capture_format(struct snd_wss *chip,
690 full_calib = 0; 704 full_calib = 0;
691 } 705 }
692 spin_unlock_irqrestore(&chip->reg_lock, flags); 706 spin_unlock_irqrestore(&chip->reg_lock, flags);
707 } else if (chip->hardware == WSS_HW_AD1845) {
708 unsigned rate = params_rate(params);
709
710 /*
711 * Program the AD1845 correctly for the capture stream.
712 * Note that we do NOT need to toggle the MCE bit because
713 * the PLAYBACK_ENABLE bit of the Interface Configuration
714 * register is set.
715 *
716 * NOTE: We seem to need to write to the MSB before the LSB
717 * to get the correct sample frequency.
718 */
719 spin_lock_irqsave(&chip->reg_lock, flags);
720 snd_wss_out(chip, CS4231_REC_FORMAT, (cdfr & 0xf0));
721 snd_wss_out(chip, AD1845_UPR_FREQ_SEL, (rate >> 8) & 0xff);
722 snd_wss_out(chip, AD1845_LWR_FREQ_SEL, rate & 0xff);
723 full_calib = 0;
724 spin_unlock_irqrestore(&chip->reg_lock, flags);
693 } 725 }
694 if (full_calib) { 726 if (full_calib) {
695 snd_wss_mce_up(chip); 727 snd_wss_mce_up(chip);
@@ -714,7 +746,6 @@ static void snd_wss_capture_format(struct snd_wss *chip,
714 spin_unlock_irqrestore(&chip->reg_lock, flags); 746 spin_unlock_irqrestore(&chip->reg_lock, flags);
715 snd_wss_mce_down(chip); 747 snd_wss_mce_down(chip);
716 } 748 }
717 snd_wss_calibrate_mute(chip, 0);
718 mutex_unlock(&chip->mce_mutex); 749 mutex_unlock(&chip->mce_mutex);
719} 750}
720 751
@@ -771,10 +802,11 @@ static void snd_wss_init(struct snd_wss *chip)
771{ 802{
772 unsigned long flags; 803 unsigned long flags;
773 804
805 snd_wss_calibrate_mute(chip, 1);
774 snd_wss_mce_down(chip); 806 snd_wss_mce_down(chip);
775 807
776#ifdef SNDRV_DEBUG_MCE 808#ifdef SNDRV_DEBUG_MCE
777 snd_printk("init: (1)\n"); 809 snd_printk(KERN_DEBUG "init: (1)\n");
778#endif 810#endif
779 snd_wss_mce_up(chip); 811 snd_wss_mce_up(chip);
780 spin_lock_irqsave(&chip->reg_lock, flags); 812 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -789,18 +821,20 @@ static void snd_wss_init(struct snd_wss *chip)
789 snd_wss_mce_down(chip); 821 snd_wss_mce_down(chip);
790 822
791#ifdef SNDRV_DEBUG_MCE 823#ifdef SNDRV_DEBUG_MCE
792 snd_printk("init: (2)\n"); 824 snd_printk(KERN_DEBUG "init: (2)\n");
793#endif 825#endif
794 826
795 snd_wss_mce_up(chip); 827 snd_wss_mce_up(chip);
796 spin_lock_irqsave(&chip->reg_lock, flags); 828 spin_lock_irqsave(&chip->reg_lock, flags);
829 chip->image[CS4231_IFACE_CTRL] &= ~CS4231_AUTOCALIB;
830 snd_wss_out(chip, CS4231_IFACE_CTRL, chip->image[CS4231_IFACE_CTRL]);
797 snd_wss_out(chip, 831 snd_wss_out(chip,
798 CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1]); 832 CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1]);
799 spin_unlock_irqrestore(&chip->reg_lock, flags); 833 spin_unlock_irqrestore(&chip->reg_lock, flags);
800 snd_wss_mce_down(chip); 834 snd_wss_mce_down(chip);
801 835
802#ifdef SNDRV_DEBUG_MCE 836#ifdef SNDRV_DEBUG_MCE
803 snd_printk("init: (3) - afei = 0x%x\n", 837 snd_printk(KERN_DEBUG "init: (3) - afei = 0x%x\n",
804 chip->image[CS4231_ALT_FEATURE_1]); 838 chip->image[CS4231_ALT_FEATURE_1]);
805#endif 839#endif
806 840
@@ -817,7 +851,7 @@ static void snd_wss_init(struct snd_wss *chip)
817 snd_wss_mce_down(chip); 851 snd_wss_mce_down(chip);
818 852
819#ifdef SNDRV_DEBUG_MCE 853#ifdef SNDRV_DEBUG_MCE
820 snd_printk("init: (4)\n"); 854 snd_printk(KERN_DEBUG "init: (4)\n");
821#endif 855#endif
822 856
823 snd_wss_mce_up(chip); 857 snd_wss_mce_up(chip);
@@ -827,9 +861,10 @@ static void snd_wss_init(struct snd_wss *chip)
827 chip->image[CS4231_REC_FORMAT]); 861 chip->image[CS4231_REC_FORMAT]);
828 spin_unlock_irqrestore(&chip->reg_lock, flags); 862 spin_unlock_irqrestore(&chip->reg_lock, flags);
829 snd_wss_mce_down(chip); 863 snd_wss_mce_down(chip);
864 snd_wss_calibrate_mute(chip, 0);
830 865
831#ifdef SNDRV_DEBUG_MCE 866#ifdef SNDRV_DEBUG_MCE
832 snd_printk("init: (5)\n"); 867 snd_printk(KERN_DEBUG "init: (5)\n");
833#endif 868#endif
834} 869}
835 870
@@ -885,8 +920,6 @@ static void snd_wss_close(struct snd_wss *chip, unsigned int mode)
885 mutex_unlock(&chip->open_mutex); 920 mutex_unlock(&chip->open_mutex);
886 return; 921 return;
887 } 922 }
888 snd_wss_calibrate_mute(chip, 1);
889
890 /* disable IRQ */ 923 /* disable IRQ */
891 spin_lock_irqsave(&chip->reg_lock, flags); 924 spin_lock_irqsave(&chip->reg_lock, flags);
892 if (!(chip->hardware & WSS_HW_AD1848_MASK)) 925 if (!(chip->hardware & WSS_HW_AD1848_MASK))
@@ -919,8 +952,6 @@ static void snd_wss_close(struct snd_wss *chip, unsigned int mode)
919 wss_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 952 wss_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */
920 spin_unlock_irqrestore(&chip->reg_lock, flags); 953 spin_unlock_irqrestore(&chip->reg_lock, flags);
921 954
922 snd_wss_calibrate_mute(chip, 0);
923
924 chip->mode = 0; 955 chip->mode = 0;
925 mutex_unlock(&chip->open_mutex); 956 mutex_unlock(&chip->open_mutex);
926} 957}
@@ -1113,7 +1144,7 @@ irqreturn_t snd_wss_interrupt(int irq, void *dev_id)
1113 if (chip->hardware & WSS_HW_AD1848_MASK) 1144 if (chip->hardware & WSS_HW_AD1848_MASK)
1114 wss_outb(chip, CS4231P(STATUS), 0); 1145 wss_outb(chip, CS4231P(STATUS), 0);
1115 else 1146 else
1116 snd_wss_outm(chip, CS4231_IRQ_STATUS, status, 0); 1147 snd_wss_out(chip, CS4231_IRQ_STATUS, status);
1117 spin_unlock(&chip->reg_lock); 1148 spin_unlock(&chip->reg_lock);
1118 return IRQ_HANDLED; 1149 return IRQ_HANDLED;
1119} 1150}
@@ -1278,7 +1309,8 @@ static int snd_wss_probe(struct snd_wss *chip)
1278 } else if (rev == 0x03) { 1309 } else if (rev == 0x03) {
1279 chip->hardware = WSS_HW_CS4236B; 1310 chip->hardware = WSS_HW_CS4236B;
1280 } else { 1311 } else {
1281 snd_printk("unknown CS chip with version 0x%x\n", rev); 1312 snd_printk(KERN_ERR
1313 "unknown CS chip with version 0x%x\n", rev);
1282 return -ENODEV; /* unknown CS4231 chip? */ 1314 return -ENODEV; /* unknown CS4231 chip? */
1283 } 1315 }
1284 } 1316 }
@@ -1314,6 +1346,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1314 chip->image[CS4231_ALT_FEATURE_2] = 1346 chip->image[CS4231_ALT_FEATURE_2] =
1315 chip->hardware == WSS_HW_INTERWAVE ? 0xc2 : 0x01; 1347 chip->hardware == WSS_HW_INTERWAVE ? 0xc2 : 0x01;
1316 } 1348 }
1349 /* enable fine grained frequency selection */
1350 if (chip->hardware == WSS_HW_AD1845)
1351 chip->image[AD1845_PWR_DOWN] = 8;
1352
1317 ptr = (unsigned char *) &chip->image; 1353 ptr = (unsigned char *) &chip->image;
1318 regnum = (chip->hardware & WSS_HW_AD1848_MASK) ? 16 : 32; 1354 regnum = (chip->hardware & WSS_HW_AD1848_MASK) ? 16 : 32;
1319 snd_wss_mce_down(chip); 1355 snd_wss_mce_down(chip);
@@ -1342,7 +1378,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1342 case 6: 1378 case 6:
1343 break; 1379 break;
1344 default: 1380 default:
1345 snd_printk("unknown CS4235 chip (enhanced version = 0x%x)\n", id); 1381 snd_printk(KERN_WARNING
1382 "unknown CS4235 chip "
1383 "(enhanced version = 0x%x)\n",
1384 id);
1346 } 1385 }
1347 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */ 1386 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */
1348 switch (id >> 5) { 1387 switch (id >> 5) {
@@ -1353,7 +1392,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1353 chip->hardware = WSS_HW_CS4236B; 1392 chip->hardware = WSS_HW_CS4236B;
1354 break; 1393 break;
1355 default: 1394 default:
1356 snd_printk("unknown CS4236 chip (enhanced version = 0x%x)\n", id); 1395 snd_printk(KERN_WARNING
1396 "unknown CS4236 chip "
1397 "(enhanced version = 0x%x)\n",
1398 id);
1357 } 1399 }
1358 } else if ((id & 0x1f) == 0x08) { /* CS4237B */ 1400 } else if ((id & 0x1f) == 0x08) { /* CS4237B */
1359 chip->hardware = WSS_HW_CS4237B; 1401 chip->hardware = WSS_HW_CS4237B;
@@ -1364,7 +1406,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1364 case 7: 1406 case 7:
1365 break; 1407 break;
1366 default: 1408 default:
1367 snd_printk("unknown CS4237B chip (enhanced version = 0x%x)\n", id); 1409 snd_printk(KERN_WARNING
1410 "unknown CS4237B chip "
1411 "(enhanced version = 0x%x)\n",
1412 id);
1368 } 1413 }
1369 } else if ((id & 0x1f) == 0x09) { /* CS4238B */ 1414 } else if ((id & 0x1f) == 0x09) { /* CS4238B */
1370 chip->hardware = WSS_HW_CS4238B; 1415 chip->hardware = WSS_HW_CS4238B;
@@ -1374,7 +1419,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1374 case 7: 1419 case 7:
1375 break; 1420 break;
1376 default: 1421 default:
1377 snd_printk("unknown CS4238B chip (enhanced version = 0x%x)\n", id); 1422 snd_printk(KERN_WARNING
1423 "unknown CS4238B chip "
1424 "(enhanced version = 0x%x)\n",
1425 id);
1378 } 1426 }
1379 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */ 1427 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */
1380 chip->hardware = WSS_HW_CS4239; 1428 chip->hardware = WSS_HW_CS4239;
@@ -1384,10 +1432,15 @@ static int snd_wss_probe(struct snd_wss *chip)
1384 case 6: 1432 case 6:
1385 break; 1433 break;
1386 default: 1434 default:
1387 snd_printk("unknown CS4239 chip (enhanced version = 0x%x)\n", id); 1435 snd_printk(KERN_WARNING
1436 "unknown CS4239 chip "
1437 "(enhanced version = 0x%x)\n",
1438 id);
1388 } 1439 }
1389 } else { 1440 } else {
1390 snd_printk("unknown CS4236/CS423xB chip (enhanced version = 0x%x)\n", id); 1441 snd_printk(KERN_WARNING
1442 "unknown CS4236/CS423xB chip "
1443 "(enhanced version = 0x%x)\n", id);
1391 } 1444 }
1392 } 1445 }
1393 } 1446 }
@@ -1618,7 +1671,8 @@ static void snd_wss_resume(struct snd_wss *chip)
1618 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 1671 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
1619 spin_unlock_irqrestore(&chip->reg_lock, flags); 1672 spin_unlock_irqrestore(&chip->reg_lock, flags);
1620 if (timeout == 0x80) 1673 if (timeout == 0x80)
1621 snd_printk("down [0x%lx]: serious init problem - codec still busy\n", chip->port); 1674 snd_printk(KERN_ERR "down [0x%lx]: serious init problem "
1675 "- codec still busy\n", chip->port);
1622 if ((timeout & CS4231_MCE) == 0 || 1676 if ((timeout & CS4231_MCE) == 0 ||
1623 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) { 1677 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) {
1624 return; 1678 return;
@@ -1628,7 +1682,7 @@ static void snd_wss_resume(struct snd_wss *chip)
1628} 1682}
1629#endif /* CONFIG_PM */ 1683#endif /* CONFIG_PM */
1630 1684
1631static int snd_wss_free(struct snd_wss *chip) 1685int snd_wss_free(struct snd_wss *chip)
1632{ 1686{
1633 release_and_free_resource(chip->res_port); 1687 release_and_free_resource(chip->res_port);
1634 release_and_free_resource(chip->res_cport); 1688 release_and_free_resource(chip->res_cport);
@@ -1651,6 +1705,7 @@ static int snd_wss_free(struct snd_wss *chip)
1651 kfree(chip); 1705 kfree(chip);
1652 return 0; 1706 return 0;
1653} 1707}
1708EXPORT_SYMBOL(snd_wss_free);
1654 1709
1655static int snd_wss_dev_free(struct snd_device *device) 1710static int snd_wss_dev_free(struct snd_device *device)
1656{ 1711{
@@ -1820,7 +1875,8 @@ int snd_wss_create(struct snd_card *card,
1820#if 0 1875#if 0
1821 if (chip->hardware & WSS_HW_CS4232_MASK) { 1876 if (chip->hardware & WSS_HW_CS4232_MASK) {
1822 if (chip->res_cport == NULL) 1877 if (chip->res_cport == NULL)
1823 snd_printk("CS4232 control port features are not accessible\n"); 1878 snd_printk(KERN_ERR "CS4232 control port features are "
1879 "not accessible\n");
1824 } 1880 }
1825#endif 1881#endif
1826 1882